datahub-lineage
Use 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 analysis", "trace the pipeline", "root cause", "upstream of X", "downstream of X", or any request involving data lineage and dependency tracking.
datahub-project · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add datahub-project/datahub-skills --skill datahub-lineage技能说明
name: datahub-lineage description: | Use 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 analysis", "trace the pipeline", "root cause", "upstream of X", "downstream of X", or any request involving data lineage and dependency tracking. user-invocable: true min-cli-version: 1.5.0.1rc1 allowed-tools: Bash(datahub *)
DataHub Lineage
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.
Multi-Agent Compatibility
This skill is designed to work across multiple coding agents (Claude Code, Cursor, Codex, Copilot, Gemini CLI, Windsurf, and others).
What works everywhere:
- The full lineage exploration workflow
- All traversal modes (impact analysis, root cause, dependency mapping)
- Lineage visualization via MCP tools or DataHub CLI
Claude Code-specific features (other agents can safely ignore these):
allowed-toolsin the YAML frontmatter aboveTask(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.
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/.
Not This Skill
| If the user wants to... | Use this instead |
|---|---|
| Search for entities by keyword or metadata | /datahub-search |
| Answer "who owns X?" or "what is X?" | /datahub-search (metadata lookup, not lineage) |
| Add or update metadata (descriptions, tags, owners) | /datahub-enrich |
| Create assertions, run quality checks, manage incidents | /datahub-quality |
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").
Step 1: Identify Target Entity
Find the entity the user wants to trace.
- If the user provides a URN, use it directly
- If they provide a name, search for it:
datahub search "<name>" --where "entity_type = dataset" --limit 5 - If multiple matches, present options and ask the user to choose
- Confirm: show entity name, URN, platform, type
Input validation: Reject shell metacharacters in search queries and URNs before passing to CLI.
Step 2: Determine Traversal Mode
Traversal modes
| Mode | Direction | Use Case | User Says |
|---|---|---|---|
| Impact analysis | Downstream | "What breaks if I change this?" | "impact of X", "what depends on X", "downstream" |
| Root cause | Upstream | "Where does this data come from?" | "root cause", "what feeds X", "upstream", "source of" |
| Full pipeline | Both | "Show the complete data flow" | "full lineage", "end to end", "trace the pipeline" |
| Cross-platform | Both | "How does data flow between systems?" | "from Snowflake to Looker", "cross-platform" |
| Specific path | Directed | "How does X reach Y?" | "path from X to Y", "how does X connect to Y" |
Depth configuration
| Depth | When to Use |
|---|---|
| 1 hop | Default — immediate upstream/downstream |
| 2-3 hops | User asks for "full" lineage or cross-platform tracing |
| 3+ hops | Only with user confirmation — results grow exponentially |
Ask about depth if the user doesn't specify: "How many hops should I trace? (default: 1, or specify 'full')"
Step 3: Execute Lineage Queries
Choosing your tool: MCP vs. CLI
| MCP tools | DataHub CLI | |
|---|---|---|
| When available | Preferred for simple traversals | Use for path, column-level lineage, --format json metadata |
| Lineage | get_lineage(urn=..., direction=..., depth=...) | datahub lineage --urn "..." --direction upstream |
| Enrich results | get_entities(urns=[...]) | datahub search "*" --where 'urn IN (...)' with --projection |
MCP provides structured lineage graphs without shell overhead — MCP tools are self-documenting, so check their schemas for parameter details. Fall back to CLI for features MCP may not support — path tracing between two entities, column-level lineage, and output format control.
Using the datahub lineage CLI command
# Upstream sources (full graph by default)
datahub lineage --urn "<URN>" --direction upstream
# Downstream dependents
datahub lineage --urn "<URN>" --direction downstream
# Limit depth
datahub lineage --urn "<
阅读完整来源 ↗