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
@@ -3,22 +3,91 @@ code: wize-create-epics-and-stories
3
3
  name: Create Epics and Stories
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 Epics and Stories
10
10
 
11
- **Goal.** Slice the PRD + architecture into epics (each ships value) and stories (each is one focused PR-sized unit).
11
+ **Goal.** Slice the PRD + architecture into **epics** (each ships value end-to-end) and **stories** (each is one focused PR-sized unit Shuri can implement and Hawkeye can test).
12
+
13
+ Tony drives. Output lands in `.wize/solutioning/epics/` and `.wize/solutioning/stories/`.
12
14
 
13
15
  ## Inputs
16
+
14
17
  - `.wize/planning/prd.md`
15
18
  - `.wize/solutioning/architecture.md`
19
+ - `.wize/planning/ux/ux-design/` (every story references one or more screens)
16
20
 
17
21
  ## Outputs
22
+
18
23
  - `.wize/solutioning/epics/{NN}-{slug}.md`
19
- - `.wize/solutioning/stories/{NN}-{slug}/{story-id}.md`
24
+ - `.wize/solutioning/stories/{epic-NN}/{story-id}.md`
25
+
26
+ ## Epic shape
27
+
28
+ An epic:
29
+ - Ships **value** on its own (a user can do the thing after this epic, even if the next one improves it).
30
+ - Lasts 1–3 sprints when in flight.
31
+ - Has 3–10 stories.
32
+ - Has a single trigger-map row as its anchor.
33
+
34
+ Epic file:
35
+
36
+ ```markdown
37
+ ---
38
+ epic_id: 01-onboarding
39
+ status: ready
40
+ owner: Tony Stark + Maria Hill
41
+ linked_prd: E01
42
+ trigger_map_row: 1
43
+ priority: 1
44
+ estimate: M
45
+ ---
46
+
47
+ # Epic 01: Sign-up + first invite
48
+
49
+ ## Outcome
50
+ A first-time team admin signs up, lands in onboarding, and invites at least one teammate within 5 minutes (trigger-map row 1 + 2).
51
+
52
+ ## Stories
53
+ - E01-S01: Sign-up empty + happy path (AC-01-1, AC-01-2)
54
+ - E01-S02: Sign-up error states (AC-01-3, AC-01-4)
55
+ - E01-S03: Onboarding step 1 — invite first teammate (AC-02-1, AC-02-2)
56
+ - E01-S04: Email delivery + retry (AC-02-3)
57
+ - E01-S05: Team list empty + with first member (AC-03-1, AC-03-2)
58
+
59
+ ## Dependencies
60
+ - Design tokens by Mantis (S0 — already done)
61
+ - Resend account configured (Tony, before S04)
62
+
63
+ ## Success
64
+ All ACs of all stories PASS gate. Telemetry shows `teammate_invited` ≥ 80% of `signup_completed` users within 24h in the beta cohort.
65
+ ```
66
+
67
+ ## Story shape — INVEST
68
+
69
+ Each story passes:
70
+ - **I**ndependent — can be implemented without waiting for another in-flight story.
71
+ - **N**egotiable — wording can move; intent stays.
72
+ - **V**aluable — a real outcome to a real user (or a clear test path that proves a slice).
73
+ - **E**stimable — Tony can size: S/M/L/XL.
74
+ - **S**mall — fits in one PR (≤ 1 day for an experienced dev, including tests).
75
+ - **T**estable — every AC is observable.
76
+
77
+ If a story is XL, slice it before merging it to `stories/`.
20
78
 
21
- ## Story template
79
+ ## Slicing patterns (Tony's defaults)
80
+
81
+ | Pattern | When |
82
+ |---|---|
83
+ | Walking skeleton | When you need the full user path to exist (even with stubs) before going deep on any single screen. |
84
+ | By user role | Admin vs member often slice naturally. |
85
+ | By acceptance criterion | One AC = one PR when ACs are independent. |
86
+ | By happy / error path | Ship happy path first; error states next story. |
87
+ | By back-end / front-end | Avoid unless the back-end can ship usable without UI; otherwise it bundles. |
88
+ | By feature flag | When a story partially ships, use a flag and write the flag retirement story now. |
89
+
90
+ ## Story file template
22
91
 
