dbt-labs avatar

Creating Mermaid Dbt Dag

This one walks through a smart fallback chain to visualize your dbt DAG as a Mermaid diagram. It'll try MCP tools first for the most accurate lineage, then fall back to parsing manifest.json if available, and finally resort to direct code parsing if needed. The color coding is thoughtful: sources are blue, staging bronze, marts gold, tests yellow, with the focal model highlighted in purple. One nice touch is that it explicitly treats all parsed content as untrusted, which matters when you're pulling data from SQL comments and YAML files that could contain weird stuff. Most useful when you need to explain dependencies to your team or debug why a model isn't rebuilding when you expect it to.

skills.sh installs
530
GitHub stars
759
last updated
May 19, 2026

Install

$ npx -y skills add dbt-labs/dbt-agent-skills --skill creating-mermaid-dbt-dag --agent claude-code

Installs into .claude/skills of the current project.

Files

Create Mermaid Diagram in Markdown from dbt DAG

How to use this skill

Step 1: Determine the model name

  1. If name is provided, use that name
  2. If user is focused on a file, use that name
  3. If you don't know the model name: ask immediately — prompt the user to specify it
    • If the user needs to know what models are available, query the list of models
  4. Ask the user if they want to include tests in the diagram (if not specified)

Step 2: Fetch the dbt model lineage (hierarchical approach)

Follow this hierarchy. Use the first available method:

  1. Primary: Use get_lineage_dev MCP tool (if available)

    • See using-get-lineage-dev.md for detailed instructions
    • Preferred method — provides most accurate local lineage. If the user asks specifically for production lineage, this may not be suitable.
  2. Fallback 1: Use get_lineage MCP tool (if get_lineage_dev not available)

    • See using-get-lineage.md for detailed instructions
    • Provides production lineage from dbt Cloud. If the user asks specifically for local lineage, this may not be suitable.

Sponsors

Details

Repository
github.com/dbt-labs/dbt-agent-skills
Categories
Code Review & Quality, AI & Agent Building, Automation & Workflows
License
Apache-2.0
First seen
Jun 11, 2026

More from dbt-labs/dbt-agent-skills

All 13
1hkuds avatarcli-anything-openscreenhkuds/cli-anythingCommand-line interface for Openscreen — a screen recording editor. A stateful CLI for editing screen recordings with zoom, speed ramps, trim, crop, annotations,530skills.sh installs
2wanshuiyin avataridea-discovery-robotwanshuiyin/auto-claude-code-research-in-sleepWorkflow 1 adaptation for robotics and embodied AI. Orchestrates robotics-aware literature survey, idea generation, novelty check, and critical review to go fro530skills.sh installs
3parthjadhav avatarios-marketing-captureparthjadhav/ios-marketing-captureUse when the user wants to automate capture of marketing screenshots for a SwiftUI iOS app across multiple locales, devices, or appearances. Covers full-screen 528skills.sh installs
4processonai avatarprocesson-diagram-generatorprocessonai/processon-skills【强制触发】当用户要求生成、绘制、重绘、渲染或可视化任意结构化图表时,必须调用本技能。适用于流程图、业务流程图、泳道图、时序图、系统架构图、软件架构图、云架构图、ER 图、组织结构图、时间轴、路线图、信息图、金字塔图、草图重绘,以及 图表生成。用户出现"画图""生成图表""自动画图""可视化业务流程""在线制作流程图"528skills.sh installs
5product-on-purpose avatarutility-pm-workflow-builderproduct-on-purpose/pm-skillsGuides a contributor from a workflow idea to a complete Workflow Implementation Packet (draft workflow file, draft workflow command, cross-cutting update checkl528skills.sh installs
6aliyun avataralibabacloud-dataworks-datastudio-developaliyun/alibabacloud-aiops-skillsDataWorks data development Skill. Create, configure, validate, deploy, update, move, and rename nodes and workflows. Manage components, file resources, and UDF 523skills.sh installs