wize-dev-kit 0.1.5 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +40 -1
  2. package/README.md +64 -0
  3. package/package.json +1 -1
  4. package/src/method-skills/1-analysis/wize-document-project/workflow.md +147 -20
  5. package/src/method-skills/1-analysis/wize-prfaq/workflow.md +150 -11
  6. package/src/method-skills/1-analysis/wize-product-brief/workflow.md +90 -19
  7. package/src/method-skills/1-analysis/wize-research/workflow.md +101 -9
  8. package/src/method-skills/1-analysis/wize-trigger-map/workflow.md +80 -16
  9. package/src/method-skills/2-plan-workflows/wize-create-prd/workflow.md +132 -23
  10. package/src/method-skills/2-plan-workflows/wize-ux-design/workflow.md +132 -28
  11. package/src/method-skills/2-plan-workflows/wize-ux-scenarios/workflow.md +91 -15
  12. package/src/method-skills/2-plan-workflows/wize-validate-prd/workflow.md +106 -12
  13. package/src/method-skills/3-solutioning/wize-check-implementation-readiness/workflow.md +101 -11
  14. package/src/method-skills/3-solutioning/wize-create-architecture/workflow.md +197 -29
  15. package/src/method-skills/3-solutioning/wize-create-epics-and-stories/workflow.md +127 -12
  16. package/src/method-skills/3-solutioning/wize-design-system/workflow.md +182 -22
  17. package/src/method-skills/3-solutioning/wize-nfr-principles/workflow.md +142 -16
  18. package/src/method-skills/3-solutioning/wize-tech-vision/workflow.md +127 -21
  19. package/src/method-skills/4-implementation/wize-code-review/workflow.md +105 -10
  20. package/src/method-skills/4-implementation/wize-create-story/workflow.md +131 -10
  21. package/src/method-skills/4-implementation/wize-dev-story/workflow.md +115 -17
  22. package/src/method-skills/4-implementation/wize-quick-dev/workflow.md +109 -18
  23. package/src/method-skills/4-implementation/wize-retrospective/workflow.md +112 -10
  24. package/src/method-skills/4-implementation/wize-sprint-planning/workflow.md +85 -10
  25. package/src/method-skills/4-implementation/wize-sprint-status/workflow.md +96 -11
  26. package/src/tea-skills/wize-tea-design/workflow.md +104 -13
  27. package/src/tea-skills/wize-tea-gate/workflow.md +108 -25
  28. package/src/tea-skills/wize-tea-nfr/workflow.md +104 -14
  29. package/src/tea-skills/wize-tea-review/workflow.md +107 -13
  30. package/src/tea-skills/wize-tea-risk/workflow.md +99 -10
  31. package/src/tea-skills/wize-tea-trace/workflow.md +83 -12
  32. package/tools/installer/commands/agent.js +197 -0
  33. package/tools/installer/commands/sync.js +45 -0
  34. package/tools/installer/commands/update.js +172 -0
  35. package/tools/installer/wize-cli.js +24 -8
@@ -4,45 +4,121 @@ name: UX Scenarios
4
4
  phase: 2-plan
5
5
  owner: wize-agent-ux-designer # Mantis (absorbs WDS Freya)
6
6
  absorbs: "WDS Freya — Phase 3 (8-question dialog)"
7
- status: stub
7
+ status: ready
8
8
  ---
9
9
 
10
10
  # UX Scenarios
11
11
 
12
- **Goal.** Produce the scenario map that anchors all UX work. Eight focused questions; one answer each.
12
+ **Goal.** Produce a scenario map that anchors all UX work. Eight focused questions; one short answer each. Scenarios are pieces of behavior, not personas — they're how *this* user, in *this* state, tries to accomplish *that* JTBD.
13
+
14
+ Mantis drives. Output lands in `.wize/planning/ux/ux-scenarios.md`. It's the bridge from PM intent (PRD) to designer concreteness (next workflow: `wize-ux-design`).
13
15
 
14
16
  ## Inputs
15
- - `.wize/planning/prd.md`
16
- - `.wize/planning/ux/trigger-map.md`
17
+
18
+ - `.wize/planning/prd.md` (validated)
19
+ - `.wize/planning/ux/trigger-map.md` (Pepper)
17
20
  - `.wize/planning/brief.md`
18
21
 
19
22
  ## Outputs
