create-anpunkit 2.0.3 → 2.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/bin/cli.js +3 -2
- package/package.json +1 -1
- package/template/.claude/agents/e2e-runner.md +44 -13
- package/template/.claude/agents/implementer.md +13 -7
- package/template/.claude/agents/infra-provisioner.md +33 -2
- package/template/.claude/agents/planner.md +79 -6
- package/template/.claude/agents/researcher.md +19 -8
- package/template/.claude/agents/spec-author.md +118 -0
- package/template/.claude/agents/test-author.md +76 -43
- package/template/.claude/anpunkit-manifest.json +47 -27
- package/template/.claude/commands/infra.md +28 -3
- package/template/.claude/commands/overview.md +84 -24
- package/template/.claude/commands/phase.md +139 -40
- package/template/.claude/commands/replan.md +23 -9
- package/template/.cursor/commands/infra.md +26 -1
- package/template/.cursor/commands/overview.md +83 -23
- package/template/.cursor/commands/phase.md +138 -39
- package/template/.cursor/commands/replan.md +22 -8
- package/template/.gitattributes +1 -0
- package/template/AGENTS.md +215 -36
- package/template/CLAUDE.md +1 -0
- package/template/README.md +59 -23
- package/template/anpunkit.png +0 -0
- package/template/commands.src/infra.md +28 -3
- package/template/commands.src/overview.md +84 -24
- package/template/commands.src/phase.md +139 -40
- package/template/commands.src/replan.md +23 -9
- package/template/docs/DESIGN_LOG.md +192 -1
- package/template/index.html +339 -0
- package/template/scripts/spec-conformance.sh +93 -0
- package/template/scripts/spec-staleness.sh +115 -0
- package/template/setup.sh +110 -47
- package/template/tests/helpers/spec-assert.py +162 -0
- package/template/tests/helpers/spec-assert.ts +158 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Run one phase end-to-end. TDD phases run SCAFFOLD -> RED -> GREEN; non-TDD phases run IMPLEMENT -> TEST. Both with the debug circuit breaker and the regression
|
|
2
|
+
description: Run one phase end-to-end. TDD phases run SPEC fill -> SPEC REVIEW -> SCAFFOLD -> RED -> conformance -> GREEN -> boundary/E2E; non-TDD phases run IMPLEMENT -> TEST. Both with the debug circuit breaker and the regression + dataflow + evidence guards at CLOSE.
|
|
3
3
|
argument-hint: [phase number]
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
Caveman ULTRA mode. You are the ORCHESTRATOR. Route work to subagents —
|
|
7
|
-
you do NOT implement or debug yourself.
|
|
7
|
+
you do NOT implement, fill specs, or debug yourself.
|
|
8
8
|
|
|
9
9
|
Note: subagents cannot talk to the user. Only YOU can.
|
|
10
10
|
|
|
@@ -29,8 +29,21 @@ b. PHASE STATE CHECK: Read docs/STATE.md and docs/PLAN.md.
|
|
|
29
29
|
c. FINAL PHASE CHECK: Read docs/PLAN.md. Is this the last phase (no further
|
|
30
30
|
pending phases after this one)? Record this as IS_FINAL_PHASE=true/false.
|
|
31
31
|
|
|
32
|
-
d. AUTH
|
|
33
|
-
|
|
32
|
+
d. AUTH LIVENESS GATE (hard rule 16): if this phase will run a boundary/E2E suite,
|
|
33
|
+
confirm every credential it needs is live NOW.
|
|
34
|
+
- If INFRA.md has no `AUTH PROOF: PASS` marker -> STOP: "Auth never proven
|
|
35
|
+
reusable. Run `/infra` first."
|
|
36
|
+
- Run `scripts/auth-setup.sh --check` (Entra token obtainable + not expired)
|
|
37
|
+
and, for each external system this phase touches (docs/DATAFLOW.md external
|
|
38
|
+
rows + docs/ENDPOINTS.md auth column), confirm its credential is obtainable
|
|
39
|
+
headlessly. Any failure -> boundary/E2E is BLOCKED; tell me what to run; the
|
|
40
|
+
MOCK suite may still proceed.
|
|
41
|
+
|
|
42
|
+
e. FRONTEND TRIGGER (hard rule 13): read docs/OVERVIEW.md `has_frontend` + the
|
|
43
|
+
frontend root. Set FRONTEND_PHASE=true iff `has_frontend: true` AND this
|
|
44
|
+
phase's `changes` (docs/PLAN.md) include any path under the frontend root.
|
|
45
|
+
This is a PATH MATCH, not a judgment call. Record FRONTEND_PHASE — it gates the
|
|
46
|
+
`ui` boundary run + evidence at CLOSE.
|
|
34
47
|
|
|
35
48
|
---
|
|
36
49
|
|
|
@@ -40,52 +53,120 @@ Dispatch `researcher` in IMPL mode scoped to this phase.
|
|
|
40
53
|
Returns terse summary + path. Read the file only if needed.
|
|
41
54
|
Unknowns block the phase -> re-dispatch narrowed. No guessing.
|
|
42
55
|
|
|
56
|
+
DATASOURCE DELTA (hard rule 15): if this phase tests against an external
|
|
57
|
+
datasource, compare what it touches to the confirmed BASELINE in
|
|
58
|
+
docs/research/datasource-<name>.md. If it touches a NEW table/column beyond the
|
|
59
|
+
baseline -> surface my understanding of just that delta as a falsifiable claim;
|
|
60
|
+
WAIT for confirm; append it to datasource-<name>.md. If it touches only confirmed
|
|
61
|
+
data -> proceed with a one-line note, no stop. Boundary/E2E against an UNCONFIRMED
|
|
62
|
+
datasource is HARD-BLOCKED (mock still runs). The confirmed baseline is what
|
|
63
|
+
`spec-author` grounds fixtures in.
|
|
64
|
+
|
|
43
65
|
Then classify the phase:
|
|
44
66
|
|
|
45
67
|
`TDD_PHASE` = the phase adds or changes a PUBLIC CALLABLE SURFACE (endpoint,
|
|
46
68
|
exported function/class, CLI command, message contract) assertable from the
|
|
47
69
|
acceptance spec. Size is NOT the criterion.
|
|
48
70
|
|
|
49
|
-
- Clear public surface -> `TDD_PHASE=true` -> run the TDD path (§2 → §
|
|
71
|
+
- Clear public surface -> `TDD_PHASE=true` -> run the TDD path (§2 → §3 → §4 → §5 → §6 → §7).
|
|
50
72
|
- Pure infra/config/doc, no public surface -> `TDD_PHASE=false` -> run the
|
|
51
73
|
non-TDD path (§2N → §3N).
|
|
52
74
|
- AMBIGUOUS -> default `TDD_PHASE=true`, but STATE the classification + the reason
|
|
53
|
-
to me, so I can override to non-TDD BEFORE
|
|
54
|
-
downgrade a TDD phase just to dodge the
|
|
75
|
+
to me, so I can override to non-TDD BEFORE SPEC fill fires. (Hard rule 11: never
|
|
76
|
+
downgrade a TDD phase just to dodge the gates.)
|
|
55
77
|
|
|
56
78
|
=====================================================================
|
|
57
79
|
## TDD PATH (TDD_PHASE=true)
|
|
58
80
|
=====================================================================
|
|
59
81
|
|
|
60
|
-
## 2.
|
|
82
|
+
## 2. SPEC FILL + STALENESS
|
|
83
|
+
|
|
84
|
+
a. SKELETON CHECK: confirm docs/spec-phase-<n>.md exists (planner generated it at
|
|
85
|
+
/overview). If MISSING (planner classified it non-TDD, or it's a new phase from
|
|
86
|
+
/replan): generate the skeleton NOW from this phase's PLAN.md `acceptance` +
|
|
87
|
+
`dataflow:` transitions in the planner skeleton format (generated header + named
|
|
88
|
+
`TBD` rows), then `bash scripts/spec-staleness.sh stamp <n>` to stamp its hash.
|
|
89
|
+
|
|
90
|
+
b. Dispatch `spec-author`. It fills each case row with a real input payload
|
|
91
|
+
(`fixtures/<case-id>-input.json`), concrete expected output
|
|
92
|
+
(`fixtures/<case-id>-expected.json`), matcher tokens for volatile fields,
|
|
93
|
+
`error-code` for failures, and `selector/assert/value` `ui` descriptors —
|
|
94
|
+
grounded in the RESEARCH findings + the confirmed datasource baseline.
|
|
95
|
+
|
|
96
|
+
c. CASE-SET-DIVERGENCE (hard re-entry, hard rule 12 / §5.52): if `spec-author`
|
|
97
|
+
returns `CASE-SET-DIVERGENCE` (a required case can't be filled from real facts,
|
|
98
|
+
or research revealed an unlisted/contradicted case) -> STOP. Surface the finding.
|
|
99
|
+
I amend the up-front case-name contract in the skeleton; you re-stamp
|
|
100
|
+
(`bash scripts/spec-staleness.sh stamp <n>`); then re-dispatch `spec-author` to
|
|
101
|
+
re-fill from scratch. AI never amends the case-name set — I own the contract.
|
|
102
|
+
|
|
103
|
+
d. STALENESS (hard rule 17): run `bash scripts/spec-staleness.sh <n>`. Nonzero
|
|
104
|
+
(upstream PLAN acceptance line / DATAFLOW rows drifted since the skeleton was
|
|
105
|
+
stamped, e.g. via /replan) -> regenerate the skeleton header from current
|
|
106
|
+
PLAN/DATAFLOW, re-stamp, re-dispatch `spec-author`. Do NOT hand-edit the hash.
|
|
107
|
+
|
|
108
|
+
## 3. SPEC REVIEW — human gate (hard rule 12)
|
|
109
|
+
|
|
110
|
+
STOP. Surface the FILLED cases to me as FALSIFIABLE CLAIMS in plain language, e.g.:
|
|
111
|
+
- "POST /orders/submit with an empty line-item list → 422 EMPTY_ORDER."
|
|
112
|
+
- "Successful submit of a 3-line order → 201; order.id is a UUID; order.status is
|
|
113
|
+
'submitted'."
|
|
114
|
+
Re-run `bash scripts/spec-staleness.sh <n>` at entry (nonzero -> back to §2d).
|
|
115
|
+
SCAFFOLD cannot begin until I confirm. Classify any rejection WITH me (§5.50):
|
|
116
|
+
- WRONG EXPECTED -> fix the case row + `fixtures/<case-id>-expected.json`; no
|
|
117
|
+
re-research. (You may patch the fixture directly per my correction.)
|
|
118
|
+
- WRONG INPUT SHAPE -> re-dispatch `spec-author` with the correction.
|
|
119
|
+
- NEW CASE or CONTRADICTED CASE -> hard re-entry (§2c): I amend the skeleton, you
|
|
120
|
+
re-stamp, re-confirm the amended case(s) + any case sharing their `covers` id
|
|
121
|
+
(the staleness hash certifies the unchanged remainder — not re-read), re-fill.
|
|
122
|
+
Loop until I approve. Unskippable on TDD phases.
|
|
123
|
+
|
|
124
|
+
## 4. SCAFFOLD
|
|
61
125
|
|
|
62
126
|
Dispatch `implementer` in SCAFFOLD mode: interface stubs only (signatures +
|
|
63
|
-
types; bodies raise NotImplementedError / return 501); NO logic, NO tests
|
|
64
|
-
Returns the stub files + the interface surface.
|
|
127
|
+
types; bodies raise NotImplementedError / return 501); NO logic, NO tests, NO
|
|
128
|
+
edits to the spec or fixtures. Returns the stub files + the interface surface.
|
|
129
|
+
|
|
130
|
+
## 5. RED
|
|
65
131
|
|
|
66
|
-
|
|
132
|
+
Dispatch `test-author` to EMIT the boundary harness from the locked spec `data`
|
|
133
|
+
rows: one deep-equality assertion per case against `fixtures/<case-id>-expected.json`
|
|
134
|
+
via the kit comparator `tests/helpers/spec-assert.*`, each citing its case with a
|
|
135
|
+
`# spec: <case-id>` comment. It does NOT author assertions — it generates them from
|
|
136
|
+
the spec. Place contract/ENDPOINTS/transition tests in `tests/regression/`,
|
|
137
|
+
phase-local in `tests/phase-<n>/`.
|
|
67
138
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
139
|
+
If FRONTEND_PHASE (and the phase has `ui` cases): also dispatch `e2e-runner` to EMIT
|
|
140
|
+
Playwright assertions from each `ui` case's `fixtures/<case-id>-ui.json` descriptor,
|
|
141
|
+
each citing `// spec: <case-id>`. Run the suites.
|
|
71
142
|
|
|
72
|
-
RED GATE = every
|
|
73
|
-
|
|
74
|
-
- Any test PASSES on stubs -> STOP (spec trivial or test wrong); show me.
|
|
143
|
+
RED GATE = every case test COLLECTS cleanly AND FAILS (assertion / NotImplemented).
|
|
144
|
+
- Any test PASSES on stubs -> STOP (spec trivial or emitter wrong); show me.
|
|
75
145
|
- Collection / import / syntax error -> stub mismatch; re-dispatch SCAFFOLD to
|
|
76
146
|
fix SIGNATURES (not logic); re-run.
|
|
77
|
-
- UNDERSPEC -> STOP; ask me to sharpen the acceptance spec.
|
|
78
147
|
|
|
79
|
-
##
|
|
148
|
+
## 6. CONFORMANCE GATE (hard rule 18) — replaces the v2.1 human TEST REVIEW
|
|
149
|
+
|
|
150
|
+
Run `bash scripts/spec-conformance.sh <n>`. It loud-fails (and BLOCKS GREEN) if:
|
|
151
|
+
- any `TBD` marker remains in docs/spec-phase-<n>.md or a referenced fixture, OR
|
|
152
|
+
- any case-id in the spec table has no boundary test citing it (`# spec: <case-id>`).
|
|
153
|
+
Nonzero -> fix the gap (re-dispatch `spec-author` for a stray TBD, or `test-author`/
|
|
154
|
+
`e2e-runner` for a missing citation) and re-run. GREEN cannot start until it passes.
|
|
155
|
+
|
|
156
|
+
## 7. GREEN + BOUNDARY/E2E
|
|
80
157
|
|
|
81
|
-
Dispatch `implementer` in FILL mode with the
|
|
82
|
-
file paths (it MAY read the tests — frozen
|
|
83
|
-
|
|
158
|
+
Dispatch `implementer` in FILL mode with the FILLED docs/spec-phase-<n>.md + its
|
|
159
|
+
fixtures + research + the generated test file paths (it MAY read the tests — frozen
|
|
160
|
+
before logic, no overfit — but must NOT edit tests, spec, or fixtures). Fill to
|
|
161
|
+
green against the spec. Budget 3, WARN@2, STUCK@3.
|
|
84
162
|
|
|
85
|
-
|
|
86
|
-
`
|
|
163
|
+
Run the BOUNDARY suite (real HTTP/CLI/message; `TEST_MODE=real`). If FRONTEND_PHASE,
|
|
164
|
+
`e2e-runner` runs its emitted `ui` specs — MANDATORY (hard rule 13) — reads INFRA.md
|
|
165
|
+
target, runs `scripts/e2e-stack.sh up` / Playwright / `down`, and captures a
|
|
166
|
+
screenshot at EACH UI-existence assertion regardless of pass/fail to
|
|
167
|
+
docs/evidence/e2e-phase-<n>/, with a summary in docs/research/e2e-<slug>.md.
|
|
87
168
|
|
|
88
|
-
PHASE GATE (rule 5) -> go to §
|
|
169
|
+
PHASE GATE (rule 5) -> go to §8/§9/§10 (see GATE below).
|
|
89
170
|
|
|
90
171
|
=====================================================================
|
|
91
172
|
## NON-TDD PATH (TDD_PHASE=false)
|
|
@@ -100,16 +181,19 @@ includes "deployed URL" before proceeding.
|
|
|
100
181
|
|
|
101
182
|
## 3N. TEST (blind)
|
|
102
183
|
|
|
103
|
-
Dispatch `test-author`. It writes MOCK +
|
|
104
|
-
spec — never reads the logic. (
|
|
184
|
+
Dispatch `test-author`. It writes MOCK + boundary suites from the acceptance
|
|
185
|
+
spec — never reads the logic. (No spec file, SPEC REVIEW, or conformance gate on
|
|
186
|
+
the non-TDD path — no public surface to contract. e2e-runner only if FRONTEND_PHASE.)
|
|
105
187
|
|
|
106
188
|
=====================================================================
|
|
107
189
|
|
|
108
190
|
## GATE (both paths)
|
|
109
191
|
|
|
110
|
-
PHASE GATE = current-phase
|
|
111
|
-
the accumulated mock regression corpus
|
|
112
|
-
entry has a regression test (
|
|
192
|
+
PHASE GATE = current-phase BOUNDARY suite passes AND (FRONTEND_PHASE) the `ui`
|
|
193
|
+
boundary passes WITH evidence captured AND the accumulated mock regression corpus
|
|
194
|
+
stays green AND every docs/ENDPOINTS.md entry has a regression test AND (TDD)
|
|
195
|
+
`spec-conformance.sh` passed AND every REACHABLE docs/DATAFLOW.md transition has a
|
|
196
|
+
filled case in the phase spec (all checked at CLOSE).
|
|
113
197
|
- GATE PASS -> go to CLOSE.
|
|
114
198
|
- GATE BLOCKED (SERVICE UNAVAILABLE, STACK NOT READY, AZURE UNAVAILABLE, FLAKE)
|
|
115
199
|
-> tell me, wait. Not a code bug. For AZURE UNAVAILABLE: suggest `/infra verify`.
|
|
@@ -117,17 +201,17 @@ entry has a regression test (checked at CLOSE).
|
|
|
117
201
|
|
|
118
202
|
---
|
|
119
203
|
|
|
120
|
-
##
|
|
204
|
+
## 8. FIX
|
|
121
205
|
|
|
122
206
|
Dispatch `debugger` (isolated context) on the specific failure.
|
|
123
|
-
- FIXED -> re-run
|
|
207
|
+
- FIXED -> re-run the boundary suite (and the regression corpus).
|
|
124
208
|
- SERVICE UNAVAILABLE -> tell me, wait. Suggest `/infra verify` if Azure.
|
|
125
209
|
- WARN (2 attempts failed) -> relay immediately, then let debugger finish attempt 3.
|
|
126
210
|
- STUCK -> go to ESCALATE.
|
|
127
211
|
|
|
128
212
|
---
|
|
129
213
|
|
|
130
|
-
##
|
|
214
|
+
## 9. ESCALATE — circuit breaker. Mode B.
|
|
131
215
|
|
|
132
216
|
FIRST STUCK: STOP. Present to me: the problem, 3 failed hypotheses, the
|
|
133
217
|
debugger's recommendation, the debug file path. Ask what to do. Wait. Options:
|
|
@@ -140,19 +224,32 @@ what to try next. Hand control to me.
|
|
|
140
224
|
|
|
141
225
|
---
|
|
142
226
|
|
|
143
|
-
##
|
|
227
|
+
## 10. CLOSE
|
|
144
228
|
|
|
145
|
-
REGRESSION
|
|
146
|
-
- Run `scripts/regression.sh` (mock corpus). A failure BLOCKS close -> route to FIX.
|
|
229
|
+
REGRESSION + COVERAGE GATES (before closing — all FAIL HARD, do not close):
|
|
230
|
+
- Run `bash scripts/regression.sh` (mock corpus). A failure BLOCKS close -> route to FIX.
|
|
147
231
|
- ENDPOINTS COVERAGE: every `docs/ENDPOINTS.md` entry MUST have >=1 test in
|
|
148
|
-
`tests/regression/`. Zero coverage -> FAIL HARD
|
|
149
|
-
-
|
|
232
|
+
`tests/regression/`. Zero coverage -> FAIL HARD.
|
|
233
|
+
- DATAFLOW COVERAGE (hard rule 14, re-seamed v2.2): every `docs/DATAFLOW.md`
|
|
234
|
+
transition whose trigger is REACHABLE in the code shipped so far MUST have >=1
|
|
235
|
+
FILLED CASE in docs/spec-phase-<n>.md. Zero coverage on a reachable transition ->
|
|
236
|
+
FAIL HARD. Unreachable transitions list as PENDING (not failed). IF
|
|
237
|
+
IS_FINAL_PHASE: any transition still PENDING -> FAIL HARD. (The case→test half is
|
|
238
|
+
already enforced by `spec-conformance.sh` at §6 — every case-id is cited by a
|
|
239
|
+
boundary test, which by placement lands in tests/regression/.)
|
|
240
|
+
- EVIDENCE (FRONTEND_PHASE only, hard rule 13): docs/evidence/e2e-phase-<n>/ must
|
|
241
|
+
contain at least the per-UI-existence-assertion screenshots. Empty -> FAIL HARD.
|
|
242
|
+
- IF IS_FINAL_PHASE: additionally run `bash scripts/regression.sh --real` (full real
|
|
150
243
|
corpus). A failure blocks close.
|
|
151
244
|
|
|
152
245
|
Mark phase `done` in docs/PLAN.md.
|
|
153
246
|
|
|
154
|
-
ARCHITECTURE SELF-CHECK:
|
|
155
|
-
|
|
247
|
+
ARCHITECTURE / DATAFLOW SELF-CHECK:
|
|
248
|
+
- Did this phase add/remove/rename an agent, hook, or command, or change a
|
|
249
|
+
workflow rule? YES -> run `/log-decision`. NO -> state why not.
|
|
250
|
+
- Did this phase add/change an object's STATE LIFECYCLE? YES -> update
|
|
251
|
+
docs/DATAFLOW.md (hard rule 9) in this CLOSE, and confirm new reachable
|
|
252
|
+
transitions are covered by a filled case. NO -> state why not.
|
|
156
253
|
|
|
157
254
|
IF IS_FINAL_PHASE — FINAL CLOSE sequence:
|
|
158
255
|
|
|
@@ -175,6 +272,7 @@ IF IS_FINAL_PHASE — FINAL CLOSE sequence:
|
|
|
175
272
|
|
|
176
273
|
## Docs
|
|
177
274
|
- Full endpoint catalogue: docs/ENDPOINTS.md
|
|
275
|
+
- Object/state flow: docs/DATAFLOW.md
|
|
178
276
|
- Infrastructure: docs/INFRA.md
|
|
179
277
|
- Project history: docs/HISTORY.md
|
|
180
278
|
```
|
|
@@ -194,6 +292,7 @@ After each step, update docs/STATE.md:
|
|
|
194
292
|
|
|
195
293
|
phase: <n> (in progress)
|
|
196
294
|
tdd: <true|false>
|
|
295
|
+
frontend_phase: <true|false>
|
|
197
296
|
completed: <steps done so far>
|
|
198
297
|
next: <exact next step>
|
|
199
298
|
blocker: <none or open issue>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Revise docs/PLAN.md when it no longer matches reality — add, cut, split, merge, or reorder phases.
|
|
2
|
+
description: Revise docs/PLAN.md when it no longer matches reality — add, cut, split, merge, or reorder phases. Keeps the deploy-last, ENDPOINTS, and DATAFLOW invariants intact.
|
|
3
3
|
argument-hint: [what changed about the plan]
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -25,10 +25,13 @@ Use when PLAN.md no longer matches reality. Change: $ARGUMENTS
|
|
|
25
25
|
- A new external service is mentioned (Stripe, Twilio, a new Azure service, etc.)
|
|
26
26
|
- The change involves architecture (a new integration pattern, auth change, etc.)
|
|
27
27
|
- A service tier or quota change is implied
|
|
28
|
+
- A new external DATASOURCE or a change to an object's STATE LIFECYCLE
|
|
28
29
|
|
|
29
30
|
If ANY of these signals are present: dispatch `researcher` in DESIGN mode
|
|
30
|
-
with the specific new service/pattern as the DESIGN TOPICS list.
|
|
31
|
-
|
|
31
|
+
with the specific new service/pattern as the DESIGN TOPICS list. For a new
|
|
32
|
+
datasource, it drafts a DATA UNDERSTANDING; surface it to me as a falsifiable
|
|
33
|
+
claim and confirm (baseline) before proceeding. Show me the key findings
|
|
34
|
+
before step 3.
|
|
32
35
|
|
|
33
36
|
If none: proceed directly to step 3 (impl-research may still be dispatched
|
|
34
37
|
in step 3 for non-trivial changes per the original logic).
|
|
@@ -37,11 +40,13 @@ Use when PLAN.md no longer matches reality. Change: $ARGUMENTS
|
|
|
37
40
|
was not needed, dispatch `researcher` in IMPL mode to ground the re-plan
|
|
38
41
|
in facts.
|
|
39
42
|
|
|
40
|
-
4. RE-PLAN. Dispatch `planner` with the change + current PLAN.md
|
|
43
|
+
4. RE-PLAN. Dispatch `planner` with the change + current PLAN.md + DATAFLOW.md.
|
|
44
|
+
It must:
|
|
41
45
|
- Keep done phases untouched.
|
|
42
46
|
- Insert / cut / split / merge / reorder only PENDING phases.
|
|
43
47
|
- Place new phases in correct DEPENDENCY order.
|
|
44
48
|
- Keep every phase a vertical slice with its own acceptance spec.
|
|
49
|
+
- Preserve the UI-existence criterion on any frontend-touching phase.
|
|
45
50
|
- Ensure the LAST pending phase still contains the deploy task block.
|
|
46
51
|
- Renumber pending phases if needed; update STATE.md `phase:` pointer.
|
|
47
52
|
|
|
@@ -54,11 +59,20 @@ Use when PLAN.md no longer matches reality. Change: $ARGUMENTS
|
|
|
54
59
|
reconciled corpus still passes against live services. A failure -> surface it
|
|
55
60
|
and stop before approval.
|
|
56
61
|
|
|
57
|
-
6.
|
|
58
|
-
|
|
62
|
+
6. RECONCILE DATAFLOW.md (v2.1). If the re-plan adds, cuts, or re-scopes objects
|
|
63
|
+
or transitions, update docs/DATAFLOW.md in step:
|
|
64
|
+
- A CUT/removed object or transition -> remove its row(s) and retire the
|
|
65
|
+
matching regression test(s).
|
|
66
|
+
- A new object/transition -> add the row(s); mark them PENDING until the phase
|
|
67
|
+
that makes them reachable runs. The deploy-last / "no PENDING at final phase"
|
|
68
|
+
invariant (hard rule 14) still holds.
|
|
69
|
+
- A reorder must not strand a transition as permanently unreachable.
|
|
59
70
|
|
|
60
|
-
7.
|
|
71
|
+
7. SHOW ME the revised phase list + the regression-corpus changes + the
|
|
72
|
+
DATAFLOW.md changes, and STOP for approval.
|
|
73
|
+
|
|
74
|
+
8. ARCHITECTURE SELF-CHECK: re-planning is not normally a kit-architecture
|
|
61
75
|
change. Only run /log-decision if the workflow itself changed (rare).
|
|
62
76
|
|
|
63
|
-
Report what changed: phases added / cut / split / reordered,
|
|
64
|
-
|
|
77
|
+
Report what changed: phases added / cut / split / reordered, regression tests
|
|
78
|
+
retired / consolidated, and DATAFLOW rows added / removed.
|
|
@@ -31,6 +31,31 @@ Action: $ARGUMENTS (default: "provision" if INFRA.md missing, "verify" if presen
|
|
|
31
31
|
4. On "make changes": dispatch UPDATE with feedback. Loop to step 2.
|
|
32
32
|
|
|
33
33
|
5. On APPLIED: tell me INFRA.md ✓, .env.test ✓, and any manual steps remaining.
|
|
34
|
+
Then run AUTH PROOF (below) before declaring Phase 0 complete.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## AUTH PROOF (one-time, hard rule 16)
|
|
39
|
+
|
|
40
|
+
Runs after a successful PROVISION (and on demand via `/infra auth-proof`). Proves
|
|
41
|
+
every credential the project's real tests will use is reusable WITHOUT interaction.
|
|
42
|
+
"Reusable" is defined falsifiably: obtainable headlessly TWICE IN A ROW.
|
|
43
|
+
|
|
44
|
+
1. Enumerate the credentials in scope: the Entra/MSAL app login, plus every
|
|
45
|
+
external datasource credential referenced in docs/DATAFLOW.md (external rows)
|
|
46
|
+
and docs/ENDPOINTS.md (auth column) — Azure SQL, Tableau, etc.
|
|
47
|
+
|
|
48
|
+
2. Dispatch `infra-provisioner` to run, for EACH credential, a headless obtain
|
|
49
|
+
twice in a row: first call primes (token fetch / connect), second call must
|
|
50
|
+
succeed from cache/refresh with ZERO prompts. The Microsoft login UI is never
|
|
51
|
+
driven (ROPC + dedicated MFA-excluded test account; hard rule 8).
|
|
52
|
+
|
|
53
|
+
3. Result:
|
|
54
|
+
- All credentials pass twice headlessly -> write `AUTH PROOF: PASS <timestamp>`
|
|
55
|
+
to docs/INFRA.md with the per-credential list. Phase 0 may complete.
|
|
56
|
+
- Any credential prompts or fails the second obtain -> NOT reusable. Write
|
|
57
|
+
`AUTH PROOF: FAIL` + which credential, STOP, tell me what to fix. Phase 0 is
|
|
58
|
+
not complete until the proof passes.
|
|
34
59
|
|
|
35
60
|
---
|
|
36
61
|
|
|
@@ -38,7 +63,7 @@ Action: $ARGUMENTS (default: "provision" if INFRA.md missing, "verify" if presen
|
|
|
38
63
|
|
|
39
64
|
1. Check INFRA.md exists. If missing: tell me to run `/infra provision` first.
|
|
40
65
|
2. Dispatch `infra-provisioner` VERIFY mode.
|
|
41
|
-
3. Return drift report.
|
|
66
|
+
3. Return drift report. If the AUTH PROOF marker is missing or stale, re-run AUTH PROOF.
|
|
42
67
|
|
|
43
68
|
---
|
|
44
69
|
|
|
@@ -14,7 +14,9 @@ Goal: stand up a fresh project workspace with a well-grounded plan.
|
|
|
14
14
|
1. Run the `grill-me` skill to interrogate me. Goal: understand initial scope.
|
|
15
15
|
Cover: project purpose, success criteria, external services, Azure services
|
|
16
16
|
needed (type + sizing), region, deployment target (Azure or local for E2E),
|
|
17
|
-
known constraints, unknowns.
|
|
17
|
+
known constraints, unknowns. ALSO establish:
|
|
18
|
+
- **has_frontend**: is there a browser-facing UI? If yes, what is the frontend
|
|
19
|
+
root path (e.g. `src/web/`, `app/`)? This drives the mandatory-E2E path match.
|
|
18
20
|
Do not stop early. Do not write OVERVIEW.md yet.
|
|
19
21
|
|
|
20
22
|
Store the round-1 answers as working context — do NOT write OVERVIEW.md yet.
|
|
@@ -29,74 +31,132 @@ Store the round-1 answers as working context — do NOT write OVERVIEW.md yet.
|
|
|
29
31
|
Quotas, rate limits, known gaps?
|
|
30
32
|
- Azure services: any sizing or SKU constraints relevant to the use case?
|
|
31
33
|
- Auth patterns: any MSAL/Entra constraints for this scenario?
|
|
34
|
+
- Each external DATASOURCE: its DATA UNDERSTANDING (see step 4).
|
|
32
35
|
- Any other architectural assumption in the round-1 answers worth verifying.
|
|
33
36
|
|
|
34
37
|
3. Dispatch `researcher` in DESIGN mode with the DESIGN TOPICS list.
|
|
35
|
-
It returns a terse summary + file paths.
|
|
36
|
-
|
|
38
|
+
It returns a terse summary + file paths. For every external datasource it
|
|
39
|
+
drafts a DATA UNDERSTANDING to `docs/research/datasource-<name>.md`:
|
|
40
|
+
grain (one row = what?), the fields likely under test with their meaning and
|
|
41
|
+
real-world nullability/range, a sample-fixture shape, and the assumption that
|
|
42
|
+
if wrong makes a test meaningless. Read the design-<slug>.md files only if needed.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
### RESEARCH REVIEW (v2.1 — read-and-confirm, not a grill)
|
|
47
|
+
|
|
48
|
+
4. Surface the design-research findings to me DIRECTLY, phrased as FALSIFIABLE
|
|
49
|
+
CLAIMS about my systems — not a passive findings dump. For example:
|
|
50
|
+
"I understand your Tableau extract refreshes nightly and the API is read-only;
|
|
51
|
+
the `orders` grain is one row per line-item; `status` is never null in practice."
|
|
52
|
+
For each external datasource, present its drafted DATA UNDERSTANDING for me to
|
|
53
|
+
confirm or correct. Then:
|
|
54
|
+
- Minor corrections -> fold forward as seed context for round-2 grill.
|
|
55
|
+
- A MATERIAL error (wrong service tier, wrong data model, wrong grain) ->
|
|
56
|
+
re-dispatch `researcher` with the correction, then re-present. Do not carry
|
|
57
|
+
a known-wrong research file into grill or OVERVIEW.md.
|
|
58
|
+
A confirmed datasource understanding is recorded as the BASELINE in its
|
|
59
|
+
`datasource-<name>.md`. (Per-phase delta-confirms happen later in `/phase`.)
|
|
37
60
|
|
|
38
61
|
---
|
|
39
62
|
|
|
40
63
|
### Round 2 — Research-informed re-grill
|
|
41
64
|
|
|
42
|
-
|
|
65
|
+
5. Run `grill-me` again — a second focused pass. Seed it with:
|
|
43
66
|
- The round-1 answers (already established — do not re-ask these)
|
|
44
67
|
- The design-research key findings and new questions raised
|
|
68
|
+
- The RESEARCH REVIEW corrections
|
|
45
69
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
70
|
+
This pass MUST explicitly cover DATA STRUCTURE and DATAFLOW, especially the
|
|
71
|
+
STATE FLOW of each key object: what are the core entities, what states does
|
|
72
|
+
each move through, what transition triggers each change, who writes it, and
|
|
73
|
+
does any state map to an external system. The re-grill asks whatever else it
|
|
74
|
+
needs for complete understanding. Do not re-ask what round 1 established.
|
|
50
75
|
|
|
51
76
|
---
|
|
52
77
|
|
|
53
|
-
### Write OVERVIEW.md
|
|
78
|
+
### Write OVERVIEW.md + DATAFLOW.md
|
|
54
79
|
|
|
55
|
-
|
|
56
|
-
+ round-2. Include:
|
|
80
|
+
6. Write docs/OVERVIEW.md from the COMBINED output of round-1 + design-research
|
|
81
|
+
+ research review + round-2. Include:
|
|
57
82
|
- Project purpose and success criteria
|
|
58
83
|
- Scope and constraints (informed by research findings)
|
|
59
84
|
- External services with confirmed capabilities/limits
|
|
60
85
|
- "Azure services" section: every service with expected SKU
|
|
61
86
|
- Deployment target (azure-deployed or local-docker for E2E)
|
|
87
|
+
- `has_frontend: true|false` and, if true, the frontend root path
|
|
62
88
|
- Known risks / open questions (if any remain)
|
|
63
89
|
|
|
64
90
|
OVERVIEW.md is written HERE — after the re-grill, not before.
|
|
65
91
|
|
|
92
|
+
7. Write docs/DATAFLOW.md — a state-transition table per key object, driven by the
|
|
93
|
+
round-2 data/state-flow grill. The data-side analogue of ENDPOINTS.md. Columns:
|
|
94
|
+
```
|
|
95
|
+
# Dataflow — <project name>
|
|
96
|
+
> Maintained from /overview; updated each phase that changes an object lifecycle.
|
|
97
|
+
> Each transition row is one testable unit (drives the CLOSE coverage gate).
|
|
98
|
+
|
|
99
|
+
| object | states | transition (from→to) | trigger | who writes | external system |
|
|
100
|
+
|--------|--------|----------------------|---------|------------|-----------------|
|
|
101
|
+
| Order | draft,submitted,fulfilled | draft→submitted | POST /orders/submit | order-svc | — |
|
|
102
|
+
```
|
|
103
|
+
Any row whose `external system` is populated ties to a `datasource-<name>.md`.
|
|
104
|
+
|
|
66
105
|
---
|
|
67
106
|
|
|
68
107
|
### Plan
|
|
69
108
|
|
|
70
|
-
|
|
71
|
-
PLAN.md MUST:
|
|
109
|
+
8. Hand OVERVIEW.md + DATAFLOW.md + design-research findings to the `planner`
|
|
110
|
+
subagent. PLAN.md MUST:
|
|
72
111
|
- Start with Phase 0 (infra setup) as the first entry (always).
|
|
73
112
|
- End with a final code phase that contains the deploy task block.
|
|
74
|
-
|
|
75
|
-
|
|
113
|
+
- For any phase whose `changes` touch the frontend root: include ≥1
|
|
114
|
+
UI-existence acceptance criterion naming the specific user-visible
|
|
115
|
+
interactive element the phase introduces (not "page renders 200").
|
|
116
|
+
- Map each phase to the DATAFLOW transitions it is expected to make reachable.
|
|
117
|
+
|
|
118
|
+
The planner ALSO writes the up-front SKELETON spec files (v2.2, §5.44/§5.51):
|
|
119
|
+
one `docs/spec-phase-<n>.md` per public-surface phase (skip Phase 0 + pure
|
|
120
|
+
infra/config/doc phases), enumerating the case NAMES — happy path, each named
|
|
121
|
+
edge, each named failure + error code — for every `dataflow:` transition and
|
|
122
|
+
every `acceptance` criterion, with `TBD` values. The generated header transcludes
|
|
123
|
+
that phase's `acceptance:` line + in-scope `DATAFLOW.md` transition rows verbatim.
|
|
124
|
+
|
|
125
|
+
8b. STAMP each skeleton's staleness hash: for every `docs/spec-phase-<n>.md` the
|
|
126
|
+
planner wrote, run `bash scripts/spec-staleness.sh stamp <n>`. This embeds the
|
|
127
|
+
hash of the transcluded acceptance line + transition rows so phase-time
|
|
128
|
+
`/phase` can detect upstream drift. (Values are filled per phase by `spec-author`.)
|
|
129
|
+
|
|
130
|
+
9. Create docs/STATE.md:
|
|
76
131
|
```
|
|
77
132
|
|
|
78
133
|
# STATE
|
|
79
134
|
|
|
80
135
|
phase: 0 (pending)
|
|
81
|
-
completed: project bootstrapped — design research
|
|
136
|
+
completed: project bootstrapped — design research, research review, double grill (incl. data/state flow) done
|
|
82
137
|
next: run /infra to provision Azure infrastructure
|
|
83
138
|
blocker: none
|
|
84
139
|
|
|
85
140
|
```
|
|
86
|
-
|
|
141
|
+
10. Create docs/ISSUES.md with header `# Issues` and `## Archived` section.
|
|
87
142
|
|
|
88
|
-
|
|
143
|
+
11. Create empty docs/HISTORY.md.
|
|
89
144
|
|
|
90
|
-
|
|
145
|
+
12. Create docs/INFRA.md from the template (populated by /infra).
|
|
91
146
|
|
|
92
|
-
|
|
147
|
+
13. Create docs/ENDPOINTS.md:
|
|
93
148
|
```
|
|
94
149
|
# Endpoints — <project name>
|
|
95
150
|
> Maintained by implementer. Updated each phase.
|
|
96
151
|
> Base URL: (populated after deployment phase)
|
|
97
152
|
```
|
|
98
153
|
|
|
99
|
-
Then stop and show me PLAN.md for approval before any phase starts.
|
|
154
|
+
Then stop and show me PLAN.md + DATAFLOW.md for approval before any phase starts.
|
|
155
|
+
EXTEND the approval surface (v2.2, §5.51 — one confirmation, no new gate): for each
|
|
156
|
+
public-surface phase, list the transition/acceptance ids it covers and the enumerated
|
|
157
|
+
case NAMES (no values). I confirm the case-name set is COMPLETE here — these names
|
|
158
|
+
are the up-front behavioral contract; values get filled + reviewed per phase at
|
|
159
|
+
`/phase` SPEC REVIEW.
|
|
100
160
|
|
|
101
|
-
Remind me: "Run `/infra` next to provision the Azure environment (Phase 0)
|
|
102
|
-
before starting Phase 1."
|
|
161
|
+
Remind me: "Run `/infra` next to provision the Azure environment (Phase 0) and
|
|
162
|
+
run the one-time AUTH PROOF before starting Phase 1."
|