wize-dev-kit 0.1.5 → 0.2.5

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 (39) hide show
  1. package/CHANGELOG.md +130 -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 +188 -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-refresh-knowledge/workflow.md +127 -0
  8. package/src/method-skills/1-analysis/wize-research/workflow.md +101 -9
  9. package/src/method-skills/1-analysis/wize-trigger-map/workflow.md +80 -16
  10. package/src/method-skills/2-plan-workflows/wize-create-prd/workflow.md +132 -23
  11. package/src/method-skills/2-plan-workflows/wize-ux-design/workflow.md +132 -28
  12. package/src/method-skills/2-plan-workflows/wize-ux-scenarios/workflow.md +91 -15
  13. package/src/method-skills/2-plan-workflows/wize-validate-prd/workflow.md +106 -12
  14. package/src/method-skills/3-solutioning/wize-check-implementation-readiness/workflow.md +101 -11
  15. package/src/method-skills/3-solutioning/wize-create-architecture/workflow.md +197 -29
  16. package/src/method-skills/3-solutioning/wize-create-epics-and-stories/workflow.md +127 -12
  17. package/src/method-skills/3-solutioning/wize-design-system/workflow.md +182 -22
  18. package/src/method-skills/3-solutioning/wize-nfr-principles/workflow.md +142 -16
  19. package/src/method-skills/3-solutioning/wize-tech-vision/workflow.md +127 -21
  20. package/src/method-skills/4-implementation/wize-code-review/workflow.md +105 -10
  21. package/src/method-skills/4-implementation/wize-create-story/workflow.md +131 -10
  22. package/src/method-skills/4-implementation/wize-dev-story/workflow.md +140 -17
  23. package/src/method-skills/4-implementation/wize-quick-dev/workflow.md +121 -18
  24. package/src/method-skills/4-implementation/wize-retrospective/workflow.md +112 -10
  25. package/src/method-skills/4-implementation/wize-sprint-planning/workflow.md +85 -10
  26. package/src/method-skills/4-implementation/wize-sprint-status/workflow.md +96 -11
  27. package/src/orchestrator-skills/wize-help/skill.md +25 -1
  28. package/src/tea-skills/wize-tea-design/workflow.md +104 -13
  29. package/src/tea-skills/wize-tea-gate/workflow.md +115 -25
  30. package/src/tea-skills/wize-tea-nfr/workflow.md +104 -14
  31. package/src/tea-skills/wize-tea-review/workflow.md +120 -13
  32. package/src/tea-skills/wize-tea-risk/workflow.md +99 -10
  33. package/src/tea-skills/wize-tea-trace/workflow.md +83 -12
  34. package/tools/installer/baseline.js +128 -0
  35. package/tools/installer/commands/agent.js +197 -0
  36. package/tools/installer/commands/sync.js +45 -0
  37. package/tools/installer/commands/update.js +172 -0
  38. package/tools/installer/version-check.js +117 -0
  39. package/tools/installer/wize-cli.js +98 -11
@@ -3,22 +3,97 @@ code: wize-sprint-planning
3
3
  name: Sprint Planning
4
4
  phase: 4-implementation
5
5
  owner: wize-agent-pm # Maria Hill
6
- status: stub
6
+ status: ready
7
7
  ---
8
8
 
9
9
  # Sprint Planning
10
10
 
11
- **Goal.** Pick what enters this sprint. Capacity-honest, priority-honest.
11
+ **Goal.** Pick what enters this sprint. Capacity-honest, priority-honest, risk-honest. The sprint is a commitment about a small slice of the future, not a wish list.
12
+
13
+ Maria Hill chairs. Tony advises on slicing. Hawkeye flags risk on stories. Shuri commits to the load.
12
14
 
13
15
  ## Inputs
14
- - Story backlog from `.wize/solutioning/stories/`
15
- - Velocity history (if exists) from `.wize/implementation/sprint-status.md`
16
- - Hawkeye risk profile (`risk-profile.md`)
17
16
 
