From techlead
Trigger when scanning an existing codebase to produce architecture documentation — reverse-engineering project structure, generating docs/ARCHITECTURE.md from source code, creating system diagrams, or mapping out services and components. Also trigger for "document this project's architecture", "what is the architecture of this codebase?", or "map out the services in this project". NEVER trigger for: code quality reviews, commit checks, defining feature specs, setting up project governance, choosing between technologies, implementing features, fixing bugs, or reading past decisions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/techlead:analyze-architectureThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Scan an existing codebase and generate comprehensive architecture documentation with mermaid diagrams, layer-specific sections, and actual directory structure.
evals/evals.jsonevals/fixtures/coupled/package.jsonevals/fixtures/coupled/src/features/auth/index.tsevals/fixtures/coupled/src/features/billing/index.tsevals/fixtures/package.jsonevals/fixtures/simple/package.jsonevals/fixtures/simple/src/cli.tsevals/fixtures/simple/src/index.tsevals/fixtures/src/index.tsevals/fixtures/src/models/task.tsevals/fixtures/src/routes/tasks.tsevals/fixtures/tsconfig.jsonevals/trigger_evals.jsonScan an existing codebase and generate comprehensive architecture documentation with mermaid diagrams, layer-specific sections, and actual directory structure.
Read broadly to understand what exists:
package.json, pyproject.toml, go.mod, Cargo.toml, pom.xml, build.gradle, Gemfile, requirements.txt, etc.tsconfig.json, .eslintrc, babel.config, webpack.config, vite.config, etc.Dockerfile, docker-compose.yml, .github/workflows/, Jenkinsfile, .gitlab-ci.ymlls and explore src/, lib/, app/, cmd/, internal/, packages/src/index.*, src/main.*, app.*, cmd/main.*README.md, docs/ARCHITECTURE.md, docs/, ADR/Do NOT read every file. Sample representative files from each directory to understand patterns.
Classify the project as one of:
List only layers that actually exist in the codebase:
Do NOT invent layers that don't exist. If the project is a simple CLI with one entry point, it has one layer.
Choose based on complexity:
docs/ARCHITECTURE.md — when ≤3 layers or total content would be <200 linesarchitecture/ directory — when 4+ layers or any single layer needs >50 lines of documentationMulti-file structure:
docs/architecture/
├── README.md # System overview, tech stack, directory structure, layer index, import rules, constraints
├── api.md # Routes, controllers, middleware
├── data.md # DB schema, models, migrations
├── infrastructure.md # Deployment, CI/CD, Docker, cloud
├── frontend.md # UI framework, components, state management
├── <layer>.md # Any other project-specific layer
Filenames adapt to the project's own terminology. Only create files for layers that exist.
Always include:
Conditionally include:
Don't force diagrams that add no value. A CLI tool needs a flowchart, not an ER diagram.
Fill all sections from actual codebase findings:
tree output or equivalent, annotated with what each directory containsDocument what's actually there — routes with their handlers, models with their fields, infra with its topology. Use the project's own terminology and naming.
After generating the documentation:
Show a summary of findings:
Ask the user:
I've generated architecture docs based on the codebase scan. Does this accurately capture the system? Any corrections, missing components, or terminology changes?
Iterate on feedback before finalizing.
/propose-architecture's jobdocs/ARCHITECTURE.md already exists, ask before overwritingnpx claudepluginhub rroundtable/techlead --plugin techleadAutomatically analyzes codebases to generate zero-config architecture diagrams by detecting project type, tech stack, and structure. For repo overviews without custom specs.
Queries and visualizes project architecture: domains, APIs, layers, tech stack via /architecture subcommands or natural queries like 'show me the structure'. Analyzes filesystem patterns with Mermaid diagrams.
Auto-generates Mermaid diagrams mapping codebase architecture: system overview, API routes, database schema, data flow. Analyzes dependencies, concerns, and saves to docs/architecture/.