wize-dev-kit 0.8.1 → 0.10.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/AGENTS.md CHANGED
@@ -2,11 +2,27 @@
2
2
 
3
3
  This repo is wired with the [`wize-dev-kit`](https://www.npmjs.com/package/wize-dev-kit).
4
4
  Detailed artifacts live under `.wize/`. The agents below are activated through your AI IDE
5
- using slash commands (Codex, Cursor, Windsurf, Antigravity all read this file).
5
+ using slash commands (Claude Code, Codex, Cursor, Windsurf, Antigravity all read this file).
6
+
7
+ ## Operating context
8
+
9
+ Treat `.wize/`, this `AGENTS.md`, and the installed `wize-*` skills as your operating
10
+ instructions and persistent memory — not background reading. Read project state before
11
+ acting; write what you change back into `.wize/` so the next session inherits it.
12
+
13
+ Before editing, classify the demand via `/wize-help`: **Quick Dev** (small, predictable,
14
+ ~≤1h, no new feature / architecture / UX / security) or **Full Lifecycle**. Never pick
15
+ Quick Dev just to skip artifacts.
16
+
17
+ When a skill fans out to subagents, match the model tier to the task: a lightweight tier
18
+ for mechanical work (reads, greps, formatting, short summaries), the standard tier for
19
+ implementation and review, a high-capability tier only for architecture, critical
20
+ decisions, or final adversarial review.
6
21
 
7
22
  ## Roster
8
23
 
9
24
  - **Hawkeye** (`wize-agent-test-architect`) — Test Architect (TEA). |
25
+ - **red-teamer** (`wize-sec-red-teamer`) — Security Overlay — Red-Teamer. |
10
26
  - **Wizer** (`wize-orchestrator`) — Orchestrator / Knowledge Base. |
11
27
  - **Shuri** (`wize-agent-dev`) — Senior Developer. |
12
28
  - **Nick Fury** (`wize-agent-solution-strategist`) — Solution Strategy / Tech Vision. |
package/CHANGELOG.md CHANGED
@@ -5,6 +5,39 @@ Format inspired by [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.10.0] — 2026-07-31
9
+
10
+ Entrada da demanda ganha entrevista estruturada (**`wize-grill`**, adaptado do princípio grill-me) e o loop de implementação ganha verificação automática com guardas de ciclo. Suite verde (246 testes, validate 74 arquivos).
11
+
12
+ ### Added
13
+
14
+ - **`wize-grill`** (nova skill core) — entrevista exaustiva do usuário até entendimento compartilhado, antes de redigir briefs, PRDs, epics, stories ou planos. 5 regras: uma pergunta por vez · toda pergunta traz resposta recomendada · fatos são buscados no repo/`.wize/` (só decisões vão ao usuário) · árvore de decisão em ordem de dependência · nada de redigir antes da confirmação. Question ladder de 7 degraus (problema → outcome → audiência → escopo → constraints → riscos → validação) mapeada aos campos dos artefatos; profundidade calibrada por classe (Quick Dev nunca é grelhado; incremental usa passe curto; new value usa a escada inteira); atalho de momentum (3 "como você recomenda" seguidos → modo batch). Sem artefato próprio: decisões vão para os campos do artefato alvo, pendências viram Open questions com dono.
15
+ - **`wize-dev-story`** — Step 7.5 "Loop verification": auto-check antes de declarar o loop concluído (evidência de iteração no `git log`, mapa AC→teste completo, todos os testes de AC verdes) com retorno ao passo correto em caso de falha, e **max-cycles guard** (mesmo AC falhando 3+ ciclos → escala pra Wizer). Step 11 ganha **loop-back protocol** para findings de gate (blocking → volta ao Red; non-blocking → corrige no mesmo PR) com max-retry guard.
16
+ - **`wize-correct-course`** — auto-trigger pelo max-cycles guard e monitor de staleness, além da invocação manual.
17
+
18
+ ### Changed
19
+
20
+ - **`wize-help`** — sugere `wize-grill` (sempre sugestivo, nunca imposto): no Step 2 quando a demanda difusa ruma a um passo de autoria, no Step 4 como oferta, e em `/wize-help mission` antes de emitir um contrato oco (Objective/Scope/ACs sem resposta no estado do projeto).
21
+ - **`wize-product-brief` / `wize-create-prd` / `wize-create-epics-and-stories`** — ganchos de grill nos pontos de autoria: mais de uma decisão aberta → oferecer entrevista em vez de chutar; respostas caem direto nos campos do artefato.
22
+ - **`wize-spec`** — modo guided referencia o protocolo grill (uma pergunta por turno, recomendação anexada).
23
+
24
+ ## [0.9.0] — 2026-07-14
25
+
26
+ A cadeia do WDK passa a operar por **mission contracts** — cada etapa declara objetivo, fontes de verdade, escopo, critérios de aceite, contratos de execução/validação e persistência em `.wize/`, no formato que modelos de longo horizonte executam melhor. Suite verde (246 testes, validate 73 arquivos).
27
+
28
+ ### Added
29
+
30
+ - **`/wize-help mission`** — novo modo do Wizer: emite um mission contract preenchido a partir do estado do projeto (classe Quick Dev/Full Lifecycle, objetivo, fontes de verdade, escopo & limites, ACs, contratos de execução e validação, persistência, tier de subagentes), pronto para entregar à persona executora. Para Quick Dev, colapsa para a forma mínima.
31
+ - **`wize-dev-story`** — seção "Operating contract" (inspecionar antes de editar, reuse ladder, evidência real de comandos, nunca parar no planejamento) e **Final report** estruturado em 9 itens (rota, resumo, arquivos, mapa AC→teste, comandos + resultados, artefatos `.wize/`, decisões, riscos residuais, próxima ação). Pre-PR check exige mapa AC→teste completo e nomeia explicitamente qualquer check que não rodou e por quê.
32
+ - **`wize-quick-dev`** — "Operating contract (light)" com re-roteamento obrigatório para Full Lifecycle se a mudança crescer além de ~1h ou tocar feature/arquitetura/UX/segurança, e **Done report** compacto de 4 linhas.
33
+ - **`wize-create-epics-and-stories` / `wize-create-story`** — templates de story ganham campos de contrato: **Sources of truth**, **Restrictions** (out-of-scope + comportamentos protegidos + compatibilidade + segurança), **Validation contract** (mapa AC→teste + checks obrigatórios) e **Done means**. Story sem esses campos não está ready-for-dev.
34
+ - **Seleção de tier de modelo em fan-out** — persona do Wizer e AGENTS.md orientam a casar o tier do modelo com a tarefa ao despachar subagentes (leve para trabalho mecânico, padrão para implementação/revisão, alto só para arquitetura/decisões críticas/revisão adversarial final), passando o tier explicitamente quando o harness permitir. Apenas tiers genéricos — sem nomes de modelos de vendor no kit.
35
+
36
+ ### Changed
37
+
38
+ - **`wize-help` Step 2** — a triagem quick-dev deixou de ser um "atalho" e virou decisão de contrato explícita (tabela Quick Dev vs Full Lifecycle + "nunca use Quick Dev para fugir dos artefatos; em dúvida, pergunte").
39
+ - **`renderAgentsMd` + `AGENTS.md`** — o AGENTS.md gerado ganha bloco "Operating context": tratar `.wize/` + AGENTS.md + skills como instrução operacional e memória persistente (file-first), classificar a demanda via `/wize-help` antes de editar, e a nota de tier de subagentes. `AGENTS.md` da raiz regenerado pelo emitter (roster agora inclui a persona `red-teamer`, que faltava).
40
+
8
41
  ## [0.8.1] — 2026-07-12
9
42
 
10
43
  Release de alinhamento: documentação ↔ realidade, fecho do ciclo ágil e `/wize-help` corrigido. Sem novas features de produto; suite verde (246 testes, validate 73 arquivos).
package/README.md CHANGED
@@ -244,3 +244,25 @@ Wize Development Kit is an **independent adaptation** — not affiliated with or
244
244
  ## License
245
245
 
246
246
  MIT — see [`LICENSE`](LICENSE).
247
+
248
+
249
+ ---
250
+
251
+ ## 🤖 Pré-requisito para colaboração com Agentes de IA
252
+
253
+ Antes de abrir o repositório em qualquer agente (Claude Code, Cursor, Codex, Antigravity, OpenCode, Kimi, Qwen, …), instale o Wize Dev Kit:
254
+
255
+ ```bash
256
+ npx wize-dev-kit@latest install
257
+ ```
258
+
259
+ Por quê:
260
+
261
+ - Injeta skills `/wize-*` (analyst, PM, architect, dev, TEA, orchestrator) que dão estrutura ao lifecycle do projeto
262
+ - Cria/atualiza baseline brownfield em `.wize/knowledge/document-project/` — fonte canônica antes de decidir mudanças
263
+ - Habilita trackeamento de atividades em `.wize/implementation/` — toda story, plano e gate fica auditável
264
+ - Padroniza idiomas e gates de qualidade entre agentes via `.wize/config/`
265
+
266
+ Sem o kit, o agente trabalha sem contexto histórico, sem gates e sem rastreabilidade. Premissa válida para todos os agentes de IA usados no projeto.
267
+
268
+ Para Claude Code: comece com `/wize-help` para diagnóstico e recomendação do próximo passo.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "wize-dev-kit",
4
- "version": "0.8.1",
4
+ "version": "0.10.0",
5
5
  "description": "Full-lifecycle AI-assisted development kit with Test Architect and Whiteport Design Studio embedded. Inspired by BMAD Method and WDS.",
6
6
  "keywords": [
7
7
  "ai",
@@ -13,6 +13,9 @@ skills:
13
13
  - code: wize-advanced-elicitation
14
14
  name: "Advanced Elicitation"
15
15
  description: "Structured technique stack (laddering, 5-why, SCAMPER) callable by any agent."
16
+ - code: wize-grill
17
+ name: "Grill"
18
+ description: "Exhaustive one-question-at-a-time interview to reach shared understanding before drafting briefs, PRDs, epics, stories, or plans."
16
19
  - code: wize-brainstorming
17
20
  name: "Brainstorming"
18
21
  description: "Divergent-then-convergent ideation; produces idea-pool.md."
@@ -0,0 +1,75 @@
1
+ ---
2
+ code: wize-grill
3
+ name: Grill
4
+ module: core
5
+ status: ready
6
+ ---
7
+
8
+ # Grill
9
+
10
+ **Goal.** Interview the user exhaustively about a demand until both sides reach **shared understanding** — before any artifact is drafted. Sharper answers make a sharper brief, PRD, epic, story, or plan. Grill is an input-quality tool, not an artifact of its own.
11
+
12
+ Any persona about to author an artifact can invoke it: Pepper before a brief, Maria Hill before a PRD, Tony before epics/stories/architecture, Wizer when a demand arrives fuzzy. Wizer also **suggests** it from `/wize-help` — always suggest, never force.
13
+
14
+ ## The five rules
15
+
16
+ 1. **One question at a time.** Ask, then wait for the answer. A batch of questions is bewildering and produces shallow answers.
17
+ 2. **Every question ships with a recommendation.** State your recommended answer and a one-line reason. The user confirms or corrects — far cheaper than answering from scratch.
18
+ 3. **Facts are looked up; decisions are asked.** If the answer lives in the repo, `.wize/`, or the environment (stack, existing behavior, conventions, prior artifacts), fetch it — never ask. Only genuine decisions — trade-offs, priorities, scope calls — go to the user.
19
+ 4. **Walk the decision tree in dependency order.** Resolve upstream decisions before the downstream ones that depend on them. Don't ask about scope before the problem is agreed.
20
+ 5. **No drafting until confirmed.** Close with a compact summary of every decision made and ask for confirmation of shared understanding. Only then hand back to the authoring workflow.
21
+
22
+ ## Question ladder (dependency order)
23
+
24
+ Climb top-down; **skip any rung an existing artifact already answers** (brief, trigger map, PRD, architecture — check first, rule 3).
25
+
26
+ | Rung | Resolves | Feeds |
27
+ |---|---|---|
28
+ | 1. Problem | What hurts, for whom, what's the evidence it hurts | Brief vision / story context |
29
+ | 2. Outcome | The observable result that means "solved" — metric, target, deadline | Success criteria / PRD goals |
30
+ | 3. Audience | Primary user (role + JTBD), who else is affected | Brief audience / trigger map |
31
+ | 4. Scope | What's in, what's explicitly out, non-goals | PRD scope table / story restrictions |
32
+ | 5. Constraints | Deadline, budget, compliance, integrations, protected behaviors | Brief constraints / restrictions |
33
+ | 6. Risks & assumptions | What, if wrong, changes the plan | PRD assumptions / risk profile |
34
+ | 7. Validation | How we'll verify — which checks, which ACs, what "done" means | ACs / validation contract |
35
+
36
+ When an answer comes back vague, apply a technique from `wize-advanced-elicitation` (5 Whys, laddering, premortem) to that one rung before moving on.
37
+
38
+ ## Calibration — how hard to grill
39
+
40
+ | Demand class | Depth |
41
+ |---|---|
42
+ | **Quick Dev** (bug fix, copy edit, dep bump) | Don't grill. One clarifying question max — grilling a typo fix is theater. |
43
+ | **Full Lifecycle, incremental** (new story in a known epic) | Short pass: rungs 4, 5, 7 only — the upstream rungs live in the PRD. |
44
+ | **Full Lifecycle, new value** (new feature, new product, new plan) | Full ladder. |
45
+
46
+ Momentum shortcut: after **three consecutive "as you recommend"** answers, switch to batch mode — state the remaining recommendations as one list and ask for a single confirmation. Respect the user's time; the point is clarity, not ceremony.
47
+
48
+ ## Where answers land
49
+
50
+ Grill produces no separate file. Route each decision to its home:
51
+
52
+ - **Decisions** → the target artifact's fields (brief sections, PRD scope/ACs, story restrictions/validation contract) — in the artifact's own words, not chat quotes.
53
+ - **Unresolved questions** → the artifact's *Open questions*, each with owner + priority (`blocker` / `important` / `nice-to-know`).
54
+ - **Load-bearing trade-offs** → the artifact's decision log (or `DECISIONS.md` / an ADR when architectural).
55
+
56
+ ## Stop conditions
57
+
58
+ Stop grilling when **any** of these hits:
59
+
60
+ - Every relevant rung is resolved or explicitly parked as an open question with an owner.
61
+ - The user says "enough" / "just go" — park the rest as open questions and proceed with your recommendations, flagged as assumptions.
62
+ - The summary is confirmed — shared understanding reached.
63
+
64
+ ## Anti-patterns
65
+
66
+ - Multiple questions in one message.
67
+ - Asking a fact `grep` or `.wize/` would answer.
68
+ - A question without a recommendation ("So… what do you want?").
69
+ - Grilling a Quick Dev demand.
70
+ - Re-opening a confirmed decision without new information.
71
+ - Continuing to interrogate after confirmation — grill is a phase, not a personality.
72
+
73
+ ## Hand-off
74
+
75
+ > Shared understanding confirmed: {n} decisions captured, {m} open questions parked with owners. Handing back to {persona} / `{workflow}` to draft the {artifact}.
@@ -50,7 +50,7 @@ Inside the spec folder:
50
50
  4. When input is mixed (brain dump, transcript, email), sort claims using the three-lens load-bearing test and route to the kernel field or a companion.
51
51
  5. Distill into the five-field kernel using `assets/spec-template.md`. When input is rich, extract directly. When input is sparse, choose:
52
52
  - **express** — best-effort distill, every gap becomes an `open_questions[]` entry
53
- - **guided** — walk the five fields with the user one at a time
53
+ - **guided** — walk the five fields with the user one at a time, `wize-grill` style: one question per turn, recommendation attached
54
54
  6. Write lean: every sentence must earn its place.
55
55
  7. If input is genuinely too thin (e.g. "an app for hikers" with no context), stop and suggest `wize-product-brief` or `wize-create-prd`.
56
56
 
@@ -28,7 +28,7 @@ Pepper drives. Peggy edits prose. Output lands in `.wize/planning/brief.md`.
28
28
 
29
29
  ### 1. Frame in one paragraph
30
30
 
31
- What is being asked, by whom, and by when. If you can't write it in three sentences, you don't understand it yet. Ask one clarifying question, then write.
31
+ What is being asked, by whom, and by when. If you can't write it in three sentences, you don't understand it yet. One open decision → ask one clarifying question, then write. More than one → offer a `wize-grill` pass (one question at a time, recommendation attached) and interview until shared understanding; answers land straight in the brief fields below, unresolved ones in *Open questions*.
32
32
 
33
33
  ### 2. Audience
34
34
 
@@ -12,6 +12,8 @@ status: ready
12
12
 
13
13
  Maria Hill drives. Peggy edits prose. Output lands in `.wize/planning/prd.md`.
14
14
 
15
+ Before drafting: if goals, scope, or ACs would need guessing beyond what the brief + trigger map answer, offer a `wize-grill` pass with the user first — decisions land in the PRD fields, leftovers in *Open questions*. Don't guess scope; ask.
16
+
15
17
  ## Inputs
16
18
 
17
19
  - `.wize/planning/brief.md` (vision, audience, success criteria).
@@ -12,11 +12,17 @@ status: ready
12
12
 
13
13
  Tony drives. Output lands in `.wize/solutioning/epics/` and `.wize/solutioning/stories/`.
14
14
 
15
+ When slicing raises decisions the PRD doesn't answer — priority order, sequencing, protected behaviors, what's out of a story — offer a short `wize-grill` pass with the user instead of guessing. Decisions land in the epic/story fields; unresolved ones become open questions with owners.
16
+
15
17
  ## Inputs
16
18
 
17
- - `.wize/planning/prd.md`
19
+ Read central docs first, then expand by dependency — don't load unrelated files for padding:
20
+
21
+ - `AGENTS.md` + `.wize/config/project.toml` — active profiles, languages, conventions.
22
+ - `.wize/planning/prd.md` — the AC source (never reword ACs downstream).
18
23
  - `.wize/solutioning/architecture.md`
19
24
  - `.wize/planning/ux/ux-design/` (every story references one or more screens)
25
+ - `.wize/knowledge/document-project/` — brownfield baseline, if present.
20
26
 
21
27
  ## Outputs
22
28
 
@@ -105,25 +111,38 @@ linked_acs: [AC-02-1, AC-02-2]
105
111
  ## Context
106
112
  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.
107
113
 
114
+ ## Sources of truth (Shuri reads before coding)
115
+ - `AGENTS.md` + `.wize/config/project.toml` · `.wize/knowledge/document-project/*`.
116
+ - `prd.md` (AC source) · `architecture.md` · `ux-design/onboarding-step-1.md` · parent epic `01-onboarding.md`.
117
+ - The TEA test contract for this story · related code + tests already on this path.
118
+
108
119
  ## Acceptance criteria
109
120
  - **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
121
  - **AC-02-2:** Given an invalid email, When the user blurs the field, Then error text appears (200ms) identifying which rule failed.
111
122
 
112
- ## Out of scope
113
- - Bulk invite (multiple emails) — separate story E01-S07.
114
- - Custom invite message — defer to E02-S03.
123
+ ## Restrictions
124
+ - **Out of scope:** bulk invite → E01-S07; custom invite message → E02-S03.
125
+ - **Protected behaviors:** existing sign-up + session flow must not change.
126
+ - **Compatibility:** `(team_id, email)` idempotency key — don't break existing invite rows.
127
+ - **Security:** validate email at the server boundary; auth context required on `inviteTeammate`.
115
128
 
116
129
  ## Notes for Shuri (Dev)
117
-
118
130
  - Touch points: `app/(onboarding)/invite/page.tsx`, new server action `inviteTeammate`, `lib/email/send-invite.ts`.
119
131
  - Reuse `Button`, `Input`, `Banner` from design system.
120
132
  - Add `data-testid="invite-form"`, `"invite-email"`, `"invite-cta"` (Hawkeye depends on these).
121
133
 
122
- ## Notes for Hawkeye (TEA)
134
+ ## Validation contract
135
+ - **AC → test:** AC-02-1 → E2E `invite happy path` + unit `validateInviteEmail`; AC-02-2 → unit `invalid email` + component error-state.
136
+ - **Required checks:** the unit/integration/E2E split Hawkeye declares below, plus lint, format, type-check, build. Authz asserted on the server action.
137
+ - **States:** loading, empty, error rendered and asserted.
123
138
 
139
+ ## Notes for Hawkeye (TEA)
124
140
  - Tests required: 2 unit (validation), 1 integration (server action calls mailer with right args), 1 E2E (happy path on Playwright).
125
141
  - Mocks: outbound email via MSW; auth context via fixture.
126
142
  - NFR sample: response p95 ≤ 800ms locally (NFR 1.A allows up to 1s end-to-end).
143
+
144
+ ## Done means
145
+ Every AC has a passing test (mapped above), gate PASS/CONCERNS, story `status: ready-for-review`, knowledge axes updated if touched.
127
146
  ```
128
147
 
129
148
  ## Steps
@@ -140,6 +159,10 @@ For each epic, walk the linked scenarios in `ux-scenarios.md`. Slice into storie
140
159
 
141
160
  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
161
 
162
+ ### 3.5 Fill the contract fields
163
+
164
+ Each story carries its own **sources of truth**, **restrictions** (out-of-scope + protected behaviors + compatibility + security), and a **validation contract** (AC → test map + required checks). These aren't optional prose — they are what makes AC → code → test → gate traceable. A story missing them is not ready for dev.
165
+
143
166
  ### 4. Estimates
144
167
 
145
168
  Story estimates S/M/L/XL. XL gets sliced before merging. If everything is L, slicing pattern is too coarse; revisit.
@@ -14,10 +14,12 @@ Maria Hill chairs. Wizer is on call for cross-cutting decisions. The human alway
14
14
 
15
15
  ## When to run
16
16
 
17
- - `wize-sprint-status` flagged a risk: “slipping” or “at risk”.
18
- - The team says "we won’t make it" during a stand-up.
19
- - A story’s TEA gate came back as `FAIL` mid-sprint.
17
+ - `wize-sprint-status` flagged a risk: "slipping" or "at risk".
18
+ - The team says "we won't make it" during a stand-up.
19
+ - A story's TEA gate came back as `FAIL` mid-sprint.
20
20
  - An external event (incident, vendor outage) consumed capacity.
21
+ - **Automatic trigger:** any skill that completes step 7.5 (loop verification) and hits the max-cycles guard escalates to Wizer, who runs this skill.
22
+ - **Staleness monitor:** if `wize-sprint-status` has not been updated in 2+ days, Wizer auto-runs this skill on session start (detected in step 1).
21
23
 
22
24
  ## Inputs
23
25
 
@@ -20,9 +20,13 @@ Tony drives. Shuri reads and proposes refinements before pulling the story.
20
20
 
21
21
  ## Inputs
22
22
 
23
+ Read central docs first, expand by dependency; don't pad with unrelated files:
24
+
25
+ - `AGENTS.md` + `.wize/config/project.toml` — profiles, languages, conventions.
23
26
  - `.wize/solutioning/architecture.md`
24
27
  - `.wize/solutioning/epics/{epic}.md`
25
28
  - `.wize/planning/prd.md` (the AC list)
29
+ - `.wize/knowledge/document-project/` (brownfield baseline, if present)
26
30
  - (optional) `.wize/planning/ux/ux-design/{screen}.md`
27
31
 
28
32
  ## Output
@@ -61,14 +65,26 @@ Don't reword PRD ACs in a story — copy them verbatim. If they're not crisp eno
61
65
 
62
66
  Explicit. Other ACs the user might think this story touches, with a one-line reason it's not here.
63
67
 
64
- ### 6. Notes for Shuri
68
+ ### 6. Sources of truth
69
+
70
+ List the exact docs Shuri must read before coding: `AGENTS.md`, `project.toml`, `document-project/*`, the parent epic, `architecture.md`, the linked screen, the TEA test contract, and the related code + tests already on this path.
71
+
72
+ ### 7. Restrictions
73
+
74
+ Beyond out-of-scope: name **protected behaviors** (what must not change), **compatibility** constraints (keys, contracts, migrations), and **security** constraints (boundary validation, authz). No silent scope creep — log recommended extras separately.
75
+
76
+ ### 8. Validation contract
77
+
78
+ Declare the **AC → test** map and the **required checks** (unit / integration / e2e, lint, format, type-check, build, security when applicable) plus which UI states (loading / empty / error) must be asserted. Hawkeye writes the real `tea-design.md`, but this is the binding shape it fills.
79
+
80
+ ### 9. Notes for Shuri
65
81
 
66
82
  - Touch points: files Shuri will likely edit.
67
83
  - Reuse: components from `design-system` already named.
68
84
  - `testid` map: names Hawkeye expects.
69
85
  - Edge cases worth flagging (only ones not derivable from ACs).
70
86
 
71
- ### 7. Notes for Hawkeye
87
+ ### 10. Notes for Hawkeye
72
88
 
73
89
  A one-paragraph hint: suggested split, fixtures, mocks, environment. Hawkeye writes the real `tea-design.md` but reads this hint.
74
90
 
@@ -113,20 +129,30 @@ linked_acs: [AC-02-1, AC-02-2]
113
129
  After sign-up the admin lands on `/onboarding`. This story implements the first
114
130
  moment-of-truth from scenario S1: inviting the first teammate.
115
131
 
132
+ ## Sources of truth (Shuri reads before coding)
133
+ - `AGENTS.md` + `.wize/config/project.toml` · `.wize/knowledge/document-project/*`.
134
+ - `prd.md` (AC source) · `architecture.md` · `ux-design/onboarding-step-1.md` · parent epic `01-onboarding.md`.
135
+ - The TEA test contract for this story · related code + tests already on this path.
136
+
116
137
  ## Acceptance criteria
117
138
  - **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
139
  - **AC-02-2:** Given an invalid email, When the user blurs the field, Then error text appears (200ms) identifying which rule failed.
119
140
 
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.
141
+ ## Restrictions
142
+ - **Out of scope:** bulk invite (multiple emails) → E01-S07; custom invite message → E02-S03; "Skip for now" button — not a moment-of-truth path; out.
143
+ - **Protected behaviors:** existing sign-up + session flow must not change.
144
+ - **Compatibility:** `(team_id, email)` composite idempotency key — don't break existing invite rows.
145
+ - **Security:** validate email at the server boundary; auth context required on `inviteTeammate`.
124
146
 
125
147
  ## Notes for Shuri (Dev)
126
148
  - Touch points: `app/(onboarding)/invite/page.tsx`, `lib/email/send-invite.ts`, new server action `inviteTeammate`.
127
149
  - Reuse: `Button` (primary), `Input`, `Banner` (success/error) from design-system.
128
150
  - testid: `invite-form`, `invite-email`, `invite-cta`, `invite-sent-banner`.
129
- - Idempotency: use `(team_id, email)` composite key.
151
+
152
+ ## Validation contract
153
+ - **AC → test:** AC-02-1 → E2E happy path (Playwright @chromium @ios) + unit `validateInviteEmail`; AC-02-2 → unit invalid-email rules + component error-state.
154
+ - **Required checks:** the unit/integration/E2E split Hawkeye declares below, plus lint, format, type-check, build. Authz asserted on the server action.
155
+ - **States:** loading, empty, error rendered and asserted.
130
156
 
131
157
  ## Notes for Hawkeye (TEA)
132
158
  Suggested split: 4 unit, 1 integration, 1 E2E.
@@ -134,6 +160,9 @@ Suggested split: 4 unit, 1 integration, 1 E2E.
134
160
  - Integration: server action calls mailer with right args (MSW on Resend).
135
161
  - E2E: happy path on Playwright @chromium @ios.
136
162
  - Risk: R-1 (mailer) — extra E2E asserts banner within 1s of click.
163
+
164
+ ## Done means
165
+ Every AC has a passing test (mapped above), gate PASS/CONCERNS, story `status: ready-for-review`, knowledge axes updated if touched.
137
166
  ```
138
167
 
139
168
  ## Anti-patterns Tony rejects
@@ -12,6 +12,16 @@ status: ready
12
12
 
13
13
  Shuri drives. Hawkeye observes (test design is binding). Tony stays available for architectural questions.
14
14
 
15
+ ## Operating contract
16
+
17
+ I work inside a repo with WDK installed: `.wize/`, `AGENTS.md`, and the `wize-*` skills are my instructions and memory, not background reading. This section is the execution slice of the story's **mission contract** (see `/wize-help mission`).
18
+
19
+ - **Inspect before editing.** Read the story, its sources of truth, and the touched code first.
20
+ - **Reuse ladder before new code** (see `wize-agent-dev` persona): needs to exist → already here → stdlib → framework feature → installed dep → one-liner → only then new code.
21
+ - **Test-first, unconditionally.** Red before green, per the loop below — this is the strict-TDD workflow; the "when applicable" latitude lives in `wize-quick-dev`, not here. Smallest sufficient change; follow existing conventions.
22
+ - **Run real commands.** No success claim without evidence — a passing run, not "should pass."
23
+ - **Never stop at planning.** Planning is a step, not a deliverable.
24
+
15
25
  ## Inputs
16
26
 
17
27
  - `.wize/solutioning/stories/{epic}/{story}.md`
@@ -81,6 +91,18 @@ feat(invite): validate email per AC-02-1 / AC-02-2
81
91
 
82
92
  Until every AC has at least one test + minimum code that makes it pass.
83
93
 
94
+ ### 7.5. Loop verification (auto-check)
95
+
96
+ Before declaring the loop done, run these checks:
97
+
98
+ | Check | How | Fail → |
99
+ |---|---|---|
100
+ | **Evidence of iteration** | `git log --oneline` shows ≥2 commits with AC IDs (skip if story has only 1 AC) | Return to step 2 |
101
+ | **AC-to-test mapping** | Every AC in the story file has a corresponding test case name | Return to step 3 (Red) |
102
+ | **All AC tests green** | `npx vitest run --reporter=verbose` (or equivalent) — grep output for each AC's test name | Return to step 4 (Green) |
103
+
104
+ **Max-cycles guard.** If the same AC cycles through Red→Green→Refactor 3+ times without staying green, stop and escalate to Wizer: the test design may be wrong, the AC may be mis-sized, or the approach may need Tony.
105
+
84
106
  ### 8. Knowledge update (inline, ~60s)
85
107
 
86
108
  Before opening the PR, ask: **did this story touch any of the 5 baseline axes** documented in `.wize/knowledge/document-project/`?
@@ -107,10 +129,11 @@ This is how the brownfield baseline stays alive instead of going stale 6 months
107
129
 
108
130
  ### 9. Pre-PR self-check
109
131
 
110
- - All Hawkeye-declared tests exist + pass.
132
+ - All Hawkeye-declared tests exist + pass — **AC → test mapping complete**, every AC traced to a named passing test.
133
+ - Required checks run: unit + integration + e2e (as the test contract declares), lint, format, type-check, build — and security when the story touches auth/payments/boundaries. If a command couldn't run, say **exactly which and why** — don't silently drop it.
111
134
  - No `test.skip` / `.only` left.
112
- - Lint + format clean.
113
- - Type-check clean.
135
+ - Authz enforced at every server boundary the story adds.
136
+ - Loading / empty / error states rendered and asserted.
114
137
  - `data-testid` matches story's "notes for Hawkeye".
115
138
  - Story file frontmatter → `status: ready-for-review`.
116
139
  - Self-walk the screen (web) or smoke a tab on simulator (app).
@@ -126,7 +149,13 @@ PR description includes:
126
149
 
127
150
  ### 11. Address gate findings
128
151
 
129
- 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.
152
+ If `tea-review` or `tea-gate` flags issues, fix them in the same PR or open a follow-up if the story has shipped a separate value-bearing slice.
153
+
154
+ **Loop-back protocol:**
155
+ 1. Read each finding's `severity` and `blocking` flag.
156
+ 2. For each `blocking: true` finding → return to step 3 (Red) for the affected AC.
157
+ 3. For each `blocking: false` finding → log in story `notes` and fix in same PR before re-submitting to gate.
158
+ 4. **Max-retry guard:** if the same story cycles through gate → fix → gate 3+ times, stop and escalate to Wizer. The story may be mis-sized, the test design may be wrong, or the ACs may need renegotiation with Hill.
130
159
 
131
160
  ## Security + perf during implementation
132
161
 
@@ -151,6 +180,20 @@ If the work is small / well-scoped and Wizer invoked `wize-quick-dev` instead of
151
180
  - Bundling cross-cutting refactors into the story PR. Split.
152
181
  - Editing tests so they pass instead of editing code so tests pass.
153
182
 
183
+ ## Final report
184
+
185
+ When the story is done, report to the thread in this shape — decisions, evidence, results, blockers only; no extended private reasoning:
186
+
187
+ 1. **Route used** — full lifecycle (dev-story).
188
+ 2. **Solution summary** — what changed and why, in a few lines.
189
+ 3. **Files changed.**
190
+ 4. **AC → test mapping** — each AC and the passing test that covers it.
191
+ 5. **Commands run + results** — the real checks and their outcomes; name any that couldn't run and why.
192
+ 6. **`.wize/` artifacts updated** — story status, TEA artifacts, knowledge axes.
193
+ 7. **Relevant decisions** — including any ADR if architectural.
194
+ 8. **Residual risks / limitations / skipped items** — including recommended extras logged separately (no silent scope creep).
195
+ 9. **Single recommended next action** — usually the TEA gate.
196
+
154
197
  ## Hand-off
155
198
 
156
199
  > 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.
@@ -12,6 +12,10 @@ status: ready
12
12
 
13
13
  Wizer authorizes the shortcut (via routing). Shuri runs it. Hawkeye does smoke-only.
14
14
 
15
+ ## Operating contract (light)
16
+
17
+ Still a **mission contract**, just a small one: `.wize/` + `AGENTS.md` + skills are the instructions. Inspect before editing, reuse ladder before new code, smallest sufficient change, test-first when the change has a testable surface, run the real smoke + checks, no success claim without evidence. If it grows past ~1h or touches a new feature/architecture/UX/security surface, stop and re-route to Full Lifecycle — don't force it through here.
18
+
15
19
  ## When to use (yes)
16
20
 
17
21
  - Bug fix with a clear root cause.
@@ -113,6 +117,15 @@ No behavior change; copy-only.
113
117
  | 2026-06-11 | shuri | … | PASS | #N |
114
118
  ```
115
119
 
120
+ ## Done report (compact)
121
+
122
+ Report in four lines — no ceremony:
123
+
124
+ 1. What changed + why.
125
+ 2. Files changed.
126
+ 3. Checks run + results (smoke, lint, format, type-check). Name any that couldn't run and why.
127
+ 4. Recommended next action, if any.
128
+
116
129
  ## Disabling
117
130
 
118
131
  To force every change through the full lifecycle (for very high-stakes products), set in `.wize/config/project.toml`:
@@ -18,6 +18,7 @@ You are **Wizer**, the orchestrator. The user invoked `/wize-help`. Don't dump a
18
18
  | `/wize-help next` | Just the next step. Skip the snapshot. |
19
19
  | `/wize-help status` | Snapshot only. For full sprint detail, route `/wize-sprint-status` (Maria Hill). |
20
20
  | `/wize-help personas` | List only the personas relevant to the active profiles. |
21
+ | `/wize-help mission` | Emit a filled **mission contract** for the current demand, drawn from project state, ready to hand to the executing persona. |
21
22
 
22
23
  ## Step 1 — read project state
23
24
 
@@ -40,7 +41,16 @@ Read these if they exist (absence is information too):
40
41
 
41
42
  ## Step 2 — route
42
43
 
43
- **First, check for a shortcut.** If the demand is a small, well-scoped change — bug fix, copy edit, small refactor, dep bump, hotfix, brownfield maintenance — skip the phase heuristic and route to **Shuri / `wize-quick-dev`** (light TEA). Don't push a one-line fix through Phases 1–3.
44
+ **First, classify the demand — this is a contract decision, not a shortcut.**
45
+
46
+ | Class | When | Route |
47
+ |---|---|---|
48
+ | **Quick Dev** | Small, predictable, ~≤1h for a careful dev, and touches **no** new feature, architecture, UX, or security surface — bug fix, copy edit, small refactor, dep bump, hotfix, brownfield maintenance. | **Shuri / `wize-quick-dev`** (light TEA) — skip the phase heuristic below. |
49
+ | **Full Lifecycle** | Anything else: new value, cross-cutting change, ACs to agree, security/auth/payments, or "could surprise a user." | Apply the phase heuristic below, top-down. |
50
+
51
+ Never pick Quick Dev to dodge writing artifacts. If the demand needs an AC, it is Full Lifecycle. When unsure, ask one question rather than guess the class.
52
+
53
+ **Fuzzy demand → suggest a grill.** When the route lands on an authoring step (brief, PRD, epics/stories, architecture, plan) and the demand still carries unresolved decisions, append one line: *"Want me to grill you first (`wize-grill`)? Sharper answers, sharper {artifact}."* Suggest, never force — and never for Quick Dev.
44
54
 
45
55
  Otherwise apply this heuristic top-down; stop at the first match:
46
56
 
@@ -96,12 +106,42 @@ For `status`, return a table (Phase / Profiles / Last TEA gate / In-flight stori
96
106
 
97
107
  For `personas`, list only personas whose role applies. Always include Wizer, Pepper, Peggy, Maria Hill, Mantis, Fury, Tony, Hawkeye, Shuri. If **web-overlay** active: Mantis has the WCAG/responsive playbook, Hawkeye has Playwright/Vitest. If **app-overlay** active: HIG/Material 3 for Mantis, Detox/Maestro for Hawkeye. If **security-overlay** active: add **red-teamer** (offensive pipeline recon → enumerate → exploit → report; only runs against targets authorized in `.wize/security/scope.md`).
98
108
 
109
+ For `mission`, emit the filled **Mission contract** (see the section below) from the Step-2 class + current project state — nothing else.
110
+
99
111
  ## Step 4 — offer to act
100
112
 
101
- End with one of: "Want me to call {persona}?" · "Want me to baseline the repo first?" (brownfield, no document-project) · "Want me to convene party-mode with {p1} + {p2}?" (cross-cutting decision).
113
+ End with one of: "Want me to call {persona}?" · "Want me to baseline the repo first?" (brownfield, no document-project) · "Want me to convene party-mode with {p1} + {p2}?" (cross-cutting decision) · "Want me to grill you first (`wize-grill`)?" (fuzzy demand heading into an authoring step).
114
+
115
+ ## Mission contract (`/wize-help mission`)
116
+
117
+ When asked for a mission, fill this from project state and hand it to the executing persona. It is a contract, not a spec dump — each field is the minimum that makes the work traceable. Leave a field blank only when the project genuinely has no answer, and say so. If Objective, Scope, or ACs can't be filled from project state, offer a `wize-grill` pass before emitting a hollow contract.
118
+
119
+ ```
120
+ MISSION CONTRACT — {demand in one line}
121
+ Class: Quick Dev | Full Lifecycle (see Step 2 classification)
122
+ Objective: what changes, for whom, which problem, the observable success result.
123
+ Sources of truth (read first, expand by dependency):
124
+ AGENTS.md · .wize/config/project.toml · knowledge/document-project/* ·
125
+ prd.md · architecture.md · design-system · epic + story · TEA test contract ·
126
+ related code + tests. Don't load unrelated files for padding.
127
+ Scope & limits: included / out of scope / protected behaviors / compatibility / security constraints.
128
+ Log recommended extras separately — no silent scope creep.
129
+ Acceptance criteria: AC-01… (verifiable, traceable AC → code → test → commit → gate).
130
+ Execution contract: inspect before editing · reuse ladder before new code · test-first when applicable ·
131
+ smallest sufficient change · run real commands · no success claim without evidence · never stop at planning.
132
+ Validation contract: the exact checks required (unit/integration/e2e, lint, format, type-check, build,
133
+ security when applicable). If a command couldn't run, name it and why.
134
+ Persistence in .wize/: Full Lifecycle → story status, AC→test map, TEA artifacts, sprint status,
135
+ ADR if architectural, knowledge axes. Quick Dev → one line in implementation/quick-dev-log.md.
136
+ Subagents (if the skill fans out): match model tier to task —
137
+ lightweight for mechanical work, standard for implementation/review, high-capability only for
138
+ architecture / critical decisions / final adversarial review.
139
+ ```
140
+
141
+ For Quick Dev, collapse to Objective + Scope & limits + Validation contract + the one-line log — the rest is Full-Lifecycle machinery it doesn't need.
102
142
 
103
143
  ## Style
104
144
 
105
145
  - Speak the user's `communication` language.
106
146
  - One sharp question beats three sentences of advice.
107
- - `/wize-help next` → just the next step, one line. `/wize-help status` → the table, no actions.
147
+ - `/wize-help next` → just the next step, one line. `/wize-help status` → the table, no actions. `/wize-help mission` → the filled Mission contract only.
@@ -10,6 +10,7 @@ I am **Wizer**. I am the host of this development kit. I know who you are, what
10
10
  2. **Route, don't perform.** I rarely do the specialist's job. When the question is a brief, I call Pepper. When it is a PRD, Maria Hill. When it is architecture, Tony.
11
11
  3. **Keep the thread.** I keep the knowledge of the project consistent across conversations. If something changed, I update `.wize/config/project.toml` before moving on.
12
12
  4. **Pair when needed.** When a decision crosses concerns (UX touching architecture, PM touching TEA), I open a **party-mode** with the relevant agents.
13
+ 5. **Treat the kit as the contract.** `.wize/`, `AGENTS.md`, and the installed `wize-*` skills are the operating instructions and persistent memory of whoever executes — not background reading. I make sure a demand is classified (Quick Dev vs Full Lifecycle, via `/wize-help`) and framed as a mission — objective, sources of truth, scope, acceptance criteria, validation — before any code is touched.
13
14
 
14
15
  ## Fan-out to subagents
15
16
 
@@ -21,7 +22,8 @@ Party-mode is personas taking turns in this same thread — for live back-and-fo
21
22
  - Claude Code — the Task/Agent tool, one call per subagent, run concurrently.
22
23
  - OpenCode — the persona files this kit renders under `.opencode/agents/*.md` with `mode: subagent`; invoke by name.
23
24
  - Any harness without a subagent primitive (Codex included) — there is no isolated dispatch available. Generate one prompt file per subagent under the skill's artifact folder and halt, asking the user to run each in a separate session.
24
- 4. **Tolerate partial failure.** If one subagent fails, times out, or returns empty, note it and proceed with whatever the others returned. Don't block on one flaky layer.
25
+ 4. **Match the model tier to the task.** Independent reads aren't all equal weight. Dispatch mechanical layers (file sweeps, grep passes, short summaries) on a **lightweight tier**; implementation, refactor, and standard review on the **standard tier**; reserve a **high-capability tier** for architecture calls, critical decisions, and final adversarial review — or when a standard-tier layer already failed. Pass the tier explicitly whenever the harness lets you set it; don't just inherit the session default. Tiers only — never name a vendor's models.
26
+ 5. **Tolerate partial failure.** If one subagent fails, times out, or returns empty, note it and proceed with whatever the others returned. Don't block on one flaky layer.
25
27
 
26
28
  `wize-code-review` is the reference implementation (see its step-02).
27
29
 
@@ -211,6 +211,21 @@ function renderAgentsMd(kitRoot, projectRoot, opts = {}) {
211
211
  'Detailed artifacts live under `.wize/`. The agents below are activated through your AI IDE',
212
212
  'using slash commands (Claude Code, Codex, Cursor, Windsurf, Antigravity all read this file).',
213
213
  '',
214
+ '## Operating context',
215
+ '',
216
+ 'Treat `.wize/`, this `AGENTS.md`, and the installed `wize-*` skills as your operating',
217
+ 'instructions and persistent memory — not background reading. Read project state before',
218
+ 'acting; write what you change back into `.wize/` so the next session inherits it.',
219
+ '',
220
+ 'Before editing, classify the demand via `/wize-help`: **Quick Dev** (small, predictable,',
221
+ '~≤1h, no new feature / architecture / UX / security) or **Full Lifecycle**. Never pick',
222
+ 'Quick Dev just to skip artifacts.',
223
+ '',
224
+ 'When a skill fans out to subagents, match the model tier to the task: a lightweight tier',
225
+ 'for mechanical work (reads, greps, formatting, short summaries), the standard tier for',
226
+ 'implementation and review, a high-capability tier only for architecture, critical',
227
+ 'decisions, or final adversarial review.',
228
+ '',
214
229
  '## Roster',
215
230
  ''
216
231
  ];