/upfront:architect
What it does
Section titled “What it does”/upfront:architect performs a structural code review focused on finding architectural problems — not bugs, not features. It maps the codebase, identifies god modules, layer violations, and pattern inconsistencies, then produces an evolution plan.
When to use it
Section titled “When to use it”- Before a major feature when you suspect the codebase has structural debt
- After a period of rapid AI-assisted development (when structure tends to drift)
- When onboarding to an unfamiliar codebase and wanting to understand its health
- Periodically as a health check
How it works
Section titled “How it works”- Load context — reads
specs/ARCHITECTURE.md,specs/DECISIONS.md,specs/LEARNINGS.md - Structural survey — parallel sub-agents map module inventory, dependency graph, and layer analysis
- God module detection — flags modules with multiple responsibilities or excessive size
- Layer violation scan — identifies improper cross-layer dependencies
- Pattern audit — checks for inconsistent patterns and unnecessary abstractions
- Evolution plan — writes
specs/ARCHITECTURE-EVOLUTION.mdwith phased restructuring steps - Decision record — appends the review findings to
specs/DECISIONS.md
Key principles
Section titled “Key principles”- Restructuring only — no behavior changes, no new features
- God modules first — fixing patterns inside a god module is wasted effort if it’s getting split
- Don’t add complexity — patterns are for managing complexity that exists, not complexity you’re introducing
- Clean is clean — if the architecture is healthy, it says so and moves on
Output
Section titled “Output”specs/ARCHITECTURE-EVOLUTION.md— phased plan for structural improvements- Updated
specs/DECISIONS.md— rationale for proposed changes - Summary of findings
Next step
Section titled “Next step”Run /upfront:re-architect to execute the evolution plan phase by phase.