23
+
20
24
  - `.wize/planning/ux/ux-scenarios.md`
21
25
 
22
- ## The 8 questions (WDS dialog)
26
+ ## Steps
27
+
28
+ ### 1. Identify the scenarios
29
+
30
+ A scenario = one (user, state, JTBD) tuple where the product earns or loses. Aim for **3–8 scenarios** that, taken together, cover all backbone stories in the PRD.
31
+
32
+ Rules:
33
+ - One sentence each at this stage.
34
+ - Verb-led. *"New manager onboards their first team."* Not *"Manager onboarding."*
35
+ - Distinct. If two scenarios share trigger + state, collapse them.
36
+
37
+ ### 2. Run the 8-question dialog per scenario (WDS Freya)
38
+
39
+ For each scenario, answer the eight questions. One paragraph per answer. No filler. Cite trigger-map row when relevant.
23
40
 
24
41
  1. **Who is the user, in one sentence?**
25
- 2. **What state are they in when they arrive?** (emotional, contextual)
26
- 3. **What are they trying to accomplish?** (job-to-be-done)
42
+ Role + context. *"A 38-year-old engineering manager at a 25-person SaaS, primarily on desktop, sometimes phone."*
43
+
44
+ 2. **What state are they in when they arrive?**
45
+ Emotion + situational context. *"It's Monday morning. They just got CTO's request to onboard 3 hires this sprint. They're alt-tabbing between Slack and Linear."*
46
+
47
+ 3. **What are they trying to accomplish?** (JTBD)
48
+ *"Add three teammates and assign each to the right project before the team standup at 10am."* Concrete.
49
+
27
50
  4. **What would they do without our product today?**
51
+ *"Slack screenshots of the project list to each new hire; have them sign up individually; cross-check who landed where."*
52
+
28
53
  5. **What's the moment of truth — when they decide it works?**
54
+ *"The first time they see all three names in the team list with the right project tags, in under 5 minutes."*
55
+
29
56
  6. **What's the failure mode — when do they walk away?**
57
+ *"If they can't tell whether the invite arrived. If the invite email looks like spam. If they have to leave the page to find someone's email."*
58
+
30
59
  7. **What does success look like to them, in their words?**
60
+ *"It just worked. I sent the invites, they signed up, they were on the right project."* (Imagine the future quote.)
61
+
31
62
  8. **What's the next thing we want them to do?**
63
+ *"Open the project where the first teammate landed and verify the access works."*
32
64
 
33
- ## Output structure
65
+ ### 3. Cross-link to the PRD
66
+
67
+ For each scenario, list the **backbone story IDs** + **AC IDs** it touches. Mantis won't write specs for a scenario the PRD doesn't cover (it'd be scope creep); Hill won't sign off on a story the scenarios don't surface (it'd be over-spec).
68
+
69
+ ### 4. Hand off to UX Design
70
+
71
+ Mark `status: ready-for-design`. Wizer pings Mantis to start `wize-ux-design`, where each scenario becomes one or more page specs.
72
+
73
+ ## Output template
34
74
 
35
75
  ```markdown
36
- # UX Scenarios
76
+ ---
77
+ status: ready-for-design
78
+ owner: Mantis
79
+ created: YYYY-MM-DD
80
+ covers_prd_stories: [E01, E02, E04]
81
+ ---
82
+
83
+ # UX Scenarios — {{project_name}}
37
84
 
38
- ## Scenario 1: {{name}}
85
+ ## Scenario 1: New manager onboards their first team
39
86
 
40
- - Q1
41
- - Q2
42
- -
87
+ - **Trigger-map row:** 1 (Sign up), 2 (Invite first teammate)
88
+ - **PRD stories:** E01, E02
89
+ - **AC IDs touched:** AC-01-1, AC-01-2, AC-02-1, AC-02-3
43
90
 
44
- ## Scenario N:
91
+ **Q1 Who:** A 38-year-old engineering manager at a 25-person SaaS, primarily on desktop, sometimes phone.
92
+ **Q2 — State:** It's Monday morning. They just got CTO's request to onboard 3 hires this sprint. They're alt-tabbing between Slack and Linear.
93
+ **Q3 — JTBD:** Add three teammates and assign each to the right project before the team standup at 10am.
94
+ **Q4 — Today:** Slack screenshots of the project list to each new hire; have them sign up individually; cross-check who landed where.
95
+ **Q5 — Moment of truth:** The first time they see all three names in the team list with the right project tags, under 5 minutes.
96
+ **Q6 — Failure mode:** Can't tell whether the invite arrived; the email looks like spam; they have to leave the page to find someone's email.
97
+ **Q7 — Success in their words:** "It just worked. I sent the invites, they signed up, they were on the right project."
98
+ **Q8 — Next thing:** Open the project where the first teammate landed and verify access.
99
+
100
+ ## Scenario 2: Returning admin adds a fourth member months later
101
+
102
+ (…)
103
+
104
+ ## Coverage check
105
+
106
+ | PRD story | Scenarios |
107
+ |---|---|
108
+ | E01 (Sign up) | S1 |
109
+ | E02 (Invite) | S1, S2 |
110
+ | E03 (Switch project) | S2 |
111
+ | E04 (Dashboard) | S1 |
45
112
  ```
