@caddis/cli 0.2.3 → 0.2.5

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 (46) hide show
  1. package/README.md +11 -0
  2. package/bundles/antigravity-plugin/agents/anchor.md +60 -0
  3. package/bundles/antigravity-plugin/agents/claude-md-curator.md +144 -0
  4. package/bundles/antigravity-plugin/agents/codebase-audit.md +53 -0
  5. package/bundles/antigravity-plugin/agents/data-engineer.md +51 -0
  6. package/bundles/antigravity-plugin/agents/debug.md +48 -0
  7. package/bundles/antigravity-plugin/agents/knowledge-transfer.md +139 -0
  8. package/bundles/antigravity-plugin/agents/security-analyst.md +49 -0
  9. package/bundles/antigravity-plugin/agents/sql-expert.md +46 -0
  10. package/bundles/antigravity-plugin/agents/tester.md +45 -0
  11. package/bundles/antigravity-plugin/agents/ui-design-reviewer.md +110 -0
  12. package/bundles/antigravity-plugin/plugin.json +1 -1
  13. package/bundles/antigravity-plugin/skills/_registry.md +6 -0
  14. package/bundles/antigravity-plugin/skills/advisory-hub/SKILL.md +183 -0
  15. package/bundles/antigravity-plugin/skills/advisory-hub/reference/context-template.md +214 -0
  16. package/bundles/antigravity-plugin/skills/advisory-hub/reference/hub-handbook.md +233 -0
  17. package/bundles/antigravity-plugin/skills/advisory-hub/reference/report-contract.md +94 -0
  18. package/bundles/antigravity-plugin/skills/advisory-hub/reference/succession.md +96 -0
  19. package/bundles/antigravity-plugin/skills/brainstorming/SKILL.md +1 -1
  20. package/bundles/antigravity-plugin/skills/code-review/SKILL.md +7 -0
  21. package/bundles/antigravity-plugin/skills/context-curator/SKILL.md +1 -1
  22. package/bundles/antigravity-plugin/skills/cross-review/SKILL.md +71 -14
  23. package/bundles/antigravity-plugin/skills/dashboard-perf-sweep/SKILL.md +18 -18
  24. package/bundles/antigravity-plugin/skills/feature-plan/SKILL.md +164 -9
  25. package/bundles/antigravity-plugin/skills/gate-preflight/SKILL.md +34 -0
  26. package/bundles/antigravity-plugin/skills/gate-review/SKILL.md +36 -0
  27. package/bundles/antigravity-plugin/skills/golden-plan/SKILL.md +22 -13
  28. package/bundles/antigravity-plugin/skills/handoff/SKILL.md +78 -0
  29. package/bundles/antigravity-plugin/skills/implement/SKILL.md +182 -3
  30. package/bundles/antigravity-plugin/skills/mermaid-diagrams/SKILL.md +57 -1
  31. package/bundles/antigravity-plugin/skills/park/SKILL.md +126 -0
  32. package/bundles/antigravity-plugin/skills/prd/SKILL.md +4 -2
  33. package/bundles/antigravity-plugin/skills/preflight/SKILL.md +5 -0
  34. package/bundles/antigravity-plugin/skills/spawn-hub/SKILL.md +287 -0
  35. package/bundles/antigravity-plugin/skills/validate-phase/SKILL.md +112 -0
  36. package/bundles/antigravity-plugin/skills/writing-plans/SKILL.md +7 -4
  37. package/bundles/antigravity-plugin/warm_start_agy.py +35 -6
  38. package/bundles/antigravity-plugin-extras/plugin.json +1 -1
  39. package/bundles/antigravity-plugin-extras/skills/agent-orchestration/SKILL.md +9 -9
  40. package/bundles/antigravity-plugin-extras/skills/cross-review/SKILL.md +56 -6
  41. package/bundles/antigravity-plugin-extras/skills/requesting-code-review/SKILL.md +1 -1
  42. package/bundles/antigravity-plugin-extras/skills/schema-migration/SKILL.md +2 -2
  43. package/bundles/antigravity-plugin-extras/skills/state-tracking/SKILL.md +4 -4
  44. package/bundles/manifest.json +3 -3
  45. package/dist/cli.js +143 -59
  46. package/package.json +1 -1
@@ -13,8 +13,10 @@ The plan file is the **durable spine of the harness** — it must let any future
13
13
  agent, on any tool) resume with zero re-discovery. Optimize for that.
14
14
 
15
15
  ## Headless mode
16
- When the invocation contains the marker **`HEADLESS RUN RULES`** (a docket runner / non-interactive
17
- caller spawned this session — no human is present), the scope-check questions and any interview are
16
+ When the invocation contains the marker **`HEADLESS RUN RULES`**, **or `CADDIS_HEADLESS` /
17
+ `DOCKET_PLAN` / `DOCKET_BRANCH` is set in the environment** (the caddis OSS launchers export
18
+ `CADDIS_HEADLESS` on claude's `-p`/`--print`; the docket runner sets the others) — a non-interactive
19
+ caller spawned this session and no human is present, so the scope-check questions and any interview are
18
20
  **suspended and forbidden**. This mode exists for one-line ideas: the card may be a short title with **no
19
21
  description**, and there may be **no codebase, PROJECT-FACTS, or prior PRD** to read. That is expected —
20
22
  write a complete best-effort plan anyway.
@@ -53,6 +55,36 @@ points), read it first. It's a free, token-zero project fingerprint that anchors
53
55
  exists instead of assumed. If the work fits comfortably in one session, say so and offer to just do it
