---
title: "Diagramming Code: review, setup & limitations · Undominated.ai"
canonical: https://undominated.ai/skills/trailofbits-trailmark-diagramming-code/
description: "Turns a Trailmark code graph into Mermaid diagrams: call graphs, class hierarchies, module-dependency maps, containment diagrams, complexity heatmaps and attack-surface data-flow views."
---

# Diagramming Code: review, setup & limitations · Undominated.ai

> Turns a Trailmark code graph into Mermaid diagrams: call graphs, class hierarchies, module-dependency maps, containment diagrams, complexity heatmaps and attack-surface data-flow views.

[← Explore all skills](/skills/)

SECURITY REVIEW / Trail of Bits

# Diagramming Code

Turns a Trailmark code graph into Mermaid diagrams: call graphs, class hierarchies, module-dependency maps, containment diagrams, complexity heatmaps and attack-surface data-flow views.

 [See setup guidance ↓](#setup)[Original source ↗](https://github.com/trailofbits/skills/tree/f0dd11d2b1da17a1ff8c403741fbe1f6bca0f871/plugins/trailmark/skills/diagramming-code)

SOURCE REVIEW

 Reviewed 2026-10-22
 Evidence 5 linked sources
 Publisher Trail of Bits
 Licence [CC-BY-SA-4.0 ↗](https://raw.githubusercontent.com/trailofbits/skills/f0dd11d2b1da17a1ff8c403741fbe1f6bca0f871/LICENSE)
 Revision f0dd11d2b1da
 [Read what was—and wasn’t—checked ↓](#review)

“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.”

 [Trail of Bits · upstream description ↗](https://raw.githubusercontent.com/trailofbits/skills/f0dd11d2b1da17a1ff8c403741fbe1f6bca0f871/plugins/trailmark/skills/diagramming-code/SKILL.md) Our analysis follows below.

01 / THE REASONING

## Why this made the selection.

 - Emits call graphs, class hierarchies, module-dependency maps, containment diagrams, complexity heatmaps and data-flow views as Mermaid from a Trailmark graph.
- Probes for the native `trailmark diagram` command with --help and otherwise runs the bundled scripts/diagram.py.

### A good fit for

 - Draw a call graph centred on one function as a Mermaid diagram
- Generate a class hierarchy or module-dependency map from source
- Produce a complexity heatmap or an attack-surface data-flow diagram

### Weigh up before choosing

 - The native `trailmark diagram` command needs Trailmark 0.4.0+; on older builds the skill runs its bundled scripts/diagram.py.
- scripts/diagram.py defaults --language to python, so a non-Python target needs `-l auto` or an explicit language.
- It does not fall back to hand-written Mermaid: if trailmark cannot be installed it reports the error.
- Installs with the whole `trailmark` plugin — and the Trailmark CLI via `uv tool install trailmark` — not as a standalone Diagramming Code skill.
- Last commit touching plugins/trailmark/skills/diagramming-code at the pinned revision: 2026-10-14.
- Not executed: it was not installed or run.

02 / THE REVIEW RECORD

## What we actually inspected.

Source review has boundaries. A clear record is more useful than a “safe” badge.

### Material inspected

 - plugins/trailmark/skills/diagramming-code/SKILL.md
- plugins/trailmark/README.md (prerequisites and version notes)
- plugins/trailmark/agents/code-slice-worker.md (host note)
- README.md (installation and licence sections)
- LICENSE

### Our findings

 - Diagramming Code's SKILL.md frontmatter declares no allowed-tools.
- If `uv run trailmark` fails, its Prerequisites tell the agent to run `uv tool install trailmark`.
- Step 1 says not to run engine.preanalysis() for a diagram, because the diagram command builds its own graph.
- Output is raw Mermaid text, wrapped in a fenced block in the reply.

### Not established by this review

 - Not executed: it was not installed or run.
- The Diagramming Code skill and any bundled scripts were not run.

The review applies to the material and revision named here. A newer upstream release can change its behavior.

03 / PUT IT TO WORK

## Add a skill to your workflow.

[Upstream setup instructions ↗](https://raw.githubusercontent.com/trailofbits/skills/f0dd11d2b1da17a1ff8c403741fbe1f6bca0f871/README.md)
 - `/plugin marketplace add trailofbits/skills` (repository README) adds the whole Trail of Bits marketplace, not one skill.
- Install the `trailmark` plugin from `/plugin menu`; it bundles the Diagramming Code skill with the other trailmark skills listed in the trailmark plugin README.
- `uv tool install trailmark` (trailmark plugin README) installs the Trailmark CLI that this skill drives.

### Before you start

 - The Trailmark CLI, installed with `uv tool install trailmark` (trailmark plugin README)
- uv

### Compatibility

Claude Code

### Installs and runs Trailmark or its diagram script over local source

 - Diagramming Code declares no allowed-tools, so tool use follows the host's settings
- Install the Trailmark CLI with `uv tool install trailmark` when `uv run trailmark` fails
- Run `trailmark analyze`, the bundled scripts/diagram.py or, on 0.4.0+, `trailmark diagram` over local source
- Return the Mermaid text in the reply

### Cost model

CC-BY-SA-4.0. The Diagramming Code skill's files name no paid service.

04 / FOLLOW THE EVIDENCE

## The source trail.

Our notes are separate from the original resource. Check upstream before adopting a new version.

 - [Diagramming Code SKILL.md ↗](https://raw.githubusercontent.com/trailofbits/skills/f0dd11d2b1da17a1ff8c403741fbe1f6bca0f871/plugins/trailmark/skills/diagramming-code/SKILL.md) Checked 2026-10-22 https://raw.githubusercontent.com/trailofbits/skills/f0dd11d2b1da17a1ff8c403741fbe1f6bca0f871/plugins/trailmark/skills/diagramming-code/SKILL.md Supports: upstreamDescription, summary, whySelected, bestFor, limitations, access, review.findings
- [trailmark plugin README ↗](https://raw.githubusercontent.com/trailofbits/skills/f0dd11d2b1da17a1ff8c403741fbe1f6bca0f871/plugins/trailmark/README.md) Checked 2026-10-22 https://raw.githubusercontent.com/trailofbits/skills/f0dd11d2b1da17a1ff8c403741fbe1f6bca0f871/plugins/trailmark/README.md Supports: install.prerequisites, install.steps
- [trailmark code-slice-worker agent (names Claude Code as host) ↗](https://raw.githubusercontent.com/trailofbits/skills/f0dd11d2b1da17a1ff8c403741fbe1f6bca0f871/plugins/trailmark/agents/code-slice-worker.md) Checked 2026-10-22 https://raw.githubusercontent.com/trailofbits/skills/f0dd11d2b1da17a1ff8c403741fbe1f6bca0f871/plugins/trailmark/agents/code-slice-worker.md Supports: compatibility
- [trailofbits/skills README ↗](https://raw.githubusercontent.com/trailofbits/skills/f0dd11d2b1da17a1ff8c403741fbe1f6bca0f871/README.md) Checked 2026-10-22 https://raw.githubusercontent.com/trailofbits/skills/f0dd11d2b1da17a1ff8c403741fbe1f6bca0f871/README.md Supports: install.steps, license
- [trailofbits/skills LICENSE ↗](https://raw.githubusercontent.com/trailofbits/skills/f0dd11d2b1da17a1ff8c403741fbe1f6bca0f871/LICENSE) Checked 2026-10-22 https://raw.githubusercontent.com/trailofbits/skills/f0dd11d2b1da17a1ff8c403741fbe1f6bca0f871/LICENSE Supports: license

KEEP COMPARING

## Other approaches to consider.

Related by category or shared topics. These are alternatives to inspect, not a measured quality order.

 [### Crypto Protocol Diagram ↗ Extracts a cryptographic protocol's message flow from source, an RFC, a paper, pseudocode, a ProVerif model or a Tamarin model, writes it as an annotated Mermaid sequence diagram in a Markdown file and prints an ASCII version.](/skills/trailofbits-trailmark-crypto-protocol-diagram/)[### Audit Augmentation ↗ Overlays external findings — SARIF static-analysis results, weAudit annotation files and Trailmark 0.4.x binary-analysis exports — onto a Trailmark code graph by file and line overlap and builds severity-based subgraphs.](/skills/trailofbits-trailmark-audit-augmentation/)[### Graph Evolution ↗ Diffs Trailmark code graphs built at two source snapshots (commits, tags or directories) to surface new attack paths, blast-radius growth, taint changes and privilege-boundary shifts that a text diff does not show.](/skills/trailofbits-trailmark-graph-evolution/)

 [AI Tools ↗](/tools/)[Skills ↗](/skills/)[Agents ↗](/agents/)[MCP Servers ↗](/mcp-servers/)[Workflows ↗](/workflows/)

## Continue your investigation

 - [Choose a toolkit](/tools/)
- [Inspect execution hosts](/agents/)
- [Check tool access](/mcp-servers/)
- [Check project dependencies](/check-repo/)