23
92
  ```markdown
24
93
  ---
@@ -27,22 +96,68 @@ epic: 01-onboarding
27
96
  status: ready-for-dev
28
97
  priority: 2
29
98
  estimate: M
30
- linked_screen: ux-design/signin.md
99
+ linked_screens: [onboarding-step-1, invite-modal]
100
+ linked_acs: [AC-02-1, AC-02-2]
31
101
  ---
32
102
 
33
- # Story: Sign-in with email + magic link
103
+ # Story: Onboarding step 1 invite first teammate
34
104
 
35
105
  ## Context
36
-
106
+ Comes right after sign-up. The user lands here with no team yet. The screen is the moment-of-truth from S1: if the user invites a teammate here, the product earned its value moment.
37
107
 
38
108
  ## Acceptance criteria
39
- - AC-1
40
- - AC-2
109
+ - **AC-02-1:** Given a new admin on `/onboarding`, When they enter a valid email and click "Send invite", Then a `teammate_invited` event fires and the screen advances to "Invite sent" within 1s.
110
+ - **AC-02-2:** Given an invalid email, When the user blurs the field, Then error text appears (200ms) identifying which rule failed.
41
111
 
42
112
  ## Out of scope
43
- -
113
+ - Bulk invite (multiple emails) — separate story E01-S07.
114
+ - Custom invite message — defer to E02-S03.
44
115
 
45
116
  ## Notes for Shuri (Dev)
46
- - Touch points: …
47
- - Tests required:
117
+
118
+ - Touch points: `app/(onboarding)/invite/page.tsx`, new server action `inviteTeammate`, `lib/email/send-invite.ts`.
119
+ - Reuse `Button`, `Input`, `Banner` from design system.
120
+ - Add `data-testid="invite-form"`, `"invite-email"`, `"invite-cta"` (Hawkeye depends on these).
121
+
122
+ ## Notes for Hawkeye (TEA)
123
+
124
+ - Tests required: 2 unit (validation), 1 integration (server action calls mailer with right args), 1 E2E (happy path on Playwright).
125
+ - Mocks: outbound email via MSW; auth context via fixture.
126
+ - NFR sample: response p95 ≤ 800ms locally (NFR 1.A allows up to 1s end-to-end).
48
127
  ```
128
+
129
+ ## Steps
130
+
131
+ ### 1. From PRD backbone → epics
132
+
133
+ Each backbone story in the PRD becomes one epic. Name epics by outcome, not by feature: "Sign-up + first invite," not "Auth screens."
134
+
135
+ ### 2. From scenarios → stories
136
+
137
+ For each epic, walk the linked scenarios in `ux-scenarios.md`. Slice into stories by the patterns above. Aim for 3–7 stories per epic.
138
+
139
+ ### 3. ACs map exactly
140
+
141
+ Every story declares the AC IDs it advances (from PRD). The union of stories per epic equals the AC set of that epic — no gaps, no overlap.
142
+
143
+ ### 4. Estimates
144
+
145
+ Story estimates S/M/L/XL. XL gets sliced before merging. If everything is L, slicing pattern is too coarse; revisit.
146
+
147
+ ### 5. Hand off
148
+
149
+ - Mark all epics + stories `status: ready-for-dev`.
150
+ - Trigger `wize-check-implementation-readiness` (Tony, with Hawkeye on risk profile).
151
+ - After ready, Hill runs sprint planning.
152
+
153
+ ## Anti-patterns Tony rejects
154
+
155
+ - **Stories without AC links.** No traceability → no gate later.
156
+ - **Stories that "ship a back-end."** Bundle with the front-end consumer unless a different team uses it independently.
157
+ - **XL stories.** Slice further or split into two PRs.
158
+ - **"Epic" that is one story.** Then it's a story.
159
+ - **Stories that share `testid` namespace.** They'll collide.
160
+
161
+ ## Hand-off
162
+
163
+ > Epics and stories at `.wize/solutioning/`. 5 epics, 28 stories. All have ACs from the PRD. Run `wize-check-implementation-readiness`; Hawkeye, `tea-risk.md` next.
@@ -4,33 +4,193 @@ name: Design System
4
4
  phase: 3-solutioning
