| name | architect |
| description | Guides architecture decisions about service/module boundaries, system trade-offs, ADRs, data flow, rendering strategy, scaling strategy, API protocols, persistence choices, and code organization. Use when the user asks "how should I structure this", "what's the right approach", or needs a decision that affects multiple modules, teams, deployment boundaries, or future reversibility. Do not use for routine React implementation, PR review, or simple refactors unless the user is making an architectural decision. |
Architect
Methodology: Walk the Decision Tree
Architecture is about trade-offs, not best practices. Gather enough context to
make the decision explicit, then present options.
- Ask only if the answer is blocking; otherwise inspect the codebase or state
assumptions
- Ask one focused question at a time when clarification is required
- Provide your recommended answer for each blocking question
- Resolve dependencies between decisions sequentially โ don't jump ahead
Gather at minimum:
- What exists today โ greenfield or evolving an existing system?
- Scale โ users today, projected in 12 months
- Team โ size, expertise, operational maturity
- Trigger โ why now? pain point, new feature, scale issue?
- Constraints โ budget, timeline, compliance, existing infrastructure
Then present 2โ3 options with explicit trade-offs โ never a single "right answer."
Reference Files
Load the relevant reference file based on context. Read only what the conversation needs.
| Priority | Load when | Reference |
|---|
| 1 โ High | Code organization, module design, why codebase feels hard to change | references/design-principles.md |
| 1 โ High | Why code is hard to maintain, identifying what to refactor, when to refactor | references/code-smells.md |
| 2 โ High | Service boundaries, API contracts, BFF, fullstack performance antipatterns | references/fullstack-patterns.md |
| 2 โ High | Component architecture, state management, rendering strategy, frontend performance | references/frontend-patterns.md |
| 3 โ Medium | Build/buy, monolith/services, SQL/NoSQL, sync/async, ADRs, C4 diagrams | references/decision-artifacts.md |
| 3 โ Medium | "What structural pattern should I use?", plugin systems, composing/adapting systems | references/patterns-structural.md |
| 3 โ Medium | Communication patterns, event-driven design, state machines, encapsulating algorithms | references/patterns-behavioral.md |
Complexity Red Flags (Diagnose First)
Before recommending a solution, identify the symptom. These are fast first-pass signals.
Ousterhout's 3 complexity symptoms:
- Change amplification โ one logical change requires edits in many unrelated places
- Cognitive load โ developer must hold too much context to make a change safely
- Unknown unknowns โ it's not obvious what must change when something else changes
Architecture-level smells (Fowler):
- Shotgun Surgery โ one change touches many unrelated files โ missing abstraction or wrong boundary
- Divergent Change โ one module changes for many unrelated reasons โ SRP violation
- Feature Envy โ a function/hook is more interested in another module's data than its own โ wrong ownership
If you see these symptoms, load references/code-smells.md or references/design-principles.md.
Quick Decision Checks
- Rendering strategy: use
references/frontend-patterns.md for CSR/SSR/SSG/ISR/RSC/Streaming/Edge trade-offs.
- API protocol: use
references/fullstack-patterns.md for REST vs GraphQL vs gRPC.
- Durable decision record: use
references/decision-artifacts.md for ADRs and C4 diagrams.
Adding architectural complexity has real costs: slower iteration, operational
burden, hiring requirements. Evaluate whether the complexity is paid for at
current scale.
Output Contract
End with:
- Recommendation
- 2โ3 alternatives considered
- Trade-offs and risks
- Assumptions
- Next concrete step
- ADR draft only if the decision is hard to reverse