18
- ## Outputs
19
- - Sprint entry appended to `.wize/implementation/sprint-status.md`
17
+ - Story backlog: `.wize/solutioning/stories/`
18
+ - Velocity history: `.wize/implementation/sprint-status.md` (previous sprints) — when present.
19
+ - `.wize/implementation/tea/risk-profile.md`
20
+ - Open `tea-gate` outcomes from last sprint.
21
+ - Team availability for the next interval (vacations, on-call rotation, planned meetings).
22
+
23
+ ## Output
24
+
25
+ - New sprint block appended to `.wize/implementation/sprint-status.md`.
26
+ - Story files updated `priority: 1` for chosen stories.
20
27
 
21
28
  ## Rules
22
- - High-risk stories get TEA design done first or are deferred.
23
- - Velocity = the smaller of "what we shipped last sprint" and "what we estimate we can ship this sprint."
24
- - Stretch goals are explicit, not silent.
29
+
30
+ 1. **Capacity = min(history velocity, declared availability).** Not the average of optimistic estimates.
31
+ 2. **High-risk stories** (linked to `R-x` HIGH in risk profile) get TEA design done in the planning meeting, not at story start.
32
+ 3. **Stretch goals** are explicit, named, not silent. If a stretch ships, great. If not, the sprint isn't a failure.
33
+ 4. **Don't carry over without reason.** A carried-over story gets a one-line "why" in the sprint log.
34
+
35
+ ## Steps
36
+
37
+ ### 1. Look back (3 min)
38
+
39
+ Last sprint: what shipped, what slipped, what surprised. Don't relitigate; observe.
40
+
41
+ ### 2. Refresh capacity
42
+
43
+ - Person-days available this sprint = sum(working days) × (1 - meetings load).
44
+ - Subtract on-call burden, oncall handoff time, planned reviews.
45
+
46
+ ### 3. Pull stories (in priority order)
47
+
48
+ Default selection algorithm:
49
+ - Always pull continuation stories (in-flight from last sprint) first.
50
+ - Then highest-priority stories that fit the capacity.
51
+ - Then risk-driven: high-risk stories (R-HIGH) preferred over more low-risk ones when capacity is tight.
52
+
53
+ For each pulled story, confirm INVEST still holds; re-slice if needed.
54
+
55
+ ### 4. Reserve buffer
56
+
57
+ 10–15% buffer for unknowns (bug fixes, support escalations). Don't fill the sprint to 100% — you'll always pay.
58
+
59
+ ### 5. Walk the gate plan
60
+
61
+ For each story pulled, what's the TEA gate cadence? Most stories: design at start, trace + review + gate at end. High-risk: include NFR re-check at epic close.
62
+
63
+ ### 6. Commit (verbal + written)
64
+
65
+ Each engineer reads back the stories they're owning. Hill writes them into the sprint block. Sprint starts.
66
+
67
+ ## Sprint block template (appended to `sprint-status.md`)
68
+
69
+ ```markdown
70
+ ## Sprint 7 — 2026-06-12 → 2026-06-25
71
+
72
+ **Capacity:** 24 person-days (3 engineers × 10 days × 0.8 utilization)
73
+ **Carry-over:** E01-S05 (90% done; Shuri); E03-S01 (TEA review pending)
74
+ **Pulled:**
75
+ - E01-S06 — M — owner: Shuri — gate cadence: design+gate
76
+ - E02-S02 — L — owner: Shuri — gate cadence: design+trace+review+gate (R-3)
77
+ - E03-S02 — M — owner: Aaliyah — gate cadence: design+trace+review+gate (R-1)
78
+ - E04-S01 — S — owner: Shuri — gate cadence: smoke (quick-dev pattern)
79
+ - E02-S03 — S — stretch
80
+
81
+ **Out (deferred to Sprint 8):**
82
+ - E03-S03 — reason: depends on E03-S02 ADR
83
+ - E05-S01 — reason: out of NFR-cost budget; revisit
84
+
85
+ **Risks flagged:**
86
+ - E02-S02 — auth refresh story; high-risk; TEA design done at planning.
87
+ ```
88
+
89
+ ## Anti-patterns Hill rejects
90
+
91
+ - **"Optimistic" velocity that ignores history.** Use observed velocity.
92
+ - **Stories pulled without owners.** Don't aspire; commit.
93
+ - **Stretch goals so big they're really plan.** Stretch = optional, not "we hope we can."
94
+ - **Pulling a story when its dependency hasn't shipped.** It will sit blocked.
95
+ - **No buffer.** Real sprints have surprises.
96
+
97
+ ## Hand-off
98
+
99
+ > Sprint 7 committed at `.wize/implementation/sprint-status.md`. Shuri owns most; Aaliyah picks up E03-S02. Hawkeye, NFR gate due on E03 at sprint end. Wizer, retro on the 25th.
@@ -3,23 +3,108 @@ code: wize-sprint-status
3
3
  name: Sprint Status
