$npx -y skills add datahub-project/datahub-skills --skill datahub-lineageUse this skill when the user wants to explore lineage, trace data dependencies, perform impact analysis, find root causes, map data pipelines, or understand how data flows between systems. Triggers on: "what feeds into X", "what depends on X", "show lineage for X", "impact analys
| 1 | # DataHub Lineage |
| 2 | |
| 3 | You are an expert DataHub lineage analyst. Your role is to help the user understand how data flows through their systems — tracing upstream sources, downstream consumers, cross-platform dependencies, and assessing the impact of changes. |
| 4 | |
| 5 | --- |
| 6 | |
| 7 | ## Multi-Agent Compatibility |
| 8 | |
| 9 | This skill is designed to work across multiple coding agents (Claude Code, Cursor, Codex, Copilot, Gemini CLI, Windsurf, and others). |
| 10 | |
| 11 | **What works everywhere:** |
| 12 | |
| 13 | - The full lineage exploration workflow |
| 14 | - All traversal modes (impact analysis, root cause, dependency mapping) |
| 15 | - Lineage visualization via MCP tools or DataHub CLI |
| 16 | |
| 17 | **Claude Code-specific features** (other agents can safely ignore these): |
| 18 | |
| 19 | - `allowed-tools` in the YAML frontmatter above |
| 20 | - `Task(subagent_type="datahub-skills:metadata-searcher")` for delegated entity lookup — only when multiple complex searches are needed to resolve and enrich a large lineage graph. For simple entity lookups, execute inline. **Fallback instructions are provided inline** for agents without sub-agent dispatch. |
| 21 | |
| 22 | **Reference file paths:** Shared references are in `../shared-references/` relative to this skill's directory. Skill-specific references are in `references/` and templates in `templates/`. |
| 23 | |
| 24 | --- |
| 25 | |
| 26 | ## Not This Skill |
| 27 | |
| 28 | | If the user wants to... | Use this instead | |
| 29 | | ------------------------------------------------------- | ------------------------------------------------ | |
| 30 | | Search for entities by keyword or metadata | `/datahub-search` | |
| 31 | | Answer "who owns X?" or "what is X?" | `/datahub-search` (metadata lookup, not lineage) | |
| 32 | | Add or update metadata (descriptions, tags, owners) | `/datahub-enrich` | |
| 33 | | Create assertions, run quality checks, manage incidents | `/datahub-quality` | |
| 34 | |
| 35 | **Key boundary:** Lineage handles **lineage and dependency questions** ("what feeds into X?", "what breaks if I change X?"). Search handles **metadata questions** ("who owns X?"). Enrich handles **metadata updates** ("set owner", "tag this"). |
| 36 | |
| 37 | --- |
| 38 | |
| 39 | ## Step 1: Identify Target Entity |
| 40 | |
| 41 | Find the entity the user wants to trace. |
| 42 | |
| 43 | 1. If the user provides a URN, use it directly |
| 44 | 2. If they provide a name, search for it: `datahub search "<name>" --where "entity_type = dataset" --limit 5` |
| 45 | 3. If multiple matches, present options and ask the user to choose |
| 46 | 4. Confirm: show entity name, URN, platform, type |
| 47 | |
| 48 | **Input validation:** Reject shell metacharacters in search queries and URNs before passing to CLI. |
| 49 | |
| 50 | --- |
| 51 | |
| 52 | ## Step 2: Determine Traversal Mode |
| 53 | |
| 54 | ### Traversal modes |
| 55 | |
| 56 | | Mode | Direction | Use Case | User Says | |
| 57 | | ------------------- | ---------- | ------------------------------------- | ----------------------------------------------------- | |
| 58 | | **Impact analysis** | Downstream | "What breaks if I change this?" | "impact of X", "what depends on X", "downstream" | |
| 59 | | **Root cause** | Upstream | "Where does this data come from?" | "root cause", "what feeds X", "upstream", "source of" | |
| 60 | | **Full pipeline** | Both | "Show the complete data flow" | "full lineage", "end to end", "trace the pipeline" | |
| 61 | | **Cross-platform** | Both | "How does data flow between systems?" | "from Snowflake to Looker", "cross-platform" | |
| 62 | | **Specific path** | Directed | "How does X reach Y?" | "path from X to Y", "how does X connect to Y" | |
| 63 | |
| 64 | ### Depth configuration |
| 65 | |
| 66 | | Depth | When to Use | |
| 67 | | -------- | -------------------------------------------------------- | |
| 68 | | 1 hop | Default — immediate upstream/downstream | |
| 69 | | 2-3 hops | User asks for "full" lineage or cross-platform tracing | |
| 70 | | 3+ hops | Only with user confirmation — results grow exponentially | |
| 71 | |
| 72 | Ask about depth if the user doesn't specify: "How many hops should I trace? (default: 1, or specify 'full')" |
| 73 | |
| 74 | --- |
| 75 | |
| 76 | ## Step 3: Execute Lineage Queries |
| 77 | |
| 78 | ### Choosing your tool: MCP vs. CLI |
| 79 | |
| 80 | | | MCP tools | DataHub CLI | |
| 81 | | ------------------ | ------------------------------------------------ | -------------------------------- |