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,283 @@
1
+ # anpunkit — AI-coding system development workflow
2
+
3
+ A reusable, self-navigating workflow for **Claude Code and Cursor**. Install with
4
+ one `npx` command, or clone it directly into your project.
5
+
6
+ ## Why
7
+
8
+ Codifies a `design-research -> grill -> plan -> implement -> test -> deploy` loop
9
+ with vertical-slice phases, blind testing, agent orchestration, automatic context
10
+ hygiene, and Azure infrastructure as a first-class Phase 0 — so the workflow runs
11
+ itself instead of being hand-steered every session.
12
+
13
+ ## The core idea
14
+
15
+ Mandatory steps live in **hooks** (deterministic, cannot be skipped).
16
+ Thinking steps live in **subagents + skills** (the model reasons).
17
+ Putting "read the issue log" in a hook is why it stops getting skipped.
18
+
19
+ ## Install
20
+
21
+ **End users — `npx` (recommended):**
22
+ ```bash
23
+ cd my-project
24
+ npx create-anpunkit # non-destructive: never clobbers your files
25
+ # then open Claude Code or Cursor — the session-start hook fires automatically
26
+ /overview # bootstrap the project (includes Phase 0 infra)
27
+ ```
28
+ Useful flags: `--dry-run` (print the plan, write nothing), `--force` (overwrite
29
+ user-modified kit files), `--kb-path <dir>` / `--kb-remote <url>` / `--no-kb`.
30
+
31
+ Upgrading an existing anpunkit project? Re-run `npx create-anpunkit`. It refreshes
32
+ kit-owned files, preserves anything you modified as `<file>.anpunkit-new`, merges
33
+ hook config into your existing `settings.json` / `.cursor/hooks.json`, and writes a
34
+ timestamped `.anpunkit-backup-*/` first.
35
+
36
+ **Kit developers — clone + `setup.sh`:**
37
+ ```bash
38
+ git clone https://github.com/MetheeS/anpunkit.git my-project
39
+ cd my-project && bash setup.sh
40
+ ```
41
+
42
+ > `npx create-anpunkit` requires Node >= 18 and `bash` on PATH (Git Bash on
43
+ > Windows). Claude Code already requires Node, so this adds no new dependency.
44
+
45
+ ## Commands
46
+
47
+ |Command |Does |
48
+ |-----------------|------------------------------------------------------------------------------|
49
+ |`/overview` |design-research → grill (×2) → OVERVIEW → PLAN (Phase 0 always first) → STATE |
50
+ |`/infra` |provision Azure infra: Bicep → what-if → review → apply → INFRA.md + .env.test|
51
+ |`/phase [n]` |run one phase: research → implement → blind test, with circuit breaker |
52
+ |`/quick [change]`|small obvious change, direct, no agent chain |
53
+ |`/unstuck` |deep re-research after a circuit breaker (you trigger it) |
54
+ |`/synthesize` |compress STATE.md, dedup ISSUES.md, prune snapshots |
55
+ |`/replan` |revise PLAN.md when it drifts |
56
+ |`/log-issue` |append an error with root cause + failed attempts |
57
+ |`/log-decision` |record an architectural change in DESIGN_LOG.md |
58
+ |`/store-wisdom` |promote resolved issues + research findings to shared KB |
59
+
60
+ ## Subagents
61
+
62
+ `researcher` (Haiku, two modes: design + impl) · `planner` (Opus) · `infra-provisioner` (Opus) ·
63
+ `implementer` (Opus, SCAFFOLD/FILL modes) · `test-author` (Opus, blind, RED-first) · `debugger` (Opus, isolated) ·
64
+ `e2e-runner` (Opus, blind, Playwright) · `synthesizer` (Haiku)
65
+
66
+ The main session is the orchestrator — it routes, it does not implement.
67
+
68
+ ## The loop (v2.0: TDD-first + regression guard)
69
+
70
+ Phases that add a public callable surface run test-first:
71
+ `RESEARCH -> SCAFFOLD -> RED -> GREEN -> TEST -> FIX -> CLOSE`. The implementer
72
+ writes interface stubs only; the `test-author` writes the suite blind against
73
+ those stubs (it must collect cleanly and FAIL — the RED gate); the implementer
74
+ then fills to green. Pure infra/config/doc phases keep the direct
75
+ `RESEARCH -> IMPLEMENT -> TEST` order.
76
+
77
+ Every phase CLOSE runs the accumulated **mock regression corpus**
78
+ (`tests/regression/`, via `scripts/regression.sh`) and a hard ENDPOINTS coverage
79
+ gate — so a contract built in an early phase cannot be silently broken later. The
80
+ final phase additionally runs the full real corpus.
81
+
82
+ Methodology lives in one place: the portable **`AGENTS.md`** at the repo root.
83
+ `CLAUDE.md` is a thin `@AGENTS.md` shim with Claude-native wiring only.
84
+
85
+ ## Compatibility
86
+
87
+ |Tool |What you get |
88
+ |--------------|------------------------------------------------------------------------------------------------------|
89
+ |**Claude Code** (full, reference)|commands, all 3 lifecycle hooks **with context injection**, named subagents, shared KB, `@AGENTS.md` import|
90
+ |**Cursor** (full)|generated commands (`.cursor/commands/`), lifecycle hooks (`.cursor/hooks.json`: sessionStart / preCompact / subagentStop), methodology via a `.cursor/rules/` pointer to `AGENTS.md`|
91
+ |**Other tools**|read `AGENTS.md` if they support the open standard; no generated adapters; not claimed as supported in v2.0|
92
+
93
+ One canonical command body in `commands.src/<name>.md` generates both tools' command sets at install.
94
+
95
+ **Cursor — verified against cursor.com/docs (June 2026):**
96
+ - **sessionStart context injection: works.** Cursor's `sessionStart` hook accepts an
97
+ `additional_context` JSON output field injected into the conversation's initial
98
+ context. Cursor expects JSON (Claude injects raw stdout), so the shipped wiring
99
+ runs the shared body through `cursor-session-start.sh`, a thin JSON-envelope
100
+ wrapper. The hook is fire-and-forget (non-blocking).
101
+ - **Named subagents: work natively.** Cursor reads `.claude/agents/*.md` directly
102
+ (documented Claude-compatibility path), with `/name` invocation and
103
+ description-based delegation — one set of role files serves both tools.
104
+ Caveat: `model: haiku/opus` tiers are Claude-specific; Cursor falls back to
105
+ `inherit`/a compatible model.
106
+ - **Hook path resolution: project hooks run from the project root** (not
107
+ `.cursor/`), so the shipped wiring uses `bash .claude/hooks/<script>.sh`. Cursor
108
+ sets `CLAUDE_PROJECT_DIR` as a compatibility alias, so the shared scripts run
109
+ unchanged.
110
+ - **preCompact is observational** in Cursor (cannot modify compaction); the
111
+ snapshot side-effect still runs, which is all the COMPRESS ritual needs.
112
+
113
+ > Note: Cursor can also load `.claude/settings.json` hooks directly ("Third-party
114
+ > skills" toggle). anpunkit does not rely on this — it requires a manual settings
115
+ > toggle (silent no-op if forgotten) and would double-fire hooks alongside
116
+ > `.cursor/hooks.json`. The explicit native wiring is the supported path.
117
+
118
+ Codex is **not** a target in v2.0 (its repo-committed command path is deprecated
119
+ home-dir custom-prompts with a divergent UX).
120
+
121
+ ## How each problem is solved
122
+
123
+ |Your problem |Fix in this kit |
124
+ |-------------------------------------------|---------------------------------------------------------------------------------------------|
125
+ |Agents miss the issue log |SessionStart hook injects open ISSUES.md every session — not optional |
126
+ |Manual navigation every session |SessionStart hook injects STATE.md + git + active phase |
127
+ |Stuck on a bug too long |warn at attempt 2; first hard-stop at 3 STOPS and asks you; `/unstuck` for deep re-research |
128
+ |Context rot during debugging |`researcher` + `debugger` write full output to `docs/research/`, return only a summary + path|
129
+ |Want orchestration |8 scoped subagents; `/phase` is the orchestrator routing them |
130
+ |Handoff / memory keeps growing |`synthesizer` + PreCompact hook compress and dedup |
131
+ |Azure auth friction per session |`scripts/auth-setup.sh` — one token check, once per session |
132
+ |Infra created ad-hoc mid-phase |`infra-provisioner` + Phase 0 — provisioned once, reviewed before apply |
133
+ |Planning without domain knowledge |design-researcher runs before planning; double grill absorbs findings |
134
+ |Deployment not in the plan |planner always puts deploy task in last phase |
135
+ |No endpoint summary at project end |final-phase close shows usage endpoints from docs/ENDPOINTS.md |
136
+ |Re-discovering same gotchas across projects|`/store-wisdom` promotes findings to shared KB; researcher checks KB before web |
137
+
138
+ ## Files it manages
139
+
140
+ - `docs/STATE.md` — current position, kept small (rewritten each phase)
141
+ - `docs/ISSUES.md` — error log, deduped by synthesizer
142
+ - `docs/PLAN.md` — vertical-slice phase plan (Phase 0 always first)
143
+ - `docs/HISTORY.md` — one line per finished phase
144
+ - `docs/OVERVIEW.md` — project scope, written after double-grill
145
+ - `docs/INFRA.md` — Azure resource manifest + cost estimates (written by infra-provisioner)
146
+ - `docs/ENDPOINTS.md` — API/service endpoint catalogue (maintained by implementer)
147
+ - `docs/.snapshots/` — pre-compact recovery markers (auto-pruned, gitignored)
148
+ - `infra/` — Bicep templates (generated by infra-provisioner, committed to git)
149
+
150
+ ## Shared Knowledge Base (optional)
151
+
152
+ The kit can connect to a shared GitHub repo (`anpunkit-kb`) that accumulates
153
+ resolved issues and research findings across all your projects. Once configured,
154
+ the researcher checks the KB at the start of every session — so you stop
155
+ re-discovering the same Azure/Databricks gotchas project after project.
156
+
157
+ **Setup (one-time per machine):**
158
+
159
+ ```bash
160
+ # 1. Create a GitHub repo: anpunkit-kb (empty)
161
+ # 2. Clone it somewhere permanent on your machine
162
+ git clone git@github.com:your-username/anpunkit-kb.git ~/anpunkit-kb
163
+
164
+ # 3. During setup.sh, provide the path when prompted
165
+ bash setup.sh
166
+ ```
167
+
168
+ **Usage:**
169
+
170
+ ```
171
+ /store-wisdom # after a resolved bug or completed phase — promotes findings to KB
172
+ ```
173
+
174
+ See `docs/KB_GUIDE.md` in the anpunkit-kb repo (created by first `/store-wisdom` run).
175
+
176
+ ## Daily flow
177
+
178
+ ```
179
+ /overview once per project (design-research + double grill)
180
+ /infra once per project (Phase 0) — after /overview
181
+ scripts/auth-setup.sh once per session (Azure projects)
182
+ /phase 1 -> /synthesize -> /clear
183
+ /phase 2 -> /synthesize -> /clear
184
+ ...
185
+ # last phase -> shows usage endpoints automatically
186
+ # bug won't die? -> /unstuck
187
+ # plan drifted? -> /replan
188
+ # learned something worth keeping? -> /store-wisdom
189
+ ```
190
+
191
+ ## Azure infrastructure (Phase 0)
192
+
193
+ The kit treats Azure infra as **Phase 0** — provisioned once before any code
194
+ phase starts, owned by the `infra-provisioner` subagent.
195
+
196
+ ### Phase 0 flow
197
+
198
+ ```
199
+ /overview # includes Phase 0 in PLAN.md automatically
200
+ /infra # generates Bicep -> what-if diff -> you review -> "go" -> apply
201
+ # writes docs/INFRA.md (resource manifest + cost estimates)
202
+ # writes .env.test (generated, never fill manually)
203
+ /phase 1 # PRE-FLIGHT checks Phase 0 is done before starting
204
+ ```
205
+
206
+ ### Session startup (Azure projects)
207
+
208
+ Run once per session before any Azure work:
209
+
210
+ ```bash
211
+ scripts/auth-setup.sh
212
+ ```
213
+
214
+ Checks your `az` token is fresh and the right subscription is active.
215
+ Prompts `az login` only if stale. No credential storage — your account only.
216
+
217
+ ### What /infra does
218
+
219
+ 1. `infra-provisioner` reads `docs/OVERVIEW.md` for the system design
220
+ 1. Generates `infra/main.bicep` + per-service modules under `infra/modules/`
221
+ 1. Runs `az deployment what-if` — shows exactly what will be created
222
+ 1. **Stops and waits for your “go”** — nothing applied without your review
223
+ 1. Applies the deployment
224
+ 1. Writes `docs/INFRA.md` — resource IDs, endpoints, cost estimates (THB, SEA region)
225
+ 1. Generates `.env.test` from the manifest
226
+
227
+ Re-run `/infra` any time infra drifts or a new resource is needed.
228
+ Re-run `/infra regenerate-env` to refresh `.env.test` only.
229
+
230
+ ### Cost awareness
231
+
232
+ `infra-provisioner` annotates every resource in `INFRA.md` with an estimated
233
+ monthly cost. It uses production-appropriate SKUs by default — not artificially
234
+ cheap dev tiers that need resizing before go-live.
235
+
236
+ ### E2E target
237
+
238
+ `infra-provisioner` determines the E2E target from the system design:
239
+
240
+ - **azure-deployed**: `E2E_STACK_EXTERNAL=1` — Playwright hits your deployed Azure app.
241
+ - **local-docker**: Containers run the app, pointed at real Azure services.
242
+
243
+ ### Test data
244
+
245
+ Seeding and cleanup are **deployment phase** concerns, not E2E concerns.
246
+ `e2e-stack.sh` has no seed/cleanup commands.
247
+
248
+ ## End-to-end testing
249
+
250
+ Three layers: unit/integration (mock suite), real API (`test-author`), and
251
+ functional browser E2E (`e2e-runner`, Playwright).
252
+
253
+ **Phase gate:** a frontend-touching phase closes only when the real API suite
254
+ AND the browser E2E suite pass. Mock-green alone never closes a phase.
255
+
256
+ **MSAL / Entra ID auth.** Browser E2E never drives the Microsoft login UI.
257
+ `e2e/global-setup.ts` uses ROPC flow with a dedicated test account (MFA excluded
258
+ via Conditional Access) to fetch a real token and inject it into the MSAL cache.
259
+
260
+ **E2E setup (one-time per project):**
261
+
262
+ 1. Run `/infra` — it generates `.env.test` automatically.
263
+ 1. Provision the Entra test user + Conditional Access MFA exclusion.
264
+ 1. `npm i -D @playwright/test && npx playwright install chromium`
265
+
266
+ ## Windows / Git Bash
267
+
268
+ The hooks are bash scripts. On Windows they run under **Git Bash**.
269
+
270
+ - **Line endings.** The shipped `.gitattributes` pins all `.sh` files to LF.
271
+ - **`bash` on PATH.** Verify in PowerShell: `bash --version`.
272
+
273
+ Hook commands use a BARE `bash` prefix: `bash .claude/hooks/session-start.sh`.
274
+ Never an explicit bash.exe path — that triggers a Claude Code argument-splitter bug.
275
+
276
+ **Verifying hooks:** in a fresh session ask Claude:
277
+
278
+ > What does my STATE.md say, and how many open issues are in ISSUES.md?
279
+
280
+ A correct answer without reading any file = hooks working. No visible banner on
281
+ newer Claude Code versions is normal — injection may be silent.
282
+
283
+ (WSL users: the kit runs as-is — WSL is Linux.)
@@ -0,0 +1,62 @@
1
+ ---
2
+ description: Provision or verify Azure infrastructure. Generates Bicep, shows what-if diff for your review, applies only after your approval, writes docs/INFRA.md and .env.test.
3
+ argument-hint: [provision | verify | update <what changed> | regenerate-env]
4
+ ---
5
+
6
+ Caveman ULTRA mode. You are the ORCHESTRATOR.
7
+
8
+ Action: $ARGUMENTS (default: "provision" if INFRA.md missing, "verify" if present)
9
+
10
+ ---
11
+
12
+ ## PRE-FLIGHT
13
+
14
+ 1. Check `az account show` — if it fails, STOP.
15
+ Tell me: "Run `scripts/auth-setup.sh` first."
16
+
17
+ 2. Determine mode from $ARGUMENTS or default logic.
18
+
19
+ ---
20
+
21
+ ## PROVISION / UPDATE flow
22
+
23
+ 1. Dispatch `infra-provisioner` with the mode.
24
+
25
+ 2. It returns WHAT-IF READY. Show me:
26
+ - resource list with SKUs and costs
27
+ - total monthly cost estimate
28
+ - what-if detail file path
29
+ Then ask:
30
+ > "Review docs/research/infra-whatif-<timestamp>.md. Type 'go' to apply,
31
+ > or describe changes to make first."
32
+ WAIT. Do not proceed until I say "go".
33
+
34
+ 3. On "go": pass APPROVED to `infra-provisioner`.
35
+
36
+ 4. On "make changes": dispatch UPDATE with feedback. Loop to step 2.
37
+
38
+ 5. On APPLIED: tell me INFRA.md ✓, .env.test ✓, and any manual steps remaining.
39
+
40
+ ---
41
+
42
+ ## VERIFY flow
43
+
44
+ 1. Check INFRA.md exists. If missing: tell me to run `/infra provision` first.
45
+ 2. Dispatch `infra-provisioner` VERIFY mode.
46
+ 3. Return drift report.
47
+
48
+ ---
49
+
50
+ ## REGENERATE-ENV flow
51
+
52
+ 1. Check INFRA.md exists.
53
+ 2. Dispatch `infra-provisioner` REGENERATE-ENV.
54
+ 3. Confirm .env.test rewritten.
55
+
56
+ ---
57
+
58
+ ## Notes
59
+
60
+ - /infra never touches PLAN.md, STATE.md, ISSUES.md, or DESIGN_LOG.md.
61
+ - Infra errors are AZURE UNAVAILABLE or CONFIG ERROR — do NOT route to debugger.
62
+ - If UNDERSPEC: list missing decisions, ask me to fill them, re-dispatch.
@@ -0,0 +1,34 @@
1
+ ---
2
+ description: Record an architectural decision in docs/DESIGN_LOG.md. Use only when the kit's structure changes.
3
+ argument-hint: [what changed]
4
+ ---
5
+
6
+ Caveman ULTRA mode.
7
+
8
+ Append an architectural decision to docs/DESIGN_LOG.md. Change: $ARGUMENTS
9
+
10
+ WHEN this applies — the change is ARCHITECTURAL:
11
+ - new / removed / renamed agent, hook, or command
12
+ - changed workflow rule (escalation, phase gate, test layering)
13
+ - design decision where alternatives were weighed
14
+
15
+ WHEN it does NOT apply:
16
+ - code changes, features, phase progress -> HISTORY.md
17
+ - bugs + fixes -> ISSUES.md
18
+ - infra changes -> INFRA.md
19
+
20
+ Steps:
21
+ 1. Read docs/DESIGN_LOG.md.
22
+ 2. Append a dated line to `## 0. Changelog`, newest first.
23
+ 3. If alternatives were weighed, ALSO append a full entry to §5:
24
+ ```
25
+
26
+ ### 5.x <decision title>
27
+
28
+ Options: <a, b, c>. **Chosen: <x>.** <why it won.>
29
+
30
+ ```
31
+ 4. If agent/hook/command/file added or removed, update the file inventory (§6).
32
+ 5. NEVER rewrite or delete existing entries — append only.
33
+
34
+ Confirm back in 2-3 lines: what was logged and where.
@@ -0,0 +1,28 @@
1
+ ---
2
+ description: Log an error to docs/ISSUES.md with root cause + solution, in the canonical format.
3
+ argument-hint: [short error description]
4
+ ---
5
+
6
+ Caveman ULTRA mode.
7
+
8
+ Append an entry to docs/ISSUES.md. Error: $ARGUMENTS
9
+
10
+ Canonical format:
11
+ ```
12
+
13
+ ### <short error title — searchable, literal error keywords>
14
+
15
+ - [x] open (or “- [x] resolved”)
16
+ - symptom: <what was observed>
17
+ - root cause: <the REAL underlying cause>
18
+ - solution: <exact fix, or “pending”>
19
+ - failed attempts: <approaches that did NOT work>
20
+
21
+ ```
22
+ Rules:
23
+ - title must contain literal error keywords -> grep finds it.
24
+ - root cause is the real cause, not "the line threw an error".
25
+ - always fill "failed attempts" — stops repeated dead ends.
26
+ - open issues go at the TOP; resolved below; archived oldest at bottom.
27
+
28
+ Confirm the entry back in 2 lines.
@@ -0,0 +1,106 @@
1
+ ---
2
+ description: Bootstrap a new project. Runs design-research, double grill, and planning. Run once per project.
3
+ ---
4
+
5
+ Caveman ULTRA mode.
6
+
7
+ Recommended: run from plan mode (Shift+Tab). Planning agents are read-only by
8
+ tool grant; plan mode adds a read-only gate on the main session too. Optional.
9
+
10
+ Goal: stand up a fresh project workspace with a well-grounded plan.
11
+
12
+ ---
13
+
14
+ ## Steps
15
+
16
+ ### Round 1 — Initial grill
17
+
18
+ 1. Run the `grill-me` skill to interrogate me. Goal: understand initial scope.
19
+ Cover: project purpose, success criteria, external services, Azure services
20
+ needed (type + sizing), region, deployment target (Azure or local for E2E),
21
+ known constraints, unknowns.
22
+ Do not stop early. Do not write OVERVIEW.md yet.
23
+
24
+ Store the round-1 answers as working context — do NOT write OVERVIEW.md yet.
25
+
26
+ ---
27
+
28
+ ### Design research
29
+
30
+ 2. Extract DESIGN TOPICS from the round-1 answers. These are things we need
31
+ to verify before planning:
32
+ - Each external service mentioned: what does it support at the relevant tier?
33
+ Quotas, rate limits, known gaps?
34
+ - Azure services: any sizing or SKU constraints relevant to the use case?
35
+ - Auth patterns: any MSAL/Entra constraints for this scenario?
36
+ - Any other architectural assumption in the round-1 answers worth verifying.
37
+
38
+ 3. Dispatch `researcher` in DESIGN mode with the DESIGN TOPICS list.
39
+ It returns a terse summary + file paths. Read the design-<slug>.md files
40
+ only if needed.
41
+
42
+ ---
43
+
44
+ ### Round 2 — Research-informed re-grill
45
+
46
+ 4. Run `grill-me` again — a second focused pass. Seed it with:
47
+ - The round-1 answers (already established — do not re-ask these)
48
+ - The design-research key findings and new questions raised
49
+
50
+ The re-grill asks whatever it needs to build complete understanding. It is
51
+ not limited to "gaps from research" — research context makes new questions
52
+ relevant even if it found no blockers. Do not re-ask what round 1 already
53
+ established clearly.
54
+
55
+ ---
56
+
57
+ ### Write OVERVIEW.md
58
+
59
+ 5. Write docs/OVERVIEW.md from the COMBINED output of round-1 + design-research
60
+ + round-2. Include:
61
+ - Project purpose and success criteria
62
+ - Scope and constraints (informed by research findings)
63
+ - External services with confirmed capabilities/limits
64
+ - "Azure services" section: every service with expected SKU
65
+ - Deployment target (azure-deployed or local-docker for E2E)
66
+ - Known risks / open questions (if any remain)
67
+
68
+ OVERVIEW.md is written HERE — after the re-grill, not before.
69
+
70
+ ---
71
+
72
+ ### Plan
73
+
74
+ 6. Hand OVERVIEW.md + design-research findings to the `planner` subagent.
75
+ PLAN.md MUST:
76
+ - Start with Phase 0 (infra setup) as the first entry (always).
77
+ - End with a final code phase that contains the deploy task block.
78
+
79
+ 7. Create docs/STATE.md:
80
+ ```
81
+
82
+ # STATE
83
+
84
+ phase: 0 (pending)
85
+ completed: project bootstrapped — design research done, double grill done
86
+ next: run /infra to provision Azure infrastructure
87
+ blocker: none
88
+
89
+ ```
90
+ 8. Create docs/ISSUES.md with header `# Issues` and `## Archived` section.
91
+
92
+ 9. Create empty docs/HISTORY.md.
93
+
94
+ 10. Create docs/INFRA.md from the template (populated by /infra).
95
+
96
+ 11. Create docs/ENDPOINTS.md:
97
+ ```
98
+ # Endpoints — <project name>
99
+ > Maintained by implementer. Updated each phase.
100
+ > Base URL: (populated after deployment phase)
101
+ ```
102
+
103
+ Then stop and show me PLAN.md for approval before any phase starts.
104
+
105
+ Remind me: "Run `/infra` next to provision the Azure environment (Phase 0)
106
+ before starting Phase 1."