architecture-docs

A command that creates documentation explaining a system’s architecture, data flow, component relationships, and important design decisions; Mermaid is used for diagrams and ADRs record those decisions.

In plain words
What is it for?
Use it to generate a quick architecture diagram or a fuller system overview with diagrams, data flows, relationships, and architecture decision records.
Why use it?
It turns a project that may be difficult to understand into a shared reference for developers and future maintenance.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/benkapner/claude-code-basecamp/architecture-docs
Clone the repo
git clone --depth 1 https://github.com/Benkapner/claude-code-basecamp

Made for: Claude Code.

Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 948 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00028 $0.00948
Opus 5 $0.00014 $0.00474
Sonnet 5 $0.00006 $0.00190
Haiku 4.5 $0.00003 $0.00095

Measured yesterday against content hash 2d6c763451d2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

architecture-docs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/architecture-docs.md · 124 lines

How it starts

The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Architecture Documentation

Generate architecture documentation for the project.

Quick Mode

If $ARGUMENTS contains --quick or quick:

  1. Read the project — README, entry points, directory structure. Understand what the system does and how data/control flows through it.

  2. Write a Mermaid flowchart showing the main flow. Keep it simple:

    • Use flowchart LR (left-to-right) for pipelines, flowchart TD (top-down) if it fits better
    • 5-12 nodes max — major components only, not individual files
    • Label arrows with what moves between components (data, events, etc.)
    • Use subgraphs sparingly — only if there's a clear grouping
    • Name nodes by what they do, not filenames
  3. Save as a self-contained HTML file that renders the diagram using Mermaid CDN:

    uv run .ai-workspace/scripts/mktmpdir.py visualize 2>/dev/null || mkdir -p .tmp/visualize
    

    Save to .tmp/visualize/architecture.html. The HTML is just a minimal page that loads https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js and renders the diagram — no extra UI.

  4. Show the user the Mermaid source inline and tell them the file path.

Stop here for quick mode — do not produce full documentation.

Full Mode (default)

Step 1: Discover Architecture

Use parallel agents to explore the codebase:

  • Read README.md, CLAUDE.md, and any existing docs
  • Map the directory structure and identify key modules
  • Trace data flow: where does data enter, how is it processed, where does it go?
  • Identify external integrations (APIs, databases, services)
  • Review config files for infrastructure context

Step 2: Generate Documentation

Produce the following sections, scaled to the project's complexity:

System Overview

  • What the system does (1-2 paragraphs)
  • Key stakeholders and users
  • External systems it connects to

Component Architecture

  • Mermaid diagram showing major components and their relationships
  • Each component: responsibility, inputs, outputs, dependencies
  • Clear boundaries between modules

Read the full file on GitHub · 124 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 124 lines · 28 tokens per session scan A 2d6c763451d2

Subscribe to this mod's changes

architecture-docs is a command published in the GitHub repository Benkapner/claude-code-basecamp (16 stars, last pushed 12d ago), licensed MIT. It adds 28 tokens to every session and 948 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.