46
113
 
114
+ ## Anti-patterns Mantis rejects
115
+
116
+ - **Personas instead of scenarios.** Mantis cares what people *do*, not who they are in the abstract.
117
+ - **Scenarios with no emotion or context.** "User wants to sign up." — that's a backbone story restated. The point is the *state*.
118
+ - **JTBD written as features.** "Wants the dashboard." Wrong layer. Reword to the goal: "Wants to know if the team is healthy at a glance."
119
+ - **Q5 ("moment of truth") that's actually a feature description.** It should be the user's perception, not the UI.
120
+ - **More than 8 scenarios.** Two of them are duplicates. Find which.
121
+
47
122
  ## Hand-off
48
- "Mantis → Mantis": run `wize-ux-design` next.
123
+
124
+ > Scenarios are in `.wize/planning/ux/ux-scenarios.md`. They cover E01–E04. Next: page specs in `.wize/planning/ux/ux-design/` (one per screen). Tony, when you read these, the moment-of-truth lines tell you which interactions are load-bearing.
@@ -2,26 +2,120 @@
2
2
  code: wize-validate-prd
3
3
  name: Validate PRD
4
4
  phase: 2-plan
5
- owner: wize-agent-pm # Maria Hill (with Pepper + Mantis + Fury input)
6
- status: stub
5
+ owner: wize-agent-pm # Maria Hill (with Pepper, Mantis, Fury input)
6
+ status: ready
7
7
  ---
8
8
 
9
9
  # Validate PRD
10
10
 
11
- **Goal.** Make sure the PRD is ready to leave Plan and enter Solutioning. Catch ambiguity before architecture is wasted on it.
11
+ **Goal.** Decide whether the PRD is ready to leave Plan and enter Solutioning. Catch ambiguity before architecture is wasted on it. Cheap step; saves multiples of itself downstream.
12
+
13
+ Maria Hill chairs. Pepper, Mantis, Fury contribute. Output is either `validated: true` written to `prd.md` or a punch list routed back to authors.
14
+
15
+ ## When to run
16
+
17
+ After `wize-create-prd` produces `status: ready-for-validation`. Run once per major PRD change.
12
18
 
13
19
  ## Inputs
20
+
14
21
  - `.wize/planning/prd.md`
22
+ - `.wize/planning/brief.md`
23
+ - `.wize/planning/ux/trigger-map.md`
24
+ - `.wize/planning/research.md` (when present)
25
+ - `.wize/planning/tech-vision.md` (when Fury already wrote one)
15
26
 
16
27
  ## Outputs
17
- - Inline edits + a validation log appended to `prd.md`.
18
28
 
