Design, architect, plan, and review software structure. Use when the user says "design the architecture", "plan this feature", "how should we build this", "break this down", "propose approaches for", "what's the best way to structure", "create a technical plan", "think through the design", "evaluate options for building", "review the architecture", "analyze the codebase", "find pain points", "what should we improve", "audit the structure", or any medium-to-large task, structural change, refactoring, creative/idea work, multi-component change, architecture review, or technology selection. Produces multi-solution analysis with tradeoffs, composable module design, and architecture-first implementation plans.
Structured process for turning requirements into robust, incremental implementation plans — or reviewing existing architecture to identify what genuinely needs improvement.
Two modes:
Hard gate: Do NOT write implementation code, scaffold projects, or invoke implementation skills until the design is approved and plan files are written.
Use when analyzing existing code for structural issues, pain points, or improvement areas.
flowchart TD
A[Analyze codebase] --> B[Identify pain points]
B --> C[Classify severity]
C --> D{Worth the cost?}
D -->|Yes| E[Propose change with justification]
D -->|No| F[Document but do not propose]
E --> G[If approved, enter Design mode]
Rate each finding honestly:
| Severity | Description | Action |
|---|---|---|
| Critical | Actively causing bugs, data loss, or blocking progress | Must fix — propose change |
| Significant | Slowing development, causing recurring confusion or rework | Worth fixing — propose change |
| Minor | Suboptimal but functional, team knows the workaround | Document only — do NOT propose change |
| Cosmetic | Style preference, "would be nicer if" | Ignore entirely |
Before proposing any change, answer honestly:
Only propose changes classified as Critical or Significant. Present findings as:
## Finding: [Name]
Severity: [Critical/Significant]
Current: [what exists and what problem it causes — be specific]
Impact: [concrete consequence — bugs reported, dev time wasted, incidents caused]
Proposed: [what to change]
Cost: [effort, risk, disruption]
If the review finds nothing worth changing, say so. "The architecture is sound" is a valid conclusion.
After approved findings, transition to Design mode (Phases 3-8) for the accepted changes.
flowchart TD
A[Receive task] --> B[Phase 1: Scan context]
B --> C[Phase 2: Clarify requirements]
C --> D[Phase 3: Zoom-out design]
D --> E[Phase 4: Multi-solution analysis]
E --> F{User picks direction}
F --> G[Phase 5: Zoom-in module design]
G --> H[Phase 6: Write plan files]
H --> I[Phase 7: Create trekker epic + tasks]
I --> J[Phase 8: Hand off to implementation]
Gather before asking:
Ask focused questions, one at a time. Prefer multiple-choice when possible.
Essential questions:
Stop clarifying when the desired outcomes are concrete and well-defined.
Think at the system/module level. Do NOT jump to file-level details yet.
Do NOT rely solely on trained knowledge. Technology moves fast — APIs change, libraries get deprecated, better alternatives emerge. Always verify with live research.
Research is mandatory when:
How to research:
resolve-library-id then query-docs for specific library documentationPresent research findings alongside proposals — not as an afterthought but as the basis for the recommendation.
Propose at least 2 approaches. Never present a single option. Scale the number to match problem complexity — simple problems need 2, ambiguous or high-stakes decisions may need 4-5. Stop when additional options no longer surface meaningfully different tradeoffs.
Evaluate each proposal from a tech lead perspective — as if reviewing a design doc that will go to production:
| Dimension | Tech Lead Questions |
|---|---|
| Architecture fit | Does it align with existing patterns? Or does it introduce a new paradigm the team must learn? |
| Operational readiness | How do we monitor, debug, and deploy this? What breaks at 3 AM? |
| Migration path | How do we get from current state to this? Can we do it incrementally? |
| Team impact | Can the team maintain this in 6 months? What's the onboarding cost? |
| Failure modes | What happens when it fails? Is the blast radius contained? |
| Dependencies | New libraries? Version constraints? Vendor lock-in? |
| Data integrity | Race conditions? Consistency guarantees? Rollback path? |
Not every dimension applies to every proposal. Evaluate what matters for the specific problem.
Present each option as:
## Option A: [Name]
[2-3 sentence summary]
Architecture: [how it fits or changes the system]
Technology: [specific APIs, SDKs, engines, models — with known pitfalls]
Migration: [incremental path or big-bang]
Ops: [monitoring/debugging/deployment story]
+ Pros
- Cons
Risk: [low/medium/high] — [one-line justification]
End with:
## Recommendation: Option [X]
[Why — with specific tradeoff acknowledgment and what we accept by choosing this]
Simplicity != lazy. The simplest robust solution wins. Three lines of duplicated code beats a premature abstraction — but ignoring error handling is not "simple," it is incomplete. A tech lead rejects both over-engineering and under-engineering.
After direction is approved, design the composable module structure.
For each module/class:
For each technology decision:
Design principles to enforce:
Generate architecture-first plan documents. No code snippets — the implementing agent writes code. The architect defines structure, decisions, and constraints.
See Plan File Templates for the structure and required sections.
Output path: docs/<plan-name>/
docs/<plan-name>/
00-overview.md # Goal, decisions, technology choices with pitfalls
01-module-architecture.md # Module map, interfaces, directory structure
02-data-and-state.md # Data model, state ownership, data flow
03-integration-points.md # External deps, platform constraints, wiring
04-edge-cases-and-resilience.md # Failure scenarios, resource management
05-implementation-sequence.md # Phased build order, incremental milestones
Rules:
Track the entire process in trekker:
flowchart LR
A[Create epic] --> B[Create tasks per plan section]
B --> C[Add dependencies]
C --> D[Comment with design rationale]
Example:
trekker epic create -t "Feature Name" -d "goal + approach summary"
trekker task create -t "Section task" -d "what + files + acceptance" -e EPIC-N
trekker dep add TREK-Y TREK-X
trekker comment add TREK-X -a "architect" -c "Decision: chose Option A because..."
After plan files are written and trekker is populated: