wize-dev-kit 0.3.0 → 0.4.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 +21 -0
- package/ARCH.md +40 -4
- package/CHANGELOG.md +50 -0
- package/DECISIONS.md +13 -0
- package/README.md +11 -2
- package/package.json +3 -2
- package/src/core-skills/module.yaml +4 -0
- package/src/core-skills/wize-spec/assets/headless-schemas.md +39 -0
- package/src/core-skills/wize-spec/assets/spec-template.md +40 -0
- package/src/core-skills/wize-spec/customize.toml +20 -0
- package/src/core-skills/wize-spec/skill.md +110 -0
- package/src/method-skills/1-analysis/wize-document-project/documentation-requirements.csv +12 -0
- package/src/method-skills/1-analysis/wize-document-project/templates/api-contracts-template.md +38 -0
- package/src/method-skills/1-analysis/wize-document-project/templates/architecture-template.md +54 -0
- package/src/method-skills/1-analysis/wize-document-project/templates/component-inventory-template.md +40 -0
- package/src/method-skills/1-analysis/wize-document-project/templates/contribution-guide-template.md +34 -0
- package/src/method-skills/1-analysis/wize-document-project/templates/data-models-template.md +36 -0
- package/src/method-skills/1-analysis/wize-document-project/templates/deep-dive-template.md +312 -0
- package/src/method-skills/1-analysis/wize-document-project/templates/deployment-guide-template.md +42 -0
- package/src/method-skills/1-analysis/wize-document-project/templates/development-guide-template.md +61 -0
- package/src/method-skills/1-analysis/wize-document-project/templates/index-template.md +185 -0
- package/src/method-skills/1-analysis/wize-document-project/templates/project-overview-template.md +110 -0
- package/src/method-skills/1-analysis/wize-document-project/templates/project-scan-report-schema.json +159 -0
- package/src/method-skills/1-analysis/wize-document-project/templates/source-tree-template.md +142 -0
- package/src/method-skills/1-analysis/wize-document-project/workflow.md +23 -0
- package/src/method-skills/1-analysis/wize-domain-research/customize.toml +14 -0
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-01-init.md +49 -0
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-02-domain-analysis.md +39 -0
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-03-competitive-landscape.md +39 -0
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-04-regulatory-focus.md +39 -0
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-05-technical-trends.md +39 -0
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-06-research-synthesis.md +43 -0
- package/src/method-skills/1-analysis/wize-domain-research/research.template.md +31 -0
- package/src/method-skills/1-analysis/wize-domain-research/workflow.md +51 -0
- package/src/method-skills/1-analysis/wize-market-research/customize.toml +14 -0
- package/src/method-skills/1-analysis/wize-market-research/research.template.md +31 -0
- package/src/method-skills/1-analysis/wize-market-research/steps/step-01-init.md +57 -0
- package/src/method-skills/1-analysis/wize-market-research/steps/step-02-customer-behavior.md +39 -0
- package/src/method-skills/1-analysis/wize-market-research/steps/step-03-customer-pain-points.md +37 -0
- package/src/method-skills/1-analysis/wize-market-research/steps/step-04-customer-decisions.md +39 -0
- package/src/method-skills/1-analysis/wize-market-research/steps/step-05-competitive-analysis.md +37 -0
- package/src/method-skills/1-analysis/wize-market-research/steps/step-06-research-completion.md +47 -0
- package/src/method-skills/1-analysis/wize-market-research/workflow.md +59 -0
- package/src/method-skills/1-analysis/wize-technical-research/customize.toml +14 -0
- package/src/method-skills/1-analysis/wize-technical-research/research.template.md +31 -0
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-01-init.md +49 -0
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-02-technical-overview.md +45 -0
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-03-integration-patterns.md +39 -0
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-04-architectural-patterns.md +39 -0
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-05-implementation-research.md +42 -0
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-06-research-synthesis.md +46 -0
- package/src/method-skills/1-analysis/wize-technical-research/workflow.md +53 -0
- package/src/method-skills/3-solutioning/wize-create-architecture/architecture-decision-template.md +41 -0
- package/src/method-skills/3-solutioning/wize-create-architecture/customize.toml +20 -0
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-01-init.md +95 -0
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-01b-continue.md +32 -0
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-02-context.md +126 -0
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-03-starter.md +110 -0
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-04-decisions.md +129 -0
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-05-patterns.md +109 -0
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-06-structure.md +97 -0
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-07-validation.md +124 -0
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-08-complete.md +59 -0
- package/src/method-skills/3-solutioning/wize-create-architecture/workflow.md +38 -201
- package/src/method-skills/4-implementation/wize-code-review/customize.toml +21 -0
- package/src/method-skills/4-implementation/wize-code-review/steps/step-01-gather-context.md +64 -0
- package/src/method-skills/4-implementation/wize-code-review/steps/step-02-review.md +38 -0
- package/src/method-skills/4-implementation/wize-code-review/steps/step-03-triage.md +43 -0
- package/src/method-skills/4-implementation/wize-code-review/steps/step-04-present.md +100 -0
- package/src/method-skills/4-implementation/wize-code-review/workflow.md +34 -89
- package/src/method-skills/module.yaml +19 -0
- package/src/tea-skills/wize-tea-risk/workflow.md +11 -0
- package/tools/installer/commands/doctor.js +27 -1
- package/tools/installer/commands/document-project.js +93 -0
- package/tools/installer/document-project/batch-scanner.js +93 -0
- package/tools/installer/document-project/classify.js +170 -0
- package/tools/installer/document-project/modes/deep-dive.js +196 -0
- package/tools/installer/document-project/modes/full-rescan.js +15 -0
- package/tools/installer/document-project/modes/initial-scan.js +100 -0
- package/tools/installer/document-project/modes/quick.js +211 -0
- package/tools/installer/document-project/render-index.js +101 -0
- package/tools/installer/document-project/state.js +110 -0
- package/tools/installer/wize-cli.js +46 -30
|
@@ -8,225 +8,62 @@ status: ready
|
|
|
8
8
|
|
|
9
9
|
# Create Architecture
|
|
10
10
|
|
|
11
|
-
**Goal.** Design the system inside Fury's frame
|
|
11
|
+
**Goal.** Design the system inside Fury's frame through collaborative, step-by-step discovery. Produces `.wize/solutioning/architecture.md` + `.wize/solutioning/adrs/` that multiple AI agents can implement consistently.
|
|
12
12
|
|
|
13
|
-
Tony drives.
|
|
13
|
+
Tony Stark drives. Pepper Potts and Nick Fury may be invoked via `wize-party-mode` or `wize-advanced-elicitation` at any step.
|
|
14
14
|
|
|
15
15
|
## Inputs
|
|
16
16
|
|
|
17
|
-
- `.wize/planning/prd.md` (
|
|
18
|
-
- `.wize/planning/ux/ux-design/` (
|
|
19
|
-
- `.wize/planning/tech-vision.md`
|
|
20
|
-
- `.wize/planning/nfr-principles.md`
|
|
21
|
-
- `.wize/solutioning/design-system/` (
|
|
22
|
-
- Stack catalogs
|
|
17
|
+
- `.wize/planning/prd.md` (required)
|
|
18
|
+
- `.wize/planning/ux/ux-scenarios.md` and `.wize/planning/ux/ux-design/` (when available)
|
|
19
|
+
- `.wize/planning/tech-vision.md`
|
|
20
|
+
- `.wize/planning/nfr-principles.md`
|
|
21
|
+
- `.wize/solutioning/design-system/` (when available)
|
|
22
|
+
- Stack catalogs from active overlays
|
|
23
23
|
- `.wize/knowledge/document-project/` (brownfield only)
|
|
24
24
|
|
|
25
25
|
## Outputs
|
|
26
26
|
|
|
27
27
|
- `.wize/solutioning/architecture.md`
|
|
28
|
-
- `.wize/solutioning/adrs/ADR-NNN-{slug}.md`
|
|
28
|
+
- `.wize/solutioning/adrs/ADR-NNN-{slug}.md`
|
|
29
29
|
|
|
30
|
-
##
|
|
31
|
-
|
|
32
|
-
### 1. Stack interview (Tony asks; Wizer relays)
|
|
33
|
-
|
|
34
|
-
Resolve every "TBD" the tech-vision left for Tony. Walk the stack catalog (active overlay) and decide, in order:
|
|
35
|
-
|
|
36
|
-
- Language(s) + runtime(s).
|
|
37
|
-
- Front-end framework + state lib + form lib.
|
|
38
|
-
- Back-end framework or BaaS.
|
|
39
|
-
- DB + ORM/query builder.
|
|
40
|
-
- Auth.
|
|
41
|
-
- Hosting + CI/CD.
|
|
42
|
-
- Observability stack.
|
|
43
|
-
- Test stack (links to `playwright-vitest.md` or `detox-maestro.md`).
|
|
44
|
-
|
|
45
|
-
Decisions Tony makes silently are ADR candidates; decisions Fury already fixed don't get their own ADR.
|
|
46
|
-
|
|
47
|
-
### 2. Components
|
|
48
|
-
|
|
49
|
-
List components with one-line responsibility each. Boundaries before internals. Examples (web SaaS):
|
|
50
|
-
|
|
51
|
-
| Component | Responsibility | Boundary |
|
|
52
|
-
|---|---|---|
|
|
53
|
-
| `web` | Server-rendered fullstack app (Next.js) | HTTPS to clients; SQL to db; HTTPS to auth-provider |
|
|
54
|
-
| `db` | Source of truth for users, teams, billing (Postgres) | SQL only via PgBouncer |
|
|
55
|
-
| `auth` | Identity provider (Supabase Auth) | OIDC to `web` |
|
|
56
|
-
| `mailer` | Outbound transactional email | HTTPS to Resend |
|
|
57
|
-
| `worker` | Outbox processor + scheduled jobs (pg_cron) | SQL to db; HTTPS to external APIs |
|
|
58
|
-
|
|
59
|
-
### 3. Sequences (the critical ones)
|
|
60
|
-
|
|
61
|
-
For each "moment of truth" in `.wize/planning/ux/ux-scenarios.md`, draw a sequence. Mermaid is fine; ASCII is fine.
|
|
62
|
-
|
|
63
|
-
```mermaid
|
|
64
|
-
sequenceDiagram
|
|
65
|
-
participant U as User
|
|
66
|
-
participant W as web
|
|
67
|
-
participant A as auth
|
|
68
|
-
participant D as db
|
|
69
|
-
U->>W: POST /signup
|
|
70
|
-
W->>A: signUp(email, password)
|
|
71
|
-
A-->>W: { user_id, session }
|
|
72
|
-
W->>D: INSERT user_id INTO accounts
|
|
73
|
-
D-->>W: ok
|
|
74
|
-
W-->>U: 302 /onboarding (sets cookie)
|
|
75
|
-
Note over W,U: total p95 ≤ 1s (NFR 1.A)
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Annotate each sequence with the NFR target it must hit.
|
|
79
|
-
|
|
80
|
-
### 4. Data model
|
|
81
|
-
|
|
82
|
-
For every entity:
|
|
83
|
-
|
|
84
|
-
- Name, columns, types, indexes.
|
|
85
|
-
- Foreign keys + cascade behavior.
|
|
86
|
-
- RLS policies if the stack supports them (Supabase, etc.).
|
|
87
|
-
- Soft-delete vs hard-delete.
|
|
88
|
-
|
|
89
|
-
Include a mini ERD (Mermaid `erDiagram`).
|
|
90
|
-
|
|
91
|
-
### 5. Cross-cutting concerns
|
|
30
|
+
## Workflow architecture
|
|
92
31
|
|
|
93
|
-
|
|
32
|
+
This skill uses **micro-file architecture**:
|
|
94
33
|
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
- **Background jobs** — outbox / queue / scheduler.
|
|
101
|
-
- **Idempotency** — keys on write endpoints.
|
|
102
|
-
- **i18n** — string source, translation pipeline.
|
|
103
|
-
- **A11y** — token + library choices that uphold WCAG.
|
|
34
|
+
- Each step is a self-contained file with embedded rules.
|
|
35
|
+
- Sequential progression with user control at each step.
|
|
36
|
+
- Document state tracked in frontmatter (`stepsCompleted`).
|
|
37
|
+
- Append-only document building through the conversation.
|
|
38
|
+
- Never proceed to a step file if the current step indicates the user must approve continuation.
|
|
104
39
|
|
|
105
|
-
|
|
40
|
+
## On activation
|
|
106
41
|
|
|
107
|
-
|
|
42
|
+
1. Load `.wize/config/project.toml` and `.wize/config/user.toml`.
|
|
43
|
+
2. Resolve `user_name`, `communication_language`, `document_output_language`, `output_folder`, and the active profiles.
|
|
44
|
+
3. Greet the user in `communication_language`.
|
|
45
|
+
4. Read fully and follow `./steps/step-01-init.md`.
|
|
108
46
|
|
|
109
|
-
|
|
110
|
-
- Security: PII in EU → DB in `eu-central-1`; backups in same region.
|
|
111
|
-
- Reliability: 99.9% → single-region with multi-AZ; failover playbook in `adrs/ADR-007-failover.md`.
|
|
112
|
-
- A11y: WCAG AA → Radix primitives + axe in CI.
|
|
113
|
-
|
|
114
|
-
### 7. ADRs
|
|
115
|
-
|
|
116
|
-
One ADR per meaningful trade-off. Format below. Number sequentially. Don't gold-plate; an ADR is a few paragraphs.
|
|
117
|
-
|
|
118
|
-
### 8. Hand off
|
|
119
|
-
|
|
120
|
-
Mark `architecture.md` `status: ready-for-stories`. Tony continues with `wize-create-epics-and-stories`.
|
|
121
|
-
|
|
122
|
-
## Architecture doc template
|
|
123
|
-
|
|
124
|
-
```markdown
|
|
125
|
-
---
|
|
126
|
-
status: ready-for-stories
|
|
127
|
-
owner: Tony Stark
|
|
128
|
-
created: YYYY-MM-DD
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
# Architecture — {{project_name}}
|
|
132
|
-
|
|
133
|
-
## Summary
|
|
134
|
-
{{One paragraph: stack family, runtime, primary data store, deploy target. The frame.}}
|
|
135
|
-
|
|
136
|
-
## Stack
|
|
137
|
-
- Language: TypeScript
|
|
138
|
-
- Front-end: Next.js (App Router, RSC, edge runtime)
|
|
139
|
-
- Back-end: Server Actions + Route Handlers
|
|
140
|
-
- DB: Supabase Postgres + Drizzle ORM
|
|
141
|
-
- Auth: Supabase Auth
|
|
142
|
-
- Hosting: Vercel
|
|
143
|
-
- Observability: Vercel + PostHog
|
|
144
|
-
- Test: Vitest + Playwright (see playbook)
|
|
145
|
-
|
|
146
|
-
## Components
|
|
147
|
-
| Component | Responsibility | Boundary |
|
|
148
|
-
|---|---|---|
|
|
149
|
-
|
|
150
|
-
## Data model
|
|
151
|
-
- `users` (id PK, email UNIQUE, created_at)
|
|
152
|
-
- `teams` (id PK, name, owner_id FK users)
|
|
153
|
-
- `memberships` (user_id, team_id, role)
|
|
154
|
-
- RLS: `auth.uid() = user_id` on all user-scoped tables.
|
|
155
|
-
|
|
156
|
-
```mermaid
|
|
157
|
-
erDiagram
|
|
158
|
-
USERS ||--o{ MEMBERSHIPS : has
|
|
159
|
-
TEAMS ||--o{ MEMBERSHIPS : has
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
## Sequences
|
|
163
|
-
|
|
164
|
-
### S1: Sign-up
|
|
165
|
-
{{sequence diagram + NFR annotation}}
|
|
166
|
-
|
|
167
|
-
### S2: Invite teammate
|
|
168
|
-
{{sequence diagram}}
|
|
169
|
-
|
|
170
|
-
## Cross-cutting
|
|
171
|
-
- Auth & session: …
|
|
172
|
-
- Errors: …
|
|
173
|
-
- Logging: …
|
|
174
|
-
- Observability: …
|
|
175
|
-
- Config: …
|
|
176
|
-
- Background jobs: …
|
|
177
|
-
- Idempotency: …
|
|
178
|
-
- i18n: …
|
|
179
|
-
- A11y: …
|
|
180
|
-
|
|
181
|
-
## NFR check
|
|
182
|
-
- Perf (1.A): how
|
|
183
|
-
- Security (2.A): how
|
|
184
|
-
- Reliability (3.A): how
|
|
185
|
-
- Maintainability (4.A): how
|
|
186
|
-
- A11y (5.A): how
|
|
187
|
-
- Cost (6.A): how
|
|
188
|
-
|
|
189
|
-
## ADRs
|
|
190
|
-
See `.wize/solutioning/adrs/`.
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
## ADR template
|
|
194
|
-
|
|
195
|
-
```markdown
|
|
196
|
-
---
|
|
197
|
-
status: accepted | superseded | deprecated
|
|
198
|
-
date: YYYY-MM-DD
|
|
199
|
-
deciders: Tony, Fury
|
|
200
|
-
supersedes: ADR-XXX
|
|
201
|
-
---
|
|
202
|
-
|
|
203
|
-
# ADR-007: {{slug}}
|
|
204
|
-
|
|
205
|
-
## Context
|
|
206
|
-
{{2–4 sentences: what forced the decision, what constraint is binding.}}
|
|
207
|
-
|
|
208
|
-
## Options
|
|
209
|
-
1. {{Option A}} — pros / cons / cost
|
|
210
|
-
2. {{Option B}} — pros / cons / cost
|
|
211
|
-
3. {{Option C}} — pros / cons / cost
|
|
212
|
-
|
|
213
|
-
## Decision
|
|
214
|
-
{{The pick. One sentence.}}
|
|
47
|
+
## Steps
|
|
215
48
|
|
|
216
|
-
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
-
|
|
49
|
+
1. `step-01-init.md` — detect continuation, discover inputs, create `architecture.md` from template.
|
|
50
|
+
2. `step-02-context.md` — analyze PRD, UX, and research for architectural implications.
|
|
51
|
+
3. `step-03-starter.md` — discover technical preferences and evaluate starter templates.
|
|
52
|
+
4. `step-04-decisions.md` — make core architectural decisions (data, auth, API, frontend, infra).
|
|
53
|
+
5. `step-05-patterns.md` — define implementation patterns that prevent agent conflicts.
|
|
54
|
+
6. `step-06-structure.md` — map requirements to concrete project structure and boundaries.
|
|
55
|
+
7. `step-07-validation.md` — validate coherence, coverage, and implementation readiness.
|
|
56
|
+
8. `step-08-complete.md` — finalize frontmatter and hand off to implementation.
|
|
221
57
|
|
|
222
|
-
##
|
|
58
|
+
## Global step rules
|
|
223
59
|
|
|
224
|
-
-
|
|
225
|
-
-
|
|
226
|
-
-
|
|
227
|
-
-
|
|
228
|
-
-
|
|
60
|
+
- Always read the complete step file before acting.
|
|
61
|
+
- Speak in `communication_language`.
|
|
62
|
+
- Write artifacts in `document_output_language`.
|
|
63
|
+
- Never generate content without user input or confirmation.
|
|
64
|
+
- Every code reference uses CWD-relative `path:line` format.
|
|
65
|
+
- No time estimates — AI development speed has fundamentally changed.
|
|
229
66
|
|
|
230
67
|
## Hand-off
|
|
231
68
|
|
|
232
|
-
> Architecture and
|
|
69
|
+
> Architecture and ADRs are in `.wize/solutioning/`. Sequences hit the NFR targets. Hawkeye can write `tea-risk.md` against this. Tony continues with `wize-create-epics-and-stories`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Wize Dev Kit — overrides for the built-in workflow "wize-code-review".
|
|
2
|
+
# DO NOT EDIT in the installed kit; copy to .wize/custom/workflows/wize-code-review/
|
|
3
|
+
# for project-level overrides.
|
|
4
|
+
|
|
5
|
+
[workflow]
|
|
6
|
+
|
|
7
|
+
# Steps to run before standard activation (config load, greet).
|
|
8
|
+
activation_steps_prepend = []
|
|
9
|
+
|
|
10
|
+
# Steps to run after greet but before the workflow begins.
|
|
11
|
+
activation_steps_append = []
|
|
12
|
+
|
|
13
|
+
# Persistent facts the workflow keeps in mind for the whole run.
|
|
14
|
+
persistent_facts = [
|
|
15
|
+
"file:{project-root}/.wize/knowledge/document-project/conventions.md",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
# Scalar executed when the workflow reaches its final step,
|
|
19
|
+
# after review findings are presented and sprint status is synced.
|
|
20
|
+
# Override wins. Leave empty for no custom post-completion behavior.
|
|
21
|
+
on_complete = ""
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
diff_output: ''
|
|
3
|
+
spec_file: ''
|
|
4
|
+
review_mode: ''
|
|
5
|
+
story_key: ''
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Step 1: Gather Context
|
|
9
|
+
|
|
10
|
+
## Rules
|
|
11
|
+
|
|
12
|
+
- Speak in `{communication_language}`.
|
|
13
|
+
- The prompt that triggered this workflow IS the intent.
|
|
14
|
+
- Do not modify any files in this step. Read-only.
|
|
15
|
+
|
|
16
|
+
## Instructions
|
|
17
|
+
|
|
18
|
+
1. **Find the review target.** Check in this order and stop as soon as the target is identified:
|
|
19
|
+
|
|
20
|
+
**Tier 1 — Explicit argument.**
|
|
21
|
+
Did the user pass a PR, commit SHA, branch, spec file, or diff source?
|
|
22
|
+
- PR reference → resolve to branch/commit via `gh pr view`.
|
|
23
|
+
- Commit or branch → use directly.
|
|
24
|
+
- Spec file → set `{spec_file}` to the path. Check its frontmatter for `baseline_commit`.
|
|
25
|
+
- Diff-mode keywords: `staged`, `uncommitted`, `branch diff`, `commit range`, `this diff`.
|
|
26
|
+
|
|
27
|
+
**Tier 2 — Recent conversation.**
|
|
28
|
+
Look for refs in the last few messages.
|
|
29
|
+
|
|
30
|
+
**Tier 3 — Sprint tracking.**
|
|
31
|
+
Look for `*sprint-status*` files and find stories with status `review`.
|
|
32
|
+
|
|
33
|
+
**Tier 4 — Current git state.**
|
|
34
|
+
If not on the default branch, confirm whether to review the current branch.
|
|
35
|
+
|
|
36
|
+
**Tier 5 — Ask.**
|
|
37
|
+
Present options: uncommitted changes, staged changes, branch diff, commit range, provided diff.
|
|
38
|
+
|
|
39
|
+
2. **Construct `{diff_output}`.**
|
|
40
|
+
- Staged only: `git diff --cached`
|
|
41
|
+
- Uncommitted: `git diff HEAD`
|
|
42
|
+
- Branch diff: `git diff <base>..<branch>`
|
|
43
|
+
- Commit range: `git diff <from>..<to>`
|
|
44
|
+
- Provided diff: validate and use verbatim
|
|
45
|
+
- File list: `git diff HEAD -- <files...>`, with untracked files included via `git diff --no-index /dev/null <path>`
|
|
46
|
+
|
|
47
|
+
If `{diff_output}` is empty, halt and say so.
|
|
48
|
+
|
|
49
|
+
3. **Set the spec context.**
|
|
50
|
+
- If `{spec_file}` is set and readable, set `{review_mode}` = `"full"`.
|
|
51
|
+
- Otherwise ask: "Is there a spec or story file that provides context for these changes?"
|
|
52
|
+
- Yes → set `{spec_file}`, verify it, set `{review_mode}` = `"full"`.
|
|
53
|
+
- No → set `{review_mode}` = `"no-spec"`.
|
|
54
|
+
|
|
55
|
+
4. **Sanity check.**
|
|
56
|
+
If the diff exceeds ~3000 lines, warn and offer to chunk.
|
|
57
|
+
|
|
58
|
+
### Checkpoint
|
|
59
|
+
|
|
60
|
+
Present a summary: diff stats, `{review_mode}`, loaded spec/context docs. Halt and wait for confirmation to proceed.
|
|
61
|
+
|
|
62
|
+
## Next
|
|
63
|
+
|
|
64
|
+
Read fully and follow `./step-02-review.md`.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
failed_layers: ''
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Step 2: Review
|
|
6
|
+
|
|
7
|
+
## Rules
|
|
8
|
+
|
|
9
|
+
- Speak in `{communication_language}`.
|
|
10
|
+
- The Blind Hunter subagent receives **only** the diff — no project context.
|
|
11
|
+
- The Edge Case Hunter subagent receives the diff and project read access.
|
|
12
|
+
- The Acceptance Auditor subagent receives the diff, spec, and context docs.
|
|
13
|
+
- All review subagents run at the same model capability as the current session.
|
|
14
|
+
|
|
15
|
+
## Instructions
|
|
16
|
+
|
|
17
|
+
1. If `{review_mode}` = `"no-spec"`, note: "Acceptance Auditor skipped — no spec file provided."
|
|
18
|
+
|
|
19
|
+
2. Launch parallel subagents without conversation context:
|
|
20
|
+
|
|
21
|
+
- **Blind Hunter** — receives `{diff_output}` only. Invoke via `wize-review-adversarial`.
|
|
22
|
+
Prompt: "Review this diff cynically. Assume problems exist. Find at least ten issues. Output as a Markdown list with one-line titles."
|
|
23
|
+
|
|
24
|
+
- **Edge Case Hunter** — receives `{diff_output}` and read access to the project. Invoke via `wize-review-edge-case-hunter`.
|
|
25
|
+
Prompt: "Walk every branching path and boundary condition in this diff. Report only unhandled edge cases as a JSON array."
|
|
26
|
+
|
|
27
|
+
- **Acceptance Auditor** (only if `{review_mode}` = `"full"`) — receives `{diff_output}`, `{spec_file}` content, and context docs.
|
|
28
|
+
Prompt: "Review this diff against the spec. Check for violations of acceptance criteria, deviations from spec intent, and missing behavior. Output findings as a Markdown list with AC/constraint reference and evidence."
|
|
29
|
+
|
|
30
|
+
3. If subagents are unavailable, generate prompt files in `{implementation_artifacts}` and halt, asking the user to run each in a separate session.
|
|
31
|
+
|
|
32
|
+
4. If any subagent fails, times out, or returns empty, append the layer name to `{failed_layers}` and proceed with findings from the remaining layers.
|
|
33
|
+
|
|
34
|
+
5. Collect all findings from completed layers.
|
|
35
|
+
|
|
36
|
+
## Next
|
|
37
|
+
|
|
38
|
+
Read fully and follow `./step-03-triage.md`.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Step 3: Triage
|
|
2
|
+
|
|
3
|
+
## Rules
|
|
4
|
+
|
|
5
|
+
- Speak in `{communication_language}`.
|
|
6
|
+
- Be precise. When uncertain between categories, prefer the more conservative classification.
|
|
7
|
+
|
|
8
|
+
## Instructions
|
|
9
|
+
|
|
10
|
+
1. **Normalize** findings into a common format. Expected input formats:
|
|
11
|
+
- Blind Hunter: Markdown list of descriptions.
|
|
12
|
+
- Edge Case Hunter: JSON array with `location`, `trigger_condition`, `guard_snippet`, `potential_consequence`.
|
|
13
|
+
- Acceptance Auditor: Markdown list with title, AC/constraint reference, and evidence.
|
|
14
|
+
|
|
15
|
+
Convert all to a unified list with:
|
|
16
|
+
- `id` — sequential integer
|
|
17
|
+
- `source` — `blind`, `edge`, `auditor`, or merged (`blind+edge`, etc.)
|
|
18
|
+
- `title` — one-line summary
|
|
19
|
+
- `detail` — full description
|
|
20
|
+
- `location` — file and line reference if available
|
|
21
|
+
|
|
22
|
+
2. **Deduplicate.** Merge findings that describe the same issue:
|
|
23
|
+
- Use the most specific finding as the base (prefer Edge Case Hunter JSON with location).
|
|
24
|
+
- Append unique detail, reasoning, or locations from other findings.
|
|
25
|
+
- Set `source` to merged sources.
|
|
26
|
+
|
|
27
|
+
3. **Classify** each finding into exactly one bucket:
|
|
28
|
+
- **decision_needed** — ambiguous choice requiring human input. Only possible if `{review_mode}` = `"full"`.
|
|
29
|
+
- **patch** — code issue fixable without human input.
|
|
30
|
+
- **defer** — pre-existing issue not caused by this change.
|
|
31
|
+
- **dismiss** — noise, false positive, or handled elsewhere.
|
|
32
|
+
|
|
33
|
+
If `{review_mode}` = `"no-spec"` and a finding would be `decision_needed`, reclassify as `patch` or `defer`.
|
|
34
|
+
|
|
35
|
+
4. **Drop** all `dismiss` findings. Record the dismiss count.
|
|
36
|
+
|
|
37
|
+
5. If `{failed_layers}` is non-empty, report which layers failed. If zero findings remain and layers failed, warn the user that the review may be incomplete.
|
|
38
|
+
|
|
39
|
+
6. If zero findings remain after triage, state: "✅ Clean review — all layers passed."
|
|
40
|
+
|
|
41
|
+
## Next
|
|
42
|
+
|
|
43
|
+
Read fully and follow `./step-04-present.md`.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
deferred_work_file: '{implementation_artifacts}/deferred-work.md'
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Step 4: Present and Act
|
|
6
|
+
|
|
7
|
+
## Rules
|
|
8
|
+
|
|
9
|
+
- Speak in `{communication_language}`.
|
|
10
|
+
- When `{spec_file}` is set, always write findings to the story file before offering action choices.
|
|
11
|
+
- `decision_needed` findings must be resolved before handling `patch` findings.
|
|
12
|
+
|
|
13
|
+
## Instructions
|
|
14
|
+
|
|
15
|
+
### 1. Clean review shortcut
|
|
16
|
+
|
|
17
|
+
If zero findings remain after triage, state that and proceed to section 6 (Sprint Status Update).
|
|
18
|
+
|
|
19
|
+
### 2. Write findings to the story file
|
|
20
|
+
|
|
21
|
+
If `{spec_file}` exists and contains a Tasks/Subtasks section, append a `### Review Findings` subsection in this order:
|
|
22
|
+
|
|
23
|
+
1. `decision_needed` (unchecked):
|
|
24
|
+
```
|
|
25
|
+
- [ ] [Review][Decision] <Title> — <Detail>
|
|
26
|
+
```
|
|
27
|
+
2. `patch` (unchecked):
|
|
28
|
+
```
|
|
29
|
+
- [ ] [Review][Patch] <Title> [<file>:<line>]
|
|
30
|
+
```
|
|
31
|
+
3. `defer` (checked):
|
|
32
|
+
```
|
|
33
|
+
- [x] [Review][Defer] <Title> [<file>:<line>] — deferred, pre-existing
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Also append each `defer` finding to `{deferred_work_file}` under `## Deferred from: code review ({date})`.
|
|
37
|
+
|
|
38
|
+
### 3. Present summary
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
Code review complete.
|
|
42
|
+
- decision_needed: {D}
|
|
43
|
+
- patch: {P}
|
|
44
|
+
- defer: {W}
|
|
45
|
+
- dismissed: {R}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
If `{spec_file}` is set, add: "Findings written to `{spec_file}`."
|
|
49
|
+
|
|
50
|
+
### 4. Resolve decision_needed findings
|
|
51
|
+
|
|
52
|
+
Present each `decision_needed` finding and ask the user to decide. Once resolved, each becomes a `patch`, `defer`, or is dismissed.
|
|
53
|
+
|
|
54
|
+
If deferred, ask for a one-line reason and append it to both the story file bullet and the deferred-work file.
|
|
55
|
+
|
|
56
|
+
### 5. Handle patch findings
|
|
57
|
+
|
|
58
|
+
If `patch` findings exist, ask:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
How would you like to handle the {P} patch findings?
|
|
62
|
+
1. Apply every patch — fix all now, no per-finding confirmation.
|
|
63
|
+
2. Leave as action items — they are already in the story file (only if spec_file set).
|
|
64
|
+
3. Walk through each patch — show details before deciding.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Wait for the numbered choice. Do not proceed until selected.
|
|
68
|
+
|
|
69
|
+
- **Apply every patch**: apply all patch findings. Afterward, present a summary of changes and check off patch items in the story file if applicable.
|
|
70
|
+
- **Leave as action items**: done.
|
|
71
|
+
- **Walk through each patch**: present each finding with detail and suggested fix, then re-offer the menu.
|
|
72
|
+
|
|
73
|
+
### 6. Update story status and sync sprint tracking
|
|
74
|
+
|
|
75
|
+
Skip if `{spec_file}` is not set.
|
|
76
|
+
|
|
77
|
+
Determine `{new_status}`:
|
|
78
|
+
- If all `decision_needed` and `patch` findings are resolved and no unresolved issues remain → `done`
|
|
79
|
+
- If patch findings were left as action items or unresolved issues remain → `in-progress`
|
|
80
|
+
|
|
81
|
+
Update the story file status and save it.
|
|
82
|
+
|
|
83
|
+
If `{story_key}` is set and a sprint-status file exists, update the matching `development_status` entry.
|
|
84
|
+
|
|
85
|
+
### 7. Next steps
|
|
86
|
+
|
|
87
|
+
Present options:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
What would you like to do next?
|
|
91
|
+
1. Start the next story — run wize-dev-story to pick up the next ready-for-dev story.
|
|
92
|
+
2. Re-run code review — address findings and review again.
|
|
93
|
+
3. Done — end the workflow.
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Wait for the numbered choice.
|
|
97
|
+
|
|
98
|
+
## On complete
|
|
99
|
+
|
|
100
|
+
Run `{workflow.on_complete}` if non-empty.
|