create-anpunkit 2.1.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 +56 -29
- package/template/.claude/agents/implementer.md +14 -8
- package/template/.claude/agents/infra-provisioner.md +53 -59
- package/template/.claude/agents/planner.md +99 -30
- package/template/.claude/agents/researcher.md +16 -1
- package/template/.claude/agents/spec-author.md +126 -0
- package/template/.claude/agents/synthesizer.md +1 -1
- package/template/.claude/agents/test-author.md +81 -63
- package/template/.claude/anpunkit-manifest.json +66 -107
- 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 +55 -13
- package/template/.claude/commands/phase.md +153 -81
- 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/.gitattributes +1 -0
- package/template/AGENTS.md +264 -130
- package/template/CLAUDE.md +5 -9
- package/template/README.md +116 -136
- 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 +55 -13
- package/template/commands.src/phase.md +153 -81
- 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 +414 -9
- package/template/knowledge/azure.md +161 -0
- package/template/knowledge/webapp.md +265 -0
- package/template/scripts/spec-conformance.sh +93 -0
- package/template/scripts/spec-staleness.sh +115 -0
- package/template/setup.sh +30 -111
- package/template/tests/helpers/spec-assert.py +162 -0
- package/template/tests/helpers/spec-assert.ts +158 -0
- 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 -145
- package/template/.cursor/commands/phase.md +0 -249
- 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 -340
- package/template/playwright.config.ts +0 -28
- package/template/scripts/auth-setup.sh +0 -51
- package/template/scripts/e2e-stack.sh +0 -65
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
Caveman ULTRA mode. You are the ORCHESTRATOR.
|
|
2
|
-
|
|
3
|
-
Action: $ARGUMENTS (default: "provision" if INFRA.md missing, "verify" if present)
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## PRE-FLIGHT
|
|
8
|
-
|
|
9
|
-
1. Check `az account show` — if it fails, STOP.
|
|
10
|
-
Tell me: "Run `scripts/auth-setup.sh` first."
|
|
11
|
-
|
|
12
|
-
2. Determine mode from $ARGUMENTS or default logic.
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## PROVISION / UPDATE flow
|
|
17
|
-
|
|
18
|
-
1. Dispatch `infra-provisioner` with the mode.
|
|
19
|
-
|
|
20
|
-
2. It returns WHAT-IF READY. Show me:
|
|
21
|
-
- resource list with SKUs and costs
|
|
22
|
-
- total monthly cost estimate
|
|
23
|
-
- what-if detail file path
|
|
24
|
-
Then ask:
|
|
25
|
-
> "Review docs/research/infra-whatif-<timestamp>.md. Type 'go' to apply,
|
|
26
|
-
> or describe changes to make first."
|
|
27
|
-
WAIT. Do not proceed until I say "go".
|
|
28
|
-
|
|
29
|
-
3. On "go": pass APPROVED to `infra-provisioner`.
|
|
30
|
-
|
|
31
|
-
4. On "make changes": dispatch UPDATE with feedback. Loop to step 2.
|
|
32
|
-
|
|
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.
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## VERIFY flow
|
|
63
|
-
|
|
64
|
-
1. Check INFRA.md exists. If missing: tell me to run `/infra provision` first.
|
|
65
|
-
2. Dispatch `infra-provisioner` VERIFY mode.
|
|
66
|
-
3. Return drift report. If the AUTH PROOF marker is missing or stale, re-run AUTH PROOF.
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
## REGENERATE-ENV flow
|
|
71
|
-
|
|
72
|
-
1. Check INFRA.md exists.
|
|
73
|
-
2. Dispatch `infra-provisioner` REGENERATE-ENV.
|
|
74
|
-
3. Confirm .env.test rewritten.
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
## Notes
|
|
79
|
-
|
|
80
|
-
- /infra never touches PLAN.md, STATE.md, ISSUES.md, or DESIGN_LOG.md.
|
|
81
|
-
- Infra errors are AZURE UNAVAILABLE or CONFIG ERROR — do NOT route to debugger.
|
|
82
|
-
- If UNDERSPEC: list missing decisions, ask me to fill them, re-dispatch.
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
Caveman ULTRA mode.
|
|
2
|
-
|
|
3
|
-
Append an architectural decision to docs/DESIGN_LOG.md. Change: $ARGUMENTS
|
|
4
|
-
|
|
5
|
-
WHEN this applies — the change is ARCHITECTURAL:
|
|
6
|
-
- new / removed / renamed agent, hook, or command
|
|
7
|
-
- changed workflow rule (escalation, phase gate, test layering)
|
|
8
|
-
- design decision where alternatives were weighed
|
|
9
|
-
|
|
10
|
-
WHEN it does NOT apply:
|
|
11
|
-
- code changes, features, phase progress -> HISTORY.md
|
|
12
|
-
- bugs + fixes -> ISSUES.md
|
|
13
|
-
- infra changes -> INFRA.md
|
|
14
|
-
|
|
15
|
-
Steps:
|
|
16
|
-
1. Read docs/DESIGN_LOG.md.
|
|
17
|
-
2. Append a dated line to `## 0. Changelog`, newest first.
|
|
18
|
-
3. If alternatives were weighed, ALSO append a full entry to §5:
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
### 5.x <decision title>
|
|
22
|
-
|
|
23
|
-
Options: <a, b, c>. **Chosen: <x>.** <why it won.>
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
4. If agent/hook/command/file added or removed, update the file inventory (§6).
|
|
27
|
-
5. NEVER rewrite or delete existing entries — append only.
|
|
28
|
-
|
|
29
|
-
Confirm back in 2-3 lines: what was logged and where.
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
Caveman ULTRA mode.
|
|
2
|
-
|
|
3
|
-
Append an entry to docs/ISSUES.md. Error: $ARGUMENTS
|
|
4
|
-
|
|
5
|
-
Canonical format:
|
|
6
|
-
```
|
|
7
|
-
|
|
8
|
-
### <short error title — searchable, literal error keywords>
|
|
9
|
-
|
|
10
|
-
- [x] open (or “- [x] resolved”)
|
|
11
|
-
- symptom: <what was observed>
|
|
12
|
-
- root cause: <the REAL underlying cause>
|
|
13
|
-
- solution: <exact fix, or “pending”>
|
|
14
|
-
- failed attempts: <approaches that did NOT work>
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
Rules:
|
|
18
|
-
- title must contain literal error keywords -> grep finds it.
|
|
19
|
-
- root cause is the real cause, not "the line threw an error".
|
|
20
|
-
- always fill "failed attempts" — stops repeated dead ends.
|
|
21
|
-
- open issues go at the TOP; resolved below; archived oldest at bottom.
|
|
22
|
-
|
|
23
|
-
Confirm the entry back in 2 lines.
|
|
@@ -1,145 +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
|
-
9. Create docs/STATE.md:
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
# STATE
|
|
122
|
-
|
|
123
|
-
phase: 0 (pending)
|
|
124
|
-
completed: project bootstrapped — design research, research review, double grill (incl. data/state flow) done
|
|
125
|
-
next: run /infra to provision Azure infrastructure
|
|
126
|
-
blocker: none
|
|
127
|
-
|
|
128
|
-
```
|
|
129
|
-
10. Create docs/ISSUES.md with header `# Issues` and `## Archived` section.
|
|
130
|
-
|
|
131
|
-
11. Create empty docs/HISTORY.md.
|
|
132
|
-
|
|
133
|
-
12. Create docs/INFRA.md from the template (populated by /infra).
|
|
134
|
-
|
|
135
|
-
13. Create docs/ENDPOINTS.md:
|
|
136
|
-
```
|
|
137
|
-
# Endpoints — <project name>
|
|
138
|
-
> Maintained by implementer. Updated each phase.
|
|
139
|
-
> Base URL: (populated after deployment phase)
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
Then stop and show me PLAN.md + DATAFLOW.md for approval before any phase starts.
|
|
143
|
-
|
|
144
|
-
Remind me: "Run `/infra` next to provision the Azure environment (Phase 0) and
|
|
145
|
-
run the one-time AUTH PROOF before starting Phase 1."
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
Caveman ULTRA mode. You are the ORCHESTRATOR. Route work to subagents —
|
|
2
|
-
you do NOT implement 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 — replaces the old soft nudge): if this phase
|
|
28
|
-
will run a real/E2E suite, 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 -> real/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 for the GATE.
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## 1. RESEARCH + TDD APPLICABILITY
|
|
45
|
-
|
|
46
|
-
Dispatch `researcher` in IMPL mode scoped to this phase.
|
|
47
|
-
Returns terse summary + path. Read the file only if needed.
|
|
48
|
-
Unknowns block the phase -> re-dispatch narrowed. No guessing.
|
|
49
|
-
|
|
50
|
-
DATASOURCE DELTA (hard rule 15): if this phase tests against an external
|
|
51
|
-
datasource, compare what it touches to the confirmed BASELINE in
|
|
52
|
-
docs/research/datasource-<name>.md. If it touches a NEW table/column beyond the
|
|
53
|
-
baseline -> surface my understanding of just that delta as a falsifiable claim;
|
|
54
|
-
WAIT for confirm; append it to datasource-<name>.md. If it touches only confirmed
|
|
55
|
-
data -> proceed with a one-line note, no stop. Real/E2E against an UNCONFIRMED
|
|
56
|
-
datasource is HARD-BLOCKED (mock still runs).
|
|
57
|
-
|
|
58
|
-
Then classify the phase:
|
|
59
|
-
|
|
60
|
-
`TDD_PHASE` = the phase adds or changes a PUBLIC CALLABLE SURFACE (endpoint,
|
|
61
|
-
exported function/class, CLI command, message contract) assertable from the
|
|
62
|
-
acceptance spec. Size is NOT the criterion.
|
|
63
|
-
|
|
64
|
-
- Clear public surface -> `TDD_PHASE=true` -> run the TDD path (§2 → §3a → §3r → §3b).
|
|
65
|
-
- Pure infra/config/doc, no public surface -> `TDD_PHASE=false` -> run the
|
|
66
|
-
non-TDD path (§2N → §3N).
|
|
67
|
-
- AMBIGUOUS -> default `TDD_PHASE=true`, but STATE the classification + the reason
|
|
68
|
-
to me, so I can override to non-TDD BEFORE SCAFFOLD fires. (Hard rule 11: never
|
|
69
|
-
downgrade a TDD phase just to dodge the RED gate.)
|
|
70
|
-
|
|
71
|
-
=====================================================================
|
|
72
|
-
## TDD PATH (TDD_PHASE=true)
|
|
73
|
-
=====================================================================
|
|
74
|
-
|
|
75
|
-
## 2. SCAFFOLD
|
|
76
|
-
|
|
77
|
-
Dispatch `implementer` in SCAFFOLD mode: interface stubs only (signatures +
|
|
78
|
-
types; bodies raise NotImplementedError / return 501); NO logic, NO tests.
|
|
79
|
-
Returns the stub files + the interface surface.
|
|
80
|
-
|
|
81
|
-
## 3a. RED
|
|
82
|
-
|
|
83
|
-
Dispatch `test-author` to write the REAL API suite (+ mock) BLIND against the
|
|
84
|
-
stubs + acceptance, AND emit docs/test-plan-phase-<n>.md (acceptance criteria →
|
|
85
|
-
test names, plus a mandatory "NOT covered / assumptions" section). Place
|
|
86
|
-
contract/ENDPOINTS/DATAFLOW-transition tests in `tests/regression/`, phase-local
|
|
87
|
-
tests in `tests/phase-<n>/`. Run the suite.
|
|
88
|
-
|
|
89
|
-
RED GATE = every acceptance test COLLECTS cleanly AND FAILS (assertion /
|
|
90
|
-
NotImplemented).
|
|
91
|
-
- Any test PASSES on stubs -> STOP (spec trivial or test wrong); show me.
|
|
92
|
-
- Collection / import / syntax error -> stub mismatch; re-dispatch SCAFFOLD to
|
|
93
|
-
fix SIGNATURES (not logic); re-run.
|
|
94
|
-
- UNDERSPEC -> STOP; ask me to sharpen the acceptance spec.
|
|
95
|
-
|
|
96
|
-
## 3r. TEST REVIEW — human gate (hard rule 12)
|
|
97
|
-
|
|
98
|
-
STOP. Surface docs/test-plan-phase-<n>.md to me: what each acceptance criterion
|
|
99
|
-
maps to, and the "NOT covered / assumptions" section. GREEN cannot begin until I
|
|
100
|
-
approve. On rejection, classify with me:
|
|
101
|
-
- MISREAD of an adequate spec -> re-dispatch `test-author` with my feedback as
|
|
102
|
-
added constraint; re-run RED; re-present the test plan.
|
|
103
|
-
- UNDERSPEC (the acceptance spec itself is too vague) -> sharpen the acceptance
|
|
104
|
-
spec in docs/PLAN.md, then re-dispatch `test-author` fresh.
|
|
105
|
-
Loop until I approve. This gate is unskippable on TDD phases.
|
|
106
|
-
|
|
107
|
-
## 3b. GREEN
|
|
108
|
-
|
|
109
|
-
Dispatch `implementer` in FILL mode with the phase spec + research + the test
|
|
110
|
-
file paths (it MAY read the tests — frozen before logic, no overfit — but must
|
|
111
|
-
NOT edit them). Fill to green. Budget 3, WARN@2, STUCK@3.
|
|
112
|
-
|
|
113
|
-
If FRONTEND_PHASE (from PRE-FLIGHT e): dispatch `e2e-runner` — MANDATORY, not
|
|
114
|
-
optional (hard rule 13). It reads INFRA.md target, runs `scripts/e2e-stack.sh up`
|
|
115
|
-
/ Playwright / `down`, and captures a screenshot at EACH UI-existence assertion
|
|
116
|
-
regardless of pass/fail to docs/evidence/e2e-phase-<n>/, with a summary in
|
|
117
|
-
docs/research/e2e-<slug>.md. Acceptance spec has no UI-existence criterion ->
|
|
118
|
-
e2e-runner returns UNDERSPEC -> STOP, sharpen the spec.
|
|
119
|
-
|
|
120
|
-
PHASE GATE (rule 5) -> go to §4/§5/§6 (see GATE below).
|
|
121
|
-
|
|
122
|
-
=====================================================================
|
|
123
|
-
## NON-TDD PATH (TDD_PHASE=false)
|
|
124
|
-
=====================================================================
|
|
125
|
-
|
|
126
|
-
## 2N. IMPLEMENT
|
|
127
|
-
|
|
128
|
-
Dispatch `implementer` (legacy mode) with phase spec + research summary.
|
|
129
|
-
Returns STUCK -> go to ESCALATE.
|
|
130
|
-
If IS_FINAL_PHASE: phase spec includes the deploy task; confirm the return
|
|
131
|
-
includes "deployed URL" before proceeding.
|
|
132
|
-
|
|
133
|
-
## 3N. TEST (blind)
|
|
134
|
-
|
|
135
|
-
Dispatch `test-author`. It writes MOCK + REAL API suites from the acceptance
|
|
136
|
-
spec — never reads the logic. (No TEST REVIEW gate on the non-TDD path — no
|
|
137
|
-
public surface to mis-test. e2e-runner only if FRONTEND_PHASE.)
|
|
138
|
-
|
|
139
|
-
=====================================================================
|
|
140
|
-
|
|
141
|
-
## GATE (both paths)
|
|
142
|
-
|
|
143
|
-
PHASE GATE = current-phase REAL API suite passes AND (FRONTEND_PHASE) E2E passes
|
|
144
|
-
WITH evidence captured AND the accumulated mock regression corpus stays green AND
|
|
145
|
-
every docs/ENDPOINTS.md entry has a regression test AND every REACHABLE
|
|
146
|
-
docs/DATAFLOW.md transition has a regression test (all checked at CLOSE).
|
|
147
|
-
- GATE PASS -> go to CLOSE.
|
|
148
|
-
- GATE BLOCKED (SERVICE UNAVAILABLE, STACK NOT READY, AZURE UNAVAILABLE, FLAKE)
|
|
149
|
-
-> tell me, wait. Not a code bug. For AZURE UNAVAILABLE: suggest `/infra verify`.
|
|
150
|
-
- GATE FAIL (LOGIC FAIL) -> go to FIX.
|
|
151
|
-
|
|
152
|
-
---
|
|
153
|
-
|
|
154
|
-
## 4. FIX
|
|
155
|
-
|
|
156
|
-
Dispatch `debugger` (isolated context) on the specific failure.
|
|
157
|
-
- FIXED -> re-run TEST (and the regression corpus).
|
|
158
|
-
- SERVICE UNAVAILABLE -> tell me, wait. Suggest `/infra verify` if Azure.
|
|
159
|
-
- WARN (2 attempts failed) -> relay immediately, then let debugger finish attempt 3.
|
|
160
|
-
- STUCK -> go to ESCALATE.
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
## 5. ESCALATE — circuit breaker. Mode B.
|
|
165
|
-
|
|
166
|
-
FIRST STUCK: STOP. Present to me: the problem, 3 failed hypotheses, the
|
|
167
|
-
debugger's recommendation, the debug file path. Ask what to do. Wait. Options:
|
|
168
|
-
(a) "re-research" -> /unstuck
|
|
169
|
-
(b) hint -> re-dispatch debugger with hint, budget 3
|
|
170
|
-
(c) "skip" / "re-slice" -> mark blocked, dispatch planner
|
|
171
|
-
|
|
172
|
-
SECOND STUCK: STOP completely. Full summary — every hypothesis, current state,
|
|
173
|
-
what to try next. Hand control to me.
|
|
174
|
-
|
|
175
|
-
---
|
|
176
|
-
|
|
177
|
-
## 6. CLOSE
|
|
178
|
-
|
|
179
|
-
REGRESSION + COVERAGE GATES (before closing — all FAIL HARD, do not close):
|
|
180
|
-
- Run `scripts/regression.sh` (mock corpus). A failure BLOCKS close -> route to FIX.
|
|
181
|
-
- ENDPOINTS COVERAGE: every `docs/ENDPOINTS.md` entry MUST have >=1 test in
|
|
182
|
-
`tests/regression/`. Zero coverage -> FAIL HARD.
|
|
183
|
-
- DATAFLOW COVERAGE (hard rule 14): every `docs/DATAFLOW.md` transition whose
|
|
184
|
-
trigger is REACHABLE in the code shipped so far MUST have >=1 test in
|
|
185
|
-
`tests/regression/`. Zero coverage on a reachable transition -> FAIL HARD.
|
|
186
|
-
Unreachable transitions list as PENDING (not failed). IF IS_FINAL_PHASE: any
|
|
187
|
-
transition still PENDING -> FAIL HARD (everything must be live by the last phase).
|
|
188
|
-
- EVIDENCE (FRONTEND_PHASE only, hard rule 13): docs/evidence/e2e-phase-<n>/ must
|
|
189
|
-
contain at least the per-UI-existence-assertion screenshots. Empty -> FAIL HARD.
|
|
190
|
-
- IF IS_FINAL_PHASE: additionally run `scripts/regression.sh --real` (full real
|
|
191
|
-
corpus). A failure blocks close.
|
|
192
|
-
|
|
193
|
-
Mark phase `done` in docs/PLAN.md.
|
|
194
|
-
|
|
195
|
-
ARCHITECTURE / DATAFLOW SELF-CHECK:
|
|
196
|
-
- Did this phase add/remove/rename an agent, hook, or command, or change a
|
|
197
|
-
workflow rule? YES -> run `/log-decision`. NO -> state why not.
|
|
198
|
-
- Did this phase add/change an object's STATE LIFECYCLE? YES -> update
|
|
199
|
-
docs/DATAFLOW.md (hard rule 9) in this CLOSE, and confirm new reachable
|
|
200
|
-
transitions are covered. NO -> state why not.
|
|
201
|
-
|
|
202
|
-
IF IS_FINAL_PHASE — FINAL CLOSE sequence:
|
|
203
|
-
|
|
204
|
-
a. Run `/synthesize` — pass the signal that this is the final phase so the
|
|
205
|
-
synthesizer runs the extended pass (OVERVIEW.md + README.md update).
|
|
206
|
-
|
|
207
|
-
b. Read docs/ENDPOINTS.md. Surface a "READY TO USE" summary to me:
|
|
208
|
-
```
|
|
209
|
-
✅ PROJECT COMPLETE
|
|
210
|
-
|
|
211
|
-
Deployed at: <base URL from docs/INFRA.md "Deployed base URL">
|
|
212
|
-
|
|
213
|
-
## Endpoints
|
|
214
|
-
<paste the full docs/ENDPOINTS.md table>
|
|
215
|
-
|
|
216
|
-
## Quick start
|
|
217
|
-
- Base URL: <URL>
|
|
218
|
-
- Auth: <Bearer token / API key / none — from ENDPOINTS.md>
|
|
219
|
-
- Health check: GET <base URL>/health
|
|
220
|
-
|
|
221
|
-
## Docs
|
|
222
|
-
- Full endpoint catalogue: docs/ENDPOINTS.md
|
|
223
|
-
- Object/state flow: docs/DATAFLOW.md
|
|
224
|
-
- Infrastructure: docs/INFRA.md
|
|
225
|
-
- Project history: docs/HISTORY.md
|
|
226
|
-
```
|
|
227
|
-
Tell me the project is complete and ready to use.
|
|
228
|
-
|
|
229
|
-
ELSE (not final phase):
|
|
230
|
-
|
|
231
|
-
Run `/synthesize`.
|
|
232
|
-
Tell me phase done + the next phase. Recommend `/clear` then `/phase` next.
|
|
233
|
-
|
|
234
|
-
---
|
|
235
|
-
|
|
236
|
-
## STATE CHECKPOINTING
|
|
237
|
-
|
|
238
|
-
After each step, update docs/STATE.md:
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
phase: <n> (in progress)
|
|
242
|
-
tdd: <true|false>
|
|
243
|
-
frontend_phase: <true|false>
|
|
244
|
-
completed: <steps done so far>
|
|
245
|
-
next: <exact next step>
|
|
246
|
-
blocker: <none or open issue>
|
|
247
|
-
|
|
248
|
-
```
|
|
249
|
-
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.
|