GitDiagram Repository Overview
ahmedkhaleel2004/gitdiagram
Explains the architecture of a public GitHub repository through GitDiagram: how the code is organized, the main components with paths, and a Mermaid diagram.
Generates Mermaid diagrams from Trailmark code graphs, including call graphs, class hierarchies, module dependency maps, complexity heatmaps and attack surface data flows.
$ npx skills add trailofbits/skills --skill diagramming-code -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install trailofbits/skills diagramming-code --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/trailofbits/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/trailmark/skills/diagramming-code .claude/skills/diagramming-code && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "diagramming-code" agent skill from https://github.com/trailofbits/skills/tree/main/plugins/trailmark/skills/diagramming-code into .claude/skills/diagramming-code/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "diagramming-code", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/trailofbits/skills/tree/main/plugins/trailmark/skills/diagramming-codeType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add trailofbits/skills --skill diagramming-code -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install trailofbits/skills diagramming-code --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/trailofbits/skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/trailmark/skills/diagramming-code .agents/skills/diagramming-code && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "diagramming-code" agent skill from https://github.com/trailofbits/skills/tree/main/plugins/trailmark/skills/diagramming-code into .agents/skills/diagramming-code/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "diagramming-code", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add trailofbits/skills --skill diagramming-code -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install trailofbits/skills diagramming-code --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/trailofbits/skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/trailmark/skills/diagramming-code .cursor/skills/diagramming-code && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "diagramming-code" agent skill from https://github.com/trailofbits/skills/tree/main/plugins/trailmark/skills/diagramming-code into .cursor/skills/diagramming-code/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "diagramming-code", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/trailofbits/skills.git --path plugins/trailmark/skills/diagramming-code--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add trailofbits/skills --skill diagramming-code -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install trailofbits/skills diagramming-code --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/trailofbits/skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/trailmark/skills/diagramming-code .gemini/skills/diagramming-code && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "diagramming-code" agent skill from https://github.com/trailofbits/skills/tree/main/plugins/trailmark/skills/diagramming-code into .gemini/skills/diagramming-code/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "diagramming-code", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install trailofbits/skills diagramming-codeInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add trailofbits/skills --skill diagramming-code -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/trailofbits/skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/trailmark/skills/diagramming-code .github/skills/diagramming-code && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "diagramming-code" agent skill from https://github.com/trailofbits/skills/tree/main/plugins/trailmark/skills/diagramming-code into .github/skills/diagramming-code/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "diagramming-code", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add trailofbits/skills --skill diagramming-code -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install trailofbits/skills diagramming-code --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/trailofbits/skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/trailmark/skills/diagramming-code .opencode/skills/diagramming-code && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "diagramming-code" agent skill from https://github.com/trailofbits/skills/tree/main/plugins/trailmark/skills/diagramming-code into .opencode/skills/diagramming-code/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "diagramming-code", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
diagramming-codeGenerates Mermaid diagrams from Trailmark code graphs, including call graphs, class hierarchies, module dependency maps, complexity heatmaps and attack surface data flows.
The agent picks a diagram type and its parameters, and a bundled script, `scripts/diagram.py`, does the Mermaid syntax generation from Trailmark's parsed code graph. The types include call graphs, class hierarchies, module dependencies, containment views with class members, complexity heatmaps with color coding, and data flow from entry points to sensitive functions. Output is raw Mermaid text, which the agent wraps in a fenced code block.
Trailmark must be installed, for example with `uv tool install trailmark`, and the agent must not fall back to hand-writing Mermaid from reading source; if installation fails it reports the error. Trailmark 0.4.0 has a native `trailmark diagram` command, so the skill checks the version and command first and uses the bundled script otherwise. It is not for plain graph queries, mutation testing triage or architecture diagrams that are not derived from code.
Read from SKILL.md and the folder at commit 82fe822. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/ (Python), which the agent can run.
Shell commands in SKILL.md call:
uvFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Code Graph Mermaid Diagrams loads about 1.7k tokens when it runs, and up to ~3.7k if it reads all its reference files. Until then it costs about 110 tokens; SKILL.md has 522 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from trailofbits/skills at commit 82fe822, republished under its CC-BY-SA-4.0 licence (© trailofbits). 522 words, ~1,701 tokens.
.claude/skills/diagramming-code/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.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 skill)genotoxic skill)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/nullIf 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
...
```├─ "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-flowFor detailed examples of each type, see references/diagram-types.md.
Diagram Progress:
- [ ] Step 1: Verify trailmark is installed
- [ ] Step 2: Identify diagram type from user request
- [ ] Step 3: Determine focus node and parameters
- [ ] Step 4: Run diagram.py script (or native trailmark diagram on v0.4+)
- [ ] Step 5: Verify output is non-empty and well-formed
- [ ] Step 6: Embed diagram in responseStep 1: Run uv run trailmark analyze --language auto --summary {targetDir}. Install
if it fails. Then run pre-analysis via the programmatic API:
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.
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_queryDirection: Use TB (default) for hierarchical views, LR for
left-to-right flows like dependency chains.
Depth: Increase --depth to see more of the call graph. Decrease to
reduce clutter. The script warns if the diagram exceeds 100 nodes.
Focus: Always use --focus for call-graph on non-trivial codebases.
For data-flow, omitting focus auto-targets the top 10 complexity hotspots.
Language: Prefer --language auto for polyglot or unfamiliar repos.
Use an explicit language only when you know the target is single-language or
you need to exclude unrelated components.
© trailofbits, CC-BY-SA-4.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 5 other files (scripts, references, assets) in plugins/trailmark/skills/diagramming-code of trailofbits/skills.
Open the folder on GitHubat commit 82fe822
Code Graph Mermaid Diagrams next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Code Graph Mermaid Diagrams this skilltrailofbits/skills | 7.4k | — | ~1.7k | Automated safety check: Pass | CC-BY-SA-4.0 | |
| GitDiagram Repository Overviewahmedkhaleel2004/gitdiagram | 18k | — | ~427 | Automated safety check: Pass | MIT | |
| GitDiagram Repo Architectureahmedkhaleel2004/gitdiagram | 18k | — | ~429 | Automated safety check: Pass | MIT | |
| draw.io Architecture DiagrammingHoangNguyen0403/agent-skills-standard | 570 | — | ~1.3k | Automated safety check: Pass | MIT | |
| Audit Flowzebbern/claude-code-guide | 4.6k | — | ~4.2k | Automated safety check: Pass | MIT | |
| Archify Diagramstt-a1i/archify | 79k | — | ~2.9k | Automated safety check: Pass | MIT |
ahmedkhaleel2004/gitdiagram
Explains the architecture of a public GitHub repository through GitDiagram: how the code is organized, the main components with paths, and a Mermaid diagram.
ahmedkhaleel2004/gitdiagram
Explains how a public GitHub repository is built by fetching its GitDiagram architecture diagram, components and optional explainer video.
HoangNguyen0403/agent-skills-standard
Draws architecture diagrams as editable draw.io files from a JSON spec, with a fixed house style, one C4 level per diagram and evidence-tagged shapes.
zebbern/claude-code-guide
Interactive system flow tracing across CODE, API, AUTH, DATA, NETWORK layers with SQLite persistence and Mermaid export.
tt-a1i/archify
Creates interactive architecture, workflow, sequence, data-flow and lifecycle diagrams as standalone HTML with inline SVG, themes and image or video export.
maslennikov-ig/claude-code-orchestrator-kit
Comprehensive software architecture skill for designing scalable, maintainable systems using ReactJS, NextJS, NodeJS, Express, React Native, Swift, Kotlin…
trailofbits/skills
Scans a codebase for vulnerabilities with CodeQL's data flow and taint tracking in run-all or important-only modes, including data extensions for project-specific sources and sinks.
trailofbits/skills
Compares Trailmark code graphs at two snapshots, such as commits, tags or directories, to surface attack paths, blast radius and taint changes that text diffs miss.
trailofbits/skills
Draws a 12 Houses tarot spread to break ties when a request is vague or casually delegated, then reads the cards to pick the next step.
trailofbits/skills
Detects languages, proposes rulesets for approval, then runs the approved Semgrep scan across a codebase and merges the output into one SARIF file.
trailofbits/skills
Searches and extracts data from Burp Suite project files on the command line: regex searches over responses, audit findings, proxy history and site map data.
trailofbits/skills
Picks a small, graph-based slice of source with Trailmark and hands a focused code task to a smaller or local model without exposing the whole repository.
Categories
Generates Mermaid diagrams from Trailmark code graphs, including call graphs, class hierarchies, module dependency maps, complexity heatmaps and attack surface data flows. py`, does the Mermaid syntax generation from Trailmark's parsed code graph. The types include call graphs, class hierarchies, module dependencies, containment views with class members, complexity heatmaps with color coding, and data flow from entry points to sensitive functions.
Code Graph Mermaid Diagrams fits situations like: drawing a call graph that starts from a chosen function; showing class inheritance or members as a diagram; mapping import dependencies between modules; highlighting complexity hotspots with color coding.
Run `npx skills add trailofbits/skills --skill diagramming-code -a claude-code`. Or copy the skill folder (plugins/trailmark/skills/diagramming-code in trailofbits/skills) into .claude/skills/diagramming-code in your project. Claude Code loads it when a task matches its description.
Run `npx skills add trailofbits/skills --skill diagramming-code -a codex`. Or copy the skill folder (plugins/trailmark/skills/diagramming-code in trailofbits/skills) into .agents/skills/diagramming-code in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add trailofbits/skills --skill diagramming-code -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/diagramming-code, .gemini/skills/diagramming-code, .github/skills/diagramming-code and .opencode/skills/diagramming-code in your project.
Going by SKILL.md and its folder, Code Graph Mermaid Diagrams needs Python for the scripts in its folder and the command-line tools its instructions call (uv). Our summary lists: Trailmark (`uv tool install trailmark`); uv.
SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Code Graph Mermaid Diagrams is published under the CC-BY-SA-4.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.7k tokens (SKILL.md is roughly 6.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Code Graph Mermaid Diagrams: GitDiagram Repository Overview (ahmedkhaleel2004/gitdiagram, 18k stars), GitDiagram Repo Architecture (ahmedkhaleel2004/gitdiagram, 18k stars), draw.io Architecture Diagramming (HoangNguyen0403/agent-skills-standard, 570 stars) and Audit Flow (zebbern/claude-code-guide, 4.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
trailofbits (a GitHub organization, an official publisher) maintains it in trailofbits/skills, which has 7,400 GitHub stars. The repository holds 79 skills in this directory. The repository was last updated on October 2, 2026.
Source: trailofbits/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.