create-anpunkit 2.0.1 → 2.1.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 +15 -1
- package/template/.claude/agents/infra-provisioner.md +33 -2
- package/template/.claude/agents/planner.md +15 -5
- package/template/.claude/agents/researcher.md +19 -8
- package/template/.claude/agents/test-author.md +25 -2
- package/template/.claude/anpunkit-manifest.json +22 -22
- package/template/.claude/commands/infra.md +28 -3
- package/template/.claude/commands/overview.md +66 -23
- package/template/.claude/commands/phase.md +68 -16
- package/template/.claude/commands/replan.md +23 -9
- package/template/.cursor/commands/infra.md +26 -1
- package/template/.cursor/commands/overview.md +65 -22
- package/template/.cursor/commands/phase.md +67 -15
- package/template/.cursor/commands/replan.md +22 -8
- package/template/AGENTS.md +101 -25
- package/template/README.md +54 -23
- package/template/anpunkit.png +0 -0
- package/template/commands.src/infra.md +28 -3
- package/template/commands.src/overview.md +66 -23
- package/template/commands.src/phase.md +68 -16
- package/template/commands.src/replan.md +23 -9
- package/template/docs/DESIGN_LOG.md +11 -0
- package/template/index.html +340 -0
- package/template/setup.sh +137 -56
|
@@ -1,5 +1,5 @@
|
|
|
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 SCAFFOLD -> RED -> TEST REVIEW -> GREEN; 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
|
|
|
@@ -29,8 +29,20 @@ 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 — replaces the old soft nudge): if this phase
|
|
33
|
+
will run a real/E2E suite, 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 -> real/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 for the GATE.
|
|
34
46
|
|
|
35
47
|
---
|
|
36
48
|
|
|
@@ -40,13 +52,21 @@ Dispatch `researcher` in IMPL mode scoped to this phase.
|
|
|
40
52
|
Returns terse summary + path. Read the file only if needed.
|
|
41
53
|
Unknowns block the phase -> re-dispatch narrowed. No guessing.
|
|
42
54
|
|
|
55
|
+
DATASOURCE DELTA (hard rule 15): if this phase tests against an external
|
|
56
|
+
datasource, compare what it touches to the confirmed BASELINE in
|
|
57
|
+
docs/research/datasource-<name>.md. If it touches a NEW table/column beyond the
|
|
58
|
+
baseline -> surface my understanding of just that delta as a falsifiable claim;
|
|
59
|
+
WAIT for confirm; append it to datasource-<name>.md. If it touches only confirmed
|
|
60
|
+
data -> proceed with a one-line note, no stop. Real/E2E against an UNCONFIRMED
|
|
61
|
+
datasource is HARD-BLOCKED (mock still runs).
|
|
62
|
+
|
|
43
63
|
Then classify the phase:
|
|
44
64
|
|
|
45
65
|
`TDD_PHASE` = the phase adds or changes a PUBLIC CALLABLE SURFACE (endpoint,
|
|
46
66
|
exported function/class, CLI command, message contract) assertable from the
|
|
47
67
|
acceptance spec. Size is NOT the criterion.
|
|
48
68
|
|
|
49
|
-
- Clear public surface -> `TDD_PHASE=true` -> run the TDD path (§2 → §3a → §3b).
|
|
69
|
+
- Clear public surface -> `TDD_PHASE=true` -> run the TDD path (§2 → §3a → §3r → §3b).
|
|
50
70
|
- Pure infra/config/doc, no public surface -> `TDD_PHASE=false` -> run the
|
|
51
71
|
non-TDD path (§2N → §3N).
|
|
52
72
|
- AMBIGUOUS -> default `TDD_PHASE=true`, but STATE the classification + the reason
|
|
@@ -66,8 +86,10 @@ Returns the stub files + the interface surface.
|
|
|
66
86
|
## 3a. RED
|
|
67
87
|
|
|
68
88
|
Dispatch `test-author` to write the REAL API suite (+ mock) BLIND against the
|
|
69
|
-
stubs + acceptance
|
|
70
|
-
|
|
89
|
+
stubs + acceptance, AND emit docs/test-plan-phase-<n>.md (acceptance criteria →
|
|
90
|
+
test names, plus a mandatory "NOT covered / assumptions" section). Place
|
|
91
|
+
contract/ENDPOINTS/DATAFLOW-transition tests in `tests/regression/`, phase-local
|
|
92
|
+
tests in `tests/phase-<n>/`. Run the suite.
|
|
71
93
|
|
|
72
94
|
RED GATE = every acceptance test COLLECTS cleanly AND FAILS (assertion /
|
|
73
95
|
NotImplemented).
|
|
@@ -76,14 +98,29 @@ NotImplemented).
|
|
|
76
98
|
fix SIGNATURES (not logic); re-run.
|
|
77
99
|
- UNDERSPEC -> STOP; ask me to sharpen the acceptance spec.
|
|
78
100
|
|
|
101
|
+
## 3r. TEST REVIEW — human gate (hard rule 12)
|
|
102
|
+
|
|
103
|
+
STOP. Surface docs/test-plan-phase-<n>.md to me: what each acceptance criterion
|
|
104
|
+
maps to, and the "NOT covered / assumptions" section. GREEN cannot begin until I
|
|
105
|
+
approve. On rejection, classify with me:
|
|
106
|
+
- MISREAD of an adequate spec -> re-dispatch `test-author` with my feedback as
|
|
107
|
+
added constraint; re-run RED; re-present the test plan.
|
|
108
|
+
- UNDERSPEC (the acceptance spec itself is too vague) -> sharpen the acceptance
|
|
109
|
+
spec in docs/PLAN.md, then re-dispatch `test-author` fresh.
|
|
110
|
+
Loop until I approve. This gate is unskippable on TDD phases.
|
|
111
|
+
|
|
79
112
|
## 3b. GREEN
|
|
80
113
|
|
|
81
114
|
Dispatch `implementer` in FILL mode with the phase spec + research + the test
|
|
82
115
|
file paths (it MAY read the tests — frozen before logic, no overfit — but must
|
|
83
116
|
NOT edit them). Fill to green. Budget 3, WARN@2, STUCK@3.
|
|
84
117
|
|
|
85
|
-
|
|
86
|
-
`scripts/e2e-stack.sh up`
|
|
118
|
+
If FRONTEND_PHASE (from PRE-FLIGHT e): dispatch `e2e-runner` — MANDATORY, not
|
|
119
|
+
optional (hard rule 13). It reads INFRA.md target, runs `scripts/e2e-stack.sh up`
|
|
120
|
+
/ Playwright / `down`, and captures a screenshot at EACH UI-existence assertion
|
|
121
|
+
regardless of pass/fail to docs/evidence/e2e-phase-<n>/, with a summary in
|
|
122
|
+
docs/research/e2e-<slug>.md. Acceptance spec has no UI-existence criterion ->
|
|
123
|
+
e2e-runner returns UNDERSPEC -> STOP, sharpen the spec.
|
|
87
124
|
|
|
88
125
|
PHASE GATE (rule 5) -> go to §4/§5/§6 (see GATE below).
|
|
89
126
|
|
|
@@ -101,15 +138,17 @@ includes "deployed URL" before proceeding.
|
|
|
101
138
|
## 3N. TEST (blind)
|
|
102
139
|
|
|
103
140
|
Dispatch `test-author`. It writes MOCK + REAL API suites from the acceptance
|
|
104
|
-
spec — never reads the logic. (
|
|
141
|
+
spec — never reads the logic. (No TEST REVIEW gate on the non-TDD path — no
|
|
142
|
+
public surface to mis-test. e2e-runner only if FRONTEND_PHASE.)
|
|
105
143
|
|
|
106
144
|
=====================================================================
|
|
107
145
|
|
|
108
146
|
## GATE (both paths)
|
|
109
147
|
|
|
110
|
-
PHASE GATE = current-phase REAL API suite passes AND (
|
|
111
|
-
the accumulated mock regression corpus stays green AND
|
|
112
|
-
entry has a regression test
|
|
148
|
+
PHASE GATE = current-phase REAL API suite passes AND (FRONTEND_PHASE) E2E passes
|
|
149
|
+
WITH evidence captured AND the accumulated mock regression corpus stays green AND
|
|
150
|
+
every docs/ENDPOINTS.md entry has a regression test AND every REACHABLE
|
|
151
|
+
docs/DATAFLOW.md transition has a regression test (all checked at CLOSE).
|
|
113
152
|
- GATE PASS -> go to CLOSE.
|
|
114
153
|
- GATE BLOCKED (SERVICE UNAVAILABLE, STACK NOT READY, AZURE UNAVAILABLE, FLAKE)
|
|
115
154
|
-> tell me, wait. Not a code bug. For AZURE UNAVAILABLE: suggest `/infra verify`.
|
|
@@ -142,17 +181,28 @@ what to try next. Hand control to me.
|
|
|
142
181
|
|
|
143
182
|
## 6. CLOSE
|
|
144
183
|
|
|
145
|
-
REGRESSION
|
|
184
|
+
REGRESSION + COVERAGE GATES (before closing — all FAIL HARD, do not close):
|
|
146
185
|
- Run `scripts/regression.sh` (mock corpus). A failure BLOCKS close -> route to FIX.
|
|
147
186
|
- ENDPOINTS COVERAGE: every `docs/ENDPOINTS.md` entry MUST have >=1 test in
|
|
148
|
-
`tests/regression/`. Zero coverage -> FAIL HARD
|
|
187
|
+
`tests/regression/`. Zero coverage -> FAIL HARD.
|
|
188
|
+
- DATAFLOW COVERAGE (hard rule 14): every `docs/DATAFLOW.md` transition whose
|
|
189
|
+
trigger is REACHABLE in the code shipped so far MUST have >=1 test in
|
|
190
|
+
`tests/regression/`. Zero coverage on a reachable transition -> FAIL HARD.
|
|
191
|
+
Unreachable transitions list as PENDING (not failed). IF IS_FINAL_PHASE: any
|
|
192
|
+
transition still PENDING -> FAIL HARD (everything must be live by the last phase).
|
|
193
|
+
- EVIDENCE (FRONTEND_PHASE only, hard rule 13): docs/evidence/e2e-phase-<n>/ must
|
|
194
|
+
contain at least the per-UI-existence-assertion screenshots. Empty -> FAIL HARD.
|
|
149
195
|
- IF IS_FINAL_PHASE: additionally run `scripts/regression.sh --real` (full real
|
|
150
196
|
corpus). A failure blocks close.
|
|
151
197
|
|
|
152
198
|
Mark phase `done` in docs/PLAN.md.
|
|
153
199
|
|
|
154
|
-
ARCHITECTURE SELF-CHECK:
|
|
155
|
-
|
|
200
|
+
ARCHITECTURE / DATAFLOW SELF-CHECK:
|
|
201
|
+
- Did this phase add/remove/rename an agent, hook, or command, or change a
|
|
202
|
+
workflow rule? YES -> run `/log-decision`. NO -> state why not.
|
|
203
|
+
- Did this phase add/change an object's STATE LIFECYCLE? YES -> update
|
|
204
|
+
docs/DATAFLOW.md (hard rule 9) in this CLOSE, and confirm new reachable
|
|
205
|
+
transitions are covered. NO -> state why not.
|
|
156
206
|
|
|
157
207
|
IF IS_FINAL_PHASE — FINAL CLOSE sequence:
|
|
158
208
|
|
|
@@ -175,6 +225,7 @@ IF IS_FINAL_PHASE — FINAL CLOSE sequence:
|
|
|
175
225
|
|
|
176
226
|
## Docs
|
|
177
227
|
- Full endpoint catalogue: docs/ENDPOINTS.md
|
|
228
|
+
- Object/state flow: docs/DATAFLOW.md
|
|
178
229
|
- Infrastructure: docs/INFRA.md
|
|
179
230
|
- Project history: docs/HISTORY.md
|
|
180
231
|
```
|
|
@@ -194,6 +245,7 @@ After each step, update docs/STATE.md:
|
|
|
194
245
|
|
|
195
246
|
phase: <n> (in progress)
|
|
196
247
|
tdd: <true|false>
|
|
248
|
+
frontend_phase: <true|false>
|
|
197
249
|
completed: <steps done so far>
|
|
198
250
|
next: <exact next step>
|
|
199
251
|
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.
|
|
@@ -17,6 +17,17 @@
|
|
|
17
17
|
|
|
18
18
|
Newest first. One entry per architectural change. Appended by `/log-decision`.
|
|
19
19
|
|
|
20
|
+
- **(v2.0.2)** — KB setup stays PATH-FIRST: the user clones the KB repo
|
|
21
|
+
themselves (`git clone ... ~/anpunkit-kb`) and passes `--kb-path` (or the
|
|
22
|
+
interactive prompt). New: the remote URL is auto-recorded from the clone's
|
|
23
|
+
`origin`, so `--kb-remote` is optional metadata. After setup, no manual git:
|
|
24
|
+
the session-start hook pulls; `/store-wisdom` commits and pushes (human-gated).
|
|
25
|
+
REJECTED: URL-first setup where anpunkit runs `git clone` itself — it was built
|
|
26
|
+
and tested, then dropped: it entangles a fresh install with the user's GitHub
|
|
27
|
+
authentication (SSH keys / gh auth), and a clone failure mid-setup is a worse
|
|
28
|
+
failure mode than asking a developer to run one clone command they already
|
|
29
|
+
understand. Setup records state; it does not acquire credentials.
|
|
30
|
+
|
|
20
31
|
- **(v2.0.1)** — Windows portability fix for the npx installer. (1) `cli.js` no
|
|
21
32
|
longer trusts bare `bash` on win32: PowerShell resolves it to the System32 WSL
|
|
22
33
|
relay, which fails with `execvpe(/bin/bash)` when no distro is installed. The
|