19
- ## Checklist
20
- - [ ] Every scope item has measurable ACs.
21
- - [ ] No "TBD" in goals or constraints.
22
- - [ ] Mantis confirms UX is addressable.
23
- - [ ] Fury approves stack-family direction (or has explicit reason not to yet).
24
- - [ ] No open questions with `blocker` priority remain.
29
+ - In-place edits to `prd.md` (validators add a "Validation log" section).
30
+ - If validated: `prd.md` frontmatter flips to `status: validated`.
31
+ - If not: a punch list, each item routed back to the owning agent.
32
+
33
+ ## Checklist (Maria Hill runs this)
34
+
35
+ ### Completeness
36
+ - [ ] Vision sentence present and matches the brief.
37
+ - [ ] 3–5 goals; each measurable; each tied to a trigger-map row.
38
+ - [ ] Scope `In` and `Out` both populated; `Out` items have reasons.
39
+ - [ ] Backbone stories cover every In-scope item.
40
+ - [ ] Every In-scope item has 3–7 ACs.
41
+ - [ ] Constraints + Assumptions + Dependencies all named.
42
+ - [ ] NFR pointer present.
43
+ - [ ] Open questions: each has an owner + deadline.
44
+
45
+ ### Quality
46
+ - [ ] Every AC is observable (testable by Hawkeye without ambiguity).
47
+ - [ ] No AC contains the word "easy", "intuitive", "responsive" without a numeric criterion.
48
+ - [ ] INVEST: every backbone story passes (independent, negotiable, valuable, estimable, small, testable).
49
+ - [ ] No goal repeats a brief constraint as if it were a goal.
50
+
51
+ ### Cross-checks
52
+ - [ ] **Pepper:** every goal anchors on a row of the trigger map.
53
+ - [ ] **Mantis:** every screen implied by the ACs is addressable in UX (no AC requires a UI the team hasn't agreed exists).
54
+ - [ ] **Fury:** the PRD's NFR pointer doesn't contradict the tech-vision.
55
+ - [ ] **Hawkeye preview:** at least the gate strategy is mentioned (advisory vs enforcing) for visibility.
56
+
57
+ ### Risk
58
+ - [ ] No open question is marked `blocker` AND has a deadline past the PRD validation date.
59
+ - [ ] Any assumption that, if wrong, kills > 30% of the scope has a verification plan.
60
+
61
+ ## Decision
62
+
63
+ After the checklist:
64
+
65
+ - **Validated** → flip frontmatter to `status: validated`. Append a Validation log block to `prd.md` with date + each signatory.
66
+ - **Concerns** → write specific fix-asks per agent. Each fix-ask is concrete (line ref + what to change).
67
+ - **Reject** → rare. Use when the brief itself is wrong; loop back to Pepper.
68
+
69
+ ## Validation log template (appended to `prd.md`)
70
+
71
+ ```markdown
72
+ ## Validation log — YYYY-MM-DD
73
+
74
+ **Status:** validated
75
+
76
+ **Signatories**
77
+ - Maria Hill (PM) — concerns: none
78
+ - Pepper Potts (Analyst) — concerns: trigger-map row 3 needs a stronger signal name, will update.
79
+ - Mantis (UX) — concerns: none, UX work starts next.
80
+ - Fury (Solution Strategy) — concerns: none. NFR pointer confirmed.
81
+
82
+ **Notes**
83
+ - Open question "Brazil-only beta?" was answered by sales lead — added to *Out of scope: global launch* with rationale.
84
+ ```
85
+
86
+ ## Punch-list template (when not validated)
87
+
88
+ ```markdown
89
+ ## Validation punch list — YYYY-MM-DD
90
+
91
+ **Status:** changes required
92
+
93
+ **By Maria Hill — author rewrites:**
94
+ - `AC-02-3`: "loads fast" is not observable. Rewrite with numeric target tied to Fury's NFRs.
95
+ - Backbone story E04 fails INVEST-S (too large). Split into 2 stories.
96
+
97
+ **By Pepper:**
98
+ - Goal 2 is not anchored on a trigger-map row. Add row reference or remove.
99
+
100
+ **By Mantis:**
101
+ - AC-01-4 implies a "preview" screen that isn't in any UX list. Either spec the screen or cut the AC.
102
+
103
+ **By Fury:**
104
+ - NFR pointer cites old version of nfr-principles.md. Update.
105
+ ```
106
+
107
+ ## Anti-patterns
108
+
109
+ - "Looks good to me" with no checklist run. The validation only counts if checked.
110
+ - Validating to keep the schedule, knowing concerns are open. Document the concern.
111
+ - Validating with no Hawkeye preview at all. Even a one-line gate strategy reference matters.
112
+
113
+ ## Hand-off
114
+
115
+ If validated:
116
+
117
+ > PRD validated. Mantis, you're up: `wize-ux-scenarios`. Fury, write or refresh `tech-vision.md` so Tony can read both.
118
+
119
+ If not:
25
120
 
26
- ## Outcome
27
- Either `validated: true` (timestamp + signatories) or list of fix-asks routed back to the right agent.
121
+ > PRD not yet validated. Punch list lives at the bottom of `prd.md`. {{Author}} fixes by {{date}}; we re-run validation.
@@ -2,21 +2,111 @@
2
2
  code: wize-check-implementation-readiness
3
3
  name: Check Implementation Readiness
4
4
  phase: 3-solutioning
5
- owner: wize-agent-architect # Tony Stark (with Hawkeye)
6
- status: stub
5
+ owner: wize-agent-architect # Tony Stark (with Hawkeye + Hill)
6
+ status: ready
7
7
  ---
8
8
 
9
9
  # Check Implementation Readiness
10
10
 
11
- **Goal.** Before any story enters dev, confirm everything is in place.
11
+ **Goal.** Before any story enters dev, confirm everything is in place. This is the **gate at the end of Phase 3**. Cheap; saves multiples of itself downstream.
12
12
 
13
- ## Checklist
14
- - [ ] Architecture doc exists and is signed (Tony + Fury approved).
15
- - [ ] All in-scope screens have UX specs (Mantis).
16
- - [ ] Design system tokens exist (Mantis).
17
- - [ ] Stories are sliced with ACs (Tony).
18
- - [ ] Hawkeye risk profile exists.
19
- - [ ] `.wize/config/tea.toml` policy choice is recorded.
13
+ Tony chairs. Hill and Hawkeye sign off. Pepper and Mantis answer if pulled in.
14
+
15
+ ## Inputs
16
+
17
+ - `.wize/planning/prd.md` (validated)
18
+ - `.wize/planning/ux/ux-design/` + `index.md`
19
+ - `.wize/planning/tech-vision.md`
20
+ - `.wize/planning/nfr-principles.md`
21
+ - `.wize/solutioning/architecture.md`
22
+ - `.wize/solutioning/adrs/`
23
+ - `.wize/solutioning/design-system/`
24
+ - `.wize/solutioning/epics/` + `stories/`
25
+ - `.wize/implementation/tea/risk-profile.md` (Hawkeye)
26
+ - `.wize/config/tea.toml` (policy choice)
27
+
28
+ ## Outputs
29
+
30
+ - `.wize/solutioning/readiness-{YYYY-MM-DD}.md` — checklist result + signoffs.
31
+
32
+ ## Checklist (Tony chairs)
33
+
34
+ ### Planning artifacts
35
+ - [ ] PRD `status: validated`.
36
+ - [ ] All open questions in PRD resolved (no `blocker` open).
37
+ - [ ] Trigger map covers every PRD goal.
38
+
39
+ ### UX
40
+ - [ ] Every In-scope item has at least one screen spec.
41
+ - [ ] UX design index maps every screen → scenario → AC.
42
+ - [ ] Design system tokens + components needed by the UX exist.
43
+
44
+ ### Strategy
45
+ - [ ] Tech vision `status: aligned`.
46
+ - [ ] NFR principles `status: aligned`; verifiers named for every non-negotiable.
47
+
48
+ ### Architecture
49
+ - [ ] Architecture doc `status: ready-for-stories`.
50
+ - [ ] ADRs cover every meaningful trade-off.
51
+ - [ ] NFR check section answers *how* for each non-negotiable.
52
+
53
+ ### Stories
54
+ - [ ] Every epic has 3–10 stories.
55
+ - [ ] Every story has AC IDs from the PRD; the union per epic equals the epic's AC set.
56
+ - [ ] No story is XL.
57
+ - [ ] Each story names touch-points + `testid` + reuse of design-system components.
58
+
59
+ ### TEA
60
+ - [ ] `tea-risk.md` exists.
61
+ - [ ] `.wize/config/tea.toml` policy is committed (advisory / enforcing).
62
+ - [ ] First-story `tea-design.md` is drafted (proof Hawkeye's contract works).
63
+
64
+ ### Cross-cutting
65
+ - [ ] CI runs tests + validators on every PR.
66
+ - [ ] Lint/format on commit.
67
+ - [ ] Branch protection on `main`.
68
+ - [ ] Secrets vault wired; no secret in repo.
20
69
 
21
70
  ## Outcome
22
- Either `ready: true` or list of fix-asks.
71
+
72
+ - **Ready** → write the readiness file, link from `sprint-planning`.
73
+ - **Concerns** → list specifically what's missing, owner per item, deadline. Re-check.
74
+
75
+ ## Output template
76
+
77
+ ```markdown
78
+ ---
79
+ status: ready | concerns
80
+ date: YYYY-MM-DD
81
+ chair: Tony Stark
82
+ signoffs:
83
+ - Maria Hill (PM)
84
+ - Hawkeye (TEA)
85
+ - Mantis (UX) — async
86
+ - Fury (Strategy) — async
87
+ ---
88
+
89
+ # Implementation Readiness — {{project_name}}
90
+
91
+ ## Result: Ready
92
+
93
+ ## Notes
94
+ - Architecture covers 5 epics and 28 stories.
95
+ - TEA policy: advisory; NFR gate per epic.
96
+ - 2 ADRs accepted in this gate review (ADR-008, ADR-009).
97
+
98
+ ## Open items (carry forward, not blockers)
99
+ - Marketing site for launch — separate track, owned by …
100
+ - Stripe-Atlas back-office decision — by date X.
101
+ ```
102
+
103
+ ## Anti-patterns
104
+
105
+ - "Looks ready" without running the checklist.
106
+ - Signing off before Hawkeye has risk-profiled.
107
+ - Closing concerns without re-checking.
108
+ - Leaving CI configuration "for later" — never gets done.
109
+
110
+ ## Hand-off
111
+
112
+ > Implementation readiness signed off. Hill, kick `wize-sprint-planning`. Hawkeye, your gate cadence is set: design per story, trace + review + gate per story, NFR per epic.
@@ -3,62 +3,230 @@ code: wize-create-architecture
3
3
  name: Create Architecture
4
4
  phase: 3-solutioning
5
5
  owner: wize-agent-architect # Tony Stark
6
- status: stub
6
+ status: ready
7
7
  ---
8
8
 
9
9
  # Create Architecture
10
10
 
11
- **Goal.** Design the system inside Fury's frame. Components, sequences, data flows, ADRs. Concrete enough that Shuri can implement and Hawkeye can test.
11
+ **Goal.** Design the system inside Fury's frame. Components, sequences, data flows, ADRs. Concrete enough that Shuri can implement and Hawkeye can write `tea-design.md` for every story.
12
+
13
+ Tony drives. Output lands in `.wize/solutioning/architecture.md` + `.wize/solutioning/adrs/`.
12
14
 
13
15
  ## Inputs
14
- - `.wize/planning/prd.md`
15
- - `.wize/planning/ux/ux-design/`
16
- - `.wize/planning/tech-vision.md` (Fury)
17
- - `.wize/planning/nfr-principles.md` (Fury)
18
- - `.wize/solutioning/design-system/` (Mantis)
19
- - `.wize/knowledge/document-project/` (if brownfield)
16
+
17
+ - `.wize/planning/prd.md` (validated)
18
+ - `.wize/planning/ux/ux-design/` (every architectural decision should make at least one screen possible)
19
+ - `.wize/planning/tech-vision.md` (the frame)
20
+ - `.wize/planning/nfr-principles.md` (the budget)
21
+ - `.wize/solutioning/design-system/` (Mantis' tokens, when available)
22
+ - Stack catalogs (overlays): `web-overlay/stack-catalog.md`, `app-overlay/stack-catalog.md`
23
+ - `.wize/knowledge/document-project/` (brownfield only)
20
24
 
21
25
  ## Outputs
26
+
22
27
  - `.wize/solutioning/architecture.md`
23
- - `.wize/solutioning/adrs/{ADR-NNN}-{slug}.md`
28
+ - `.wize/solutioning/adrs/ADR-NNN-{slug}.md` (one ADR per meaningful trade-off)
24
29
 
25
30
  ## Steps
26
- 1. **Stack interview.** Tony asks the user (via Wizer) about preferences: language, runtime, deployment target. Consults overlay stack catalogs (web/app) if active. Records decisions.
27
- 2. **Components.** List components, responsibilities, boundaries.
28
- 3. **Sequences.** For each critical scenario from Mantis, write a sequence (text or PlantUML).
29
- 4. **Data model.** Tables / collections / contracts.
30
- 5. **Cross-cutting.** Auth, logging, observability, error handling.
31
- 6. **ADRs.** Every significant trade-off becomes its own ADR: context, options, decision, consequences.
32
- 7. **Validate against NFRs.** Check each Fury principle.
33
- 8. **Hand-off to epics.**
31
+
32
+ ### 1. Stack interview (Tony asks; Wizer relays)
33
+
34
+ Resolve every "TBD" the tech-vision left for Tony. Walk the stack catalog (active overlay) and decide, in order:
35
+
36
+ - Language(s) + runtime(s).
37
+ - Front-end framework + state lib + form lib.
38
+ - Back-end framework or BaaS.
39
+ - DB + ORM/query builder.
40
+ - Auth.
41
+ - Hosting + CI/CD.
42
+ - Observability stack.
43
+ - Test stack (links to `playwright-vitest.md` or `detox-maestro.md`).
44
+
45
+ Decisions Tony makes silently are ADR candidates; decisions Fury already fixed don't get their own ADR.
46
+
47
+ ### 2. Components
48
+
49
+ List components with one-line responsibility each. Boundaries before internals. Examples (web SaaS):
50
+
51
+ | Component | Responsibility | Boundary |
52
+ |---|---|---|
53
+ | `web` | Server-rendered fullstack app (Next.js) | HTTPS to clients; SQL to db; HTTPS to auth-provider |
54
+ | `db` | Source of truth for users, teams, billing (Postgres) | SQL only via PgBouncer |
55
+ | `auth` | Identity provider (Supabase Auth) | OIDC to `web` |
56
+ | `mailer` | Outbound transactional email | HTTPS to Resend |
57
+ | `worker` | Outbox processor + scheduled jobs (pg_cron) | SQL to db; HTTPS to external APIs |
58
+
59
+ ### 3. Sequences (the critical ones)
60
+
61
+ For each "moment of truth" in `.wize/planning/ux/ux-scenarios.md`, draw a sequence. Mermaid is fine; ASCII is fine.
62
+
63
+ ```mermaid
64
+ sequenceDiagram
65
+ participant U as User
66
+ participant W as web
67
+ participant A as auth
68
+ participant D as db
69
+ U->>W: POST /signup
70
+ W->>A: signUp(email, password)
71
+ A-->>W: { user_id, session }
72
+ W->>D: INSERT user_id INTO accounts
73
+ D-->>W: ok
74
+ W-->>U: 302 /onboarding (sets cookie)
75
+ Note over W,U: total p95 ≤ 1s (NFR 1.A)
76
+ ```
77
+
78
+ Annotate each sequence with the NFR target it must hit.
79
+
80
+ ### 4. Data model
81
+
82
+ For every entity:
83
+
84
+ - Name, columns, types, indexes.
85
+ - Foreign keys + cascade behavior.
86
+ - RLS policies if the stack supports them (Supabase, etc.).
87
+ - Soft-delete vs hard-delete.
88
+
89
+ Include a mini ERD (Mermaid `erDiagram`).
90
+
91
+ ### 5. Cross-cutting concerns
92
+
93
+ For each, name the pattern and the library/component:
94
+
95
+ - **Auth & session** — token shape, refresh, multi-device.
96
+ - **Errors** — error class hierarchy, mapping to HTTP, user-facing copy.
97
+ - **Logging** — structured (JSON), correlation IDs, sampling.
98
+ - **Observability** — metrics emitter, traces, dashboards.
99
+ - **Config** — env vars, secrets, feature flags.
100
+ - **Background jobs** — outbox / queue / scheduler.
101
+ - **Idempotency** — keys on write endpoints.
102
+ - **i18n** — string source, translation pipeline.
103
+ - **A11y** — token + library choices that uphold WCAG.
104
+
105
+ ### 6. NFR check (every category)
106
+
107
+ Walk Fury's NFRs. For each non-negotiable, write *how* the architecture achieves it.
108
+
109
+ - Perf: LCP ≤ 2.5s → edge runtime + RSC + image policy.
110
+ - Security: PII in EU → DB in `eu-central-1`; backups in same region.
111
+ - Reliability: 99.9% → single-region with multi-AZ; failover playbook in `adrs/ADR-007-failover.md`.
112
+ - A11y: WCAG AA → Radix primitives + axe in CI.
113
+
114
+ ### 7. ADRs
115
+
116
+ One ADR per meaningful trade-off. Format below. Number sequentially. Don't gold-plate; an ADR is a few paragraphs.
117
+
118
+ ### 8. Hand off
119
+
120
+ Mark `architecture.md` `status: ready-for-stories`. Tony continues with `wize-create-epics-and-stories`.
34
121
 
35
122
  ## Architecture doc template
36
123
 
37
124
  ```markdown
125
+ ---
126
+ status: ready-for-stories
127
+ owner: Tony Stark
128
+ created: YYYY-MM-DD
129
+ ---
130
+
38
131
  # Architecture — {{project_name}}
39
132
 
133
+ ## Summary
134
+ {{One paragraph: stack family, runtime, primary data store, deploy target. The frame.}}
135
+
40
136
  ## Stack
41
- - Language:
42
- - Runtime:
43
- - Storage:
44
- - Deploy:
137
+ - Language: TypeScript
138
+ - Front-end: Next.js (App Router, RSC, edge runtime)
139
+ - Back-end: Server Actions + Route Handlers
140
+ - DB: Supabase Postgres + Drizzle ORM
141
+ - Auth: Supabase Auth
142
+ - Hosting: Vercel
143
+ - Observability: Vercel + PostHog
144
+ - Test: Vitest + Playwright (see playbook)
45
145
 
46
146
  ## Components
47
147
  | Component | Responsibility | Boundary |
48
148
  |---|---|---|
49
149
 
50
150
  ## Data model
51
-
151
+ - `users` (id PK, email UNIQUE, created_at)
152
+ - `teams` (id PK, name, owner_id FK users)
153
+ - `memberships` (user_id, team_id, role)
154
+ - RLS: `auth.uid() = user_id` on all user-scoped tables.
155
+
156
+ ```mermaid
157
+ erDiagram
158
+ USERS ||--o{ MEMBERSHIPS : has
159
+ TEAMS ||--o{ MEMBERSHIPS : has
160
+ ```
161
+
162
+ ## Sequences
163
+
164
+ ### S1: Sign-up
165
+ {{sequence diagram + NFR annotation}}
166
+
167
+ ### S2: Invite teammate
168
+ {{sequence diagram}}
52
169
 
53
170
  ## Cross-cutting
54
- - Auth: …
55
- - Observability: …
171
+ - Auth & session: …
56
172
  - Errors: …
173
+ - Logging: …
174
+ - Observability: …
175
+ - Config: …
176
+ - Background jobs: …
177
+ - Idempotency: …
178
+ - i18n: …
179
+ - A11y: …
57
180
 
58
181
  ## NFR check
59
- - Performance:
60
- - Security:
61
- - Reliability:
62
- - Accessibility:
63
- - Cost:
182
+ - Perf (1.A): how
183
+ - Security (2.A): how
184
+ - Reliability (3.A): how
185
+ - Maintainability (4.A): how
186
+ - A11y (5.A): how
187
+ - Cost (6.A): how
188
+
189
+ ## ADRs
190
+ See `.wize/solutioning/adrs/`.
64
191
  ```
192
+
193
+ ## ADR template
194
+
195
+ ```markdown
196
+ ---
197
+ status: accepted | superseded | deprecated
198
+ date: YYYY-MM-DD
199
+ deciders: Tony, Fury
200
+ supersedes: ADR-XXX
201
+ ---
202
+
203
+ # ADR-007: {{slug}}
204
+
205
+ ## Context
206
+ {{2–4 sentences: what forced the decision, what constraint is binding.}}
207
+
208
+ ## Options
209
+ 1. {{Option A}} — pros / cons / cost
210
+ 2. {{Option B}} — pros / cons / cost
211
+ 3. {{Option C}} — pros / cons / cost
212
+
213
+ ## Decision
214
+ {{The pick. One sentence.}}
215
+
216
+ ## Consequences
217
+ - **Now:** what we gain, what we accept.
218
+ - **Later:** what we'll likely revisit and when.
219
+ - **Related ADRs:** ADR-005, ADR-009.
220
+ ```
221
+
222
+ ## Anti-patterns Tony rejects
223
+
224
+ - **Architecture without sequences.** A diagram with boxes is half a doc.
225
+ - **NFR check left as "TBD".** Each non-negotiable answers *how*.
226
+ - **ADRs for trivial choices** (which CSS file name) — saves nothing, costs trust.
227
+ - **No ADR for genuinely contested choices** (auth provider, DB selection) — future-readers will re-litigate.
228
+ - **Diagrams in proprietary format only.** Mermaid/ASCII version always present in markdown.
229
+
230
+ ## Hand-off
231
+
232
+ > Architecture and 6 ADRs at `.wize/solutioning/`. Sequences hit the NFR targets. Hawkeye, you can write `tea-risk.md` against this. Tony continues with `wize-create-epics-and-stories`.