create-anpunkit 2.0.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.
Files changed (66) hide show
  1. package/README.md +44 -0
  2. package/bin/cli.js +41 -0
  3. package/package.json +34 -0
  4. package/template/.claude/agents/debugger.md +47 -0
  5. package/template/.claude/agents/e2e-runner.md +63 -0
  6. package/template/.claude/agents/implementer.md +78 -0
  7. package/template/.claude/agents/infra-provisioner.md +159 -0
  8. package/template/.claude/agents/planner.md +78 -0
  9. package/template/.claude/agents/researcher.md +103 -0
  10. package/template/.claude/agents/synthesizer.md +74 -0
  11. package/template/.claude/agents/test-author.md +71 -0
  12. package/template/.claude/anpunkit-manifest.json +256 -0
  13. package/template/.claude/commands/infra.md +62 -0
  14. package/template/.claude/commands/log-decision.md +34 -0
  15. package/template/.claude/commands/log-issue.md +28 -0
  16. package/template/.claude/commands/overview.md +106 -0
  17. package/template/.claude/commands/phase.md +202 -0
  18. package/template/.claude/commands/quick.md +30 -0
  19. package/template/.claude/commands/replan.md +64 -0
  20. package/template/.claude/commands/store-wisdom.md +195 -0
  21. package/template/.claude/commands/synthesize.md +26 -0
  22. package/template/.claude/commands/unstuck.md +40 -0
  23. package/template/.claude/hooks/cursor-session-start.sh +14 -0
  24. package/template/.claude/hooks/pre-compact.sh +25 -0
  25. package/template/.claude/hooks/session-start.sh +135 -0
  26. package/template/.claude/hooks/subagent-stop.sh +11 -0
  27. package/template/.claude/settings.json +16 -0
  28. package/template/.claude/skills/caveman/SKILL.md +39 -0
  29. package/template/.claude/skills/grill-me/SKILL.md +10 -0
  30. package/template/.claude/skills/karpathy-guidelines/SKILL.md +34 -0
  31. package/template/.cursor/commands/infra.md +57 -0
  32. package/template/.cursor/commands/log-decision.md +29 -0
  33. package/template/.cursor/commands/log-issue.md +23 -0
  34. package/template/.cursor/commands/overview.md +102 -0
  35. package/template/.cursor/commands/phase.md +197 -0
  36. package/template/.cursor/commands/quick.md +25 -0
  37. package/template/.cursor/commands/replan.md +59 -0
  38. package/template/.cursor/commands/store-wisdom.md +191 -0
  39. package/template/.cursor/commands/synthesize.md +22 -0
  40. package/template/.cursor/commands/unstuck.md +36 -0
  41. package/template/.cursor/hooks.json +14 -0
  42. package/template/.cursor/rules/anpunkit.md +11 -0
  43. package/template/.gitattributes +12 -0
  44. package/template/AGENTS.md +216 -0
  45. package/template/CLAUDE.md +70 -0
  46. package/template/README.md +283 -0
  47. package/template/commands.src/infra.md +62 -0
  48. package/template/commands.src/log-decision.md +34 -0
  49. package/template/commands.src/log-issue.md +28 -0
  50. package/template/commands.src/overview.md +106 -0
  51. package/template/commands.src/phase.md +202 -0
  52. package/template/commands.src/quick.md +30 -0
  53. package/template/commands.src/replan.md +64 -0
  54. package/template/commands.src/store-wisdom.md +195 -0
  55. package/template/commands.src/synthesize.md +26 -0
  56. package/template/commands.src/unstuck.md +40 -0
  57. package/template/docker-compose.test.yml +34 -0
  58. package/template/docs/DESIGN_LOG.md +578 -0
  59. package/template/e2e/global-setup.ts +57 -0
  60. package/template/playwright.config.ts +28 -0
  61. package/template/scripts/auth-setup.sh +51 -0
  62. package/template/scripts/e2e-stack.sh +65 -0
  63. package/template/scripts/regression.sh +46 -0
  64. package/template/setup.sh +236 -0
  65. package/template/tests/phase-1/README.md +4 -0
  66. package/template/tests/regression/README.md +11 -0