54
56
  instead of planning. Only produce a plan for genuinely multi-phase work.
55
57
 
58
+ ### Evidence gate — do not write plan content while a BLOCKER is unresolved
59
+ Absorbed from `golden-plan`, whose strongest idea this is, and the direct counter to the failure
60
+ mode that makes a plan dangerous: **you write the spec, so you cannot see its gaps.** A phase built
61
+ on guessed field names or an imagined API is confidently wrong, passes every completeness check,
62
+ and only fails at the exit gate — or worse, doesn't.
63
+
64
+ Before writing any phase, tier each item:
65
+ - **BLOCKER** — stop and ask the user. Do not plan around it.
66
+ - **WARNING** — proceed, but the affected phases carry a stated assumption.
67
+ - **OPTIONAL** — note its absence and continue.
68
+
69
+ | # | Evidence | Tier |
70
+ |---|---|---|
71
+ | E1 | A mockup / wireframe / screenshot of the target UI, and is it frozen? | BLOCKER for UI-heavy work, WARNING otherwise |
72
+ | E2 | A real data sample on the CURRENT schema, so field names are read not guessed | BLOCKER for any data binding, WARNING if a typed DTO/interface defines it |
73
+ | E3 | The API contract for anything you will call — real request/response shapes | BLOCKER when integrating something you did not write |
74
+ | E4 | Scaffold inventory: what already exists that these phases must fit into | WARNING — `.caddis/PROJECT-FACTS.md` fills this for free if present |
75
+
76
+ **Free head-start:** `.caddis/PROJECT-FACTS.md` pre-fills E4 plus the run/test/build commands, env-var
77
+ names and CI workflows at zero token cost — and grounds the `## Risks` table in what the scan actually
78
+ shows rather than boilerplate.
79
+
80
+ **If a PRD exists for this feature, read it FIRST.** Look for `.caddis/prd/<feature-slug>.md`.
81
+ `/caddis:prd` ends by suggesting `/feature-plan <feature>`, and until now nothing on this side ever
82
+ opened the file — so the whole chain's first handoff depended on the model happening to look. Carry
83
+ its functional requirements into phases (they are written *"so a test can verify it"*, which is
84
+ exactly what a phase's exit gate needs) and its `## Open questions` into `## Constraints & decisions`.
85
+ A headless pipeline that plans straight from a bare title while a complete PRD sits on disk is the
86
+ failure this closes.
87
+
56
88
  ## Step 2 — Design phases
57
89
  Break the work into **independently completable** phases (~30–60 min each, clear exit gate). Each phase
58
90
  follows the harness loop: **RED → GREEN → REFACTOR → VERIFY → COMMIT**. Front-load risk.
@@ -88,10 +120,54 @@ A tier can be served by an OSS provider instead of Anthropic (cheat sheet:
88
120
  feature branch). The local-coder gate below exists exactly so these phases survive a weaker
89
121
  implementer — a phase may only take this lane if it passes that gate.
90
122
  - **review lane (every phase that touches code)** — cross-vendor review by a vendor that did NOT
91
- write the code: `python .github/tools/oss_review.py --range main..HEAD --provider deepseek`
123
+ write the code: `/caddis:cross-review --range main..HEAD`
92
124
  (Claude or GLM implemented) or `--provider glm` / a Claude `code-reviewer` pass (DeepSeek-adjacent
93
125
  work). Never same-vendor.
94
126
 
127
+ **The `Lane:` line is a routing directive read by `/caddis:implement`, not a note.** An interactive
128
+ session that is handed a phase belonging to another lane spawns that lane rather than absorbing the
129
+ work; a headless one records the deviation in the Tracker. Write the launch command out in full, per
130
+ phase — it is executed verbatim.
131
+
132
+ #### A phase may take a no-escalation lane only if its exit gate would fail on a spec error
133
+ `glm-headless` cannot escalate: it does what the phase says. So completeness is only half the test —
134
+ the other half is whether being **wrong** would be caught. Ask literally: *"if the instruction I just
135
+ wrote were wrong, would this phase's exit gate go red?"*
136
+ - **Yes** → pure logic with literal assertions: a parser, a computed value, an API shape assertion
137
+ (*"`expected_slots` returns exactly 96 and 1440"*). Safe for a no-escalation lane.
138
+ - **No** → user-facing copy, nav/menu entries, status or badge flags, ordering, wording, config
139
+ defaults — anything whose only proof is a human looking at it. **Not safe, however completely it
140
+ is specified.**
141
+
142
+ This is the failure the completeness gate cannot see, because **you wrote the spec**: if you could
143
+ see the gap you would have filled it. Live case — a phase spelled out to 10 literal steps across 8
144
+ files passed every bullet of the local-coder gate, and the spec itself was wrong twice (it shipped an
145
+ internal repo path into stakeholder-facing copy, and set a `live` status flag that suppressed the
146
+ framework's own "Soon" badge). `tsc` clean, 632/632 tests green, cross-review CLEAN, exit gate
147
+ satisfied. A headless run following it literally would have committed both, entirely green.
148
+
149
+ In an Advisory-Hub plan, treat your lane as **provisional**: the Hub writes each `phase-NN.prompt.md`
150
+ before the phase runs, and that is the first time anyone but the spec's author reads it. Let that
151
+ read confirm or downgrade the lane. It costs nothing — the prompt is being written anyway.
152
+
153
+ ### Group phases into MILESTONES — only when the plan is big enough
154
+ **Add milestones when the plan has ~8+ phases OR spans multiple sessions.** Below that, phases and a
155
+ Tracker are enough; a three-phase feature gains nothing from ceremony. (Same sizing instinct as the
156
+ Advisory-Hub test, deliberately — one threshold to remember, not two.)
157
+
158
+ A milestone is **a group of phases that ship together**. It answers "what lands when this is done?",
159
+ which is the question a long plan otherwise leaves the executor guessing at.
160
+
161
+ ```markdown
162
+ ### Milestone M2 — <name> (phases 4-7)
163
+ **Ships:** <what actually lands — a version, a PR, a deploy>
164
+ **Gate:** <the check that must pass before it ships>
165
+ **Boundary:** handoff + fresh session before M3
166
+ ```
167
+
168
+ Then give every phase a `**Milestone:** M2` line and add a `Milestone` column to the Tracker, so a
169
+ resuming session can see at a glance which group it is in and what remains before the next ship.
170
+
95
171
  ### Flag high-risk phases (`risk:` — a marker, not a mechanism)
96
172
  Each phase may carry **`risk: normal|high`** (default `normal` — omit the line unless the phase is
97
173
  `high`), meaning only "this is a phase where a wrong answer is expensive" — security/authz, a
@@ -133,6 +209,7 @@ Creating Model: <model-id>
133
209
  ### Phase 1 — <name> ⏳
134
210
  > ⚠️ **Switch model/lane BEFORE starting this phase** — the *active* model does the work, not the
135
211
  > one named here. Lane `claude`: run `/model <alias>`. Lane `glm-headless`: run the exact command below.
212
+ **Milestone:** M1 *(omit on plans without milestones)*
136
213
  **Model:** <tier> (`/model <alias>`) — <one-line rationale tied to this phase's difficulty>
137
214
  **Lane:** claude — this session | glm-headless — `claude-glm -p "/caddis:implement <this plan's path> — Phase 1 only"`
138
215
  **Session:** continue | **fresh** (start a new session for this phase — note why: lane change / heavy context)
@@ -144,10 +221,11 @@ Creating Model: <model-id>
144
221
  - GREEN: <minimal implementation>
145
222
  - REFACTOR: <what to clean if needed>
146
223
  **Verify (subagents):** dispatch `tester` (must return passed), then `code-reviewer` (verdict: approved)
147
- **Cross-review:** `python .github/tools/oss_review.py --range main..HEAD --provider <vendor that did NOT implement>` → REVIEW: CLEAN
224
+ **Cross-review:** `/caddis:cross-review --range main..HEAD` → REVIEW: CLEAN
148
225
  **Exit gate:** <specific, testable — e.g. "GET /api/x returns 200 with {shape}", not "tests pass">
149
226
  **Commit:** `<conventional commit message>`
150
- **Then:** update the Tracker row (status + hash) → `/caddis:handoff` if ending the session here.
227
+ **Then:** update the Tracker row (status + hash). If this phase ends the session, WRITE the handoff
228
+ yourself (relay + Tracker) before stopping — do not hand back "run `/caddis:handoff`" as the next action.
151
229
 
152
230
  ### Phase 2 — <name> 🔲
153
231
  <same structure>
@@ -155,9 +233,36 @@ Creating Model: <model-id>
155
233
  ## Execution protocol (standing rules — this plan is the memory, not anyone's head)
156
234
  - One phase at a time: read this plan → run the phase on its **Lane** → RED→GREEN→VERIFY→CROSS-REVIEW→
157
235
  COMMIT → update the **Tracker** row. The Tracker is the resume signal for every future session.
158
- - **Session boundaries:** `/caddis:handoff` after any phase that ends a sitting. Start a FRESH
236
+ - **Session boundaries:** the executor WRITES the handoff (durable `relay.md` + Tracker) after any
237
+ phase that ends a sitting — it performs the work, it does not suggest the command. Start a FRESH
159
238
  session (or `/clear`) before any phase marked `Session: fresh`, before a lane change, or whenever
160
239
  context feels heavy. Resume with exactly: `read <this plan's path> and implement the next ⏳ phase`.
240
+ - **Run to a boundary, not to a phase.** The executor implements phase after phase, committing each,
241
+ and stops only at a marked boundary. Do not plan a stop after every phase — that is the friction
242
+ this structure exists to remove.
243
+ - **The four halts, and nothing else:**
244
+ 1. **A milestone boundary** — its `Gate:` passed and it is ready to ship.
245
+ 2. **A phase marked `Session: fresh`** — context is heavy or the work changes shape.
246
+ 3. **After a `risk: high` phase** — *after*, never before. The phase is executed and committed
247
+ normally; the halt stops anything being **built on top of it** before a human has looked. Blast
248
+ radius stays one reviewable, revertable commit. Halting *beforehand* buys nothing: the phase has
249
+ to be executed either way, and a well-specced high-risk phase is as executable as any other.
250
+ 4. **A failed or blocked phase** — tests red, exit gate unmet, or the plan turned out wrong. Stop;
251
+ do not build on it.
252
+ - **A lane change is NOT a halt.** `/caddis:implement` spawns the assigned lane itself and verifies
253
+ the result. It used to need a human only because the routing was inert.
254
+ - **At every halt, leave both:** the executor PERFORMS the handoff (writes `relay.md`, updates the
255
+ Tracker) and then prints the **halt block** — the single thing the human acts on. A next action of
256
+ "do a handoff" / "update the relay" is a DEFECT, not a handoff: it names the work instead of doing
257
+ it, and the context needed to do it is gone the moment the session ends:
258
+ ```
259
+ === HALT — <one-line reason> ===
260
+ Done: phases 4-7 (M2) · commits <sha>, <sha>
261
+ Blocked: <what, or "nothing">
262
+ You: /clear, then paste ↓
263
+ read <plan path> and implement Phase 8
264
+ ```
265
+ A run that trails off without this costs a human the work of reconstructing where it got to.
161
266
  - **Ship gate:** NEVER push or merge to main from a phase — phases only commit to the feature branch.
162
267
  When all phases are ✅: `/caddis:ship-pr` (stops at green CI), then STOP and wait for the human's
163
268
  explicit go before `/caddis:ship-merge`.
@@ -171,9 +276,9 @@ Creating Model: <model-id>
171
276
  |---|---|
172
277
 
173
278
  ## Tracker (update as you go — this is the resume signal)
174
- | Phase | Model | Lane | Status | Commit | Cross-review | Notes |
175
- |---|---|---|---|---|---|---|
176
- | 1 | mid | claude | not started | — | — | |
279
+ | Phase | Milestone | Model | Lane | Status | Commit | Cross-review | Notes |
280
+ |---|---|---|---|---|---|---|---|
281
+ | 1 | M1 | mid | claude | not started | — | — | |
177
282
  ```
178
283
 
179
284
  ## Plan quality gate — local-coder ready (MANDATORY)
@@ -195,9 +300,59 @@ done:
195
300
  the literal launch command for glm phases) and a cross-review provider that is a different vendor
196
301
  than the implementer. A glm-headless phase MUST pass every bullet of this gate — that lane has no
197
302
  slack for reasoning out gaps.
303
+ - **Launch command is spawnable** — every `glm-headless` phase's command carries **`-p`** (or
304
+ `--print`) and ends with **`— Phase N only`**. Both are load-bearing, not style: the launchers set
305
+ `CADDIS_HEADLESS` *only* on `-p`, and that variable is the guard that stops a spawned session
306
+ spawning another one forever; the `Phase N only` suffix is what stops the child running to the end
307
+ of the plan. The command is executed verbatim by a model with no slack to notice a missing flag,
308
+ and `/caddis:implement` now refuses a command without `-p` rather than running it.
309
+ - **Gate-detectable** — if this phase's instruction were WRONG, its exit gate would go red. A phase
310
+ whose gates pass either way (copy, nav entries, badges, ordering, wording, config defaults) must
311
+ not take a lane that cannot escalate, no matter how completely it is specified. Every other bullet
312
+ here checks that the spec is COMPLETE; only this one checks that a mistake would be noticed.
198
313
 
199
314
  If any phase relies on the implementer *reasoning out* a gap, close the gap in the plan now.
200
315
 
316
+ ## Step 3b — Does this plan need an Advisory Hub? (ask once, here)
317
+
318
+ The Advisory Hub is **opt-in per plan**, gated on a single file: `<plan-stem>-advisory-context.md`
319
+ beside the plan. `/caddis:implement`, `/caddis:handoff` and `/caddis:validate-phase` all check for it;
320
+ **no file → no behaviour change, ever.** But nothing has ever *asked* whether to create it, so the
321
+ pattern only ever gets used by someone who already knows it exists. This step closes that gap.
322
+
323
+ **Ask it here** — at the end of planning is the only moment the phase count, risk levels and session
324
+ boundaries are all known.
325
+
326
+ > **You MUST call `Skill(advisory-hub)` and read *"When it earns its keep"* before deciding.**
327
+ > Do not decide from memory, and do not decide from any summary — including one in this file.
328
+ > The test is stated in exactly one place on purpose: two copies of a rule drift on the first edit,
329
+ > and the copy that used to live here had already drifted. It compressed the REQUIRED leg to the
330
+ > phrase *"expensive-to-reverse"* and dropped the enumeration that defines it — which reads as
331
+ > *"can I `git revert` this?"*, and under that reading a plan that publishes € figures to business
332
+ > stakeholders scores "no stakes". That is the one leg that fires on reporting, analytics and
333
+ > dashboard work, i.e. most of what this fleet builds. Load the skill.
334
+
335
+ If the test passes, tell the user plainly what it costs and what it buys, and offer to scaffold the
336
+ context doc from the `advisory-hub` skill's template. **Do not create it silently** — an opt-in
337
+ pattern that switches itself on is no longer opt-in.
338
+
339
+ **In headless mode, never offer and never create.** Headless forbids asking anything, so an "offer"
340
+ is impossible there. Instead record the result as a line under `## Constraints & decisions` —
341
+ *"Advisory Hub: test passed (N phases, <criteria>) — not scaffolded, headless run; create
342
+ `<plan-stem>-advisory-context.md` to enable"* — so the decision reaches a human rather than being
343
+ silently dropped or silently taken.
344
+
345
+ If it does not pass, say nothing **to the user** — a three-phase feature should never hear about
346
+ this. But **always record the determination in the plan, pass or fail**: one line under
347
+ `## Constraints & decisions`, naming which REQUIRED trigger was or was not hit.
348
+
349
+ > `Advisory Hub: not applicable — no REQUIRED trigger (not a migration / security change /
350
+ > production data correctness / numbers published to stakeholders).`
351
+
352
+ Silent to the human, auditable in the artifact. "Say nothing" once meant *leave no trace anywhere*,
353
+ and a wrong negative was then invisible — no line in the plan, no line in the chat, nothing for
354
+ anyone to challenge. A rule whose failures leave no artifact cannot be reviewed.
355
+
201
356
  ## Step 4 — Report
202
357
  Output the plan path (`.caddis/plans/<feature-slug>.md`), the phase list (one line each, with each
203
358
  phase's model tier + lane), confirm the local-coder gate passed (or list the phases that need
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: gate-preflight
3
+ description: Deterministic headless preflight — validates a plan against the actual codebase, self-contained (never depends on a skill activating)
4
+ ---
5
+
6
+ # /caddis:gate-preflight — headless plan-vs-codebase validation (self-contained)
7
+
8
+ Validate the implementation plan at **$ARGUMENTS** against the ACTUAL codebase before any code is
9
+ written.
10
+
11
+ This command exists because `/caddis:preflight` is a model-invoked `context: fork` **SKILL**, and
12
+ skills do not reliably activate under headless `claude -p` — proven live (2026-07-08): a run saw
13
+ the raw `/caddis:code-review <sha-range>` text, didn't recognise it, and replied "I don't see a
14
+ specific task in your message." No review happened. This command spells the task and criteria out
15
+ inline instead, so the check always happens whether or not the skill fires.
16
+
17
+ **What to do:** read the plan, then verify every technical claim with your tools — do the file
18
+ paths it cites exist (or are they correctly marked new)? Do referenced functions/classes/types
19
+ exist with the exact names (grep them, don't trust the plan's spelling)? Do API/route shapes and
20
+ data fields match what the codebase actually returns? Are required dependencies installed or
21
+ explicitly scheduled for installation in an earlier phase? **A claim you cannot verify is a
22
+ finding, not a pass.**
23
+
24
+ If a `preflight` skill is available, use its methodology as a nudge — its 8-category framework is
25
+ more thorough than the paragraph above. But do not wait on it or treat it as required: the check
26
+ above is enough to produce a real verdict on its own.
27
+
28
+ ## HEADLESS RUN RULES (mandatory)
29
+ - **Non-interactive. No human is present. NEVER ask a question.** Where the plan leaves a genuine
30
+ gap, that is itself a finding — note it and keep going.
31
+ - **READ-ONLY.** Do NOT write or edit any code. Do NOT switch branches. Do NOT commit.
32
+ - A plan **PASSES** only with zero blocking discrepancies.
33
+
34
+ End with EXACTLY one line and nothing after it: `PREFLIGHT: PASS` or `PREFLIGHT: FAIL`.
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: gate-review
3
+ description: Deterministic headless code review — adversarial diff review, self-contained (never depends on a skill activating)
4
+ ---
5
+
6
+ # /caddis:gate-review — headless adversarial code review (self-contained)
7
+
8
+ Perform an adversarial code review of **$ARGUMENTS** (a git range, e.g. `abc123..HEAD` — defaults
9
+ to the current working diff when empty).
10
+
11
+ This command exists because `/caddis:code-review` is a model-invoked `context: fork` **SKILL**, and
12
+ skills do not reliably activate under headless `claude -p` — proven live (2026-07-08): a run saw
13
+ the raw `/caddis:code-review <sha-range>` text, didn't recognise it, and replied "I don't see a
14
+ specific task in your message." No review happened. This command spells the task and criteria out
15
+ inline instead, so the review always happens whether or not the skill fires.
16
+
17
+ **What to do:** inspect the diff (`git diff $ARGUMENTS`, and `git show <sha>` per commit as
18
+ needed) and read the changed files in full context, not just the diff hunks. Judge, in priority
19
+ order:
20
+ 1. **Correctness** — logic bugs, wrong results, missed edge cases.
21
+ 2. **Tests** — would a test actually fail without this change; are the stated behaviors covered.
22
+ 3. **Security** — injection, auth gaps, secret exposure, unvalidated input.
23
+ 4. **Conventions** — the repo's `AGENTS.md` rules (canonical; `CLAUDE.md` is an `@AGENTS.md` shim).
24
+ 5. **Simplicity** — unneeded abstraction, scope creep beyond what the diff needed to do.
25
+
26
+ Classify each issue as **blocking** (must fix before merge), **should-fix**, or **nit**.
27
+
28
+ If a `code-review` skill is available, use its methodology as a nudge. But do not wait on it or
29
+ treat it as required: the checklist above is enough to produce a real verdict on its own.
30
+
31
+ ## HEADLESS RUN RULES (mandatory)
32
+ - **Non-interactive. No human is present. NEVER ask a question.**
33
+ - **READ-ONLY.** Do NOT edit code. Do NOT commit. Do NOT switch branches.
34
+ - Report only; do not fix — that is a different session's job.
35
+
36
+ End with EXACTLY one line and nothing after it: `REVIEW: CLEAN` (no blocking issues) or `REVIEW: BLOCKING` (one or more blocking issues).
@@ -6,6 +6,12 @@ description: "USE THIS SKILL whenever a user asks for a comprehensive implementa
6
6
 
7
7
  # Golden Plan
8
8
 
9
+ > **`/caddis:feature-plan` is the canonical planning entry point.** It writes to `.caddis/plans/`,
10
+ > which is what `/caddis:implement`, `/caddis:handoff`, `/caddis:digress` and `/caddis:resume`
11
+ > actually read, and it now carries this skill's evidence gate. Reach for golden-plan when you
12
+ > specifically need its heavier apparatus — the data-binding tables, the query catalog, the
13
+ > self-sweep. For ordinary multi-phase work, feature-plan is the shorter path to the same place.
14
+
9
15
  ## When to Use
10
16
 
11
17
  Activate this skill when the request is for a **comprehensive implementation plan** that involves:
@@ -92,8 +98,8 @@ Run through the checklist below. For each item, determine its tier:
92
98
  - **Tier:** OPTIONAL. Skill paths that do not exist should be omitted from phase prompts - do not list phantom skills.
93
99
 
94
100
  #### E8 - Output Destination
95
- - Where should the plan file be saved? (Default: `.github/plans/<feature-slug>.md`)
96
- - Where should the associated tracker be saved? (Default: `.github/plans/tracker/<feature-slug>-tracker.md`)
101
+ - Where should the plan file be saved? (Default: `.caddis/plans/<feature-slug>.md`)
102
+ - Where should the associated tracker be saved? (Default: `.caddis/plans/tracker/<feature-slug>-tracker.md`)
97
103
  - Is there a `chain_id` to use? (Format: `FEAT-YYYY-MMDD-{slug}`)
98
104
  - **Tier:** OPTIONAL. Default path is used if not specified.
99
105
 
@@ -185,7 +191,7 @@ Creating Model: <exact runtime model identifier or display name>
185
191
  > **Visual reference:** [path to mockup or "N/A"]
186
192
  > **Data source:** [path to canonical data sample or "See E3 - API Contract section"]
187
193
  > **Output destination:** [path where plan is saved]
188
- > **Execution tracker:** `.github/plans/tracker/<feature-slug>-tracker.md`
194
+ > **Execution tracker:** `.caddis/plans/tracker/<feature-slug>-tracker.md`
189
195
  > **Execution:** Manual - one agent session per phase. See protocol below.
190
196
 
191
197
  ---
@@ -335,7 +341,7 @@ Do not mark done unless all items pass. If any fail, fix and re-verify.
335
341
  After all items pass:
336
342
  1. Create the phase implementation commit: `git add -A && git commit -m "phase(N): [Name] complete"`.
337
343
  2. Capture the phase implementation commit hash with `git rev-parse HEAD`.
338
- 3. Update the associated execution tracker declared in the plan header: `.github/plans/tracker/<feature-slug>-tracker.md`.
344
+ 3. Update the associated execution tracker declared in the plan header: `.caddis/plans/tracker/<feature-slug>-tracker.md`.
339
345
  4. Mark Phase N complete in the tracker row with status, gate, completed date, executor/model, changed files, validation evidence, commit hash, push state, and comments.
340
346
  5. Commit the tracker update or amend it into the phase commit according to the repository's commit policy.
341
347
  6. Do not consider the phase complete until the tracker row is updated after validation and commit, and the row includes the commit hash and comments.
@@ -378,7 +384,7 @@ git commit -m "phase(N): [Name] complete"
378
384
  git rev-parse HEAD
379
385
 
380
386
  # 3. Update tracker
381
- # Use .github/plans/tracker/<feature-slug>-tracker.md and mark Phase N complete with:
387
+ # Use .caddis/plans/tracker/<feature-slug>-tracker.md and mark Phase N complete with:
382
388
  # status, gate, completed date, executor/model, changed files,
383
389
  # validation evidence, commit hash, push state, and comments.
384
390
  ```
@@ -506,14 +512,17 @@ When a new phase must be inserted into an **existing plan** (discovered mid-proj
506
512
 
507
513
  ## Output Destination
508
514
 
509
- Every generated plan MUST have an associated execution tracker. Put the tracker path in the plan header as `> **Execution tracker:** .github/plans/tracker/<feature-slug>-tracker.md`.
515
+ Every generated plan MUST have an associated execution tracker. Put the tracker path in the plan header as `> **Execution tracker:** .caddis/plans/tracker/<feature-slug>-tracker.md`.
510
516
 
511
517
  Golden-plan must create both files together. Never emit the plan without creating its associated tracker in the same run.
512
518
 
513
519
  Save the completed plan to:
514
520
 
515
- - `.github/plans/<feature-slug>.md` - default for both modes
516
- - `.github/plans/backlog/<feature-slug>.md` - optional backlog location
521
+ - `.caddis/plans/<feature-slug>.md` - default for both modes
522
+ - **Not ready to execute?** It is not a plan yet — file it as one future-work item at
523
+ `.caddis/parking-lot/<feature-slug>.md` (`type: parking-lot`, `status: open`), or run
524
+ `/caddis:park`. `.caddis/plans/backlog/` is retired: a second backlog location meant no session
525
+ could answer "what is left to do?" without knowing both.
517
526
 
518
527
  If mode is **`junai-pipeline`**, additionally register the artefact in `.github/agent-docs/ARTIFACTS.md` with `status: current`.
519
528
 
@@ -521,7 +530,7 @@ When revising an existing plan file, preserve `Original Author`, `Creation Date`
521
530
 
522
531
  ### Plan Status Tracker
523
532
 
524
- Alongside the plan file, **always** create `.github/plans/tracker/<feature-slug>-tracker.md` using
533
+ Alongside the plan file, **always** create `.caddis/plans/tracker/<feature-slug>-tracker.md` using
525
534
  this template (one row per phase, populated from the Pre-Flight Scan). The plan header must reference this exact tracker path:
526
535
 
527
536
  ```
@@ -533,14 +542,14 @@ Creating Model: <exact runtime model identifier or display name>
533
542
 
534
543
  # Plan Status - [Project Name]
535
544
 
536
- > Plan: `.github/plans/<feature-slug>.md`
537
- > Tracker: `.github/plans/tracker/<feature-slug>-tracker.md`
545
+ > Plan: `.caddis/plans/<feature-slug>.md`
546
+ > Tracker: `.caddis/plans/tracker/<feature-slug>-tracker.md`
538
547
  > Started: YYYY-MM-DDTHH:MM:SSZ
539
548
  > Last updated: YYYY-MM-DDTHH:MM:SSZ
540
549
 
541
550
  | Phase | Name | Agent | Model | Status | Gate | Completed | Changed files | Validation evidence | Commit | Push | Comments |
542
551
  |---|---|---|---|---|---|---|---|---|---|---|---|
543
- | 0 | Context & Decisions | - | - | Complete | passed | YYYY-MM-DDTHH:MM:SSZ | `.github/plans/<feature-slug>.md` | Evidence gate complete | - | not_required | Plan authored |
552
+ | 0 | Context & Decisions | - | - | Complete | passed | YYYY-MM-DDTHH:MM:SSZ | `.caddis/plans/<feature-slug>.md` | Evidence gate complete | - | not_required | Plan authored |
544
553
  | 1 | [Name] | @[Agent] | [model] | Pending | not_run | - | | | | unknown | |
545
554
  | 2 | [Name] | @[Agent] | [model] | Pending | not_run | - | | | | unknown | |
546
555
  | N | [Name] | @[Agent] | [model] | Pending | not_run | - | | | | unknown | |
@@ -558,7 +567,7 @@ Creating Model: <exact runtime model identifier or display name>
558
567
  **Comments rule:** The `Comments` column is required for completed, blocked, or skipped phases. Use it for concise handoff notes, blockers, decisions, caveats, known limitations, or follow-up context discovered during the phase.
559
568
 
560
569
  **Plan Completion Protocol:** When every tracker row has `status: Complete`, the plan is done. The executing agent (or the Janitor backstop) MUST:
561
- 1. Filesystem-move the plan file from `.github/plans/<feature-slug>.md` to `.github/plans/done/<feature-slug>.md` using `Move-Item`/`mv`/`run_command` — NOT `git mv` (the `done/` folder is gitignored in project repos).
570
+ 1. Filesystem-move the plan file from `.caddis/plans/<feature-slug>.md` to `.caddis/plans/done/<feature-slug>.md` using `Move-Item`/`mv`/`run_command` — NOT `git mv` (the `done/` folder is gitignored in project repos).
562
571
  2. Update the plan frontmatter: set `status: done` and add `Archived: <YYYY-MM-DD>`.
563
572
  3. Log the move in the tracker `Comments` field of the last completed phase row.
564
573
  4. Never delete plan files — only move to `done/`.
@@ -26,9 +26,23 @@ is to run it.
26
26
  git status --short
27
27
  git branch --show-current
28
28
  git log --oneline -5
29
+ python scripts/caddis_inventory.py # what EXISTS — do not compose this from memory
29
30
  ```
30
31
  Then read the active plan in `.caddis/plans/` (falling back to legacy `.github/plans/` if present) and its tracker.
31
32
 
33
+ **Read the inventory before writing anything.** It enumerates plans, PRDs, prompts, handoffs, KB
34
+ notes, the parking-lot backlog, open comms, every script and its purpose, and any generated artefact
35
+ committed before its generator last changed. Paste the parts a next session needs; do not retype
36
+ them from memory.
37
+
38
+ **Why this step is mechanical.** A handover used to be composed from what the outgoing session
39
+ remembered, so it was only ever as complete as that memory. Bringing one Hub to a usable state took
40
+ nine corrective round trips and the user caught six of them — including *"the handover listed no
41
+ reports, documents, KB notes or scripts"*. None of those are judgement calls; every one is a
42
+ directory listing. An agent recalls **what it did**; a generator enumerates **what exists**, and
43
+ those are different sets. Your judgement is still needed for what matters and what to do next —
44
+ that half cannot be derived and is the only half you should be writing.
45
+
32
46
  **Crash / interrupted-work check.** Cross-check the tracker against `git status` + `git log`: if a phase is
33
47
  marked in-progress but has **uncommitted changes** (work left mid-flight), or a phase is marked done with
34
48
  **no commit** to back it, the last session was interrupted. Say so explicitly in `## Next step` ("resume
@@ -39,6 +53,38 @@ clean phase boundary and lose or double-do the work.
39
53
  tracker shows plan A in progress, but the work moved to plan B), suggest the user run `/digress` to park
40
54
  plan A on the workstream stack — so its exact resume point survives and `/resume` can pop it back later.
41
55
 
56
+ ## Step 2b — Advisory-Hub handoff audit (conditional — skip silently if not applicable)
57
+
58
+ **Trigger:** the active plan found in Step 2 has a sibling `<slug>-advisory-context.md`. **No such file
59
+ → skip this step entirely and silently** — no extra work on an ordinary handoff.
60
+
61
+ > **First, say which command the user actually wants.** A context doc means a Hub is running, and
62
+ > handing over a Hub is `/caddis:spawn-hub`, not this command. The two look interchangeable from
63
+ > outside and are not: `/handoff` writes a resume doc for the same workstream, while `spawn-hub`
64
+ > ends the Hub's tenure, runs the mechanical audit, conserves the carried-open ledger, and files
65
+ > `hub-NN.spawn.md` in `.caddis/advisory-hub-reports/`. Tell the user plainly, then continue only if
66
+ > they still want a plain handoff.
67
+
68
+ **Why it is a distinct step:** a context doc is written *before* the work happens, so it is **always
69
+ stale by the time it is needed**. The outgoing Hub's instinct is always "yes, this doc is designed for
70
+ exactly this" — **that instinct has been measured and found wrong**: a real audit found seven gaps in a
71
+ context file the outgoing Hub believed was current, including the single highest-value technique the Hub
72
+ had developed by then.
73
+
74
+ **Do not ask "are there gaps?" Assume there are, and find them mechanically** (full detail: the
75
+ `advisory-hub` skill's §G):
76
+ 1. **List every technique, decision, and correction you actually used this session** — from your own
77
+ actions in this transcript, not by re-reading the context doc.
78
+ 2. **For each, check whether the context doc's instruction itself already covers it** — not whether the
79
+ word appears. Would a fresh Hub, reading only that file, be told to do the same thing?
80
+ 3. **The caveat that will burn you:** a literal-string grep over prose produces **false MISSINGs**. A
81
+ `0 matches` result means "this exact string isn't here," not "this isn't covered." **Read the section
82
+ before believing a 0-match grep.**
83
+ 4. **Land every real gap as a durable rule** in the right section of the advisory-context, carrying the
84
+ specific failure that earned it — a note left for later is not a fix.
85
+
86
+ Record the outcome in relay.md's `## Learnings captured` line (below).
87
+
42
88
  ## Step 3 — write the resume doc (overwrite) with exactly these sections
43
89
  > **Where to write:** solo / single active branch → `.caddis/relay.md` (default).
44
90
  > **Team / parallel branches** → write `.caddis/relay/<current-branch>.md` instead, so two
@@ -74,6 +120,7 @@ plan A on the workstream stack — so its exact resume point survives and `/resu
74
120
 
75
121
  ## Learnings captured
76
122
  knowledge-transfer: <✓ ran → files written | ✗ skipped → reason>
123
+ advisory-context audit: <N candidates → M gaps → landed in <path>> | n/a (no advisory-context for this plan)
77
124
 
78
125
  ## Resume prompt
79
126
  \`\`\`
@@ -81,6 +128,35 @@ Read relay.md, then the plan it points to. Continue from <phase/step>. Next acti
81
128
  \`\`\`
82
129
  ```
83
130
 
131
+ ## Step 4 — tidy finished artifacts
132
+ Flip any plan/prompt's frontmatter `status:` to `done` (or `superseded`) if this session actually
133
+ finished it — that is your judgment call; the script below never makes it and never auto-flips
134
+ status. Then run:
135
+ ```
136
+ python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_tidy.py" --apply
137
+ ```
138
+ (falls back to `scripts/caddis_tidy.py` from a source checkout). **If the script is missing,
139
+ skip this step** — it degrades open, same as the other machine gates; an older install must not
140
+ be blocked by a script it does not have. Include its report in your output. A **collision**
141
+ (`done/<name>` already exists) is reported by the script, not fatal — surface it, do not fail the
142
+ handoff over it.
143
+
144
+ ## Step 5 — check the handover you just wrote
145
+
146
+ ```
147
+ python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_gate.py" handover-check --doc .caddis/relay.md
148
+ ```
149
+ (falls back to `scripts/caddis_gate.py` in a source checkout; degrades open when the script is
150
+ missing.) **Run it in the repo the handover is about** — a handover describing another repo will
151
+ report that repo's paths as missing, which is the tool being right about the wrong question.
152
+
153
+ It fails when the handover names a file that does not exist. The incoming session has **no other
154
+ source** for those paths, so it cannot tell a typo from a real file: one live handover sent an
155
+ incoming Hub looking for a prompt that was never written. Fix what it lists, then re-run.
156
+
157
+ It also notes any generated artefact committed before its generator last changed. That is advisory,
158
+ not blocking — but do not quote a report the note names without rebuilding it first.
159
+
84
160
  ## Rules
85
161
  - **One next action, by priority ladder.** `## Next step` names exactly ONE action — not a menu. Pick it in
86
162
  order: (1) interrupted mid-phase work → finish + commit it; else (2) the active plan's next not-started
@@ -88,6 +164,8 @@ Read relay.md, then the plan it points to. Continue from <phase/step>. Next acti
88
164
  - Only verified facts and real paths. Mark anything unconfirmed as `Unknown`.
89
165
  - Update the plan's tracker rows too (status + last commit) — relay and tracker must agree.
90
166
  - Don't commit unless asked. Report where `relay.md` was written and the one next action.
167
+ - **Never hand off a Hub session on the strength of "the context doc is designed for this."** That is the
168
+ one instinct that has been measured and found wrong. Run Step 2b's audit instead.
91
169
  - **Prune the Done section — two rules, both apply:**
92
170
  1. **Merge-based:** Phases already merged to `main` (confirmed by a tag or commit) must be compressed
93
171
  to a single line: `- **RW-N**: merged to main as vYYYY.MM.DD.N (<commit>) ✅`. Only the current