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.
- package/CHANGELOG.md +40 -1
- package/README.md +64 -0
- package/package.json +1 -1
- package/src/method-skills/1-analysis/wize-document-project/workflow.md +147 -20
- package/src/method-skills/1-analysis/wize-prfaq/workflow.md +150 -11
- package/src/method-skills/1-analysis/wize-product-brief/workflow.md +90 -19
- package/src/method-skills/1-analysis/wize-research/workflow.md +101 -9
- package/src/method-skills/1-analysis/wize-trigger-map/workflow.md +80 -16
- package/src/method-skills/2-plan-workflows/wize-create-prd/workflow.md +132 -23
- package/src/method-skills/2-plan-workflows/wize-ux-design/workflow.md +132 -28
- package/src/method-skills/2-plan-workflows/wize-ux-scenarios/workflow.md +91 -15
- package/src/method-skills/2-plan-workflows/wize-validate-prd/workflow.md +106 -12
- package/src/method-skills/3-solutioning/wize-check-implementation-readiness/workflow.md +101 -11
- package/src/method-skills/3-solutioning/wize-create-architecture/workflow.md +197 -29
- package/src/method-skills/3-solutioning/wize-create-epics-and-stories/workflow.md +127 -12
- package/src/method-skills/3-solutioning/wize-design-system/workflow.md +182 -22
- package/src/method-skills/3-solutioning/wize-nfr-principles/workflow.md +142 -16
- package/src/method-skills/3-solutioning/wize-tech-vision/workflow.md +127 -21
- package/src/method-skills/4-implementation/wize-code-review/workflow.md +105 -10
- package/src/method-skills/4-implementation/wize-create-story/workflow.md +131 -10
- package/src/method-skills/4-implementation/wize-dev-story/workflow.md +115 -17
- package/src/method-skills/4-implementation/wize-quick-dev/workflow.md +109 -18
- package/src/method-skills/4-implementation/wize-retrospective/workflow.md +112 -10
- package/src/method-skills/4-implementation/wize-sprint-planning/workflow.md +85 -10
- package/src/method-skills/4-implementation/wize-sprint-status/workflow.md +96 -11
- package/src/tea-skills/wize-tea-design/workflow.md +104 -13
- package/src/tea-skills/wize-tea-gate/workflow.md +108 -25
- package/src/tea-skills/wize-tea-nfr/workflow.md +104 -14
- package/src/tea-skills/wize-tea-review/workflow.md +107 -13
- package/src/tea-skills/wize-tea-risk/workflow.md +99 -10
- package/src/tea-skills/wize-tea-trace/workflow.md +83 -12
- package/tools/installer/commands/agent.js +197 -0
- package/tools/installer/commands/sync.js +45 -0
- package/tools/installer/commands/update.js +172 -0
- package/tools/installer/wize-cli.js +24 -8
|
@@ -3,41 +3,147 @@ code: wize-tech-vision
|
|
|
3
3
|
name: Tech Vision
|
|
4
4
|
phase: 2-to-3-boundary
|
|
5
5
|
owner: wize-agent-solution-strategist # Nick Fury
|
|
6
|
-
status:
|
|
6
|
+
status: ready
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Tech Vision
|
|
10
10
|
|
|
11
|
-
**Goal.** State the technical north star in one page. Stack family,
|
|
11
|
+
**Goal.** State the technical north star in one page. Stack family, runtime envelope, build/buy/borrow calls, non-negotiables. Fury sets the **shape**, not the libraries — Tony fills in inside the frame.
|
|
12
|
+
|
|
13
|
+
Output lands in `.wize/planning/tech-vision.md`. Tony reads this before drawing architecture. Hill references it when scoping. Hawkeye uses it when picking gate granularity.
|
|
14
|
+
|
|
15
|
+
## Inputs
|
|
16
|
+
|
|
17
|
+
- `.wize/planning/prd.md` (validated)
|
|
18
|
+
- `.wize/planning/ux/ux-design/` (so the runtime envelope respects the UX)
|
|
19
|
+
- `.wize/knowledge/document-project/` (brownfield only)
|
|
20
|
+
- Stack catalogs (per active overlay):
|
|
21
|
+
- `src/web-overlay/stack-catalog.md`
|
|
22
|
+
- `src/app-overlay/stack-catalog.md`
|
|
23
|
+
|
|
24
|
+
## Outputs
|
|
12
25
|
|
|
13
|
-
## Output
|
|
14
26
|
- `.wize/planning/tech-vision.md`
|
|
15
27
|
|
|
16
|
-
##
|
|
28
|
+
## Steps
|
|
29
|
+
|
|
30
|
+
### 1. Pick the stack family
|
|
31
|
+
|
|
32
|
+
By order of constraint:
|
|
33
|
+
|
|
34
|
+
1. **Audience reach.** Public + SEO-critical? Authenticated app? Native mobile required?
|
|
35
|
+
2. **Latency budget.** Sub-1s LCP on 3G or richer-but-slower OK?
|
|
36
|
+
3. **Team familiarity.** Favor what the team has shipped before unless the project truly demands new.
|
|
37
|
+
4. **Backend coupling.** Separate API / fullstack monolith / BaaS?
|
|
38
|
+
5. **Deploy target.** Edge / container / self-managed.
|
|
39
|
+
|
|
40
|
+
Don't pick libraries here. Pick the *shape*: "Next.js-class SSR fullstack on edge" or "React Native + Expo with a Supabase backend" or "Compose Multiplatform with Kotlin services."
|
|
41
|
+
|
|
42
|
+
### 2. State the runtime envelope
|
|
43
|
+
|
|
44
|
+
| Dimension | Decision |
|
|
45
|
+
|---|---|
|
|
46
|
+
| Language(s) of record | TS, Kotlin, etc. |
|
|
47
|
+
| Runtime(s) | Browser / Node / Edge / Native iOS / Native Android / JVM |
|
|
48
|
+
| Persistence | Postgres / SQLite / KV / cloud-native |
|
|
49
|
+
| Deploy target | Vercel / Cloudflare / Fly / EKS / EAS / etc. |
|
|
50
|
+
| Edge vs origin | Edge-first / origin-first |
|
|
51
|
+
|
|
52
|
+
### 3. Build / buy / borrow
|
|
53
|
+
|
|
54
|
+
For each capability the PRD implies, declare:
|
|
55
|
+
|
|
56
|
+
| Capability | Build | Buy | Borrow (OSS) |
|
|
57
|
+
|---|---|---|---|
|
|
58
|
+
| Auth | — | Clerk / Auth0 | NextAuth / Lucia |
|
|
59
|
+
| Payments | — | Stripe | — |
|
|
60
|
+
| Search | — | Algolia / Typesense Cloud | Meilisearch self-hosted |
|
|
61
|
+
| Queues | — | SQS / Cloud Tasks | BullMQ |
|
|
62
|
+
| Analytics | — | Amplitude | PostHog OSS |
|
|
63
|
+
| Email | — | Resend / Postmark | — |
|
|
64
|
+
| Realtime | — | Pusher / Ably | Supabase Realtime |
|
|
65
|
+
|
|
66
|
+
One row per capability. Empty cells are explicit choices.
|
|
67
|
+
|
|
68
|
+
### 4. Non-negotiables
|
|
69
|
+
|
|
70
|
+
The 2–5 things the team will not compromise on.
|
|
71
|
+
|
|
72
|
+
Examples:
|
|
73
|
+
- *"All endpoint responses ≤ 200ms p95 from the user's region."*
|
|
74
|
+
- *"Single source of truth for user data — no shadow stores."*
|
|
75
|
+
- *"PII never leaves the EU."*
|
|
76
|
+
- *"On-call burden ≤ 0.5 pages per engineer per week."*
|
|
77
|
+
|
|
78
|
+
These outrank PRD goals. If they conflict, Fury escalates.
|
|
79
|
+
|
|
80
|
+
### 5. Deferred (with triggers)
|
|
81
|
+
|
|
82
|
+
What we won't decide yet, and what would trigger the decision. Don't list "could be revisited"; list the *signal* that forces the decision.
|
|
83
|
+
|
|
84
|
+
- *"Multi-region storage: revisit when EU+US daily active users > 5k."*
|
|
85
|
+
- *"WebSockets vs SSE: revisit when realtime updates < 500ms become a PRD goal."*
|
|
86
|
+
|
|
87
|
+
### 6. Hand off
|
|
88
|
+
|
|
89
|
+
Mark `status: aligned`. Tony reads it as the frame; he can argue specific decisions but not redraw the family without escalating.
|
|
90
|
+
|
|
91
|
+
## Output template
|
|
92
|
+
|
|
17
93
|
```markdown
|
|
18
|
-
|
|
94
|
+
---
|
|
95
|
+
status: aligned
|
|
96
|
+
owner: Nick Fury
|
|
97
|
+
created: YYYY-MM-DD
|
|
98
|
+
---
|
|
19
99
|
|
|
20
|
-
|
|
21
|
-
- {Web|Mobile|Hybrid}
|
|
100
|
+
# Tech Vision — {{project_name}}
|
|
22
101
|
|
|
23
|
-
##
|
|
24
|
-
-
|
|
102
|
+
## Stack family
|
|
103
|
+
Next.js-class SSR fullstack on edge, with Supabase Postgres as the system of record.
|
|
25
104
|
|
|
26
105
|
## Runtime envelope
|
|
27
|
-
|
|
106
|
+
| Dimension | Decision |
|
|
107
|
+
|---|---|
|
|
108
|
+
| Language | TypeScript end-to-end |
|
|
109
|
+
| Runtime | Edge (Vercel Edge Functions) + Node (server actions) |
|
|
110
|
+
| Persistence | Supabase Postgres (RLS) + PgBouncer |
|
|
111
|
+
| Deploy target | Vercel for app; Supabase managed for data |
|
|
112
|
+
| Edge vs origin | Edge-first for reads; origin for writes |
|
|
28
113
|
|
|
29
|
-
## Build
|
|
30
|
-
| Capability | Decision |
|
|
31
|
-
|
|
32
|
-
| Auth |
|
|
33
|
-
| Payments |
|
|
34
|
-
| Search |
|
|
35
|
-
| Queues |
|
|
36
|
-
| Analytics |
|
|
114
|
+
## Build / buy / borrow
|
|
115
|
+
| Capability | Decision |
|
|
116
|
+
|---|---|
|
|
117
|
+
| Auth | Buy — Supabase Auth |
|
|
118
|
+
| Payments | Buy — Stripe |
|
|
119
|
+
| Search | Buy — Algolia (1st year), revisit |
|
|
120
|
+
| Queues | Borrow — pg_cron + outbox pattern |
|
|
121
|
+
| Analytics | Borrow — PostHog OSS |
|
|
122
|
+
| Email | Buy — Resend |
|
|
37
123
|
|
|
38
124
|
## Non-negotiables
|
|
39
|
-
|
|
125
|
+
1. PII (incl. emails) stored in the user's region only.
|
|
126
|
+
2. p95 server response ≤ 200ms in the user's region.
|
|
127
|
+
3. Single auth identity per human (no shadow accounts).
|
|
128
|
+
4. On-call rotation never exceeds 0.5 pages/eng/week.
|
|
129
|
+
|
|
130
|
+
## Deferred
|
|
131
|
+
- Multi-region writes: revisit when EU active users > 2k.
|
|
132
|
+
- Native mobile clients: revisit when web TTI > 4s on > 20% of sessions or PRD demands offline.
|
|
40
133
|
|
|
41
|
-
##
|
|
42
|
-
-
|
|
134
|
+
## Constraints that drove this
|
|
135
|
+
- Brief constraint #2 (LGPD/GDPR) ruled out global-replica DBs.
|
|
136
|
+
- PRD goal G1 ruled in edge-first reads.
|
|
137
|
+
- Hiring tail in TypeScript ruled out Compose Multiplatform.
|
|
43
138
|
```
|
|
139
|
+
|
|
140
|
+
## Anti-patterns Fury rejects
|
|
141
|
+
|
|
142
|
+
- **Picking a library here.** That's Tony. Pick the *family*.
|
|
143
|
+
- **Non-negotiables that are aspirations.** "Always 100% uptime." Wrong. "Error budget ≤ 0.1% in EU region."
|
|
144
|
+
- **Deferred items with no trigger.** That's procrastination.
|
|
145
|
+
- **A non-negotiable that contradicts a PRD constraint silently.** Surface it, escalate it, decide it.
|
|
146
|
+
|
|
147
|
+
## Hand-off
|
|
148
|
+
|
|
149
|
+
> Tech vision at `.wize/planning/tech-vision.md`. Tony, build the architecture inside this frame. Hill, scope the PRD against the non-negotiables (item 1 means the global launch is back on the table only after EU baseline holds). Hawkeye, pick gate granularity assuming `policy = advisory`.
|
|
@@ -3,22 +3,117 @@ code: wize-code-review
|
|
|
3
3
|
name: Code Review
|
|
4
4
|
phase: 4-implementation
|
|
5
5
|
owner: wize-agent-dev # Shuri (peer Shuri — done at PR open time)
|
|
6
|
-
status:
|
|
6
|
+
status: ready
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Code Review
|
|
10
10
|
|
|
11
|
-
**Goal.**
|
|
11
|
+
**Goal.** Audit **code health** on the PR. Separate from Hawkeye's `tea-review` (which audits AC fulfillment). Both run on every story PR; they're complementary.
|
|
12
|
+
|
|
13
|
+
Shuri reviews peer PRs. Tony reviews when architecture is at stake.
|
|
14
|
+
|
|
15
|
+
## When to run
|
|
16
|
+
|
|
17
|
+
Every PR that ships code. Quick-dev PRs get a lighter review (skip code-architecture checks unless they touched architecture).
|
|
18
|
+
|
|
19
|
+
## Inputs
|
|
20
|
+
|
|
21
|
+
- The PR (diff + tests).
|
|
22
|
+
- Story file (for context — what the PR is supposed to accomplish).
|
|
23
|
+
- Linked design system (when components change).
|
|
24
|
+
|
|
25
|
+
## Output
|
|
26
|
+
|
|
27
|
+
- Inline comments on the PR.
|
|
28
|
+
- Final review verdict: `approve` / `request-changes` / `comment`.
|
|
12
29
|
|
|
13
30
|
## What this checks
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
31
|
+
|
|
32
|
+
### Naming + structure
|
|
33
|
+
- Are types, functions, variables named for **what they are**, not **how they're used**?
|
|
34
|
+
- Are files in the right folder per the architecture?
|
|
35
|
+
- Are exports minimal? Module boundaries respected?
|
|
36
|
+
- Are there new abstractions justified by the story or premature?
|
|
37
|
+
|
|
38
|
+
### Tests
|
|
39
|
+
- Do tests cover the changed behavior (not just coverage %)?
|
|
40
|
+
- Are they fast and isolated?
|
|
41
|
+
- Are mocks at the boundary, not inside the unit?
|
|
42
|
+
- Any `test.skip` / `.only` left in?
|
|
43
|
+
|
|
44
|
+
### Security (obvious-misses)
|
|
45
|
+
- Input validation at boundaries.
|
|
46
|
+
- Tokens / secrets / PII never logged.
|
|
47
|
+
- SQL parameterized, not concatenated.
|
|
48
|
+
- New deps audited; no known CVEs introduced.
|
|
49
|
+
- Auth context checked on every server entry point.
|
|
50
|
+
|
|
51
|
+
### Performance (obvious-misses)
|
|
52
|
+
- No N+1 queries.
|
|
53
|
+
- No `await` in tight loops without batching.
|
|
54
|
+
- No new sync I/O on hot paths.
|
|
55
|
+
- Bundle delta acceptable (size of new front-end imports).
|
|
56
|
+
|
|
57
|
+
### Architectural drift
|
|
58
|
+
- Story didn't quietly introduce a new layer / new pattern.
|
|
59
|
+
- If it did, an ADR was opened or a comment justifies it.
|
|
60
|
+
- Components reused from design system; new components added to system if reusable.
|
|
61
|
+
|
|
62
|
+
### Style + convention
|
|
63
|
+
- Follows lint / format / type rules.
|
|
64
|
+
- Comments explain *why*, not *what*.
|
|
65
|
+
- Dead code removed.
|
|
66
|
+
- TODOs have an owner + a ticket.
|
|
19
67
|
|
|
20
68
|
## What this does NOT check
|
|
21
|
-
- AC fulfillment — that's Hawkeye's `trace` + `review` + `gate`.
|
|
22
69
|
|
|
23
|
-
|
|
24
|
-
-
|
|
70
|
+
- Whether ACs are met — that's Hawkeye's `tea-review`.
|
|
71
|
+
- Whether the design is right — that's reviewed in pull-request walk-through, ADR review, or party-mode.
|
|
72
|
+
|
|
73
|
+
Don't conflate. Two reviewers, two scopes.
|
|
74
|
+
|
|
75
|
+
## Comment style
|
|
76
|
+
|
|
77
|
+
Use these prefixes:
|
|
78
|
+
|
|
79
|
+
| Prefix | Meaning |
|
|
80
|
+
|---|---|
|
|
81
|
+
| `nit:` | Cosmetic; non-blocking |
|
|
82
|
+
| `q:` | Question; might be a misunderstanding |
|
|
83
|
+
| `praise:` | Real call-outs; teams need them |
|
|
84
|
+
| `suggestion:` | Idea, the author decides |
|
|
85
|
+
| `blocking:` | Must change before merge |
|
|
86
|
+
| `out-of-scope:` | Real issue, separate story |
|
|
87
|
+
|
|
88
|
+
Never `LGTM` without scanning. Never `LGTM` with `blocking:` open.
|
|
89
|
+
|
|
90
|
+
## Verdict
|
|
91
|
+
|
|
92
|
+
- **approve** — all blockings resolved.
|
|
93
|
+
- **request-changes** — at least one `blocking:`.
|
|
94
|
+
- **comment** — reviewed, no opinion (rare; used for early-draft PRs).
|
|
95
|
+
|
|
96
|
+
## PR-open checklist (Shuri's self-review)
|
|
97
|
+
|
|
98
|
+
Before opening, Shuri runs through:
|
|
99
|
+
|
|
100
|
+
- [ ] CI green locally.
|
|
101
|
+
- [ ] Lint + format clean.
|
|
102
|
+
- [ ] Type-check clean.
|
|
103
|
+
- [ ] No `console.log` / `dbg!` / debug printf.
|
|
104
|
+
- [ ] No `test.skip` / `.only`.
|
|
105
|
+
- [ ] Reading the diff right now, can I explain every line?
|
|
106
|
+
- [ ] Self-walk: open the changed screen / call the changed endpoint.
|
|
107
|
+
- [ ] Story status flipped to `ready-for-review`.
|
|
108
|
+
|
|
109
|
+
## Anti-patterns Shuri rejects in herself
|
|
110
|
+
|
|
111
|
+
- Approving without reading.
|
|
112
|
+
- Approving on the basis of green CI alone.
|
|
113
|
+
- "Big PR; will trust" — refuse and ask for slicing.
|
|
114
|
+
- Inline suggestions for full rewrites — open a follow-up instead.
|
|
115
|
+
- Demanding stylistic preferences not in the lint config.
|
|
116
|
+
|
|
117
|
+
## Hand-off
|
|
118
|
+
|
|
119
|
+
> Reviewed PR #418 (E02-S02). 2 nits, 1 blocking on auth-context check missing in one new route. Shuri to fix; re-review needed; then Hawkeye runs `tea-review`.
|
|
@@ -3,25 +3,146 @@ code: wize-create-story
|
|
|
3
3
|
name: Create Story
|
|
4
4
|
phase: 4-implementation
|
|
5
5
|
owner: wize-agent-architect # Tony writes; Shuri may refine
|
|
6
|
-
status:
|
|
6
|
+
status: ready
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Create Story
|
|
10
10
|
|
|
11
|
-
**Goal.** Author one Pull-Request-sized story
|
|
11
|
+
**Goal.** Author one Pull-Request-sized story with crisp acceptance criteria, named touch-points, and a contract for Hawkeye's `tea-design.md`. This is the single most-edited artifact in the lifecycle; make it useful.
|
|
12
|
+
|
|
13
|
+
Tony drives. Shuri reads and proposes refinements before pulling the story.
|
|
14
|
+
|
|
15
|
+
## When to use
|
|
16
|
+
|
|
17
|
+
- New story splits from an epic (most common — done in `wize-create-epics-and-stories`).
|
|
18
|
+
- A story that comes in mid-sprint and needs a quick scaffold.
|
|
19
|
+
- A `tea-gate` waived rationale created a follow-up story.
|
|
12
20
|
|
|
13
21
|
## Inputs
|
|
22
|
+
|
|
14
23
|
- `.wize/solutioning/architecture.md`
|
|
15
24
|
- `.wize/solutioning/epics/{epic}.md`
|
|
16
|
-
- (
|
|
25
|
+
- `.wize/planning/prd.md` (the AC list)
|
|
26
|
+
- (optional) `.wize/planning/ux/ux-design/{screen}.md`
|
|
27
|
+
|
|
28
|
+
## Output
|
|
17
29
|
|
|
18
|
-
## Outputs
|
|
19
30
|
- `.wize/solutioning/stories/{epic}/{story-id}.md`
|
|
20
31
|
|
|
21
|
-
##
|
|
22
|
-
|
|
32
|
+
## Steps
|
|
33
|
+
|
|
34
|
+
### 1. Name it by outcome
|
|
35
|
+
|
|
36
|
+
Verb-led, user-visible. *"Onboarding: invite first teammate"* not *"Build invite form."*
|
|
37
|
+
|
|
38
|
+
### 2. Frontmatter
|
|
39
|
+
|
|
40
|
+
```yaml
|
|
41
|
+
---
|
|
42
|
+
story_id: E01-S03
|
|
43
|
+
epic: 01-onboarding
|
|
44
|
+
status: ready-for-dev
|
|
45
|
+
priority: 2 # 1=now, 2=next, 3=later
|
|
46
|
+
estimate: M # S | M | L (XL → slice further before merging here)
|
|
47
|
+
linked_screens: [onboarding-step-1, invite-modal]
|
|
48
|
+
linked_acs: [AC-02-1, AC-02-2]
|
|
49
|
+
---
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 3. Context (3–5 lines)
|
|
53
|
+
|
|
54
|
+
What place this story occupies in the user journey, why it matters here, what it depends on.
|
|
55
|
+
|
|
56
|
+
### 4. ACs (lifted from PRD; not reworded)
|
|
57
|
+
|
|
58
|
+
Don't reword PRD ACs in a story — copy them verbatim. If they're not crisp enough, fix in the PRD first.
|
|
59
|
+
|
|
60
|
+
### 5. Out of scope
|
|
61
|
+
|
|
62
|
+
Explicit. Other ACs the user might think this story touches, with a one-line reason it's not here.
|
|
63
|
+
|
|
64
|
+
### 6. Notes for Shuri
|
|
65
|
+
|
|
66
|
+
- Touch points: files Shuri will likely edit.
|
|
67
|
+
- Reuse: components from `design-system` already named.
|
|
68
|
+
- `testid` map: names Hawkeye expects.
|
|
69
|
+
- Edge cases worth flagging (only ones not derivable from ACs).
|
|
70
|
+
|
|
71
|
+
### 7. Notes for Hawkeye
|
|
72
|
+
|
|
73
|
+
A one-paragraph hint: suggested split, fixtures, mocks, environment. Hawkeye writes the real `tea-design.md` but reads this hint.
|
|
74
|
+
|
|
75
|
+
## INVEST rules
|
|
76
|
+
|
|
77
|
+
Every story passes:
|
|
78
|
+
|
|
79
|
+
- **I**ndependent.
|
|
80
|
+
- **N**egotiable.
|
|
81
|
+
- **V**aluable.
|
|
82
|
+
- **E**stimable (Tony sizes).
|
|
83
|
+
- **S**mall (≤ 1 PR).
|
|
84
|
+
- **T**estable.
|
|
85
|
+
|
|
86
|
+
If any letter fails, fix before queueing.
|
|
87
|
+
|
|
88
|
+
## Estimation rough guide
|
|
89
|
+
|
|
90
|
+
- **S** ≤ 4h.
|
|
91
|
+
- **M** 4h–1d.
|
|
92
|
+
- **L** 1–2d.
|
|
93
|
+
- **XL** > 2d → split.
|
|
94
|
+
|
|
95
|
+
These are intervals, not commitments. Hill plans capacity against M-median.
|
|
96
|
+
|
|
97
|
+
## Full story template
|
|
98
|
+
|
|
99
|
+
```markdown
|
|
100
|
+
---
|
|
101
|
+
story_id: E01-S03
|
|
102
|
+
epic: 01-onboarding
|
|
103
|
+
status: ready-for-dev
|
|
104
|
+
priority: 2
|
|
105
|
+
estimate: M
|
|
106
|
+
linked_screens: [onboarding-step-1, invite-modal]
|
|
107
|
+
linked_acs: [AC-02-1, AC-02-2]
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
# Story: Onboarding step 1 — invite first teammate
|
|
111
|
+
|
|
112
|
+
## Context
|
|
113
|
+
After sign-up the admin lands on `/onboarding`. This story implements the first
|
|
114
|
+
moment-of-truth from scenario S1: inviting the first teammate.
|
|
115
|
+
|
|
116
|
+
## Acceptance criteria
|
|
117
|
+
- **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.
|
|
118
|
+
- **AC-02-2:** Given an invalid email, When the user blurs the field, Then error text appears (200ms) identifying which rule failed.
|
|
119
|
+
|
|
120
|
+
## Out of scope
|
|
121
|
+
- Bulk invite (multiple emails) — separate story E01-S07.
|
|
122
|
+
- Custom invite message — defer to E02-S03.
|
|
123
|
+
- "Skip for now" button — not a moment-of-truth path; out.
|
|
124
|
+
|
|
125
|
+
## Notes for Shuri (Dev)
|
|
126
|
+
- Touch points: `app/(onboarding)/invite/page.tsx`, `lib/email/send-invite.ts`, new server action `inviteTeammate`.
|
|
127
|
+
- Reuse: `Button` (primary), `Input`, `Banner` (success/error) from design-system.
|
|
128
|
+
- testid: `invite-form`, `invite-email`, `invite-cta`, `invite-sent-banner`.
|
|
129
|
+
- Idempotency: use `(team_id, email)` composite key.
|
|
130
|
+
|
|
131
|
+
## Notes for Hawkeye (TEA)
|
|
132
|
+
Suggested split: 4 unit, 1 integration, 1 E2E.
|
|
133
|
+
- Unit: validateInviteEmail, mailer payload, server action error mapping, retry policy.
|
|
134
|
+
- Integration: server action calls mailer with right args (MSW on Resend).
|
|
135
|
+
- E2E: happy path on Playwright @chromium @ios.
|
|
136
|
+
- Risk: R-1 (mailer) — extra E2E asserts banner within 1s of click.
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Anti-patterns Tony rejects
|
|
140
|
+
|
|
141
|
+
- **ACs reworded from PRD.** Source-of-truth drift.
|
|
142
|
+
- **Stories with no touch points.** Shuri spends an hour finding the files.
|
|
143
|
+
- **No notes for Hawkeye.** TEA designs in the dark.
|
|
144
|
+
- **Stories named by feature** ("Add invite button") — name by **outcome**.
|
|
145
|
+
|
|
146
|
+
## Hand-off
|
|
23
147
|
|
|
24
|
-
|
|
25
|
-
- One story = one PR. If two, split.
|
|
26
|
-
- Each AC must be testable. If Hawkeye can't write a test for it, rewrite the AC.
|
|
27
|
-
- "Out of scope" is mandatory. Force the cut.
|
|
148
|
+
> Story E01-S03 ready. Shuri, pull when sprint allows. Hawkeye, `tea-design.md` for this story whenever you're ready.
|
|
@@ -3,31 +3,129 @@ code: wize-dev-story
|
|
|
3
3
|
name: Dev Story
|
|
4
4
|
phase: 4-implementation
|
|
5
5
|
owner: wize-agent-dev # Shuri
|
|
6
|
-
status:
|
|
6
|
+
status: ready
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Dev Story
|
|
10
10
|
|
|
11
|
-
**Goal.** Implement one story under TDD discipline.
|
|
11
|
+
**Goal.** Implement one story under TDD discipline. Tests first; minimum code to pass; refactor with green. Each commit cites an AC ID. The PR ends in a clean gate, not a "looks good to me."
|
|
12
|
+
|
|
13
|
+
Shuri drives. Hawkeye observes (test design is binding). Tony stays available for architectural questions.
|
|
12
14
|
|
|
13
15
|
## Inputs
|
|
14
|
-
|
|
16
|
+
|
|
17
|
+
- `.wize/solutioning/stories/{epic}/{story}.md`
|
|
15
18
|
- `.wize/solutioning/architecture.md`
|
|
16
|
-
- `.wize/
|
|
19
|
+
- `.wize/solutioning/design-system/` (use existing components)
|
|
20
|
+
- `.wize/implementation/tea/{epic}/{story}/design.md` (the test contract)
|
|
17
21
|
|
|
18
22
|
## Outputs
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
|
|
24
|
+
- Code + tests in the target repo.
|
|
25
|
+
- Commit messages reference AC IDs.
|
|
26
|
+
- Story file updated to `status: ready-for-review`.
|
|
27
|
+
|
|
28
|
+
## The loop (TDD, story-scoped)
|
|
29
|
+
|
|
30
|
+
### 1. Read
|
|
31
|
+
|
|
32
|
+
Story ACs, out-of-scope, notes, `tea-design.md`. Confirm the test split. If the design doesn't match the story (mismatch on test count, mock, environment), ping Hawkeye **before** writing code.
|
|
33
|
+
|
|
34
|
+
### 2. Slice the story into micro-cycles
|
|
35
|
+
|
|
36
|
+
Each cycle is one AC (or part of one) and produces a green test + small code change. Don't try to ship the whole story in one commit.
|
|
37
|
+
|
|
38
|
+
### 3. Red
|
|
39
|
+
|
|
40
|
+
Write the failing test first. Match the assertion shape in `design.md`. Don't write code yet.
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
// red — first run, fails
|
|
44
|
+
test('valid email returns ok', () => {
|
|
45
|
+
expect(validateInviteEmail('a@b.co')).toEqual({ ok: true });
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 4. Green
|
|
50
|
+
|
|
51
|
+
Write the **minimum** code that turns the test green. No anticipated branches; no "just-in-case" handling.
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
// green — minimum to pass
|
|
55
|
+
export const validateInviteEmail = (s: string) => ({ ok: /@/.test(s) });
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 5. Refactor
|
|
59
|
+
|
|
60
|
+
Now harden, with the test as safety net.
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
// refactor — same green tests, real logic
|
|
64
|
+
import { z } from 'zod';
|
|
65
|
+
const schema = z.string().email();
|
|
66
|
+
export const validateInviteEmail = (s: string) =>
|
|
67
|
+
schema.safeParse(s).success ? { ok: true } : { ok: false, code: 'invalid_format', field: 'email' };
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 6. Commit
|
|
71
|
+
|
|
72
|
+
Conventional commits, AC IDs referenced.
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
feat(invite): validate email per AC-02-1 / AC-02-2
|
|
76
|
+
- add validateInviteEmail with zod
|
|
77
|
+
- add 4 unit tests covering valid + invalid rules
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 7. Repeat
|
|
81
|
+
|
|
82
|
+
Until every AC has at least one test + minimum code that makes it pass.
|
|
83
|
+
|
|
84
|
+
### 8. Pre-PR self-check
|
|
85
|
+
|
|
86
|
+
- All Hawkeye-declared tests exist + pass.
|
|
87
|
+
- No `test.skip` / `.only` left.
|
|
88
|
+
- Lint + format clean.
|
|
89
|
+
- Type-check clean.
|
|
90
|
+
- `data-testid` matches story's "notes for Hawkeye".
|
|
91
|
+
- Story file frontmatter → `status: ready-for-review`.
|
|
92
|
+
- Self-walk the screen (web) or smoke a tab on simulator (app).
|
|
93
|
+
|
|
94
|
+
### 9. Open PR
|
|
95
|
+
|
|
96
|
+
PR description includes:
|
|
97
|
+
- Story link.
|
|
98
|
+
- AC list with the test names that cover them.
|
|
99
|
+
- Screenshots / recordings of happy + failure paths.
|
|
100
|
+
- TEA expected next: design → trace → review → gate.
|
|
101
|
+
|
|
102
|
+
### 10. Address gate findings
|
|
103
|
+
|
|
104
|
+
If `tea-review` flags issues, fix them in the same PR or open a follow-up if the story has shipped a separate value-bearing slice.
|
|
105
|
+
|
|
106
|
+
## Security + perf during implementation
|
|
107
|
+
|
|
108
|
+
Shuri thinks both at write time, not at review time:
|
|
109
|
+
|
|
110
|
+
- Auth context on every server entry point — confirm via Tony's middleware pattern.
|
|
111
|
+
- Tokens never logged.
|
|
112
|
+
- Inputs validated at the boundary; trusted by the time they reach domain.
|
|
113
|
+
- Network calls in handlers wrapped with timeout + retry policy from architecture.
|
|
114
|
+
- Don't `await` in a loop without batching.
|
|
115
|
+
- Don't ship dead code (`isFooEnabled = true` always).
|
|
31
116
|
|
|
32
117
|
## Quick-dev exception
|
|
33
|
-
|
|
118
|
+
|
|
119
|
+
If the work is small / well-scoped and Wizer invoked `wize-quick-dev` instead of this workflow, the design step is replaced by smoke-test-only commitment and the gate is a single one-line entry in `quick-dev-log.md`.
|
|
120
|
+
|
|
121
|
+
## Anti-patterns Shuri rejects in her own work
|
|
122
|
+
|
|
123
|
+
- Writing code first and tests "after the bug fix" — that's not TDD; that's regression-tests.
|
|
124
|
+
- Commits that don't cite an AC.
|
|
125
|
+
- "Refactor while green" turning into "rewrite while green."
|
|
126
|
+
- Bundling cross-cutting refactors into the story PR. Split.
|
|
127
|
+
- Editing tests so they pass instead of editing code so tests pass.
|
|
128
|
+
|
|
129
|
+
## Hand-off
|
|
130
|
+
|
|
131
|
+
> Story E01-S03 implemented. All ACs covered by tests; CI green. PR opened (#412). Hawkeye, ready for trace + review. Notes section of the story has the testid map you'll use.
|