NW-DESIGN: Architecture Design Wave: DESIGN (wave 3 of 6) Agents: Morgan…
- User
NW-DESIGN: Architecture Design
Wave: DESIGN (wave 3 of 6) | Agents: Morgan (nw-solution-architect) | Command:
*design-architectureOverview
Execute DESIGN wave through discovery-driven architecture design. Morgan asks about business drivers and constraints first, then recommends architecture that fits. Analyzes existing codebase, evaluates open-source alternatives, produces C4 diagrams (Mermaid) as mandatory output.
Context Files Required
- docs/feature/{feature-name}/discuss/requirements.md
- docs/feature/{feature-name}/discuss/user-stories.md
- docs/feature/{feature-name}/discuss/domain-model.md
- docs/feature/{feature-name}/discuss/ux-journey.md
- docs/feature/{feature-name}/discuss/jtbd-job-stories.md — Job stories (JTBD Phase 1)
- docs/feature/{feature-name}/discuss/jtbd-four-forces.md — Four Forces analysis
- docs/feature/{feature-name}/discuss/jtbd-opportunity-scores.md — Opportunity scores (if multiple jobs)
- docs/feature/{feature-name}/design/constraints.md — Technical and business constraints
Discovery Flow
Architecture decisions driven by quality attributes, not pattern shopping:
Step 1: Understand the Problem
Review JTBD artifacts from DISCUSS to understand which jobs the architecture must serve. Morgan asks: What are we building? For whom? Which quality attributes matter most? (scalability|maintainability|testability|time-to-market|fault tolerance|auditability)
Step 2: Understand Constraints
Morgan asks: Team size/experience? Timeline? Existing systems to integrate? Regulatory requirements? Operational maturity (CI/CD, monitoring)?
Step 3: Team Structure (Conway's Law)
Morgan asks: How many teams? Communication patterns? Does proposed architecture match org chart?
Step 3.5: Development Paradigm Selection
Morgan identifies primary language(s) from constraints, then applies:
- FP-native (Haskell|F#|Scala|Clojure|Elixir): recommend Functional
- OOP-native (Java|C#|Go): recommend OOP
- Multi-paradigm (TypeScript|Kotlin|Python|Rust|Swift): present both, let user choose based on team experience and domain fit
After confirmation, ask user permission to write paradigm to project CLAUDE.md:
- FP:
This project follows the **functional programming** paradigm. Use @nw-functional-software-crafter for implementation. - OOP:
This project follows the **object-oriented** paradigm. Use @nw-software-crafter for implementation.
Assistant
I'll start by gathering the existing DISCUSS wave artifacts and understanding the current codebase architecture before launching the design process.
Assistant
The DESIGN wave is complete. Here's a summary of what was produced:
Architecture Design Deliverables
Design Documents (4 files in
docs/feature/oauth-rar-dpop/design/):architecture-design.md— C4 diagrams (L1 System Context, L2 Container, 2x L3 Component), data flows, quality attribute strategiestechnology-stack.md— Zero new dependencies (reuses existingjose+ Bun Web Crypto)component-boundaries.md— 12 components inapp/src/server/oauth/with pure core / effect shell separationdata-models.md— SurrealDB schema extensions, TypeScript algebraic types, JWT token format
ADRs (5 records in ):
- User
/context context
- User
commit
Assistant
Committed
132b2eb7— 9 files, 1,305 lines added. Design wave artifacts (4 architecture docs + 5 ADRs) are onmarcus-sa/oauth-rar-dpop-server.