5
5
  owner: wize-agent-ux-designer # Mantis (WDS Freya — Phase 7)
6
6
  absorbs: "WDS Freya — Phase 7 (Design System)"
7
- status: stub
7
+ status: ready
8
8
  ---
9
9
 
10
10
  # Design System
11
11
 
12
- **Goal.** Establish design tokens and a baseline component library that Shuri implements consistently across the product.
12
+ **Goal.** Establish design tokens and a baseline component library Shuri implements consistently. Mantis defines what; Tony picks the runtime; Shuri builds. Hawkeye verifies a11y and consistency at gate.
13
+
14
+ Mantis drives. Output lands in `.wize/solutioning/design-system/`.
13
15
 
14
16
  ## Inputs
15
- - `.wize/planning/ux/ux-design/`
17
+
18
+ - `.wize/planning/ux/ux-design/` (every component the specs use)
19
+ - `.wize/planning/nfr-principles.md` (a11y and perf budgets)
20
+ - Overlay playbooks (active):
21
+ - `web-overlay/playbooks/wcag-aa.md`, `responsive-breakpoints.md`, `semantic-html.md`
22
+ - `app-overlay/playbooks/apple-hig.md`, `material-design-3.md`, `touch-targets-and-gestures.md`
16
23
 
17
24
  ## Outputs
