一键导入
lineage-diff
Compare column-level lineage between two versions of a SQL query to show added, removed, and changed data flow edges.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Compare column-level lineage between two versions of a SQL query to show added, removed, and changed data flow edges.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Analyze and optimize SQL queries for better performance
Cloudflare-style AI code review for dbt/SQL pull requests. Produces a signed APPROVE/COMMENT/REQUEST_CHANGES verdict where every blocking finding is backed by a deterministic engine call — column-lineage blast radius, query equivalence, PII classification, and A–F grade. Use to review a dbt PR or the working-tree changes before merge.
REQUIRED before writing or modifying ANY dbt model. Invoke this skill FIRST whenever a task says "create", "build", "add", "modify", "update", "fix", or "refactor" a dbt model, staging file, mart, incremental, or snapshot. Skipping this skill is the leading cause of silent-correctness bugs — models that compile and `dbt build` cleanly but produce wrong values. It contains the patterns that prevent the most common such bugs encountered in real dbt projects: • Incremental high-water marks (`>=` vs `>` ties → silent row dropout) • Snapshot strategy selection (timestamp vs check, `unique_key` choice) • `LEFT JOIN + COUNT(*)` phantom rows from unmatched parents • Type harmonization in `COALESCE` / `CASE` / `UNION` legs • Date-spine completeness (every period present, even empty ones) • Off-by-one window boundaries (`BETWEEN d - (N-1) AND d` for N-wide) • Uniqueness enforcement when schema implies a key • Window-function `LIMIT` with deterministic tiebreaker • Verifying transformation correctness with dbt unit te
REQUIRED after building or modifying ANY dbt model that has columns declared in `schema.yml` / `_models.yml`. Run `altimate-dbt schema-verify --model <name>` to diff actual columns against the spec, and treat any `mismatch` verdict as "not done." The most common reason "the build is green but the tests still fail" is that the model produces the right *data values* in the wrong *column shape* — extra columns, missing columns, wrong order, wrong types. Many dbt equality tests grade the column tuple `(name, type, position)` exactly, and the agent's prior bias is to add "helpful" extras (`p1`/`p2`/`p3` rank breakdowns, name-resolved variants, lineage metadata) or reorder columns "more logically." Both break the contract. This skill enforces the mechanical check that catches those bugs before declaring done. Use it before declaring any model task complete.
Generate dbt unit tests automatically for any model. Analyzes SQL logic (CASE/WHEN, JOINs, window functions, NULLs), creates type-correct mock inputs from manifest schema, and assembles complete YAML. Use when a user says "generate tests", "add unit tests", "test this model", or "test coverage" for dbt models.
Validate that two tables or query results are identical — or diagnose exactly how they differ. Discover schema, identify keys, profile cheaply, then diff. Use for migration validation, ETL regression, and query refactor verification.
| name | lineage-diff |
| description | Compare column-level lineage between two versions of a SQL query to show added, removed, and changed data flow edges. |
Agent: any (read-only analysis) Tools used: lineage_check, read, bash (for git operations), glob
Compare column-level lineage between two versions of a SQL model to identify changes in data flow.
Get the original SQL — Either:
git show HEAD:path/to/file.sql via bash to get the last committed versionGet the modified SQL — Either:
Run lineage on both versions:
lineage_check with the original SQLlineage_check with the modified SQLCompute the diff:
Report the diff in a clear format:
Lineage Diff: model_name
═══════════════════════════
+ ADDED (new data flow):
+ source_table.new_column → target_table.output_column
- REMOVED (broken data flow):
- source_table.old_column → target_table.output_column
UNCHANGED: 5 edges
Impact: 1 new edge, 1 removed edge
The user invokes this skill with a file path:
/lineage-diff models/marts/dim_customers.sql — Compare current file against last git commit/lineage-diff — Compare staged changes in the current fileTwo edges are considered the same if all four fields match:
source_table + source_column + target_table + target_columnThe transform field is informational and not used for matching.
Use the tools: lineage_check, read, bash (for git operations), glob.