agentic-actions-audito…
Audits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI, OpenAI Codex, and GitHub AI…
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
$ npx -y skills add trailofbits/skills --skill diagramming-code --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/diagramming-codeContext preview
The summary Claude sees to decide when to auto-load this skill.
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
name: diagramming-code description: > 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.
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.
**trailmark** must be installed. If `uv run trailmark` fails, run:
uv tool install trailmark # Python snippets: uv run --with trailmark python - (a tool env is not importable)
**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.
Check whether native v0.4 diagram support exists:
trailmark diagram --help 2>/dev/null || uv run trailmark diagram --help 2>/dev/null
If this succeeds, you may use `trailmark diagram`. If it fails, use `uv run {baseDir}/scripts/diagram.py`, which keeps the older skill workflow intact. Do not assume the native CLI exists on Trailmark 0.2.x.
---
uv run {baseDir}/scripts/diagram.py \
--target {targetDir} --language auto --type call-graph \
--focus main --depth 2
# Trailmark 0.4.0+ equivalent after the Version Gate succeeds
uv run trailmark diagram \
--target {targetDir} --language auto --type call-graph \
--focus main --depth 2Output is raw Mermaid text. Wrap in a fenced code block:
```mermaid
flowchart TB
...--- ## Diagram Types
├─ "Who calls what?" → --type call-graph ├─ "Class inheritance?" → --type class-hierarchy ├─ "Module dependencies?" → --type module-deps ├─ "Class members and structure?" → --type containment ├─ "Where is complexity highest?" → --type complexity └─ "Path from input to function?" → --type data-flow
For detailed examples of each type, see [references/diagram-types.md](references/diagram-types.md). --- ## Workflow
Diagram Progress:
**Step 1:** Run `uv run trailmark analyze --language auto --summary {targetDir}`. Install
if it fails. Then run pre-analysis via the programmatic API:
```python
from trailmark.query.api import QueryEngine
engine = QueryEngine.from_directory("{targetDir}", language="auto")
engine.preanalysis()Pre-analysis enriches the graph with blast radius, taint propagation, and privilege boundary data used by `data-flow` diagrams.
If auto-detection is wrong for the target, rerun with an explicit language or comma-separated list such as `python,rust`.
**Step 2:** Match the user's request to a `--type` using the decision tree above.
**Step 3:** For `call-graph` and `data-flow`, identify the focus function. Default `--depth 2`. Use `--direction LR` for dependency flows.
**Step 4:** Run the script and capture stdout. If the native v0.4 CLI is available, either command is acceptable; prefer the bundled script when you need behavior consistent with this skill's references.
**Step 5:** Check: output starts with `flowchart` or `classDiagram`, contains at least one node. If empty or malformed, consult [references/mermaid-syntax.md](references/mermaid-syntax.md).
**Step 6:** Wrap output in ` ```mermaid ``` ` code fence.
---
uv run {baseDir}/scripts/diagram.py [OPTIONS]
# or, on Trailmark 0.4.0+:
uv run trailmark diagram [OPTIONS]| Argument | Short | Default | Description | |---|---|---|---| | `--target` | `-t` | required | Directory to analyze | | `--language` | `-l` | `python` | Source language | | `--type` | `-T` | required | Diagram type (see above) | | `--focus` | `-f` | none | Center diagram on this node | | `--depth` | `-d` | `2` | BFS traversal depth | | `--direction` | | `TB` | Layout: `TB` (top-bottom) or `LR` (left-right) | | `--threshold` | | `10` | Min complexity for `complexity` type |
# 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
uv run {baseDir}/scripts/diagram.py -t src/ -T module-deps --direction LR
# Class members
uv run {baseDir}/scripts/diagram.py -t src/ -T containment
# Complexity heatmap (threshold 5)
uv run {baseDir}/scripts/diagram.py -t src/ -T complexity --threshold 5
# Data flow from entrypoints to a specific function
uv run {baseDir}/scripts/diagram.py -t src/ -T data-flow -f execute_query---
**Direction:** Use `TB` (default) for hierarchical views, `LR` for left-to-right flows like de
A Claude Code plugin marketplace from Trail of Bits providing skills to enhance AI-assisted security analysis, testing, and development workflows. Codex can load this marketplace through its Claude marketplace compatibility.
Audits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI, OpenAI Codex, and GitHub AI…
Understand a codebase before looking for bugs in it - what each function assumes, what it guarantees, and what it depends on elsewhere. Use when starting an…
Scans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing field validations, and access…
Prepares codebases for security review using Trail of Bits' checklist. Helps set review goals, runs static analysis tools, increases test coverage, removes…
Scans Cairo/StarkNet smart contracts for 6 critical vulnerabilities including felt252 arithmetic overflow, L1-L2 messaging issues, address conversion problems,…
Systematic code maturity assessment using Trail of Bits' 9-category framework. Analyzes codebase for arithmetic safety, auditing practices, access controls,…