18
- - `.wize/solutioning/design-system/tokens.json`
19
- - `.wize/solutioning/design-system/components/{Component}.md`
20
- - `.wize/solutioning/design-system/README.md`
21
-
22
- ## Tokens covered
23
- - color (semantic + raw scale)
24
- - typography (family, sizes, weights, line-heights)
25
- - spacing scale
26
- - radii
27
- - motion (durations, easings)
28
- - shadows / elevation
29
- - z-index layers
30
-
31
- ## Component baseline
32
- Buttons, inputs, selects, modals, dialogs, tabs, cards, notifications. Enough for the first epic; expand as stories require.
33
-
34
- ## Overlays
35
- - **Web overlay** active responsive token variants, REM-based typography.
36
- - **App overlay** active platform-token sets (iOS / Android), touch-friendly spacing scale.
25
+
26
+ - `.wize/solutioning/design-system/tokens.json` — single source of truth.
27
+ - `.wize/solutioning/design-system/components/{Component}.md` — one per component.
28
+ - `.wize/solutioning/design-system/README.md` — index + theming guide.
29
+
30
+ ## Tokens (the only acceptable way to ship styles)
31
+
32
+ Mantis defines the tokens; Tony picks the runtime (Tailwind, CSS modules, Vanilla Extract, Compose theme, SwiftUI tokens). The names below are framework-agnostic.
33
+
34
+ ### Color (semantic + raw scale)
35
+
36
+ | Semantic | Light | Dark | Contrast pair |
37
+ |---|---|---|---|
38
+ | `surface.base` | #FFFFFF | #0B0F14 | text.primary |
39
+ | `surface.raised` | #F5F7FA | #121821 | text.primary |
40
+ | `text.primary` | #0B0F14 | #E5E7EB | surface.base |
41
+ | `text.secondary` | #4B5563 | #9CA3AF | surface.base |
42
+ | `accent.brand` | #6F49FF | #8B6FFF | text.onAccent |
43
+ | `text.onAccent` | #FFFFFF | #FFFFFF | accent.brand |
44
+ | `success` | #058E5C | #34D399 | text.onSuccess |
45
+ | `warning` | #C9621E | #F59E0B | text.onWarning |
46
+ | `error` | #B42318 | #FCA5A5 | text.onError |
47
+ | `border.default` | #E5E7EB | #2A313A | — |
48
+ | `border.focus` | accent.brand | accent.brand | — |
49
+
50
+ Validate every pair against WCAG AA (≥ 4.5:1 normal, ≥ 3:1 large). Run before you commit.
51
+
52
+ ### Typography
53
+
54
+ | Token | Family | Size | Weight | Line | Letter |
55
+ |---|---|---|---|---|---|
56
+ | `display.l` | Inter Display | clamp(2.5rem, 5vw, 3.5rem) | 700 | 1.05 | -0.02em |
57
+ | `display.m` | Inter Display | clamp(2rem, 4vw, 2.5rem) | 700 | 1.1 | -0.01em |
58
+ | `heading.l` | Inter | clamp(1.5rem, 3vw, 2rem) | 600 | 1.2 | -0.01em |
59
+ | `heading.m` | Inter | 1.25rem | 600 | 1.3 | 0 |
60
+ | `heading.s` | Inter | 1rem | 600 | 1.4 | 0 |
61
+ | `body.l` | Inter | 1.125rem | 400 | 1.6 | 0 |
62
+ | `body.m` | Inter | 1rem | 400 | 1.55 | 0 |
63
+ | `body.s` | Inter | 0.875rem | 400 | 1.5 | 0 |
64
+ | `caption` | Inter | 0.75rem | 500 | 1.4 | 0.01em |
65
+
66
+ Use rem for body; clamp() for fluid headings (see `responsive-breakpoints.md`).
67
+
68
+ ### Spacing scale (4px base, geometric)
69
+
70
+ `0` 0 · `1` 4 · `2` 8 · `3` 12 · `4` 16 · `5` 24 · `6` 32 · `7` 48 · `8` 64 · `9` 96 · `10` 128
71
+
72
+ ### Radius
73
+
74
+ `none` 0 · `sm` 4 · `md` 8 · `lg` 12 · `xl` 16 · `pill` 999.
75
+
76
+ ### Elevation
77
+
78
+ | Token | Light | Dark (tonal) |
79
+ |---|---|---|
80
+ | `e1` | 0 1px 2px rgba(0,0,0,.06) | surface.raised |
81
+ | `e2` | 0 2px 4px rgba(0,0,0,.08) | surface.raised + 4% |
82
+ | `e3` | 0 4px 12px rgba(0,0,0,.10) | surface.raised + 8% |
83
+ | `e4` | 0 12px 24px rgba(0,0,0,.12) | surface.raised + 12% |
84
+
85
+ App overlay: prefer tonal elevation per Material 3.
86
+
87
+ ### Motion
88
+
89
+ | Token | Duration | Easing |
90
+ |---|---|---|
91
+ | `motion.micro` | 100ms | `ease-out` |
92
+ | `motion.transition` | 200ms | `cubic-bezier(0.2, 0, 0, 1)` |
93
+ | `motion.page` | 300ms | `cubic-bezier(0.4, 0, 0.2, 1)` |
94
+ | `motion.spring.subtle` | (spring) | mass 1, stiff 350, damp 30 |
95
+
96
+ Honor `prefers-reduced-motion`. Replace transforms with fades.
97
+
98
+ ## Components — the baseline set
99
+
100
+ Each component has its own `.md` doc with: purpose, anatomy, states (default/hover/focus/active/disabled/loading), variants, accessibility, do/don't, snippets.
101
+
102
+ | Component | Mandatory states | Notes |
103
+ |---|---|---|
104
+ | Button | default, hover, focus, active, disabled, loading | variants: primary, secondary, tertiary, destructive, ghost |
105
+ | Input | default, focus, error, disabled, success | always has visible label |
106
+ | Select | default, open, focus, disabled | native first; custom only when needed |
107
+ | Textarea | as Input | auto-grow optional |
108
+ | Checkbox | unchecked, checked, indeterminate, focus, disabled | native input + custom skin |
109
+ | Radio | unchecked, checked, focus, disabled | grouped under fieldset |
110
+ | Toggle/Switch | off, on, focus, disabled | `role="switch" aria-checked` |
111
+ | Card | default, raised, interactive | elevation tokens |
112
+ | Modal / Dialog | open, closing | focus trap + ESC + restore |
113
+ | Sheet (app) | half / full | drag handle |
114
+ | Tabs | active, inactive, focus | keyboard arrows |
115
+ | Accordion | collapsed, expanded, focus | `<details>` when possible |
116
+ | Toast / Snackbar | info, success, warning, error | `role="status"` or `alert` |
117
+ | Tooltip | hidden, visible | `aria-describedby`, touch alt |
118
+ | Menu | closed, open, focus | keyboard navigation |
119
+ | Dropdown | (synonym of Menu / Combobox) | follow ARIA combobox |
120
+ | Badge | default, success, warning, error | contrast ≥ 4.5:1 |
121
+ | Avatar | image, initials, placeholder | 1:1 ratio, alt text |
122
+ | Skeleton | static, shimmer | respect reduced-motion |
123
+ | Empty state | default | message + primary action |
124
+ | Loading | spinner / progress | accessible announcement |
125
+
126
+ ## Component template (one per component)
127
+
128
+ ```markdown
129
+ ---
130
+ component: Button
131
+ status: ready
132
+ owner: Mantis
133
+ linked_screens: [signup-empty, team-list-empty, …]
134
+ ---
135
+
136
+ # Button
137
+
138
+ ## Purpose
139
+ Trigger an action. Never use for navigation between routes.
140
+
141
+ ## Anatomy
142
+ [icon?] [label] [icon?] · padding by size · radius `md`
143
+
144
+ ## Variants
145
+ - `primary` — main action; one per screen region.
146
+ - `secondary` — alternative action.
147
+ - `tertiary` — text-only.
148
+ - `destructive` — irreversible action.
149
+ - `ghost` — minimal chrome, e.g., toolbar.
150
+
151
+ ## Sizes
152
+ - `sm` (height 32, label `body.s`)
153
+ - `md` (height 40, label `body.m`)
154
+ - `lg` (height 48, label `body.m`)
155
+
156
+ ## States
157
+
158
+ | State | Treatment |
159
+ |---|---|
160
+ | default | accent.brand bg, text.onAccent label |
161
+ | hover | accent.brand 10% darker |
162
+ | focus | 2px outline `border.focus`, offset 2px |
163
+ | active | accent.brand 15% darker |
164
+ | disabled | opacity 0.4, `aria-disabled="true"`, cursor not-allowed |
165
+ | loading | spinner replaces icon; label unchanged; click ignored |
166
+
167
+ ## Accessibility
168
+ - Native `<button>`.
169
+ - `aria-label` when icon-only.
170
+ - Visible focus ring always (don't override).
171
+ - 24×24 px hit area minimum (web), 44pt (iOS), 48dp (Android).
172
+ - Min contrast on label ≥ 4.5:1.
173
+
174
+ ## Don't
175
+ - Use `<div onclick>`.
176
+ - Remove the focus ring without replacement.
177
+ - Use destructive for "Continue".
178
+ - Stack > 2 primary buttons on a screen.
179
+ ```
180
+
181
+ ## Theming + overlays
182
+
183
+ - **Web overlay:** tokens emit as CSS custom properties; dark mode toggled via `[data-theme="dark"]` on `<html>`.
184
+ - **App overlay (iOS):** tokens as SwiftUI environment values; dark mode auto.
185
+ - **App overlay (Android):** tokens as Compose `MaterialTheme` extensions; honor `dynamicColorScheme` when allowed.
186
+
187
+ ## Anti-patterns Mantis rejects
188
+
189
+ - **Hex in components.** Everything via tokens.
190
+ - **One-off components shipped without doc.** Add to the system or refuse to merge.
191
+ - **Component matrix without states.** A button without disabled+loading isn't a button.
192
+ - **Component that fails axe.** Failed at definition; don't ship.
193
+
194
+ ## Hand-off
195
+
196
+ > Tokens + 20 components at `.wize/solutioning/design-system/`. Tony picks the runtime (Tailwind / Vanilla Extract / SwiftUI tokens / Compose theme); Shuri implements. Hawkeye references this in `tea-design.md`: a11y + visual regression hooks point at these tokens.
@@ -3,31 +3,157 @@ code: wize-nfr-principles
3
3
  name: NFR Principles