@@ -0,0 +1,202 @@
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 guard at CLOSE.
3
+ argument-hint: [phase number]
4
+ ---
5
+
6
+ Caveman ULTRA mode. You are the ORCHESTRATOR. Route work to subagents —
7
+ you do NOT implement or debug yourself.
8
+
9
+ Note: subagents cannot talk to the user. Only YOU can.
10
+
11
+ Target phase: $ARGUMENTS (default: the phase marked pending in docs/PLAN.md)
12
+
13
+ ---
14
+
15
+ ## 0. PRE-FLIGHT
16
+
17
+ a. INFRA CHECK (phases > 0):
18
+ - Read docs/INFRA.md. If Phase 0 not done -> STOP.
19
+ Tell me: "Phase 0 (infra) not complete. Run `/infra` first."
20
+ - Exception: if $ARGUMENTS is "0", tell me to run `/infra` directly.
21
+
22
+ b. PHASE STATE CHECK: Read docs/STATE.md and docs/PLAN.md.
23
+ - No phase in progress, requested is next pending -> START at step 1.
24
+ - Same phase in-progress -> RESUME from STATE.md "next action".
25
+ - Different phase in-progress -> STOP. Tell me which phase is open.
26
+ - Out of dependency order -> STOP. Warn, proceed only if I confirm.
27
+ - Phase not in PLAN.md -> STOP. Suggest /overview or /replan.
28
+
29
+ c. FINAL PHASE CHECK: Read docs/PLAN.md. Is this the last phase (no further
30
+ pending phases after this one)? Record this as IS_FINAL_PHASE=true/false.
31
+
32
+ d. AUTH NUDGE: if INFRA.md exists and auth marker absent, remind me to run
33
+ `scripts/auth-setup.sh`. Not a gate — just a reminder.
34
+
35
+ ---
36
+
37
+ ## 1. RESEARCH + TDD APPLICABILITY
38
+
39
+ Dispatch `researcher` in IMPL mode scoped to this phase.
40
+ Returns terse summary + path. Read the file only if needed.
41
+ Unknowns block the phase -> re-dispatch narrowed. No guessing.
42
+
43
+ Then classify the phase:
44
+
45
+ `TDD_PHASE` = the phase adds or changes a PUBLIC CALLABLE SURFACE (endpoint,
46
+ exported function/class, CLI command, message contract) assertable from the
47
+ acceptance spec. Size is NOT the criterion.
48
+
49
+ - Clear public surface -> `TDD_PHASE=true` -> run the TDD path (§2 → §3a → §3b).
50
+ - Pure infra/config/doc, no public surface -> `TDD_PHASE=false` -> run the
51
+ non-TDD path (§2N → §3N).
52
+ - AMBIGUOUS -> default `TDD_PHASE=true`, but STATE the classification + the reason
53
+ to me, so I can override to non-TDD BEFORE SCAFFOLD fires. (Hard rule 11: never
54
+ downgrade a TDD phase just to dodge the RED gate.)
55
+
56
+ =====================================================================
57
+ ## TDD PATH (TDD_PHASE=true)
58
+ =====================================================================
59
+
60
+ ## 2. SCAFFOLD
61
+
62
+ 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.
65
+
66
+ ## 3a. RED
67
+
68
+ Dispatch `test-author` to write the REAL API suite (+ mock) BLIND against the
69
+ stubs + acceptance. Place contract/ENDPOINTS tests in `tests/regression/`,
70
+ phase-local tests in `tests/phase-<n>/`. Run the suite.
71
+
72
+ RED GATE = every acceptance test COLLECTS cleanly AND FAILS (assertion /
73
+ NotImplemented).
74
+ - Any test PASSES on stubs -> STOP (spec trivial or test wrong); show me.
75
+ - Collection / import / syntax error -> stub mismatch; re-dispatch SCAFFOLD to
76
+ fix SIGNATURES (not logic); re-run.
77
+ - UNDERSPEC -> STOP; ask me to sharpen the acceptance spec.
78
+
79
+ ## 3b. GREEN
80
+
81
+ Dispatch `implementer` in FILL mode with the phase spec + research + the test
82
+ file paths (it MAY read the tests — frozen before logic, no overfit — but must
83
+ NOT edit them). Fill to green. Budget 3, WARN@2, STUCK@3.
84
+
85
+ Dispatch `e2e-runner` IF this phase touches the frontend (reads INFRA.md target;
86
+ `scripts/e2e-stack.sh up` / Playwright / `down`).
87
+
88
+ PHASE GATE (rule 5) -> go to §4/§5/§6 (see GATE below).
89
+
90
+ =====================================================================
91
+ ## NON-TDD PATH (TDD_PHASE=false)
92
+ =====================================================================
93
+
94
+ ## 2N. IMPLEMENT
95
+
96
+ Dispatch `implementer` (legacy mode) with phase spec + research summary.
97
+ Returns STUCK -> go to ESCALATE.
98
+ If IS_FINAL_PHASE: phase spec includes the deploy task; confirm the return
99
+ includes "deployed URL" before proceeding.
100
+
101
+ ## 3N. TEST (blind)
102
+
103
+ Dispatch `test-author`. It writes MOCK + REAL API suites from the acceptance
104
+ spec — never reads the logic. (e2e-runner only if frontend.)
105
+
106
+ =====================================================================
107
+
108
+ ## GATE (both paths)
109
+
110
+ PHASE GATE = current-phase REAL API suite passes AND (if frontend) E2E passes AND
111
+ the accumulated mock regression corpus stays green AND every docs/ENDPOINTS.md
112
+ entry has a regression test (checked at CLOSE).
113
+ - GATE PASS -> go to CLOSE.
114
+ - GATE BLOCKED (SERVICE UNAVAILABLE, STACK NOT READY, AZURE UNAVAILABLE, FLAKE)
115
+ -> tell me, wait. Not a code bug. For AZURE UNAVAILABLE: suggest `/infra verify`.
116
+ - GATE FAIL (LOGIC FAIL) -> go to FIX.
117
+
118
+ ---
119
+
120
+ ## 4. FIX
121
+
122
+ Dispatch `debugger` (isolated context) on the specific failure.
123
+ - FIXED -> re-run TEST (and the regression corpus).
124
+ - SERVICE UNAVAILABLE -> tell me, wait. Suggest `/infra verify` if Azure.
125
+ - WARN (2 attempts failed) -> relay immediately, then let debugger finish attempt 3.
126
+ - STUCK -> go to ESCALATE.
127
+
128
+ ---
129
+
130
+ ## 5. ESCALATE — circuit breaker. Mode B.
131
+
132
+ FIRST STUCK: STOP. Present to me: the problem, 3 failed hypotheses, the
133
+ debugger's recommendation, the debug file path. Ask what to do. Wait. Options:
134
+ (a) "re-research" -> /unstuck
135
+ (b) hint -> re-dispatch debugger with hint, budget 3
136
+ (c) "skip" / "re-slice" -> mark blocked, dispatch planner
137
+
138
+ SECOND STUCK: STOP completely. Full summary — every hypothesis, current state,
139
+ what to try next. Hand control to me.
140
+
141
+ ---
142
+
143
+ ## 6. CLOSE
144
+
145
+ REGRESSION GATE (before closing — Feature 3):
146
+ - Run `scripts/regression.sh` (mock corpus). A failure BLOCKS close -> route to FIX.
147
+ - ENDPOINTS COVERAGE: every `docs/ENDPOINTS.md` entry MUST have >=1 test in
148
+ `tests/regression/`. Zero coverage -> FAIL HARD; do not close.
149
+ - IF IS_FINAL_PHASE: additionally run `scripts/regression.sh --real` (full real
150
+ corpus). A failure blocks close.
151
+
152
+ Mark phase `done` in docs/PLAN.md.
153
+
154
+ ARCHITECTURE SELF-CHECK: did this phase add/remove/rename an agent, hook, or
155
+ command, or change a workflow rule? YES -> run `/log-decision`. NO -> state why not.
156
+
157
+ IF IS_FINAL_PHASE — FINAL CLOSE sequence:
158
+
159
+ a. Run `/synthesize` — pass the signal that this is the final phase so the
160
+ synthesizer runs the extended pass (OVERVIEW.md + README.md update).
161
+
162
+ b. Read docs/ENDPOINTS.md. Surface a "READY TO USE" summary to me:
163
+ ```
164
+ ✅ PROJECT COMPLETE
165
+
166
+ Deployed at: <base URL from docs/INFRA.md "Deployed base URL">
167
+
168
+ ## Endpoints
169
+ <paste the full docs/ENDPOINTS.md table>
170
+
171
+ ## Quick start
172
+ - Base URL: <URL>
173
+ - Auth: <Bearer token / API key / none — from ENDPOINTS.md>
174
+ - Health check: GET <base URL>/health
175
+
176
+ ## Docs
177
+ - Full endpoint catalogue: docs/ENDPOINTS.md
178
+ - Infrastructure: docs/INFRA.md
179
+ - Project history: docs/HISTORY.md
180
+ ```
181
+ Tell me the project is complete and ready to use.
182
+
183
+ ELSE (not final phase):
184
+
185
+ Run `/synthesize`.
186
+ Tell me phase done + the next phase. Recommend `/clear` then `/phase` next.
187
+
188
+ ---
189
+
190
+ ## STATE CHECKPOINTING
191
+
192
+ After each step, update docs/STATE.md:
193
+ ```
194
+
195
+ phase: <n> (in progress)
196
+ tdd: <true|false>
197
+ completed: <steps done so far>
198
+ next: <exact next step>
199
+ blocker: <none or open issue>
200
+
201
+ ```
202
+ Keep STATE.md small — overwrite, do not append.
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: Make a small, obvious change directly — no agent chain, no phase overhead.
3
+ argument-hint: [what to change]
4
+ ---
5
+
6
+ Caveman ULTRA mode. Apply `karpathy-guidelines` skill.
7
+
8
+ Purpose: skip the orchestration tax for a 5-line fix.
9
+
10
+ Use `/quick` when ALL hold:
11
+ - change is small (under 30 lines) and obvious
12
+ - no new vertical slice
13
+ - no external service contract change
14
+ - not mid-phase
15
+
16
+ If any fail -> STOP, tell me, recommend `/phase`.
17
+ (Hard rule 11: never route phase-worthy work through `/quick` to dodge the RED gate.)
18
+
19
+ Steps:
20
+ 1. grep docs/ISSUES.md for anything related.
21
+ 2. Make the change. Smallest diff that works.
22
+ 3. Run it — lint/typecheck/smoke. Show me result.
23
+ 4. REGRESSION GUARD: run `scripts/regression.sh` (mock corpus). A break BLOCKS the
24
+ `/quick` — surface it to me and stop. No agent chain is added.
25
+ 5. Error you cannot fix in 2 tries -> STOP. Recommend `/phase`.
26
+ 6. Change revealed a bug -> `/log-issue`.
27
+ 7. ARCHITECTURE SELF-CHECK: touched an agent, hook, command, or workflow rule?
28
+ YES -> `/log-decision`.
29
+
30
+ No STATE.md rewrite, no synthesize, no /clear needed.
@@ -0,0 +1,64 @@
1
+ ---
2
+ description: Revise docs/PLAN.md when it no longer matches reality — add, cut, split, merge, or reorder phases.
3
+ argument-hint: [what changed about the plan]
4
+ ---
5
+
6
+ Caveman ULTRA mode.
7
+
8
+ Recommended: run from plan mode (Shift+Tab). Optional; the command stops for
9
+ your approval regardless.
10
+
11
+ Use when PLAN.md no longer matches reality. Change: $ARGUMENTS
12
+
13
+ ---
14
+
15
+ ## Steps
16
+
17
+ 1. PRE-FLIGHT. Read docs/STATE.md and docs/PLAN.md.
18
+ - Phase in progress -> tell me which. Ask: revise around it, or is it the
19
+ thing being changed? Do not silently rewrite a mid-execution phase.
20
+ - Done phases are FROZEN. /replan never edits or reorders done phases.
21
+ - Phase 0 (infra) is ALWAYS frozen once done.
22
+
23
+ 2. DESIGN RESEARCH CHECK. Scan $ARGUMENTS for signals that design research
24
+ is warranted before re-planning:
25
+ - A new external service is mentioned (Stripe, Twilio, a new Azure service, etc.)
26
+ - The change involves architecture (a new integration pattern, auth change, etc.)
27
+ - A service tier or quota change is implied
28
+
29
+ If ANY of these signals are present: dispatch `researcher` in DESIGN mode
30
+ with the specific new service/pattern as the DESIGN TOPICS list. Show me the
31
+ key findings before proceeding to step 3.
32
+
33
+ If none: proceed directly to step 3 (impl-research may still be dispatched
34
+ in step 3 for non-trivial changes per the original logic).
35
+
36
+ 3. IMPL RESEARCH if needed. If the change is non-trivial but design research
37
+ was not needed, dispatch `researcher` in IMPL mode to ground the re-plan
38
+ in facts.
39
+
40
+ 4. RE-PLAN. Dispatch `planner` with the change + current PLAN.md. It must:
41
+ - Keep done phases untouched.
42
+ - Insert / cut / split / merge / reorder only PENDING phases.
43
+ - Place new phases in correct DEPENDENCY order.
44
+ - Keep every phase a vertical slice with its own acceptance spec.
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. SHOW ME the revised phase list + the regression-corpus changes, and STOP for
58
+ approval.
59
+
60
+ 7. ARCHITECTURE SELF-CHECK: re-planning is not normally a kit-architecture
61
+ change. Only run /log-decision if the workflow itself changed (rare).
62
+
63
+ Report what changed: phases added / cut / split / reordered, and regression
64
+ tests retired / consolidated.
@@ -0,0 +1,195 @@
1
+ ---
2
+ description: Promote resolved issues and research findings from this project to the shared anpunkit-kb repo. Analyzes, proposes candidates for your review, then pushes approved entries.
3
+ ---
4
+
5
+ Caveman ULTRA mode. You are the ORCHESTRATOR.
6
+
7
+ Purpose: share what this project learned with all future projects.
8
+ Only resolved issues and completed research qualify. Open issues do NOT.
9
+
10
+ ---
11
+
12
+ ## PRE-FLIGHT
13
+
14
+ 1. Read `.claude/kb-config.json`.
15
+ - Not found -> STOP. Tell me: "KB not configured. Run setup.sh to set up the
16
+ shared KB repo, then retry /store-wisdom."
17
+ - Found -> extract `kb_path` and `kb_remote`.
18
+
19
+ 2. Expand `kb_path` (resolve `~` to home directory).
20
+ Verify the path exists and is a git repo (`git -C <path> status`).
21
+ - Fails -> STOP. Tell me the path is broken and to re-run setup.sh.
22
+
23
+ ---
24
+
25
+ ## STEP 1 — PULL LATEST KB
26
+
27
+ Run: `git -C <kb_path> pull --ff-only`
28
+
29
+ - Success -> continue.
30
+ - Conflict or diverged -> STOP. Tell me:
31
+ "KB has a conflict. Resolve manually in <kb_path>, then retry /store-wisdom."
32
+ - Offline (no network) -> WARN me, ask: "KB pull failed (offline?). Continue
33
+ with local KB copy, or abort?" Wait for answer.
34
+
35
+ ---
36
+
37
+ ## STEP 2 — ANALYZE LOCAL PROJECT
38
+
39
+ Scan this project for promotion candidates:
40
+
41
+ ### From docs/ISSUES.md — resolved issues only
42
+ - Read all entries marked `- [x] resolved`.
43
+ - Exclude: entries with no root cause filled in, entries without a solution.
44
+ - For each qualifying entry, note: title, symptom, root cause, solution,
45
+ failed attempts.
46
+
47
+ ### From docs/research/ — completed research files
48
+ - Read docs/research/INDEX.md. For each entry:
49
+ - Read the corresponding file.
50
+ - A research entry qualifies if: it documents an external service behavior,
51
+ API contract, SDK gotcha, architectural constraint, or cost finding that
52
+ would be useful in a different project.
53
+ - A research entry does NOT qualify if: it is a project-specific config
54
+ finding, a one-off trace with no generalizable conclusion, or a debug
55
+ trace (`debug-*.md`).
56
+ - Note: research entries get a `created:` timestamp (today's date if not
57
+ already present in the file). Staleness is measured from this date.
58
+
59
+ ### Cross-check against KB
60
+ - Read `<kb_path>/INDEX.md` (if it exists).
61
+ - For each candidate: does a matching slug already exist in the KB?
62
+ - YES, fresh entry: skip (already in KB, not stale).
63
+ - YES, stale entry (marked [STALE] in the snapshot): flag as REWRITE candidate.
64
+ - NO: flag as NEW candidate.
65
+
66
+ ---
67
+
68
+ ## STEP 3 — PROPOSE CANDIDATES
69
+
70
+ Present candidates one at a time. For each:
71
+ ```
72
+
73
+ [N of M] <type: NEW | REWRITE> — <slug>
74
+ Domain: <inferred path, e.g. azure/auth.md or databricks/sdk.md>
75
+ Tags: <tag1, tag2, tag3>
76
+ Action: <“new entry” | “replaces stale entry from YYYY-MM-DD”>
77
+
78
+ ## Preview:
79
+
80
+ ## [<slug>]
81
+
82
+ ## created: <YYYY-MM-DD>
83
+ tags: <tags>
84
+ symptom/context: <…>
85
+ root-cause / finding: <…>
86
+ fix / recommendation: <…>
87
+
88
+ [APPROVE / EDIT / SKIP]
89
+
90
+ ```
91
+ - APPROVE: add to approved list.
92
+ - EDIT: ask me for the edit, apply it, re-show, wait for APPROVE or SKIP.
93
+ - SKIP: discard this candidate.
94
+
95
+ After all candidates: show me the summary:
96
+ ```
97
+
98
+ Approved: <N> entries
99
+ Skipped: <M> entries
100
+ Domains to write: <list>
101
+ New domain folders to create: <list or “none”>
102
+ Proceed? [yes / abort]
103
+
104
+ ```
105
+ Wait for "yes" before writing anything.
106
+
107
+ ---
108
+
109
+ ## STEP 4 — WRITE TO KB
110
+
111
+ For each approved entry:
112
+
113
+ 1. Determine the domain file path: `<kb_path>/<domain>/<file>.md`
114
+ - If the directory does not exist: create it.
115
+ - If the file does not exist: create it with a `# <domain> — <file>` header.
116
+
117
+ 2. REWRITE candidates: find the existing `## [<slug>]` block in the file and
118
+ replace it entirely with the new entry.
119
+
120
+ 3. NEW candidates: append the entry to the end of the domain file.
121
+
122
+ 4. Update `<kb_path>/INDEX.md`:
123
+ - For NEW entries: append a line:
124
+ `YYYY-MM-DD | <domain>/<file> | <slug> | <one-sentence summary>`
125
+ - For REWRITE entries: update the existing line in-place (new date, same slug).
126
+
127
+ 5. If this is the first `/store-wisdom` run (no INDEX.md existed):
128
+ Also create `<kb_path>/KB_GUIDE.md` with the entry format reference:
129
+
130
+ ```markdown
131
+ # anpunkit-kb — guide
132
+
133
+ This repo accumulates resolved issues and research findings from anpunkit projects.
134
+ Populated by `/store-wisdom`. Read by the anpunkit `researcher` agent at session start.
135
+
136
+ ## Entry format — issues
137
+ ## [slug]
138
+ created: YYYY-MM-DD
139
+ tags: tag1, tag2
140
+ symptom: what was observed
141
+ root-cause: the real underlying cause
142
+ fix: exact solution
143
+ failed-attempts: what did not work
144
+
145
+ ## Entry format — research
146
+ ## [slug]
147
+ created: YYYY-MM-DD
148
+ tags: tag1, tag2
149
+ symptom/context: what prompted the research
150
+ finding: what was discovered
151
+ recommendation: what to do
152
+
153
+ ## INDEX.md format
154
+ YYYY-MM-DD | domain/file | slug | one-sentence summary
155
+
156
+ ## Staleness
157
+ Research entries older than 6 months are flagged [STALE] at session load.
158
+ Stale entries are re-researched locally and rewritten via /store-wisdom.
159
+ Issue entries never go stale.
160
+ ```
161
+
162
+ -----
163
+
164
+ ## STEP 5 — COMMIT AND PUSH
165
+
166
+ Run from `<kb_path>`:
167
+
168
+ ```bash
169
+ git add -A
170
+ git commit -m "store-wisdom: <N> entries from <project-name> (<YYYY-MM-DD>)"
171
+ git push
172
+ ```
173
+
174
+ - Push success -> tell me:
175
+
176
+ ```
177
+ KB updated.
178
+ - entries written: <N> (<list of slugs>)
179
+ - domains touched: <list>
180
+ - new domains created: <list or "none">
181
+ - pushed to: <kb_remote>
182
+ ```
183
+ - Push fails -> tell me the push failed, show the git error.
184
+ The entries ARE written locally — tell me to push manually:
185
+ `git -C <kb_path> push`
186
+
187
+ -----
188
+
189
+ ## NOTES
190
+
191
+ - `/store-wisdom` never modifies docs/ISSUES.md or docs/research/ in this project.
192
+ It reads them; it does not change them.
193
+ - If there are no qualifying candidates, tell me so and stop. Do not push an empty commit.
194
+ - The KB is append-only except for REWRITE of stale research entries.
195
+ Issue entries are never deleted or overwritten — they are facts.
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: Compress handoff docs, dedup the issue log, prune snapshots. Run before /clear.
3
+ ---
4
+
5
+ Caveman ULTRA mode.
6
+
7
+ Trigger: end of a phase, or any time STATE.md / ISSUES.md feel bloated.
8
+
9
+ Dispatch the `synthesizer` subagent.
10
+
11
+ For a normal phase: it rewrites STATE.md, dedups ISSUES.md, prunes snapshots,
12
+ appends to HISTORY.md.
13
+
14
+ For the FINAL phase (no further pending phases): also pass the signal
15
+ "FINAL PHASE" so the synthesizer runs the extended pass — updating OVERVIEW.md
16
+ and README.md to reflect the completed project state.
17
+
18
+ To determine if this is the final phase: read docs/PLAN.md. If no phases remain
19
+ with status "pending" after the current one, it is the final phase.
20
+
21
+ When synthesizer returns "safe to /clear: yes", tell me:
22
+ - before/after line counts
23
+ - whether the final-pass ran
24
+ - that I can now run /clear (or proceed to the endpoint summary if final phase)
25
+
26
+ If it returns anything unsafe, show me what and stop.
@@ -0,0 +1,40 @@
1
+ ---
2
+ description: Forced re-research after a circuit breaker. Stops flailing, re-routes to deep research with full memory of dead ends.
3
+ ---
4
+
5
+ Caveman ULTRA mode.
6
+
7
+ Trigger: I chose "re-research" at a circuit breaker (see /phase step 5).
8
+
9
+ Steps:
10
+
11
+ 1. WRITE IT DOWN. Append to docs/ISSUES.md as OPEN:
12
+ ```
13
+
14
+ ### <error title>
15
+
16
+ - [ ] open - stuck after 3 attempts
17
+ - symptom: <…>
18
+ - attempts that FAILED: <hypothesis 1>, <2>, <3>
19
+
20
+ ```
21
+ Reference the existing debug-<slug>.md.
22
+
23
+ 2. RESET FRAME. The 3 failed hypotheses are probably all wrong. Discard them.
24
+
25
+ 3. DEEP RESEARCH. Dispatch `researcher` in IMPL mode WIDE:
26
+ - Read existing debug-<slug>.md and ISSUES.md failed-attempts FIRST.
27
+ - Re-read the actual error from scratch.
28
+ - Check real external service contract / docs.
29
+ - Look one layer below: config? env? version? data shape?
30
+ - Return fresh HYPOTHESIS backed by NEW evidence.
31
+
32
+ 4. RE-PLAN if needed. Research shows phase design was wrong -> dispatch planner.
33
+
34
+ 5. RESUME. Hand fresh hypothesis to `debugger`. It reads the prior debug file
35
+ (already knows what's ruled out). Budget = 3, NEW hypotheses only.
36
+
37
+ 6. This counts as the path chosen at the first breaker. If STUCK again ->
38
+ /phase step 5 SECOND STUCK. Do not loop further.
39
+
40
+ Report each step.
@@ -0,0 +1,34 @@
1
+ # docker-compose.test.yml — E2E test stack (local-docker mode).
2
+ # TEMPLATE — adjust build contexts and ports for your project layout.
3
+ services:
4
+ backend:
5
+ build:
6
+ context: ./backend # <-- adjust
7
+ environment:
8
+ SQL_SERVER: ${E2E_SQL_SERVER}
9
+ SQL_DB: ${E2E_SQL_DB}
10
+ SQL_USER: ${E2E_SQL_USER}
11
+ SQL_PASSWORD: ${E2E_SQL_PASSWORD}
12
+ TENANT_ID: ${E2E_TENANT_ID}
13
+ CLIENT_ID: ${E2E_CLIENT_ID}
14
+ STORAGE_CONN: ${E2E_STORAGE_CONN:-}
15
+ ports:
16
+ - "8081:8081"
17
+ healthcheck:
18
+ test: ["CMD", "curl", "-fs", "http://localhost:8081/health"]
19
+ interval: 5s
20
+ timeout: 3s
21
+ retries: 12
22
+
23
+ webapp:
24
+ build:
25
+ context: ./frontend # <-- adjust
26
+ environment:
27
+ API_BASE_URL: http://backend:8081
28
+ TENANT_ID: ${E2E_TENANT_ID}
29
+ CLIENT_ID: ${E2E_CLIENT_ID}
30
+ ports:
31
+ - "8080:80"
32
+ depends_on:
33
+ backend:
34
+ condition: service_healthy