4
4
  phase: 4-implementation
5
5
  owner: wize-agent-pm # Maria Hill
6
- status: stub
6
+ status: ready
7
7
  ---
8
8
 
9
9
  # Sprint Status
10
10
 
11
- **Goal.** Daily snapshot of in-flight stories. Blockers up front.
11
+ **Goal.** Keep a snapshot of in-flight work that the team and stakeholders can read in 60 seconds. Sprint status is read by everyone, written by Hill (or delegated to Wizer); the source of truth is the file, not Slack.
12
12
 
13
- ## Outputs
14
- - Updates appended to `.wize/implementation/sprint-status.md`
13
+ Update **daily** during a sprint, or after any state change (story moves, blocker appears, gate fails).
14
+
15
+ ## Inputs
16
+
17
+ - `.wize/solutioning/stories/` (current statuses)
18
+ - `.wize/implementation/tea/{epic}/{story}/gate.md` (gate outcomes)
19
+ - The team (verbal stand-up or async update)
20
+
21
+ ## Output
22
+
23
+ - Updated entry in `.wize/implementation/sprint-status.md`.
24
+
25
+ ## Steps
26
+
27
+ ### 1. Per story, name a status
28
+
29
+ | Status | Meaning |
30
+ |---|---|
31
+ | `pulled` | Committed for this sprint, not started yet |
32
+ | `in-progress` | Engineer actively working it (or paused < 1 day) |
33
+ | `paused` | Started, paused > 1 day, reason listed |
34
+ | `blocked` | Cannot proceed; depends on a named external resolution |
35
+ | `in-review` | PR open; Hawkeye running design → trace → review |
36
+ | `gate-PASS` / `gate-CONCERNS` / `gate-FAIL` | TEA gate outcome |
37
+ | `shipped` | Merged to main + deployed (when applicable) |
38
+
39
+ ### 2. Blockers up front
40
+
41
+ Blockers always appear in the top section. Each gets:
42
+ - Owner (the person who can unblock it).
43
+ - Specific ask (the action they should take).
44
+ - Deadline.
45
+
46
+ If a blocker sits longer than 2 days, Hill escalates. Stalled blockers are how sprints fail silently.
47
+
48
+ ### 3. Trend
49
+
50
+ Daily, write a one-line trend: *"On track."* / *"At risk for E03-S02 due to vendor outage."* / *"Slipping; will defer E04-S01 to next sprint."*
51
+
52
+ ### 4. Capture decisions
53
+
54
+ If something material was decided during the sprint that affects the plan (story sliced, scope dropped, ADR opened), append a one-line entry.
55
+
56
+ ## File template
15
57
 