4
4
  phase: 2-to-3-boundary
5
5
  owner: wize-agent-solution-strategist # Nick Fury
6
- status: stub
6
+ status: ready
7
7
  ---
8
8
 
9
9
  # NFR Principles
10
10
 
11
- **Goal.** Define non-functional non-negotiables Tony must design against and Hawkeye must verify.
11
+ **Goal.** Define non-functional non-negotiables Tony must design against and Hawkeye must verify. Hill defers to this when sizing scope. Mantis respects the a11y/perf bars in UX specs. Shuri implements with these targets in hand.
12
+
13
+ Fury drives. Output lands in `.wize/planning/nfr-principles.md`.
14
+
15
+ ## Inputs
16
+
17
+ - `.wize/planning/prd.md`
18
+ - `.wize/planning/tech-vision.md`
19
+ - `.wize/planning/brief.md` (compliance constraints, audience implications)
20
+ - Overlay perf playbooks if active:
21
+ - `web-overlay/playbooks/web-perf-budgets.md`
22
+ - `app-overlay/playbooks/mobile-perf-budgets.md`
23
+ - `web-overlay/playbooks/wcag-aa.md`
24
+ - `app-overlay/playbooks/apple-hig.md`, `material-design-3.md`
25
+
26
+ ## Outputs
12
27
 
