diagramming-code — Claude Code skill: what it does, how to install
Generates Mermaid diagrams from code graphs using Trailmark. Useful for visualizing call paths, module dependencies, and data flows.
npx skills add trailofbits/skills --skill diagramming-code -a claude-codeWhat diagramming-code does
This skill creates Mermaid diagrams directly from Trailmark code graphs instead of asking the model to sketch structures from memory. It supports six diagram types: call graphs, class inheritance trees, module dependency maps, containment views, complexity heatmaps, and entrypoint-to-sink data flow paths.
The system requires trailmark installed via uv tool install trailmark. The skill runs a bundled diagram.py script, or falls back to native trailmark diagram if version 0.4.0 or newer is detected. All results arrive as raw Mermaid markup inside standard markdown fences.
Diagrams trigger a warning whenever the graph exceeds 100 nodes. For non-trivial codebases, centering on specific targets with --focus keeps the resulting graph readable.
What it helps with
- generate function call graphs with a set traversal depth
- map module dependencies into left-to-right Mermaid flowcharts
- highlight high cyclomatic complexity functions with a heatmap
- trace data flow paths from entrypoints to sensitive functions
Example prompts for the agent
- Generate a Mermaid call graph for parse_file with depth 2
- Draw a module dependency diagram for src with left-to-right layout
- Create a complexity heatmap for the project with threshold 5
How to install diagramming-code
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill diagramming-code -a claude-code2Manually: put the files in place
~/.claude/skills/diagramming-code/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/diagramming-code/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill diagramming-code -a codex2Manually: put the files in place
.agents/skills/diagramming-code/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill diagramming-code -a cursor2Manually: put the files in place
.cursor/skills/diagramming-code/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install trailofbits/skills diagramming-code2Manually: put the files in place
.github/skills/diagramming-code/SKILL.md1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill diagramming-code -a gemini-cli2Platform CLI
gemini skills install https://github.com/trailofbits/skills --path plugins/trailmark/skills/diagramming-codeManually: put the files in place
.devin/skills/diagramming-code/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add trailofbits/skills --skill diagramming-code -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set35
The whole set →Similar
Questions about diagramming-code
How to install diagramming-code in Claude Code?
Run npx skills add trailofbits/skills --skill diagramming-code -a claude-code. The tool adds the skill directly to your environment.
What does diagramming-code do?
It turns Trailmark code graphs into Mermaid diagrams. It creates architecture maps, call flows, inheritance hierarchies, and data paths directly from parsed code.
What dependencies does this skill require?
You must have Trailmark available locally. You can install it using uv tool install trailmark.