Dependency graph

From athola/claude-night-market · View interactive version

Dependency graph is an AI agent skill from the GitHub repository athola/claude-night-market. Generates a Mermaid dependency graph showing import relationships between modules. Use when analyzing coupling, finding circular deps, or planning refactors.

How to use this skill

Skill file

Dependency Graph

Generate a Mermaid flowchart showing import and dependency

relationships between modules, packages, or plugins.

When To Use

When NOT To Use

Workflow

Step 1: Explore the Codebase

Dispatch the codebase explorer agent:

Agent(cartograph:codebase-explorer)
Prompt: Explore [scope] and return a structural model.
Focus on import statements and cross-module dependencies
for a dependency graph. Track both internal and external
imports.

Step 2: Generate Mermaid Syntax

Transform the structural model into a Mermaid flowchart

with directed edges representing dependencies.

Rules for dependency graphs:

"A depends on B")

Example output:

flowchart LR
    subgraph sanctum[Sanctum]
        commit[commit]
        pr_prep[pr_prep]
        workspace[workspace]
    end

    subgraph leyline[Leyline]
        git[git_platform]
        errors[error_patterns]
    end

    subgraph external[External]
        subprocess[subprocess]
        json[json]
    end

    commit --> git
    commit --> json
    pr_prep --> workspace
    pr_prep --> git
    workspace --> errors
    workspace -.-> subprocess

Step 3: Render via MCP

Call the Mermaid Chart MCP to render:

mcp__claude_ai_Mermaid_Chart__validate_and_render_mermaid_diagram
  prompt: "Dependency graph of [scope]"
  mermaidCode: [generated syntax]
  diagramType: "flowchart"
  clientName: "claude-code"

If rendering fails, fix syntax and retry (max 2 retries).

Step 4: Present Results

Show the rendered diagram with analysis notes:

Exit Criteria

from dependent to dependency (A --> B means "A depends on B")

called and returns without error

and highest fan-out modules

styling and listed explicitly in the analysis notes

internal dependency arrows

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.