13
- ## Output
14
28
  - `.wize/planning/nfr-principles.md`
15
29
 
16
- ## Categories
17
- - **Performance** — targets (LCP, p95, throughput).
18
- - **Security** auth model, data classes, threat surface posture.
19
- - **Reliability** — uptime, error budget, retry/idempotency policy.
20
- - **Maintainability** — coding standards, tech-debt allowance.
21
- - **Accessibility** — WCAG / platform guidelines minimums.
22
- - **Cost** monthly envelope and degradation strategy.
30
+ ## Categories (always cover these six)
31
+
32
+ For each, write **non-negotiable** + **stretch** + **deferred** (with trigger). Use the playbooks as starting points; **tighten** if PRD demands, never loosen below playbook recommendations.
33
+
34
+ ### 1. Performance
35
+
36
+ | Tier | Targets |
37
+ |---|---|
38
+ | Non-negotiable | LCP ≤ 2.5s mobile, INP ≤ 200ms, CLS ≤ 0.1 (web) — cold start ≤ 1.5s mid-range (app) |
39
+ | Stretch | LCP ≤ 1.8s, INP ≤ 100ms |
40
+ | Deferred | Server-side LCP for edge regions — revisit when audience > 30% non-NA |
41
+
42
+ ### 2. Security
43
+
44
+ | Tier | Items |
45
+ |---|---|
46
+ | Non-negotiable | OWASP Top 10 covered; auth via {{vendor}}; tokens never logged; secrets via {{provider}}; RLS on every table with user_id |
47
+ | Stretch | SOC2 type-I controls in place by {{date}} |
48
+ | Deferred | SOC2 type-II — revisit at $1M ARR |
49
+
50
+ ### 3. Reliability
51
+
52
+ | Tier | Targets |
53
+ |---|---|
54
+ | Non-negotiable | 99.9% uptime in primary region; error budget 0.1%/month; retries idempotent with deduplication key |
55
+ | Stretch | 99.95% uptime |
56
+ | Deferred | Multi-region active/active — revisit per tech-vision deferred |
57
+
58
+ ### 4. Maintainability
59
+
60
+ | Tier | Items |
61
+ |---|---|
62
+ | Non-negotiable | Lint + format on commit; > 80% test coverage on logic modules; ADRs for every architectural decision; deps audited monthly |
63
+ | Stretch | < 5% files over 300 LOC; cyclomatic complexity < 15 per function |
64
+ | Deferred | Auto-doc generation — revisit when API consumers > 3 |
65
+
66
+ ### 5. Accessibility
67
+
68
+ | Tier | Items |
69
+ |---|---|
70
+ | Non-negotiable | WCAG 2.2 AA on every shipped page; keyboard-complete; axe in CI |
71
+ | Stretch | AAA on critical flows (signup, billing) |
72
+ | Deferred | Full screen-reader manual audit every release — revisit at next compliance review |
73
+
74
+ ### 6. Cost
75
+
76
+ | Tier | Targets |
77
+ |---|---|
78
+ | Non-negotiable | Total infra ≤ ${{X}}/month under {{load}}; degradation strategy documented for 10× spike |
79
+ | Stretch | Cost-per-active-user ≤ ${{Y}} |
80
+ | Deferred | Per-feature cost attribution — revisit when finance asks |
81
+
82
+ ## Steps
83
+
84
+ ### 1. Read the playbooks first
85
+
86
+ If web/app overlays are active, the perf and a11y playbooks already hold real targets calibrated to mid-range device + 3G fast. Use them as starting point.
87
+
88
+ ### 2. Tighten by audience
89
+
90
+ Mid-range mobile is the playbook baseline. If your PRD audience is *more* constrained (emerging markets, kiosk hardware, healthcare older devices), tighten. Don't loosen.
91
+
92
+ ### 3. Map every non-negotiable to a verifier
93
+
94
+ Every non-negotiable must answer the question: *Who and how do we verify this on every release?*
95
+
96
+ - LCP → `web-perf-budgets.md` lighthouse-ci config.
97
+ - WCAG → axe in CI + Hawkeye review.
98
+ - Uptime → SLO defined in `.wize/solutioning/observability.md` (Tony).
99
+ - Error budget → tracked in {{tool}}.
100
+
101
+ A non-negotiable with no verifier is a wish.
102
+
103
+ ### 4. Tell the story (one paragraph)
104
+
105
+ Open the doc with a paragraph: *why these numbers, and what trade-offs they imply.* Future readers re-litigate non-negotiables every six months; the story saves that hour.
106
+
107
+ ### 5. Hand off
108
+
109
+ Mark `status: aligned`. Tony reads before architecture; Hawkeye reads before risk profile.
110
+
111
+ ## Output template
23
112
 
