create-anpunkit 2.2.0 → 2.3.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 +2 -2
- package/package.json +2 -3
- package/template/.claude/agents/debugger.md +1 -1
- package/template/.claude/agents/e2e-runner.md +13 -3
- package/template/.claude/agents/implementer.md +1 -1
- package/template/.claude/agents/infra-provisioner.md +53 -59
- package/template/.claude/agents/planner.md +35 -29
- package/template/.claude/agents/researcher.md +16 -1
- package/template/.claude/agents/spec-author.md +9 -1
- package/template/.claude/agents/synthesizer.md +1 -1
- package/template/.claude/agents/test-author.md +9 -1
- package/template/.claude/anpunkit-manifest.json +52 -113
- package/template/.claude/commands/infra.md +7 -3
- package/template/.claude/commands/log-decision.md +1 -1
- package/template/.claude/commands/log-issue.md +1 -1
- package/template/.claude/commands/overview.md +37 -12
- package/template/.claude/commands/phase.md +50 -25
- package/template/.claude/commands/quick.md +1 -1
- package/template/.claude/commands/replan.md +1 -1
- package/template/.claude/commands/store-wisdom.md +1 -1
- package/template/.claude/commands/synthesize.md +1 -1
- package/template/.claude/commands/unstuck.md +1 -1
- package/template/.claude/hooks/session-start.sh +5 -11
- package/template/.claude/ref/compression.md +56 -0
- package/template/.claude/skills/karpathy-guidelines/SKILL.md +1 -1
- package/template/AGENTS.md +115 -84
- package/template/CLAUDE.md +4 -9
- package/template/README.md +91 -122
- package/template/commands.src/infra.md +7 -3
- package/template/commands.src/log-decision.md +1 -1
- package/template/commands.src/log-issue.md +1 -1
- package/template/commands.src/overview.md +37 -12
- package/template/commands.src/phase.md +50 -25
- package/template/commands.src/quick.md +1 -1
- package/template/commands.src/replan.md +1 -1
- package/template/commands.src/store-wisdom.md +1 -1
- package/template/commands.src/synthesize.md +1 -1
- package/template/commands.src/unstuck.md +1 -1
- package/template/docs/DESIGN_LOG.md +222 -8
- package/template/knowledge/azure.md +161 -0
- package/template/knowledge/webapp.md +265 -0
- package/template/setup.sh +30 -111
- package/template/.claude/hooks/cursor-session-start.sh +0 -17
- package/template/.claude/skills/caveman/SKILL.md +0 -39
- package/template/.cursor/commands/infra.md +0 -82
- package/template/.cursor/commands/log-decision.md +0 -29
- package/template/.cursor/commands/log-issue.md +0 -23
- package/template/.cursor/commands/overview.md +0 -162
- package/template/.cursor/commands/phase.md +0 -296
- package/template/.cursor/commands/quick.md +0 -25
- package/template/.cursor/commands/replan.md +0 -73
- package/template/.cursor/commands/store-wisdom.md +0 -191
- package/template/.cursor/commands/synthesize.md +0 -22
- package/template/.cursor/commands/unstuck.md +0 -36
- package/template/.cursor/hooks.json +0 -14
- package/template/.cursor/rules/anpunkit.md +0 -11
- package/template/anpunkit.png +0 -0
- package/template/docker-compose.test.yml +0 -34
- package/template/e2e/global-setup.ts +0 -57
- package/template/index.html +0 -339
- package/template/playwright.config.ts +0 -28
- package/template/scripts/auth-setup.sh +0 -51
- package/template/scripts/e2e-stack.sh +0 -65
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
Caveman ULTRA mode.
|
|
2
|
-
|
|
3
|
-
Recommended: run from plan mode (Shift+Tab). Planning agents are read-only by
|
|
4
|
-
tool grant; plan mode adds a read-only gate on the main session too. Optional.
|
|
5
|
-
|
|
6
|
-
Goal: stand up a fresh project workspace with a well-grounded plan.
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Steps
|
|
11
|
-
|
|
12
|
-
### Round 1 — Initial grill
|
|
13
|
-
|
|
14
|
-
1. Run the `grill-me` skill to interrogate me. Goal: understand initial scope.
|
|
15
|
-
Cover: project purpose, success criteria, external services, Azure services
|
|
16
|
-
needed (type + sizing), region, deployment target (Azure or local for E2E),
|
|
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.
|
|
20
|
-
Do not stop early. Do not write OVERVIEW.md yet.
|
|
21
|
-
|
|
22
|
-
Store the round-1 answers as working context — do NOT write OVERVIEW.md yet.
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
### Design research
|
|
27
|
-
|
|
28
|
-
2. Extract DESIGN TOPICS from the round-1 answers. These are things we need
|
|
29
|
-
to verify before planning:
|
|
30
|
-
- Each external service mentioned: what does it support at the relevant tier?
|
|
31
|
-
Quotas, rate limits, known gaps?
|
|
32
|
-
- Azure services: any sizing or SKU constraints relevant to the use case?
|
|
33
|
-
- Auth patterns: any MSAL/Entra constraints for this scenario?
|
|
34
|
-
- Each external DATASOURCE: its DATA UNDERSTANDING (see step 4).
|
|
35
|
-
- Any other architectural assumption in the round-1 answers worth verifying.
|
|
36
|
-
|
|
37
|
-
3. Dispatch `researcher` in DESIGN mode with the DESIGN TOPICS list.
|
|
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`.)
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
### Round 2 — Research-informed re-grill
|
|
64
|
-
|
|
65
|
-
5. Run `grill-me` again — a second focused pass. Seed it with:
|
|
66
|
-
- The round-1 answers (already established — do not re-ask these)
|
|
67
|
-
- The design-research key findings and new questions raised
|
|
68
|
-
- The RESEARCH REVIEW corrections
|
|
69
|
-
|
|
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.
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
### Write OVERVIEW.md + DATAFLOW.md
|
|
79
|
-
|
|
80
|
-
6. Write docs/OVERVIEW.md from the COMBINED output of round-1 + design-research
|
|
81
|
-
+ research review + round-2. Include:
|
|
82
|
-
- Project purpose and success criteria
|
|
83
|
-
- Scope and constraints (informed by research findings)
|
|
84
|
-
- External services with confirmed capabilities/limits
|
|
85
|
-
- "Azure services" section: every service with expected SKU
|
|
86
|
-
- Deployment target (azure-deployed or local-docker for E2E)
|
|
87
|
-
- `has_frontend: true|false` and, if true, the frontend root path
|
|
88
|
-
- Known risks / open questions (if any remain)
|
|
89
|
-
|
|
90
|
-
OVERVIEW.md is written HERE — after the re-grill, not before.
|
|
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
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
### Plan
|
|
108
|
-
|
|
109
|
-
8. Hand OVERVIEW.md + DATAFLOW.md + design-research findings to the `planner`
|
|
110
|
-
subagent. PLAN.md MUST:
|
|
111
|
-
- Start with Phase 0 (infra setup) as the first entry (always).
|
|
112
|
-
- End with a final code phase that contains the deploy task block.
|
|
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:
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
# STATE
|
|
134
|
-
|
|
135
|
-
phase: 0 (pending)
|
|
136
|
-
completed: project bootstrapped — design research, research review, double grill (incl. data/state flow) done
|
|
137
|
-
next: run /infra to provision Azure infrastructure
|
|
138
|
-
blocker: none
|
|
139
|
-
|
|
140
|
-
```
|
|
141
|
-
10. Create docs/ISSUES.md with header `# Issues` and `## Archived` section.
|
|
142
|
-
|
|
143
|
-
11. Create empty docs/HISTORY.md.
|
|
144
|
-
|
|
145
|
-
12. Create docs/INFRA.md from the template (populated by /infra).
|
|
146
|
-
|
|
147
|
-
13. Create docs/ENDPOINTS.md:
|
|
148
|
-
```
|
|
149
|
-
# Endpoints — <project name>
|
|
150
|
-
> Maintained by implementer. Updated each phase.
|
|
151
|
-
> Base URL: (populated after deployment phase)
|
|
152
|
-
```
|
|
153
|
-
|
|
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.
|
|
160
|
-
|
|
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."
|
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
Caveman ULTRA mode. You are the ORCHESTRATOR. Route work to subagents —
|
|
2
|
-
you do NOT implement, fill specs, or debug yourself.
|
|
3
|
-
|
|
4
|
-
Note: subagents cannot talk to the user. Only YOU can.
|
|
5
|
-
|
|
6
|
-
Target phase: $ARGUMENTS (default: the phase marked pending in docs/PLAN.md)
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## 0. PRE-FLIGHT
|
|
11
|
-
|
|
12
|
-
a. INFRA CHECK (phases > 0):
|
|
13
|
-
- Read docs/INFRA.md. If Phase 0 not done -> STOP.
|
|
14
|
-
Tell me: "Phase 0 (infra) not complete. Run `/infra` first."
|
|
15
|
-
- Exception: if $ARGUMENTS is "0", tell me to run `/infra` directly.
|
|
16
|
-
|
|
17
|
-
b. PHASE STATE CHECK: Read docs/STATE.md and docs/PLAN.md.
|
|
18
|
-
- No phase in progress, requested is next pending -> START at step 1.
|
|
19
|
-
- Same phase in-progress -> RESUME from STATE.md "next action".
|
|
20
|
-
- Different phase in-progress -> STOP. Tell me which phase is open.
|
|
21
|
-
- Out of dependency order -> STOP. Warn, proceed only if I confirm.
|
|
22
|
-
- Phase not in PLAN.md -> STOP. Suggest /overview or /replan.
|
|
23
|
-
|
|
24
|
-
c. FINAL PHASE CHECK: Read docs/PLAN.md. Is this the last phase (no further
|
|
25
|
-
pending phases after this one)? Record this as IS_FINAL_PHASE=true/false.
|
|
26
|
-
|
|
27
|
-
d. AUTH LIVENESS GATE (hard rule 16): if this phase will run a boundary/E2E suite,
|
|
28
|
-
confirm every credential it needs is live NOW.
|
|
29
|
-
- If INFRA.md has no `AUTH PROOF: PASS` marker -> STOP: "Auth never proven
|
|
30
|
-
reusable. Run `/infra` first."
|
|
31
|
-
- Run `scripts/auth-setup.sh --check` (Entra token obtainable + not expired)
|
|
32
|
-
and, for each external system this phase touches (docs/DATAFLOW.md external
|
|
33
|
-
rows + docs/ENDPOINTS.md auth column), confirm its credential is obtainable
|
|
34
|
-
headlessly. Any failure -> boundary/E2E is BLOCKED; tell me what to run; the
|
|
35
|
-
MOCK suite may still proceed.
|
|
36
|
-
|
|
37
|
-
e. FRONTEND TRIGGER (hard rule 13): read docs/OVERVIEW.md `has_frontend` + the
|
|
38
|
-
frontend root. Set FRONTEND_PHASE=true iff `has_frontend: true` AND this
|
|
39
|
-
phase's `changes` (docs/PLAN.md) include any path under the frontend root.
|
|
40
|
-
This is a PATH MATCH, not a judgment call. Record FRONTEND_PHASE — it gates the
|
|
41
|
-
`ui` boundary run + evidence at CLOSE.
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## 1. RESEARCH + TDD APPLICABILITY
|
|
46
|
-
|
|
47
|
-
Dispatch `researcher` in IMPL mode scoped to this phase.
|
|
48
|
-
Returns terse summary + path. Read the file only if needed.
|
|
49
|
-
Unknowns block the phase -> re-dispatch narrowed. No guessing.
|
|
50
|
-
|
|
51
|
-
DATASOURCE DELTA (hard rule 15): if this phase tests against an external
|
|
52
|
-
datasource, compare what it touches to the confirmed BASELINE in
|
|
53
|
-
docs/research/datasource-<name>.md. If it touches a NEW table/column beyond the
|
|
54
|
-
baseline -> surface my understanding of just that delta as a falsifiable claim;
|
|
55
|
-
WAIT for confirm; append it to datasource-<name>.md. If it touches only confirmed
|
|
56
|
-
data -> proceed with a one-line note, no stop. Boundary/E2E against an UNCONFIRMED
|
|
57
|
-
datasource is HARD-BLOCKED (mock still runs). The confirmed baseline is what
|
|
58
|
-
`spec-author` grounds fixtures in.
|
|
59
|
-
|
|
60
|
-
Then classify the phase:
|
|
61
|
-
|
|
62
|
-
`TDD_PHASE` = the phase adds or changes a PUBLIC CALLABLE SURFACE (endpoint,
|
|
63
|
-
exported function/class, CLI command, message contract) assertable from the
|
|
64
|
-
acceptance spec. Size is NOT the criterion.
|
|
65
|
-
|
|
66
|
-
- Clear public surface -> `TDD_PHASE=true` -> run the TDD path (§2 → §3 → §4 → §5 → §6 → §7).
|
|
67
|
-
- Pure infra/config/doc, no public surface -> `TDD_PHASE=false` -> run the
|
|
68
|
-
non-TDD path (§2N → §3N).
|
|
69
|
-
- AMBIGUOUS -> default `TDD_PHASE=true`, but STATE the classification + the reason
|
|
70
|
-
to me, so I can override to non-TDD BEFORE SPEC fill fires. (Hard rule 11: never
|
|
71
|
-
downgrade a TDD phase just to dodge the gates.)
|
|
72
|
-
|
|
73
|
-
=====================================================================
|
|
74
|
-
## TDD PATH (TDD_PHASE=true)
|
|
75
|
-
=====================================================================
|
|
76
|
-
|
|
77
|
-
## 2. SPEC FILL + STALENESS
|
|
78
|
-
|
|
79
|
-
a. SKELETON CHECK: confirm docs/spec-phase-<n>.md exists (planner generated it at
|
|
80
|
-
/overview). If MISSING (planner classified it non-TDD, or it's a new phase from
|
|
81
|
-
/replan): generate the skeleton NOW from this phase's PLAN.md `acceptance` +
|
|
82
|
-
`dataflow:` transitions in the planner skeleton format (generated header + named
|
|
83
|
-
`TBD` rows), then `bash scripts/spec-staleness.sh stamp <n>` to stamp its hash.
|
|
84
|
-
|
|
85
|
-
b. Dispatch `spec-author`. It fills each case row with a real input payload
|
|
86
|
-
(`fixtures/<case-id>-input.json`), concrete expected output
|
|
87
|
-
(`fixtures/<case-id>-expected.json`), matcher tokens for volatile fields,
|
|
88
|
-
`error-code` for failures, and `selector/assert/value` `ui` descriptors —
|
|
89
|
-
grounded in the RESEARCH findings + the confirmed datasource baseline.
|
|
90
|
-
|
|
91
|
-
c. CASE-SET-DIVERGENCE (hard re-entry, hard rule 12 / §5.52): if `spec-author`
|
|
92
|
-
returns `CASE-SET-DIVERGENCE` (a required case can't be filled from real facts,
|
|
93
|
-
or research revealed an unlisted/contradicted case) -> STOP. Surface the finding.
|
|
94
|
-
I amend the up-front case-name contract in the skeleton; you re-stamp
|
|
95
|
-
(`bash scripts/spec-staleness.sh stamp <n>`); then re-dispatch `spec-author` to
|
|
96
|
-
re-fill from scratch. AI never amends the case-name set — I own the contract.
|
|
97
|
-
|
|
98
|
-
d. STALENESS (hard rule 17): run `bash scripts/spec-staleness.sh <n>`. Nonzero
|
|
99
|
-
(upstream PLAN acceptance line / DATAFLOW rows drifted since the skeleton was
|
|
100
|
-
stamped, e.g. via /replan) -> regenerate the skeleton header from current
|
|
101
|
-
PLAN/DATAFLOW, re-stamp, re-dispatch `spec-author`. Do NOT hand-edit the hash.
|
|
102
|
-
|
|
103
|
-
## 3. SPEC REVIEW — human gate (hard rule 12)
|
|
104
|
-
|
|
105
|
-
STOP. Surface the FILLED cases to me as FALSIFIABLE CLAIMS in plain language, e.g.:
|
|
106
|
-
- "POST /orders/submit with an empty line-item list → 422 EMPTY_ORDER."
|
|
107
|
-
- "Successful submit of a 3-line order → 201; order.id is a UUID; order.status is
|
|
108
|
-
'submitted'."
|
|
109
|
-
Re-run `bash scripts/spec-staleness.sh <n>` at entry (nonzero -> back to §2d).
|
|
110
|
-
SCAFFOLD cannot begin until I confirm. Classify any rejection WITH me (§5.50):
|
|
111
|
-
- WRONG EXPECTED -> fix the case row + `fixtures/<case-id>-expected.json`; no
|
|
112
|
-
re-research. (You may patch the fixture directly per my correction.)
|
|
113
|
-
- WRONG INPUT SHAPE -> re-dispatch `spec-author` with the correction.
|
|
114
|
-
- NEW CASE or CONTRADICTED CASE -> hard re-entry (§2c): I amend the skeleton, you
|
|
115
|
-
re-stamp, re-confirm the amended case(s) + any case sharing their `covers` id
|
|
116
|
-
(the staleness hash certifies the unchanged remainder — not re-read), re-fill.
|
|
117
|
-
Loop until I approve. Unskippable on TDD phases.
|
|
118
|
-
|
|
119
|
-
## 4. SCAFFOLD
|
|
120
|
-
|
|
121
|
-
Dispatch `implementer` in SCAFFOLD mode: interface stubs only (signatures +
|
|
122
|
-
types; bodies raise NotImplementedError / return 501); NO logic, NO tests, NO
|
|
123
|
-
edits to the spec or fixtures. Returns the stub files + the interface surface.
|
|
124
|
-
|
|
125
|
-
## 5. RED
|
|
126
|
-
|
|
127
|
-
Dispatch `test-author` to EMIT the boundary harness from the locked spec `data`
|
|
128
|
-
rows: one deep-equality assertion per case against `fixtures/<case-id>-expected.json`
|
|
129
|
-
via the kit comparator `tests/helpers/spec-assert.*`, each citing its case with a
|
|
130
|
-
`# spec: <case-id>` comment. It does NOT author assertions — it generates them from
|
|
131
|
-
the spec. Place contract/ENDPOINTS/transition tests in `tests/regression/`,
|
|
132
|
-
phase-local in `tests/phase-<n>/`.
|
|
133
|
-
|
|
134
|
-
If FRONTEND_PHASE (and the phase has `ui` cases): also dispatch `e2e-runner` to EMIT
|
|
135
|
-
Playwright assertions from each `ui` case's `fixtures/<case-id>-ui.json` descriptor,
|
|
136
|
-
each citing `// spec: <case-id>`. Run the suites.
|
|
137
|
-
|
|
138
|
-
RED GATE = every case test COLLECTS cleanly AND FAILS (assertion / NotImplemented).
|
|
139
|
-
- Any test PASSES on stubs -> STOP (spec trivial or emitter wrong); show me.
|
|
140
|
-
- Collection / import / syntax error -> stub mismatch; re-dispatch SCAFFOLD to
|
|
141
|
-
fix SIGNATURES (not logic); re-run.
|
|
142
|
-
|
|
143
|
-
## 6. CONFORMANCE GATE (hard rule 18) — replaces the v2.1 human TEST REVIEW
|
|
144
|
-
|
|
145
|
-
Run `bash scripts/spec-conformance.sh <n>`. It loud-fails (and BLOCKS GREEN) if:
|
|
146
|
-
- any `TBD` marker remains in docs/spec-phase-<n>.md or a referenced fixture, OR
|
|
147
|
-
- any case-id in the spec table has no boundary test citing it (`# spec: <case-id>`).
|
|
148
|
-
Nonzero -> fix the gap (re-dispatch `spec-author` for a stray TBD, or `test-author`/
|
|
149
|
-
`e2e-runner` for a missing citation) and re-run. GREEN cannot start until it passes.
|
|
150
|
-
|
|
151
|
-
## 7. GREEN + BOUNDARY/E2E
|
|
152
|
-
|
|
153
|
-
Dispatch `implementer` in FILL mode with the FILLED docs/spec-phase-<n>.md + its
|
|
154
|
-
fixtures + research + the generated test file paths (it MAY read the tests — frozen
|
|
155
|
-
before logic, no overfit — but must NOT edit tests, spec, or fixtures). Fill to
|
|
156
|
-
green against the spec. Budget 3, WARN@2, STUCK@3.
|
|
157
|
-
|
|
158
|
-
Run the BOUNDARY suite (real HTTP/CLI/message; `TEST_MODE=real`). If FRONTEND_PHASE,
|
|
159
|
-
`e2e-runner` runs its emitted `ui` specs — MANDATORY (hard rule 13) — reads INFRA.md
|
|
160
|
-
target, runs `scripts/e2e-stack.sh up` / Playwright / `down`, and captures a
|
|
161
|
-
screenshot at EACH UI-existence assertion regardless of pass/fail to
|
|
162
|
-
docs/evidence/e2e-phase-<n>/, with a summary in docs/research/e2e-<slug>.md.
|
|
163
|
-
|
|
164
|
-
PHASE GATE (rule 5) -> go to §8/§9/§10 (see GATE below).
|
|
165
|
-
|
|
166
|
-
=====================================================================
|
|
167
|
-
## NON-TDD PATH (TDD_PHASE=false)
|
|
168
|
-
=====================================================================
|
|
169
|
-
|
|
170
|
-
## 2N. IMPLEMENT
|
|
171
|
-
|
|
172
|
-
Dispatch `implementer` (legacy mode) with phase spec + research summary.
|
|
173
|
-
Returns STUCK -> go to ESCALATE.
|
|
174
|
-
If IS_FINAL_PHASE: phase spec includes the deploy task; confirm the return
|
|
175
|
-
includes "deployed URL" before proceeding.
|
|
176
|
-
|
|
177
|
-
## 3N. TEST (blind)
|
|
178
|
-
|
|
179
|
-
Dispatch `test-author`. It writes MOCK + boundary suites from the acceptance
|
|
180
|
-
spec — never reads the logic. (No spec file, SPEC REVIEW, or conformance gate on
|
|
181
|
-
the non-TDD path — no public surface to contract. e2e-runner only if FRONTEND_PHASE.)
|
|
182
|
-
|
|
183
|
-
=====================================================================
|
|
184
|
-
|
|
185
|
-
## GATE (both paths)
|
|
186
|
-
|
|
187
|
-
PHASE GATE = current-phase BOUNDARY suite passes AND (FRONTEND_PHASE) the `ui`
|
|
188
|
-
boundary passes WITH evidence captured AND the accumulated mock regression corpus
|
|
189
|
-
stays green AND every docs/ENDPOINTS.md entry has a regression test AND (TDD)
|
|
190
|
-
`spec-conformance.sh` passed AND every REACHABLE docs/DATAFLOW.md transition has a
|
|
191
|
-
filled case in the phase spec (all checked at CLOSE).
|
|
192
|
-
- GATE PASS -> go to CLOSE.
|
|
193
|
-
- GATE BLOCKED (SERVICE UNAVAILABLE, STACK NOT READY, AZURE UNAVAILABLE, FLAKE)
|
|
194
|
-
-> tell me, wait. Not a code bug. For AZURE UNAVAILABLE: suggest `/infra verify`.
|
|
195
|
-
- GATE FAIL (LOGIC FAIL) -> go to FIX.
|
|
196
|
-
|
|
197
|
-
---
|
|
198
|
-
|
|
199
|
-
## 8. FIX
|
|
200
|
-
|
|
201
|
-
Dispatch `debugger` (isolated context) on the specific failure.
|
|
202
|
-
- FIXED -> re-run the boundary suite (and the regression corpus).
|
|
203
|
-
- SERVICE UNAVAILABLE -> tell me, wait. Suggest `/infra verify` if Azure.
|
|
204
|
-
- WARN (2 attempts failed) -> relay immediately, then let debugger finish attempt 3.
|
|
205
|
-
- STUCK -> go to ESCALATE.
|
|
206
|
-
|
|
207
|
-
---
|
|
208
|
-
|
|
209
|
-
## 9. ESCALATE — circuit breaker. Mode B.
|
|
210
|
-
|
|
211
|
-
FIRST STUCK: STOP. Present to me: the problem, 3 failed hypotheses, the
|
|
212
|
-
debugger's recommendation, the debug file path. Ask what to do. Wait. Options:
|
|
213
|
-
(a) "re-research" -> /unstuck
|
|
214
|
-
(b) hint -> re-dispatch debugger with hint, budget 3
|
|
215
|
-
(c) "skip" / "re-slice" -> mark blocked, dispatch planner
|
|
216
|
-
|
|
217
|
-
SECOND STUCK: STOP completely. Full summary — every hypothesis, current state,
|
|
218
|
-
what to try next. Hand control to me.
|
|
219
|
-
|
|
220
|
-
---
|
|
221
|
-
|
|
222
|
-
## 10. CLOSE
|
|
223
|
-
|
|
224
|
-
REGRESSION + COVERAGE GATES (before closing — all FAIL HARD, do not close):
|
|
225
|
-
- Run `bash scripts/regression.sh` (mock corpus). A failure BLOCKS close -> route to FIX.
|
|
226
|
-
- ENDPOINTS COVERAGE: every `docs/ENDPOINTS.md` entry MUST have >=1 test in
|
|
227
|
-
`tests/regression/`. Zero coverage -> FAIL HARD.
|
|
228
|
-
- DATAFLOW COVERAGE (hard rule 14, re-seamed v2.2): every `docs/DATAFLOW.md`
|
|
229
|
-
transition whose trigger is REACHABLE in the code shipped so far MUST have >=1
|
|
230
|
-
FILLED CASE in docs/spec-phase-<n>.md. Zero coverage on a reachable transition ->
|
|
231
|
-
FAIL HARD. Unreachable transitions list as PENDING (not failed). IF
|
|
232
|
-
IS_FINAL_PHASE: any transition still PENDING -> FAIL HARD. (The case→test half is
|
|
233
|
-
already enforced by `spec-conformance.sh` at §6 — every case-id is cited by a
|
|
234
|
-
boundary test, which by placement lands in tests/regression/.)
|
|
235
|
-
- EVIDENCE (FRONTEND_PHASE only, hard rule 13): docs/evidence/e2e-phase-<n>/ must
|
|
236
|
-
contain at least the per-UI-existence-assertion screenshots. Empty -> FAIL HARD.
|
|
237
|
-
- IF IS_FINAL_PHASE: additionally run `bash scripts/regression.sh --real` (full real
|
|
238
|
-
corpus). A failure blocks close.
|
|
239
|
-
|
|
240
|
-
Mark phase `done` in docs/PLAN.md.
|
|
241
|
-
|
|
242
|
-
ARCHITECTURE / DATAFLOW SELF-CHECK:
|
|
243
|
-
- Did this phase add/remove/rename an agent, hook, or command, or change a
|
|
244
|
-
workflow rule? YES -> run `/log-decision`. NO -> state why not.
|
|
245
|
-
- Did this phase add/change an object's STATE LIFECYCLE? YES -> update
|
|
246
|
-
docs/DATAFLOW.md (hard rule 9) in this CLOSE, and confirm new reachable
|
|
247
|
-
transitions are covered by a filled case. NO -> state why not.
|
|
248
|
-
|
|
249
|
-
IF IS_FINAL_PHASE — FINAL CLOSE sequence:
|
|
250
|
-
|
|
251
|
-
a. Run `/synthesize` — pass the signal that this is the final phase so the
|
|
252
|
-
synthesizer runs the extended pass (OVERVIEW.md + README.md update).
|
|
253
|
-
|
|
254
|
-
b. Read docs/ENDPOINTS.md. Surface a "READY TO USE" summary to me:
|
|
255
|
-
```
|
|
256
|
-
✅ PROJECT COMPLETE
|
|
257
|
-
|
|
258
|
-
Deployed at: <base URL from docs/INFRA.md "Deployed base URL">
|
|
259
|
-
|
|
260
|
-
## Endpoints
|
|
261
|
-
<paste the full docs/ENDPOINTS.md table>
|
|
262
|
-
|
|
263
|
-
## Quick start
|
|
264
|
-
- Base URL: <URL>
|
|
265
|
-
- Auth: <Bearer token / API key / none — from ENDPOINTS.md>
|
|
266
|
-
- Health check: GET <base URL>/health
|
|
267
|
-
|
|
268
|
-
## Docs
|
|
269
|
-
- Full endpoint catalogue: docs/ENDPOINTS.md
|
|
270
|
-
- Object/state flow: docs/DATAFLOW.md
|
|
271
|
-
- Infrastructure: docs/INFRA.md
|
|
272
|
-
- Project history: docs/HISTORY.md
|
|
273
|
-
```
|
|
274
|
-
Tell me the project is complete and ready to use.
|
|
275
|
-
|
|
276
|
-
ELSE (not final phase):
|
|
277
|
-
|
|
278
|
-
Run `/synthesize`.
|
|
279
|
-
Tell me phase done + the next phase. Recommend `/clear` then `/phase` next.
|
|
280
|
-
|
|
281
|
-
---
|
|
282
|
-
|
|
283
|
-
## STATE CHECKPOINTING
|
|
284
|
-
|
|
285
|
-
After each step, update docs/STATE.md:
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
phase: <n> (in progress)
|
|
289
|
-
tdd: <true|false>
|
|
290
|
-
frontend_phase: <true|false>
|
|
291
|
-
completed: <steps done so far>
|
|
292
|
-
next: <exact next step>
|
|
293
|
-
blocker: <none or open issue>
|
|
294
|
-
|
|
295
|
-
```
|
|
296
|
-
Keep STATE.md small — overwrite, do not append.
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
Caveman ULTRA mode. Apply `karpathy-guidelines` skill.
|
|
2
|
-
|
|
3
|
-
Purpose: skip the orchestration tax for a 5-line fix.
|
|
4
|
-
|
|
5
|
-
Use `/quick` when ALL hold:
|
|
6
|
-
- change is small (under 30 lines) and obvious
|
|
7
|
-
- no new vertical slice
|
|
8
|
-
- no external service contract change
|
|
9
|
-
- not mid-phase
|
|
10
|
-
|
|
11
|
-
If any fail -> STOP, tell me, recommend `/phase`.
|
|
12
|
-
(Hard rule 11: never route phase-worthy work through `/quick` to dodge the RED gate.)
|
|
13
|
-
|
|
14
|
-
Steps:
|
|
15
|
-
1. grep docs/ISSUES.md for anything related.
|
|
16
|
-
2. Make the change. Smallest diff that works.
|
|
17
|
-
3. Run it — lint/typecheck/smoke. Show me result.
|
|
18
|
-
4. REGRESSION GUARD: run `scripts/regression.sh` (mock corpus). A break BLOCKS the
|
|
19
|
-
`/quick` — surface it to me and stop. No agent chain is added.
|
|
20
|
-
5. Error you cannot fix in 2 tries -> STOP. Recommend `/phase`.
|
|
21
|
-
6. Change revealed a bug -> `/log-issue`.
|
|
22
|
-
7. ARCHITECTURE SELF-CHECK: touched an agent, hook, command, or workflow rule?
|
|
23
|
-
YES -> `/log-decision`.
|
|
24
|
-
|
|
25
|
-
No STATE.md rewrite, no synthesize, no /clear needed.
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
Caveman ULTRA mode.
|
|
2
|
-
|
|
3
|
-
Recommended: run from plan mode (Shift+Tab). Optional; the command stops for
|
|
4
|
-
your approval regardless.
|
|
5
|
-
|
|
6
|
-
Use when PLAN.md no longer matches reality. Change: $ARGUMENTS
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Steps
|
|
11
|
-
|
|
12
|
-
1. PRE-FLIGHT. Read docs/STATE.md and docs/PLAN.md.
|
|
13
|
-
- Phase in progress -> tell me which. Ask: revise around it, or is it the
|
|
14
|
-
thing being changed? Do not silently rewrite a mid-execution phase.
|
|
15
|
-
- Done phases are FROZEN. /replan never edits or reorders done phases.
|
|
16
|
-
- Phase 0 (infra) is ALWAYS frozen once done.
|
|
17
|
-
|
|
18
|
-
2. DESIGN RESEARCH CHECK. Scan $ARGUMENTS for signals that design research
|
|
19
|
-
is warranted before re-planning:
|
|
20
|
-
- A new external service is mentioned (Stripe, Twilio, a new Azure service, etc.)
|
|
21
|
-
- The change involves architecture (a new integration pattern, auth change, etc.)
|
|
22
|
-
- A service tier or quota change is implied
|
|
23
|
-
- A new external DATASOURCE or a change to an object's STATE LIFECYCLE
|
|
24
|
-
|
|
25
|
-
If ANY of these signals are present: dispatch `researcher` in DESIGN mode
|
|
26
|
-
with the specific new service/pattern as the DESIGN TOPICS list. For a new
|
|
27
|
-
datasource, it drafts a DATA UNDERSTANDING; surface it to me as a falsifiable
|
|
28
|
-
claim and confirm (baseline) before proceeding. Show me the key findings
|
|
29
|
-
before step 3.
|
|
30
|
-
|
|
31
|
-
If none: proceed directly to step 3 (impl-research may still be dispatched
|
|
32
|
-
in step 3 for non-trivial changes per the original logic).
|
|
33
|
-
|
|
34
|
-
3. IMPL RESEARCH if needed. If the change is non-trivial but design research
|
|
35
|
-
was not needed, dispatch `researcher` in IMPL mode to ground the re-plan
|
|
36
|
-
in facts.
|
|
37
|
-
|
|
38
|
-
4. RE-PLAN. Dispatch `planner` with the change + current PLAN.md + DATAFLOW.md.
|
|
39
|
-
It must:
|
|
40
|
-
- Keep done phases untouched.
|
|
41
|
-
- Insert / cut / split / merge / reorder only PENDING phases.
|
|
42
|
-
- Place new phases in correct DEPENDENCY order.
|
|
43
|
-
- Keep every phase a vertical slice with its own acceptance spec.
|
|
44
|
-
- Preserve the UI-existence criterion on any frontend-touching phase.
|
|
45
|
-
- Ensure the LAST pending phase still contains the deploy task block.
|
|
46
|
-
- Renumber pending phases if needed; update STATE.md `phase:` pointer.
|
|
47
|
-
|
|
48
|
-
5. RECONCILE THE REGRESSION CORPUS (scoped to `tests/regression/`):
|
|
49
|
-
- A CUT phase -> retire its regression tests.
|
|
50
|
-
- A MERGE -> consolidate the merged phases' regression tests.
|
|
51
|
-
- A REORDER -> keep the tests as-is (contracts are phase-independent).
|
|
52
|
-
Do NOT touch phase-local `tests/phase-<n>/` here beyond renumbering dirs.
|
|
53
|
-
After reconciling, run `scripts/regression.sh --real` to confirm the
|
|
54
|
-
reconciled corpus still passes against live services. A failure -> surface it
|
|
55
|
-
and stop before approval.
|
|
56
|
-
|
|
57
|
-
6. RECONCILE DATAFLOW.md (v2.1). If the re-plan adds, cuts, or re-scopes objects
|
|
58
|
-
or transitions, update docs/DATAFLOW.md in step:
|
|
59
|
-
- A CUT/removed object or transition -> remove its row(s) and retire the
|
|
60
|
-
matching regression test(s).
|
|
61
|
-
- A new object/transition -> add the row(s); mark them PENDING until the phase
|
|
62
|
-
that makes them reachable runs. The deploy-last / "no PENDING at final phase"
|
|
63
|
-
invariant (hard rule 14) still holds.
|
|
64
|
-
- A reorder must not strand a transition as permanently unreachable.
|
|
65
|
-
|
|
66
|
-
7. SHOW ME the revised phase list + the regression-corpus changes + the
|
|
67
|
-
DATAFLOW.md changes, and STOP for approval.
|
|
68
|
-
|
|
69
|
-
8. ARCHITECTURE SELF-CHECK: re-planning is not normally a kit-architecture
|
|
70
|
-
change. Only run /log-decision if the workflow itself changed (rare).
|
|
71
|
-
|
|
72
|
-
Report what changed: phases added / cut / split / reordered, regression tests
|
|
73
|
-
retired / consolidated, and DATAFLOW rows added / removed.
|