Agent skill · Data & Analytics

diagramming-code

Generates Mermaid diagrams from Trailmark code graphs. Produces call graphs, class hierarchies, module dependency maps, containment diagrams, complexity heatmaps, and attack surface data flow visualizations. Use when visualizing code architecture, drawing call graphs, generating class diagrams, creating dependency maps, producing complexity heatmaps, or visualizing data flow and attack surface paths as Mermaid diagrams.

trailofbitsgithub.com/trailofbitsGitHub ↗
claude-codeships scriptsCC-BY-SA-4.0
Install
npx skills add trailofbits/skills --skill diagramming-code --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 6
SKILL.md size: 7 KB
Bundled scripts: yes
Path: plugins/trailmark/skills/diagramming-code/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 6,426
Language: Python
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Diagramming Code Generates Mermaid diagrams from Trailmark's code graph. A pre-made script handles Mermaid syntax generation; Claude selects the diagram type and parameters. Trailmark 0.4.0 includes a native `trailmark diagram` command; use it only after a version/command check, otherwise use this skill's bundled script. ## When to Use - Visualizing call paths between functions - Drawing class inheritance hierarchies - Mapping module import dependencies - Showing class structure with members - Highlighting complexity hotspots with color coding - Tracing data flow from entrypoints to sensitive functions ## When NOT to Use - Querying the graph without visualization (use the `trailmark` skill) - Mutation testing triage (use the `genotoxic` skill) - Architecture diagrams not derived from code (draw by hand) ## Prerequisites **trailmark** must be installed. If `uv run trailmark` fails, run: ```bash uv pip install trailmark ``` **DO NOT** fall back to hand-writing Mermaid from source code reading. The script uses Trailmark's parsed graph for accuracy. If installation fails, report the error to the user. ## Version Gate Check whether native v0.4 diagram support exists: ```bash trailmark

What's inside
Steps it walks through
  1. When to Use
  2. When NOT to Use
  3. Prerequisites
  4. Version Gate
  5. Quick Start
  6. Diagram Types
  7. Workflow
  8. Script Reference
  9. Examples
  10. Customization
  11. Supporting Documentation
Ships with 5 files
  • agents/openai.yaml
  • assets/trail-of-bits-mark.svg
  • references/diagram-types.md
  • references/mermaid-syntax.md
  • scripts/diagram.py
Commands it runs
uv pip install trailmark
trailmark diagram --help 2>/dev/null || uv run trailmark diagram --help 2>/dev/null
uv run {baseDir}/scripts/diagram.py \
Trailmark 0.4.0+ equivalent after the Version Gate succeeds
uv run trailmark diagram \
Call graph centered on a function
uv run {baseDir}/scripts/diagram.py -t src/ -T call-graph -f parse_file
Class hierarchy for a Rust project
uv run {baseDir}/scripts/diagram.py -t src/ -l rust -T class-hierarchy
Module dependency map, left-to-right
More from skills
All skills →
About this skill
What does the diagramming-code skill do?

Generates Mermaid diagrams from Trailmark code graphs. Produces call graphs, class hierarchies, module dependency maps, containment diagrams, complexity heatmaps, and attack surface data flow visualizations. Use when visualizing code architecture, drawing call graphs, generating class diagrams, creating dependency maps, producing complexity heatmaps, or visualizing data flow and attack surface paths as Mermaid diagrams.

How do I install it?

Run `npx skills add trailofbits/skills --skill diagramming-code --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From trailofbits/skills, a repository with 6,426 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going