Architecture Examination
You are examining a codebase's architecture to identify structural problems. Follow a systematic approach: identify architectural surfaces, analyze each in parallel, consolidate findings, then validate with plan-refiner.
Core Principles
- •Analyze, don't fix: This command identifies problems and creates implementation plans, but doesn't make changes
- •Parallel analysis: Launch multiple agents to examine different surfaces simultaneously
- •Validate recommendations: Use plan-refiner to eliminate over-engineering from proposed fixes
- •Use TodoWrite: Track all progress throughout
Phase 1: Surface Identification
Goal: Identify which architectural surfaces to examine
Focus area: $ARGUMENTS
Actions:
- •Create todo list with all phases
- •If $ARGUMENTS specified, focus surfaces on that area
- •Identify 4-8 architectural surfaces based on project characteristics
Surface Categories:
- •Vertical: Auth flow, data persistence, API request/response, error handling
- •Horizontal: UI/presentation, business logic, data access, integrations
- •Cross-cutting: State management, testing, configuration, logging
- •Structural: Component organization, dependencies, build/deployment
- •Present selected surfaces and confirm with user before proceeding
Phase 2: Parallel Analysis
Goal: Examine each surface for architectural problems
Actions:
- •Launch architecture-reviewer agents in parallel (one per surface)
- •Each agent should:
- •Analyze the surface for brittleness, complexity, and coupling
- •Output findings with severity, effort, and suggested approach
- •Include a list of key files examined
- •Wait for all agents to complete
- •Read key files identified by agents to build context
Phase 3: Consolidation
Goal: Merge findings into prioritized, actionable issues
Actions:
- •Review all agent findings
- •Merge overlapping issues across surfaces
- •Identify root causes that span multiple areas
- •Create step-by-step implementation plans for each issue
- •Prioritize by impact (severity × breadth)
Phase 4: Validation
Goal: Ensure recommendations aren't over-engineered
Actions:
- •Launch plan-refiner agent to review implementation plans
- •Plan-refiner should:
- •Eliminate over-engineering
- •Validate tractability
- •Suggest simpler approaches
- •Flag anything too complex to be worth fixing
- •Incorporate plan-refiner feedback
- •Present validated findings to user
Phase 5: Summary
Goal: Present actionable findings
Actions:
- •Mark all todos complete
- •Present findings in this format:
code
ARCHITECTURE EXAMINATION COMPLETE Surfaces examined: X Raw findings: Y Consolidated issues: Z ACTIONABLE FIXES (ready to implement): 1. [Issue Title] - Severity: high|medium|low | Effort: small|medium|large Problem: [What's architecturally wrong] Impact: [What's hard because of this] Root cause: [Why this exists] Implementation Plan: 1. [Step with file references] 2. [Step with file references] Plan-refiner notes: [Simplifications applied] 2. [...] DEFERRED: - [Issue] - Why: [Too complex / Low impact / Not worth fixing]
- •Use AskUserQuestion to ask which issues they want to address (multiSelect: true)