Skills Explorer Add Skills

diagramming-code

An agent skill by trailofbits, from trailofbits/skills. Tags: analysis, architecture, diagramming, documentation.

What it does

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.

Install

With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:

npx skills add trailofbits/skills --skill diagramming-code

Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):

git clone --depth 1 https://github.com/trailofbits/skills
cp -r skills/plugins/trailmark/skills/diagramming-code ~/.claude/skills/diagramming-code

Safety box score

Grade B, low risk: 21 of 100 risk points, rated 2026-10-21. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.

This skill is a read-only code-graph visualizer: it runs Trailmark on a chosen target tree and emits Mermaid diagrams. The main risks are that it executes an external Python dependency and may install that dependency from the network if missing; it does not appear to modify project files or touch secrets.

Category levels, from 0 (none) to 3 (high)
CategoryLevelWhy
Code & shell execution1 (low)It runs `uv run {baseDir}/scripts/diagram.py` or `uv run trailmark diagram`, but `scripts/diagram.py` is only a thin wrapper around `from trailmark.diagram import main`.
Network access2 (moderate)If Trailmark is absent, the skill explicitly says to run `uv tool install trailmark`, which can download packages from the network.
Filesystem reach1 (low)The skill reads the user-supplied `--target` tree to build graphs, but the shipped files only print Mermaid to stdout and do not write or delete project files.
Secrets & credentials0 (none)There is no prompt to read tokens, keychains, `.env` files, browser sessions, or other credential stores.
Privilege & persistence0 (none)It does not request sudo, register services, change shell settings, or install system-wide software.
Instruction hijack surface0 (none)The files do not tell the agent to ignore safeguards, follow remote instructions, or hide behavior; they only describe diagram-generation workflow.
Irreversible actions0 (none)It generates diagrams for the user and does not post, deploy, pay, merge, or delete anything.
Transparency2 (moderate)The real analysis engine is external to the repo: `scripts/diagram.py` imports `trailmark.diagram.main`, and the skill depends on an unpinned `trailmark` package (`dependencies = ["trailmark"]`, `uv tool install trailmark`).

Before installing

Rated 2026-10-21 by an automated review of 7 files from the skill's repository.

Source

Repository
trailofbits/skills (all skills from this repository)
Path
plugins/trailmark/skills/diagramming-code/SKILL.md
Branch
main
Collection
trailmark
Updated
2026-09-19