24
- ## Template
25
113
  ```markdown
26
- # NFR Principles
114
+ ---
115
+ status: aligned
116
+ owner: Nick Fury
117
+ created: YYYY-MM-DD
118
+ ---
119
+
120
+ # NFR Principles — {{project_name}}
121
+
122
+ ## Why these numbers
123
+
124
+ {{One paragraph: target audience, country mix, device class, compliance frame. Why we picked these targets specifically.}}
125
+
126
+ ## Performance
127
+ | Tier | Targets | Verifier |
128
+ |---|---|---|
129
+ | Non-negotiable | LCP ≤ 2.5s mobile (CWV), INP ≤ 200ms, CLS ≤ 0.1 | lighthouse-ci + web-vitals beacon |
130
+ | Stretch | LCP ≤ 1.8s | same |
131
+ | Deferred | Multi-region LCP — trigger: EU DAU > 5k | — |
27
132
 
28
- | Category | Non-negotiable | Stretch | Deferred |
29
- |---|---|---|---|
30
- | Performance | … | … | … |
31
- | Security | … | … | … |
133
+ ## Security
134
+
135
+
136
+ ## Reliability
137
+
138
+
139
+ ## Maintainability
140
+
141
+
142
+ ## Accessibility
143
+
144
+
145
+ ## Cost
32
146
 
33
147
  ```
148
+
149
+ ## Anti-patterns Fury rejects
150
+
151
+ - **Targets without numbers.** "Fast." Wrong. "p95 server response ≤ 200ms."
152
+ - **Stretch targets that are actually goals.** If you must hit it, it's non-negotiable.
153
+ - **No verifier.** Every non-negotiable answers *who verifies, with what tool, on what cadence*.
154
+ - **Loosening below the playbook.** Tightening is fine. Loosening is a smell — escalate.
155
+ - **Cost left blank.** Cost is always an NFR.
156
+
157
+ ## Hand-off
158
+
159
+ > NFRs at `.wize/planning/nfr-principles.md`. Tony, architecture must respect items 1.A and 4.A from day one (perf and ADR discipline). Hawkeye, your gate policy can stay advisory but NFR gate per epic is mandatory. Hill, scope must keep the budget headroom for item 6.A.