16
- ## Format
17
58
  ```markdown
18
- ## Sprint N — Day D
19
- - Story E01-S03 — in progress (Shuri). Blocked: no.
20
- - Story E01-S04 — TEA design — Hawkeye.
21
- - Story E02-S01 — done (gate PASS).
59
+ # Sprint status
22
60
 
23
- Blockers:
24
- - (none) | or specific list
61
+ ## Sprint 7 — 2026-06-12 → 2026-06-25
62
+
63
+ ### Day 4 (2026-06-15)
64
+ **Trend:** On track.
65
+
66
+ **Blockers:**
67
+ - (none)
68
+
69
+ **Stories:**
70
+ - E01-S05 — gate-PASS — shipped (carry-over from S6).
71
+ - E01-S06 — in-progress — Shuri.
72
+ - E02-S02 — in-review — PR #418; Hawkeye doing trace.
73
+ - E03-S02 — in-progress — Aaliyah.
74
+ - E04-S01 — pulled — Shuri starts after E01-S06.
75
+ - E02-S03 (stretch) — pulled — Aaliyah picks up if capacity allows.
76
+
77
+ **Decisions:**
78
+ - E03-S03 sliced into two stories (E03-S03a, E03-S03b) — ADR-009 incoming.
79
+
80
+ ### Day 5 (2026-06-16)
81
+ **Trend:** At risk on E02-S02 (vendor sandbox down; Hawkeye unblocked at 14:00).
82
+ **Blockers:** Resolved.
83
+ **Stories:** (changes from Day 4)
84
+ - E02-S02 — gate-PASS at 16:30; merged.
85
+ - E01-S06 — in-review — PR #419.
86
+
87
+ ## Sprint 6 — 2026-05-29 → 2026-06-11
88
+ {{archived}}
25
89
  ```
90
+
91
+ ## Daily cadence (lean)
92
+
93
+ A daily standup, when present, is 5 minutes max:
94
+
95
+ - "What did I ship since last time?"
96
+ - "What am I shipping next?"
97
+ - "Anything blocking me?"
98
+
99
+ Hill updates `sprint-status.md` immediately after; Wizer reads it before any other agent's session that day.
100
+
101
+ ## Anti-patterns Hill rejects
102
+
103
+ - "Status: in progress" for 4 days with no further detail. Either it really is, in which case slice progress, or it's stuck.
104
+ - Blockers without an owner or a deadline.
105
+ - Sprint goals that drift silently (added stories without removing others).
106
+ - Stale entries in the file. Update daily or delegate the update.
107
+
108
+ ## Hand-off
109
+
110
+ > `sprint-status.md` updated. Day 5 trend: at-risk-mitigated. Wizer, if asked about state, the file is the answer. Pepper, brief stays valid; no scope move triggered.
@@ -58,10 +58,34 @@ Apply this heuristic, top-down. Stop at the first match.
58
58
  12. **Has active sprint, oldest in-flight story has no `tea/.../design.md`.** → Next: **Hawkeye / `wize-tea-design`** for that story.
59
59
  13. **In-flight story exists, no implementation commits.** → Next: **Shuri / `wize-dev-story`** on that story.
60
60
  14. **In-flight story exists with code, no `gate.md`.** → Next: **Hawkeye / `wize-tea-trace` → `wize-tea-review` → `wize-tea-gate`** for that story.
61
- 15. **All stories gated.** → Next: **Wizer / `wize-retrospective`** + plan next epic.
61
+ 15. **All sprint stories gated `PASS`/`CONCERNS`, backlog has no `ready-for-dev` left.** → Sprint ended. Next: **Wizer / `wize-retrospective`** + **Pepper+Peggy / `wize-refresh-knowledge`** (the inline knowledge notes pile up over the sprint; the refresh consolidates them into the baseline docs).
62
+ 16. **All stories gated and no new epic pulled.** → Plan next epic with Tony + Hill, or run a roadmap session.
62
63
 
63
64
  For brownfield repos where `.wize/knowledge/document-project/` is missing, prepend: "Run `wize-document-project` first to baseline the codebase."
64
65
 
