dependency-graph
@athola · 收录于 1 周前
Generates a Mermaid dependency graph showing import relationships between modules. Use when analyzing coupling, finding circular deps, or planning refactors.
适合你,如果需要在重构前理清模块间的依赖关系
/ 下载安装
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code
~/.claude/skills/(项目级 .claude/skills/)Codex CLI
~/.codex/skills/Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add athola/claude-night-market/dependency-graph/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- athola/claude-night-market/dependency-graph/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify athola/claude-night-market/dependency-graph安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
324GitHub stars
待重算上下文体积
镜像托管
怎么用
技能原文 SKILL.md
Dependency Graph
Generate a Mermaid flowchart showing import and dependency relationships between modules, packages, or plugins.
When To Use
- Understanding what depends on what
- Finding circular dependencies
- Analyzing coupling between modules
- Planning refactoring by seeing dependency impact
- Answering "what breaks if I change this?"
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:
- Use
flowchart LR(left-right) for dependency direction - Each node is a module or package
- Edges point from dependent to dependency (A --> B means "A depends on B")
- Color-code by dependency type:
- Default arrows for internal dependencies
- Dotted arrows (
-.->) for external/optional deps - Thick arrows (
==>) for critical path dependencies - Group into subgraphs by package/plugin
- If depth parameter given, limit transitive dependencies
- Highlight circular dependencies with red styling
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:
- Total modules and dependency count
- Most-depended-on modules (high fan-in)
- Modules with most dependencies (high fan-out)
- Circular dependencies if any detected
Exit Criteria
- [ ] Mermaid
flowchart LRsyntax generated with directed edges from dependent to dependency (A --> B means "A depends on B") - [ ]
mcp__claude_ai_Mermaid_Chart__validate_and_render_mermaid_diagramcalled and returns without error - [ ] Analysis notes include total module count, highest fan-in modules, and highest fan-out modules
- [ ] Circular dependencies, if detected, are highlighted with red styling and listed explicitly in the analysis notes
- [ ] External dependencies use dotted arrows (
-.->) distinct from internal dependency arrows
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →
评论
登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。
…