Agent SkillsAltimateAI/altimate-code › lineage-diff

lineage-diff

GitHub

对比两个SQL版本的列级数据血缘,识别新增、移除或变更的数据流边,辅助评估代码修改对数据依赖的影响。

.opencode/skills/lineage-diff/SKILL.md AltimateAI/altimate-code

Trigger Scenarios

需要分析SQL模型变更对数据血缘的影响 检查当前文件与上次提交的血缘差异

Install

npx skills add AltimateAI/altimate-code --skill lineage-diff -g -y
More Options

Non-standard path

npx skills add https://github.com/AltimateAI/altimate-code/tree/main/.opencode/skills/lineage-diff -g -y

Use without installing

npx skills use AltimateAI/altimate-code@lineage-diff

指定 Agent (Claude Code)

npx skills add AltimateAI/altimate-code --skill lineage-diff -a claude-code -g -y

安装 repo 全部 skill

npx skills add AltimateAI/altimate-code --all -g -y

预览 repo 内 skill

npx skills add AltimateAI/altimate-code --list

SKILL.md

Frontmatter
{
    "name": "lineage-diff",
    "description": "Compare column-level lineage between two versions of a SQL query to show added, removed, and changed data flow edges."
}

Lineage Diff

Requirements

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.

Workflow

  1. Get the original SQL — Either:

    • Read the file from disk (current committed version)
    • Use git show HEAD:path/to/file.sql via bash to get the last committed version
    • Accept the "before" SQL directly from the user
  2. Get the modified SQL — Either:

    • Read the current (modified) file from disk
    • Accept the "after" SQL directly from the user
  3. Run lineage on both versions:

    • Call lineage_check with the original SQL
    • Call lineage_check with the modified SQL
  4. Compute the diff:

    • Added edges: Edges in the new lineage that don't exist in the old
    • Removed edges: Edges in the old lineage that don't exist in the new
    • Unchanged edges: Edges present in both
  5. 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

Usage

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 file

Edge Matching

Two edges are considered the same if all four fields match:

  • source_table + source_column + target_table + target_column

The transform field is informational and not used for matching.

Use the tools: lineage_check, read, bash (for git operations), glob.

Version History

  • 8c9a9a8 Current 2026-07-25 06:35

Same Skill Collection

.opencode/skills/altimate-setup/SKILL.md
.opencode/skills/cost-report/SKILL.md
.opencode/skills/data-parity/SKILL.md
.opencode/skills/dbt-analyze/SKILL.md
.opencode/skills/dbt-docs/SKILL.md
.opencode/skills/dbt-pr-review/SKILL.md
.opencode/skills/dbt-test/SKILL.md
.opencode/skills/dbt-troubleshoot/SKILL.md
.opencode/skills/dbt-unit-tests/SKILL.md
.opencode/skills/pii-audit/SKILL.md
.opencode/skills/query-optimize/SKILL.md
.opencode/skills/schema-migration/SKILL.md
.opencode/skills/sql-review/SKILL.md
.opencode/skills/sql-translate/SKILL.md
.opencode/skills/teach/SKILL.md
.opencode/skills/train/SKILL.md
.opencode/skills/training-status/SKILL.md
.opencode/skills/data-viz/SKILL.md
.opencode/skills/dbt-develop/SKILL.md
.opencode/skills/dbt-schema-verify/SKILL.md

Metadata

Files
0
Version
e27aeac
Hash
7e6f283c
Indexed
2026-07-25 06:35

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 09:02
浙ICP备14020137号-1 $mapa de visitantes$