Comprehensive project architecture blueprint generator. Use when: generate architecture docs, create architectural blueprint, analyze codebase architecture, document tech stack, create Mermaid diagrams, map component dependencies, document API surface, detect architectural patterns, reverse-engineer architecture, produce system design docs, visualize codebase structure, generate architecture.md
Produces a comprehensive docs/architecture.md for any codebase by detecting technology stacks, classifying streams (Frontend / Backend / Data), delegating deep analysis to specialist sub-agents, and synthesizing the results into a unified, diagram-rich blueprint.
Scan the repository root:
package.json, pyproject.toml, go.mod, pom.xml, Cargo.toml, or composer.json to identify language, framework, and key dependenciespnpm-workspace.yaml, nx.json, turbo.json, lerna.json, packages/, apps/.env.example or config/ to identify external services (DB, cache, queue, CDN).github/workflows/, Dockerfile, docker-compose.yml) for deployment topology hintsUsing signals from stack-patterns.md, determine which streams are present:
| Stream | Delegate Sub-agent | Primary Path Signal |
|---|---|---|
| Frontend | frontend-analyst | src/, client/, components/, pages/, app/ |
| Backend | backend-analyst | server/, api/, controllers/, routes/, services/ |
| Data | data-analyst | models/, migrations/, db/, schema/, pipelines/ |
For monorepos, classify each workspace package independently and run sub-agents per package.
Invoke each detected sub-agent with its scoped path. Pass:
Collect the structured report from each sub-agent before proceeding.
Error handling: If a sub-agent returns an empty report or fails, do NOT abort the whole analysis. Record the failure, continue with the remaining sub-agents, and include a
> ⚠️ Warningnote in the relevant section of the output file.
Using the sub-agent reports, build the cross-stream view:
Produce Mermaid diagrams at the appropriate scope:
data-analyst report)Save the final blueprint to docs/architecture.md using the structure in architecture-template.md.
If docs/ does not exist, create it. Confirm the file path to the user when done.
Error handling: If the file cannot be written (permissions, read-only workspace), print the full blueprint content to the conversation as a fallback so the user does not lose the output.
Before finishing, verify:
docs/architecture.md (or acknowledged as inline per user request)⚠️ Warning note in the output