66
+ ## Step 2.5 — version-skew detection (proactive)
67
+
68
+ Before routing, compare:
69
+ - `kit_version` in `.wize/config/project.toml`
70
+ - The version of the installed kit (from `node_modules/wize-dev-kit/package.json` — *or* the version baked into the activated skills if you don't have a node-side check)
71
+
72
+ If you have access to the user's terminal (Claude Code Bash tool, Codex exec, OpenCode), additionally check the npm registry with a 2-second timeout:
73
+
74
+ ```bash
75
+ npm view wize-dev-kit version 2>/dev/null
76
+ ```
77
+
78
+ Cases:
79
+ - **Installed version > project.toml's `kit_version`** → suggest `npx wize-dev-kit update` (no `@latest` needed; the installed version is already newer).
80
+ - **Registry > installed version** → suggest `npx wize-dev-kit@latest update` to pick up the newer release.
81
+ - **All three match** → no message; carry on.
82
+
83
+ Phrase it as one short line, not a banner. Example:
84
+
85
+ > *"Heads up: registry has 0.2.3, you're on 0.2.2. Want me to run `npx wize-dev-kit@latest update`? (it preserves your `user.toml` and re-renders adapters)"*
86
+
87
+ If the user says yes and you can execute Bash, run it in the project root and stream output. Otherwise, print the command for them to run.
88
+
65
89
  ## Step 3 — respond
66
90
 
67
91
  Default response shape (3 lines). When `user.toml` provides a `[user] name`, include it in the greeting:
@@ -4,35 +4,126 @@ name: TEA Test Design
4
4
  gate: design
5
5
  owner: wize-agent-test-architect # Hawkeye
6
6
  when: per-story-start
7
- status: stub
7
+ status: ready
8
8
  ---
9
9
 
10
10
  # TEA — Test Design
11
11
 
12
- **Goal.** For one story: declare the test split (unit / integration / e2e), required fixtures, mocks, environments.
12
+ **Goal.** For **one story**: declare the test split, the fixtures, the mocks, the environments, and the assertion targets. This is Hawkeye's contract Shuri implements against. No story enters dev without one.
13
+
14
+ Hawkeye drives. Runs at the start of every story (advisory; can be relaxed only when `tea.toml` says so).
13
15
 
14
16
  ## Inputs
17
+
15
18
  - `.wize/solutioning/stories/{epic}/{story}.md`
16
19
  - `.wize/solutioning/architecture.md`
20
+ - `.wize/implementation/tea/risk-profile.md`
21
+ - Overlay test playbooks if active:
22
+ - `web-overlay/playbooks/playwright-vitest.md`
23
+ - `app-overlay/playbooks/detox-maestro.md`
17
24
 
18
25
  ## Output
26
+
19
27
  - `.wize/implementation/tea/{epic}/{story}/design.md`
20
28
 
21
- ## YAML frontmatter
29
+ ## Steps
30
+
31
+ ### 1. Read the story; map every AC
32
+
33
+ For each AC, write **one assertion-shape sentence**: *"There will be a {kind} test that does {what} and expects {observable}."*
34
+
35
+ ### 2. Pick the test split
36
+
37
+ Defaults (from `playwright-vitest.md` / `detox-maestro.md`):
38
+ - **Low-risk story:** 70% unit / 20% integration / 10% E2E.
39
+ - **Risk-profile flagged story (R-1..R-3):** add 1–2 dedicated E2E + integration for the risk area.
40
+ - **UI-only story:** 60% unit / 30% component (Testing Library) / 10% E2E.
41
+ - **Server-only story:** 80% unit / 20% integration; no E2E unless an upstream consumer story bundles it.
42
+
43
+ ### 3. Declare fixtures + mocks
44
+
45
+ - Fixtures: known users, known DB rows, known files.
46
+ - Mocks: external services at the network boundary (MSW). Don't mock the unit under test.
47
+
48
+ ### 4. Environment
49
+
50
+ - Where it runs (local sim, headless emulator, real device farm).
51
+ - Network conditions (offline / 3G slow / lossy WiFi).
52
+ - OS / browser matrix (from `device-matrix.md` or playwright projects).
53
+
54
+ ### 5. Edge cases (cheap; pay back × 10)
55
+
56
+ List 3–7 edge cases the ACs don't name but the user might hit:
57
+ - Empty / max-length inputs.
58
+ - IME / paste / autofill.
59
+ - Offline mid-action.
60
+ - Concurrent users on the same resource.
61
+ - Time-zone / DST.
62
+ - Localized number/currency.
63
+
64
+ Each gets a test of its own (usually unit).
65
+
66
+ ### 6. Hand off
67
+
68
+ Mark `status: ready-for-dev` in the design.md frontmatter. Shuri reads before starting.
69
+
70
+ ## YAML frontmatter (canonical)
71
+
22
72
  ```yaml
23
73
  ---
24
74
  gate: design
25
- story_id:
26
- ac_ids: [AC-1, AC-2, …]
75
+ story_id: E01-S03
76
+ ac_ids: [AC-02-1, AC-02-2]
77
+ status: PASS
78
+ created_at: 2026-06-11T12:00:00Z
27
79
  test_split:
28
- unit: count + brief description
29
- integration: count + brief description
30
- e2e: count + brief description
31
- fixtures: [...]
32
- mocks: [...]
33
- environment: dev|staging|isolated
80
+ unit: { count: 4, description: "validation, server-action contract, error mapper, mailer payload" }
81
+ integration: { count: 1, description: "server action calls mailer with right args, against MSW" }
82
+ e2e: { count: 1, description: "happy path; Playwright @chromium @ios" }
83
+ fixtures:
84
+ - "new-admin user"
85
+ - "empty team"
86
+ mocks:
87
+ - "Resend via MSW"
88
+ - "Auth session via fixture cookie"
89
+ environment: "local + Playwright project chromium + ios"
90
+ risk_links: [R-1]
91
+ edges:
92
+ - "invalid email rules: blank, missing @, weird IME chars"
93
+ - "duplicate teammate email"
94
+ - "offline at submit time"
34
95
  ---
35
96
  ```
36
97
 
37
- ## Body
38
- Plain-English rationale + edge-case list.
98
+ ## Body of `design.md`
99
+
100
+ ```markdown
101
+ ## Per-AC assertion shapes
102
+
103
+ - **AC-02-1**: Vitest unit on `validateInviteEmail()` → returns `{ ok: true }` for `name+tag@example.com`. Vitest integration on `inviteTeammate()` server action → asserts `mailer.send` called once with `{ to: 'name@example.com', template: 'team-invite' }`. Playwright E2E → clicks "Send invite", asserts `[data-testid="invite-sent-banner"]` appears within 1s.
104
+
105
+ - **AC-02-2**: Vitest unit on `validateInviteEmail()` → returns `{ ok: false, code: 'invalid_format', field: 'email' }` for empty/no-@. Component test (Testing Library) on `<InviteForm>` → asserts the input's `aria-describedby` error region announces "Enter a valid email."
106
+
107
+ ## Edge cases (additional tests)
108
+
109
+ - E1: Empty email — `validateInviteEmail('')` → `invalid_format`.
110
+ - E2: 254-char local part — boundary check; expect graceful clipping.
111
+ - E3: Same email submitted twice — second call hits `inviteTeammate()`, asserts second insert is a no-op (idempotency key based on `(team_id, email)`).
112
+ - E4: Offline at submit — Playwright `context.setOffline(true)` after click; banner shows "We'll retry when you're back online."
113
+
114
+ ## Run plan
115
+ - On every PR: full unit + integration; E2E `@smoke` tag only (≤ 30s).
116
+ - Nightly: full E2E suite + Lighthouse baseline.
117
+ ```
118
+
119
+ ## Anti-patterns Hawkeye rejects
120
+
121
+ - **`design.md` written after dev started.** Then the story slipped through; flag.
122
+ - **One test per AC, no edges.** Edges are where users live.
123
+ - **Mocking the unit under test.** You'd be testing the mock.
124
+ - **E2E that test the happy path only.** Cover failure too.
125
+ - **Selectors by visible text in a multilingual app.** Use `data-testid` or `role` with locale-aware patterns.
126
+
127
+ ## Hand-off
128
+
129
+ > Test design for E01-S03 at `.wize/implementation/tea/E01-S03/design.md`. 4 unit, 1 integration, 1 E2E, plus 4 edges. Shuri can start; I'll check `tea-trace.md` against this when the PR opens.
@@ -4,48 +4,138 @@ name: TEA Gate Decision
4
4
  gate: gate
5
5
  owner: wize-agent-test-architect # Hawkeye
6
6
  when: story-final
7
- status: stub
7
+ status: ready
8
8
  ---
9
9
 
10
10
  # TEA — Gate Decision
11
11
 
12
- **Goal.** Final per-story gate. PASS / CONCERNS / FAIL / WAIVED with documented rationale.
12
+ **Goal.** Final per-story decision. **PASS / CONCERNS / FAIL / WAIVED** with documented rationale, score, and policy mode. This is the line: a story doesn't advance past it without a recorded gate.
13
+
14
+ Hawkeye drives. The four inputs (`design`, `trace`, `review`, plus `nfr` at epic boundary) feed in. Policy is read from `.wize/config/tea.toml`.
13
15
 
14
16
  ## Inputs
15
- - `design.md`, `trace.md`, `review.md` for the story
16
- - `nfr/{epic}.md` if applicable
17
- - Story file
17
+
18
+ - `.wize/implementation/tea/{epic}/{story}/design.md`
19
+ - `.wize/implementation/tea/{epic}/{story}/trace.md`
20
+ - `.wize/implementation/tea/{epic}/{story}/review.md`
21
+ - `.wize/implementation/tea/nfr/{epic}.md` (when the story is the last of its epic)
22
+ - `.wize/config/tea.toml`
18
23
 
19
24
  ## Output
25
+
20
26
  - `.wize/implementation/tea/{epic}/{story}/gate.md`
21
27
 
28
+ ## Decision rules
29
+
30
+ | Inputs | Recommendation |
31
+ |---|---|
32
+ | All ACs `met`, no findings | **PASS** |
33
+ | All ACs `met`, only low/medium non-blocking findings | **PASS** with notes (or **CONCERNS** depending on count) |
34
+ | Any AC `partial` | **CONCERNS** |
35
+ | Any AC `not-met` | **FAIL** |
36
+ | NFR `FAIL` on the epic (last story) | **FAIL** |
37
+ | `tea-review` flagged `knowledge_axes_touched` ≠ `knowledge_axes_updated` (any axis touched without update) | **CONCERNS** (advisory mode) / **FAIL** (enforcing mode) — adds finding `KN-NN` |
38
+ | Failing AC OR non-neg NFR with documented business rationale + senior signoff | **WAIVED** |
39
+
40
+ Score (0–100): heuristic. `100 - (10 × high) - (5 × medium) - (2 × low)`. Floor 0.
41
+
42
+ ## Policy
43
+
44
+ `.wize/config/tea.toml` sets `policy = "advisory"` (default) or `"enforcing"`.
45
+
46
+ - **Advisory:** `FAIL` is a visible warning in PR; merge isn't auto-blocked. The team decides.
47
+ - **Enforcing:** `FAIL` blocks merge via CI status check (`tea-gate`). PASS / CONCERNS allowed through.
48
+
49
+ ## Steps
50
+
51
+ ### 1. Read the three inputs
52
+
53
+ If trace shows `partial`, you know the recommendation. If review recommends FAIL, you've got your decision. The gate doc just records it.
54
+
55
+ ### 2. Compute score
56
+
57
+ Don't game it. The score communicates magnitude to humans skimming a backlog.
58
+
59
+ ### 3. Write the doc
60
+
61
+ Frontmatter is the structured truth. The body is the narrative for humans.
62
+
63
+ ### 4. Notify
64
+
65
+ Update the PR description with the gate verdict + link to the doc. Maria Hill watches the gate status in `sprint-status.md`.
66
+
22
67
  ## YAML frontmatter (canonical)
68
+
23
69
  ```yaml
24
70
  ---
25
71
  gate: gate
26
- story_id:
27
- status: PASS | CONCERNS | FAIL | WAIVED
28
- score: 0-100
29
- policy: advisory | enforcing
72
+ story_id: E01-S03
73
+ status: PASS
74
+ score: 95
75
+ policy: advisory
30
76
  inputs:
31
- - design.md: …
32
- - trace.md: …
33
- - review.md: …
34
- - nfr/{epic}.md:
77
+ design: ".wize/implementation/tea/E01-S03/design.md"
78
+ trace: ".wize/implementation/tea/E01-S03/trace.md"
79
+ review: ".wize/implementation/tea/E01-S03/review.md"
80
+ nfr: null # not the last story of E01
35
81
  findings:
36
- - id: G-1
37
- severity: low | medium | high
38
- summary:
39
- recommendation:
40
- waived_by: null | "wizer"
41
- waived_reason: null | "…"
42
- created_at: ISO-8601
82
+ - id: REV-01
83
+ severity: low
84
+ summary: "Empty-state copy slightly differs from Mantis' spec."
85
+ recommendation: "Update `<EmptyTeamPanel>` heading in a follow-up."
86
+ - id: KN-01
87
+ severity: medium
88
+ summary: "Story added a new component (`<InviteForm>`) but architecture-snapshot.md was not updated."
89
+ recommendation: "Add 2 lines to `.wize/knowledge/document-project/architecture-snapshot.md` under a dated bullet referencing the new component + its public testid contract."
90
+ owner: shuri
91
+ blocking: false # advisory mode; would be true under enforcing
92
+ waived_by: null
93
+ waived_reason: null
94
+ created_at: 2026-06-11T20:30:00Z
43
95
  ---
44
96
  ```
45
97
 
46
- ## Body
47
- Narrative explanation; structured data is the YAML.
98
+ ## Body of `gate.md`
48
99
 
49
- ## Policy
50
- - **advisory** (default): FAIL is a warning. Merge proceeds.
51
- - **enforcing**: FAIL blocks merge via CI. Configured in `.wize/config/tea.toml`.
100
+ ```markdown
101
+ ## Verdict
102
+ **PASS** (score 95)
103
+
104
+ ## Why
105
+ - All ACs met with observed evidence.
106
+ - Trace clean; coverage 100% on ACs, partial on edges (E3, E4) — tracked for follow-up.
107
+ - Review found one low-severity copy finding (REV-01).
108
+ - Story is not the last in epic 01; NFR gate runs separately at epic boundary.
109
+
110
+ ## Notes for follow-up
111
+ - Open a tiny story (or include in next sprint planning) to fix REV-01 and close edges E3, E4.
112
+
113
+ ## Trail
114
+ - design.md → 4/1/1 split (unit/integration/e2e) + 4 edges declared.
115
+ - trace.md → all ACs `covered`; E3 `partial`, E4 `missing` (follow-up).
116
+ - review.md → ACs `met`, scope mostly disciplined, copy nit.
117
+ - nfr.md → N/A (mid-epic).
118
+ ```
119
+
120
+ ## When to WAIVE
121
+
122
+ Rare. Examples:
123
+ - A failing E2E that depends on a flaky external sandbox; the production code is unaffected; sign-off by Tony + Hill.
124
+ - A non-negotiable temporarily slipped because of an external integration blocker; we ship with mitigation in place; sign-off by Fury.
125
+
126
+ A WAIVE always lists:
127
+ - Who waived (`waived_by`).
128
+ - Why (`waived_reason`).
129
+ - The compensating control (a follow-up story, an SLA monitor, a feature flag).
130
+
131
+ ## Anti-patterns Hawkeye rejects
132
+
133
+ - **Gating without `review.md`.** No review → no gate.
134
+ - **PASS with a `not-met` AC.** Auto-fail.
135
+ - **WAIVED with no `waived_by` field.** Reject.
136
+ - **Scoring jiggered to clear a threshold.** Trust trumps point-scoring; if the count says 70, don't write 91.
137
+ - **Enforcing mode gates without CI check wiring.** Ghost gate; remove or wire it.
138
+
139
+ ## Hand-off
140
+
141
+ > Gate for E01-S03: **PASS** (score 95). One low-severity finding logged for follow-up. Maria Hill, sprint-status updated; Shuri, ready to start the next story.