Use when the user asks to understand code structure, impact of changes, find owners, audit dependencies, or navigate the codebase graph. Specializes in the OpenCodeHub MCP toolkit and always grounds claims in graph queries rather than text search.
Produce {{ docsroot }}/analysis/dead-code.md: three tables enumerating unreferenced exports, unreferenced files, and dead imports in {{ repo }}. The file is always emitted — when the graph reports no dead code, emit a No unreferenced symbols detected. banner plus a timestamp so Phase E cross-references have a stable…
Produce {{ docsroot }}/analysis/ownership.md: a ranked table of folders in {{ repo }} by top-contributor share, followed by a ## Single points of failure H2 listing paths where the top owner holds > 70% of commits — each SPOF row gets a one-sentence mitigation suggestion.
Produce {{ docsroot }}/analysis/risk-hotspots.md: a ranked table of the top 12 files in {{ repo }} by combined risk score (30-day trend slope + current finding severity), followed by a ## Per-file drill-down section with one H3 per top-5 hotspot covering what's there, recent activity, owners, and open findings.
Produce {{ docsroot }}/architecture/data-flow.md: a walk of the top 3 processes in {{ repo }}, each rendered as numbered steps plus one Mermaid sequenceDiagram. Every step cites path:LOC for the function that advances the flow.
Produce {{ docsroot }}/architecture/module-map.md: one H2 per top module, each with a one-paragraph description and a bullet list of the module's top 8 files cited as path:LOC with (N LOC) suffix.
Produce {{ docsroot }}/architecture/system-overview.md: a 400–600-word narrative of what {{ repo }} does and how its top-level pieces fit, with one stack table and one Mermaid flowchart LR of the top 6 modules.
Produce {{ docsroot }}/behavior/processes.md: one H2 per top process in {{ repo }}, each with a numbered step list citing path:LOC on every line, entry-point attribution (HTTP route / MCP tool / CLI command / scheduled job), and a ### Related subsection with backtick citations to handler files.
Produce {{ docsroot }}/behavior/state-machines.md: one H2 per state machine in {{ repo }}, each containing exactly one Mermaid stateDiagram-v2 block that reflects the states and transitions declared in source, followed by a path:LOC citation to the definition site.
Produce {{ groupdocsroot }}/cross-repo/contracts-matrix.md: the N×N producer/consumer matrix for the {{ group }} group (rows = producers, columns = consumers, cells = contract counts), followed by a ## Notable contracts H2 listing the top 10 contracts with both-ends repo:path:LOC citations.
Produce {{ groupdocsroot }}/cross-repo/dependency-flow.md: a single Mermaid flowchart TB showing inter-repo data flow across the {{ group }} group — nodes are repos (plus events/streams as needed), edges are contract groups labeled by HTTP verb + path or event type.
Produce {{ groupdocsroot }}/cross-repo/portfolio-map.md: a 2-paragraph narrative of the {{ group }} group's shape, a Mermaid flowchart LR of its member repos with contract-count edges, and a ## Repos section with per-member H2 + relative link into each member's own .codehub/docs/ tree.
Produce {{ docsroot }}/diagrams/architecture/components.md: a single Mermaid classDiagram of the top 8 components of {{ repo }} with HAS-A / USES edges, capped at 20 total nodes.
Produce {{ docsroot }}/diagrams/structural/dependency-graph.md: a single Mermaid flowchart LR showing {{ repo }}'s internal communities alongside external-dep leaf nodes, capped at 20 total nodes.
Produce {{ docsroot }}/diagrams/behavioral/sequences.md: up to three Mermaid sequenceDiagram blocks, one per top process, each showing the outbound call order across 4-8 participants.
Produce {{ docsroot }}/reference/cli.md: one H2 per CLI subcommand (derived from routemap), each with a fenced usage block, a one-sentence description, a path:LOC citation, and a bulleted flag list where each flag cites path:LOC .
Produce {{ docsroot }}/reference/mcp-tools.md: the authoritative reference for every MCP tool {{ repo }} exposes, one H2 per tool, each with a verbatim signature, input/output shapes, a one-sentence purpose, and a path:LOC citation to the handler file.
Produce {{ docsroot }}/reference/public-api.md: one H3 per exported symbol for the top 30 public exports of {{ repo }}, each with a fenced code block that quotes the symbol's signature verbatim, a one-sentence description, and a path:LOC citation. When {{ repo }} is not a CLI, append an ## HTTP H2 rendered from…