@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.
- package/README.md +11 -0
- package/bundles/antigravity-plugin/agents/anchor.md +60 -0
- package/bundles/antigravity-plugin/agents/claude-md-curator.md +144 -0
- package/bundles/antigravity-plugin/agents/codebase-audit.md +53 -0
- package/bundles/antigravity-plugin/agents/data-engineer.md +51 -0
- package/bundles/antigravity-plugin/agents/debug.md +48 -0
- package/bundles/antigravity-plugin/agents/knowledge-transfer.md +139 -0
- package/bundles/antigravity-plugin/agents/security-analyst.md +49 -0
- package/bundles/antigravity-plugin/agents/sql-expert.md +46 -0
- package/bundles/antigravity-plugin/agents/tester.md +45 -0
- package/bundles/antigravity-plugin/agents/ui-design-reviewer.md +110 -0
- package/bundles/antigravity-plugin/plugin.json +1 -1
- package/bundles/antigravity-plugin/skills/_registry.md +6 -0
- package/bundles/antigravity-plugin/skills/advisory-hub/SKILL.md +183 -0
- package/bundles/antigravity-plugin/skills/advisory-hub/reference/context-template.md +214 -0
- package/bundles/antigravity-plugin/skills/advisory-hub/reference/hub-handbook.md +233 -0
- package/bundles/antigravity-plugin/skills/advisory-hub/reference/report-contract.md +94 -0
- package/bundles/antigravity-plugin/skills/advisory-hub/reference/succession.md +96 -0
- package/bundles/antigravity-plugin/skills/brainstorming/SKILL.md +1 -1
- package/bundles/antigravity-plugin/skills/code-review/SKILL.md +7 -0
- package/bundles/antigravity-plugin/skills/context-curator/SKILL.md +1 -1
- package/bundles/antigravity-plugin/skills/cross-review/SKILL.md +71 -14
- package/bundles/antigravity-plugin/skills/dashboard-perf-sweep/SKILL.md +18 -18
- package/bundles/antigravity-plugin/skills/feature-plan/SKILL.md +164 -9
- package/bundles/antigravity-plugin/skills/gate-preflight/SKILL.md +34 -0
- package/bundles/antigravity-plugin/skills/gate-review/SKILL.md +36 -0
- package/bundles/antigravity-plugin/skills/golden-plan/SKILL.md +22 -13
- package/bundles/antigravity-plugin/skills/handoff/SKILL.md +78 -0
- package/bundles/antigravity-plugin/skills/implement/SKILL.md +182 -3
- package/bundles/antigravity-plugin/skills/mermaid-diagrams/SKILL.md +57 -1
- package/bundles/antigravity-plugin/skills/park/SKILL.md +126 -0
- package/bundles/antigravity-plugin/skills/prd/SKILL.md +4 -2
- package/bundles/antigravity-plugin/skills/preflight/SKILL.md +5 -0
- package/bundles/antigravity-plugin/skills/spawn-hub/SKILL.md +287 -0
- package/bundles/antigravity-plugin/skills/validate-phase/SKILL.md +112 -0
- package/bundles/antigravity-plugin/skills/writing-plans/SKILL.md +7 -4
- package/bundles/antigravity-plugin/warm_start_agy.py +35 -6
- package/bundles/antigravity-plugin-extras/plugin.json +1 -1
- package/bundles/antigravity-plugin-extras/skills/agent-orchestration/SKILL.md +9 -9
- package/bundles/antigravity-plugin-extras/skills/cross-review/SKILL.md +56 -6
- package/bundles/antigravity-plugin-extras/skills/requesting-code-review/SKILL.md +1 -1
- package/bundles/antigravity-plugin-extras/skills/schema-migration/SKILL.md +2 -2
- package/bundles/antigravity-plugin-extras/skills/state-tracking/SKILL.md +4 -4
- package/bundles/manifest.json +3 -3
- package/dist/cli.js +143 -59
- package/package.json +1 -1
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spawn-hub
|
|
3
|
+
description: Hand the Advisory Hub role to a fresh session — run the mechanical audit, then generate the succession prompt with a context self-check the new Hub must pass
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /caddis:spawn-hub — hand the Hub role to a fresh session
|
|
7
|
+
|
|
8
|
+
> **The Hub is a ROLE, not a conversation.** It outlives any one session and hands to the next through
|
|
9
|
+
> **files** — never chat history. This command is the handoff. Until it existed, every Hub was spawned
|
|
10
|
+
> by a hand-written prompt, which meant the pattern only worked for someone who already knew what to
|
|
11
|
+
> put in one.
|
|
12
|
+
|
|
13
|
+
**This command does not start the new session.** It leaves the outgoing Hub's context in a state a
|
|
14
|
+
fresh one can pick up, then prints the prompt to paste. The human runs it.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## When to spawn — do not guess, and do not wait for the crash
|
|
19
|
+
|
|
20
|
+
**The default seam is a MILESTONE BOUNDARY.** A milestone ends with a deploy, a smoke test and a
|
|
21
|
+
handoff; that is already the plan's own `/handoff` → `/clear` point. Carrying a Hub across a deploy is
|
|
22
|
+
where staleness bites — the outgoing Hub's picture of prod is exactly what just changed.
|
|
23
|
+
|
|
24
|
+
**Spawn at the next milestone boundary if ANY of these is true:**
|
|
25
|
+
|
|
26
|
+
- the current Hub has validated **≥5 phases**
|
|
27
|
+
- it has executed **≥2 deploys**
|
|
28
|
+
- it has done substantial work *outside* phase validation (fleet changes, tooling, plugin releases) —
|
|
29
|
+
that consumes context far faster than validation does
|
|
30
|
+
- **its own context is filling** — this one overrides the milestone seam entirely
|
|
31
|
+
|
|
32
|
+
> **Observed, not theorised:** on the reference project, Hubs 1–4 each ended because context ran out,
|
|
33
|
+
> never because a milestone did. A Hub covers roughly **4–6 phases / 1–2 milestones** before that
|
|
34
|
+
> happens. So treat the milestone as the *planned* seam and context as the *real* constraint, and run
|
|
35
|
+
> this command at whichever arrives first.
|
|
36
|
+
|
|
37
|
+
**Do not wait until context is nearly gone.** Step 1 is a real audit that needs room to run, and the
|
|
38
|
+
outgoing Hub is the only session that can do it. A handoff written from a nearly-full context is the
|
|
39
|
+
one most likely to omit exactly what the next Hub needs.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Step 0 — resolve the context file, and refuse cleanly when you cannot
|
|
44
|
+
|
|
45
|
+
Use `$ARGUMENTS` if given. Otherwise look for `<plan-stem>-advisory-context.md` beside every plan in
|
|
46
|
+
`.caddis/plans/`.
|
|
47
|
+
|
|
48
|
+
- **None found → STOP and say so.** This project is not running an Advisory Hub, so there is no role to
|
|
49
|
+
hand over. Do not scaffold one here: that decision belongs to `/caddis:feature-plan` Step 3b, at
|
|
50
|
+
planning time, when the phase count and risk are actually known.
|
|
51
|
+
- **More than one → ask which**, listing them with each plan's status. Never guess: handing over the
|
|
52
|
+
wrong plan's Hub is worse than not handing over.
|
|
53
|
+
- **Already handed over?** Check the succession table. If the last row has no end reason, this is a
|
|
54
|
+
fresh handover. **If the last row is already closed and a new one opened, STOP** — a previous run
|
|
55
|
+
completed and re-running would double-close it and re-open a duplicate. Re-running this command is
|
|
56
|
+
safe only when the tree still shows the outgoing Hub as current.
|
|
57
|
+
|
|
58
|
+
## Step 1 — the mechanical audit (MANDATORY, and it is not a formality)
|
|
59
|
+
|
|
60
|
+
**Do not ask yourself "are there gaps?" — assume there are, and find them mechanically.** The outgoing
|
|
61
|
+
Hub's instinct is always *"yes, this is ready"*, because it is judging against its own memory of the
|
|
62
|
+
session rather than against the document. **That instinct is wrong by default.** On the reference
|
|
63
|
+
project the first answer to "can we hand off" was yes; a mechanical audit then found **seven gaps** —
|
|
64
|
+
including that mutation testing, by then the single highest-value technique in use, was written down
|
|
65
|
+
nowhere a fresh Hub would find it.
|
|
66
|
+
|
|
67
|
+
1. **List every technique, decision and correction actually used this session** — from your own
|
|
68
|
+
actions, not from the context doc. Re-ran a cross-review with a second provider after a timeout?
|
|
69
|
+
Mutation-tested a seam? Fixed something directly rather than only flagging it? Corrected a gate
|
|
70
|
+
rather than the code? Each is a candidate line item.
|
|
71
|
+
2. **For each, check whether the advisory context already tells a fresh Hub to do the same thing.**
|
|
72
|
+
Not "does the word appear" — whether *the instruction* is there.
|
|
73
|
+
3. **Land every real gap as a durable rule** in the advisory context — its *Standing gotchas*,
|
|
74
|
+
*Hub techniques*, *Environment facts* or *Succession* section. **Cite sections BY NAME, never by
|
|
75
|
+
number:** numbers drift between a project's hand-grown file and the shipped template, and this
|
|
76
|
+
command previously named §7/§9/§13, which matched one project and no template.
|
|
77
|
+
**A correction that lives only in a verdict file dies with the session that wrote it.**
|
|
78
|
+
4. **Audit in BOTH directions.** As well as what is missing, look for what is now **obsolete** — a
|
|
79
|
+
gotcha since promoted to `AGENTS.md`, or one a committed test now enforces, compresses to a line
|
|
80
|
+
and a pointer. The context doc is append-only by design and every incoming Hub must read it end to
|
|
81
|
+
end; without a diet it becomes the thing it exists to prevent.
|
|
82
|
+
|
|
83
|
+
> **The caveat that will burn you: a literal-string grep over prose throws false MISSINGs.** The same
|
|
84
|
+
> audit that found seven real gaps also produced three false negatives — content that *was* present,
|
|
85
|
+
> phrased differently. `0 matches` means "not this exact string", not "not covered". Search by concept
|
|
86
|
+
> and read the surrounding paragraph.
|
|
87
|
+
|
|
88
|
+
## Step 2 — close the record
|
|
89
|
+
|
|
90
|
+
- Every validated phase has a **verdict file**, and its `verdict:` frontmatter is one of
|
|
91
|
+
`accept` / `accept-with-correction` / `reject`.
|
|
92
|
+
- Every **ACCEPT-WITH-CORRECTION** either has its corrections landed, or they are in the carried-open
|
|
93
|
+
list. An unlanded correction that nobody is tracking is the worst thing to hand over.
|
|
94
|
+
- The plan's **Tracker rows** match reality. Check them; they get silently skipped, and on the
|
|
95
|
+
reference project four completed rows were reverted to "not started" by a stray staged edit and only
|
|
96
|
+
caught two milestones later.
|
|
97
|
+
- `git status` is clean, or every uncommitted change is deliberate and named in the handoff.
|
|
98
|
+
|
|
99
|
+
## Step 3 — update the succession table
|
|
100
|
+
|
|
101
|
+
In the advisory context's succession section: close the outgoing Hub's row (what it covered, why it
|
|
102
|
+
ended) and open the next one.
|
|
103
|
+
|
|
104
|
+
**Then update the carried-open list — APPEND AND CLOSE, never rewrite.**
|
|
105
|
+
|
|
106
|
+
Each Hub used to *rewrite* this list, which means an open item can vanish between generations with
|
|
107
|
+
nothing to show it ever existed. Nobody notices, because the only evidence was the list itself.
|
|
108
|
+
|
|
109
|
+
So: every item gets a stable id and is **never deleted**.
|
|
110
|
+
|
|
111
|
+
```markdown
|
|
112
|
+
- **[C7] Break-glass is DB-engine-dependent** — raised Hub 4. <what, and enough to act on>
|
|
113
|
+
→ **CLOSED by Hub 6**: fixed in `abc1234`, verified on prod.
|
|
114
|
+
- **[C9] `files.py` sibling-prefix traversal** — raised Hub 4. <detail>
|
|
115
|
+
→ still open.
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Closing an item requires **saying who closed it and why** — a line, not a deletion. That makes a
|
|
119
|
+
disappearance impossible: an item either carries a close reason or it is still open, and both are
|
|
120
|
+
visible. It also lets a later Hub see that something was closed *wrongly*, which a deletion hides
|
|
121
|
+
forever.
|
|
122
|
+
|
|
123
|
+
**ARTIFACT CONSERVATION — the same check, for the files you wrote.** The ledger check above catches
|
|
124
|
+
an id that *disappeared*. Nothing caught a file that *exists and is invisible*, which is the inverted
|
|
125
|
+
failure and just as silent:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_gate.py" hub-artifacts --reports .caddis/advisory-hub-reports
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Exit 1 means you wrote a phase prompt the successor will never learn about. It will find no prompt,
|
|
132
|
+
write a fresh one, and lose whatever reasoning yours carried — plausibly and completely. Name every
|
|
133
|
+
prompt you authored in this spawn doc before handing over. (Degrades open: no handover yet, or no
|
|
134
|
+
script, means proceed.)
|
|
135
|
+
|
|
136
|
+
**CONSERVATION CHECK — mechanical, and it fails the spawn.** Every id in the predecessor's ledger
|
|
137
|
+
must appear in the outgoing one as either still-open or closed-with-a-reason. An id that is simply
|
|
138
|
+
absent is a silent loss: **stop and restore it before handing over.** Do not ask "did anything
|
|
139
|
+
vanish?" — diff the ids. That is the same design move as the handoff audit, for the same reason.
|
|
140
|
+
|
|
141
|
+
**One ledger, one home.** A verdict may *raise* an item, but it is not raised until it has an id in
|
|
142
|
+
the context doc's ledger, in the same commit. Two uncoordinated lists drift, and the drift is
|
|
143
|
+
invisible.
|
|
144
|
+
|
|
145
|
+
Carry the whole list forward, closed items included. It is short, and its history is the cheapest
|
|
146
|
+
audit trail this pattern has.
|
|
147
|
+
|
|
148
|
+
## Step 4 — generate the prompt
|
|
149
|
+
|
|
150
|
+
**"From the files, not from memory" is an instruction you cannot follow by intending to. Run the
|
|
151
|
+
generator:**
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_inventory.py" --with-tests
|
|
155
|
+
```
|
|
156
|
+
(falls back to `scripts/caddis_inventory.py` in a source checkout; skip the step if absent — it
|
|
157
|
+
degrades open like every other machine step here.)
|
|
158
|
+
|
|
159
|
+
Paste its output into the prompt as a **Repository inventory** section, verbatim. It enumerates
|
|
160
|
+
plans, PRDs, prompts, handoffs, KB notes, the parking-lot backlog, open comms, every script and its
|
|
161
|
+
purpose, and any generated artefact committed before its generator last changed. `--with-tests`
|
|
162
|
+
runs the suite instead of reporting a remembered number — one handover claimed 20 tests when there
|
|
163
|
+
were 19, and the incoming Hub found the discrepancy before anyone else.
|
|
164
|
+
|
|
165
|
+
**Why a generator and not care.** Nine corrective round trips were needed to bring one Hub to a
|
|
166
|
+
usable state, and the user caught six of the nine: no reports listed, no documents, no KB notes, no
|
|
167
|
+
scripts, planned work absent, and confusion over which of two prompts actually existed. Every one of
|
|
168
|
+
those is a directory listing. They were missed because an outgoing agent recalls *what it did*
|
|
169
|
+
rather than enumerating *what exists* — and the incoming Hub cannot know what it was not told.
|
|
170
|
+
|
|
171
|
+
Then write the judgement half yourself. It must contain:
|
|
172
|
+
|
|
173
|
+
1. **The role and the one rule** — re-derive, do not trust; validate, do not implement.
|
|
174
|
+
2. **The read order**: advisory context (all of it, especially the succession section and the
|
|
175
|
+
carried-open list) → the plan's milestones / execution protocol / tracker → the project's
|
|
176
|
+
measurement rules → the most recent 2–3 verdicts.
|
|
177
|
+
3. **A context self-check the new Hub must answer BEFORE touching a phase**, from the files, including:
|
|
178
|
+
- re-derive **one anchor number live** (not quote it)
|
|
179
|
+
- name the decisions that are **accepted but reversible**, and what would reverse them
|
|
180
|
+
- state **where the next deploy gate is and how it determined that** (read the milestone table —
|
|
181
|
+
never state a deploy boundary from memory)
|
|
182
|
+
- name **one thing a green automated check does NOT prove**, with the example that taught it
|
|
183
|
+
- **verify the tree independently** — `git fetch`, count divergence, and `git status`/diff any dirty
|
|
184
|
+
file before treating it as authority
|
|
185
|
+
4. **At least one question whose naive answer is WRONG.** This is the load-bearing part. A Hub that
|
|
186
|
+
only skimmed must fail *visibly* rather than silently.
|
|
187
|
+
|
|
188
|
+
> **USE A DIFFERENT TRAP THAN THE PREVIOUS HUB'S.** Check the last spawn prompt in
|
|
189
|
+
> `.caddis/advisory-hub-reports/` and pick a fresh one. A trap reused across generations stops
|
|
190
|
+
> testing comprehension and starts testing whether the new Hub read the old prompt — which it can
|
|
191
|
+
> pass while understanding nothing. Rotate it, and prefer a fact the *most recent* milestone
|
|
192
|
+
> established, since that is what the incoming Hub is least likely to have absorbed.
|
|
193
|
+
|
|
194
|
+
Good traps share a shape: a figure that looks obvious, a correct value that differs, and a reason
|
|
195
|
+
rooted in the data rather than in the code. On the reference project, one generation asked why the
|
|
196
|
+
funnel's `offered` is not `SUM(OfferedInd)` (naive 3,814, correct 4,783 — the raw flags do not
|
|
197
|
+
nest); the next asked why an abandonment rate moved from 7.6% to 5.9% (the old figure was not a
|
|
198
|
+
rate at all — 72% of its numerator sat outside its own denominator).
|
|
199
|
+
5. **What is carried open — INLINE THE OPEN ITEMS VERBATIM, do not link to them.** (Closed items stay
|
|
200
|
+
in the context file for the audit trail; they do not belong in the prompt.) A pointer costs a file hop at
|
|
201
|
+
exactly the moment the new Hub has least context, and a carried-open item that is not read is
|
|
202
|
+
indistinguishable from one that was closed.
|
|
203
|
+
6. **The next work**, with its batching (`Session: continue` = batchable, `fresh` = not) and any
|
|
204
|
+
standing constraint the new Hub would not otherwise know — a stalled upstream load, a deploy hold,
|
|
205
|
+
an environment that is mid-change.
|
|
206
|
+
7. **The standing authorisations**: deploys are user-authorised **every time**; a previous yes does not
|
|
207
|
+
carry.
|
|
208
|
+
8. **What comes after this, and why the order matters.** Not only what is done and what is carried
|
|
209
|
+
open — **what this is building towards**, for the next two or three phases. A Hub that does not
|
|
210
|
+
know what comes next can design the current phase in a way that blocks it, and it will never find
|
|
211
|
+
out, because nothing it can read says so. One live handover omitted a planned model comparison
|
|
212
|
+
entirely; the user caught it. A section covering only the past reads complete and is not.
|
|
213
|
+
9. **The deliverable.** Name the thing this workstream must eventually produce, and the step that
|
|
214
|
+
produces it. One handover carried every phase faithfully and never mentioned the report that was
|
|
215
|
+
the whole point of the exercise. The user caught that too.
|
|
216
|
+
10. **A standing instruction to maintain the tracker.** Put this in the prompt, in these words or
|
|
217
|
+
close to them:
|
|
218
|
+
|
|
219
|
+
> **Maintain the tracker.** Your in-session task list does not survive this session.
|
|
220
|
+
> `.caddis/relay.md` does. Mirror your working list into it as you go, and include its current
|
|
221
|
+
> state in every progress report. Anything not written there is lost.
|
|
222
|
+
|
|
223
|
+
The succession table records **who held the role**; `relay.md` records **where the work is**. The
|
|
224
|
+
table is written when a Hub *ends*, so nothing covers the hours while a Hub is *working* — which
|
|
225
|
+
is the whole period this mechanism exists to protect. A real spawned Hub read `relay.md`,
|
|
226
|
+
answered a thirteen-question context check correctly, found four genuine defects in its
|
|
227
|
+
handover, **and created no tracker at all**, because nothing asked it to.
|
|
228
|
+
|
|
229
|
+
Note for the incoming Hub: `relay.md` is gitignored and machine-local. Anything a successor **on
|
|
230
|
+
another machine** will need belongs in the advisory context or the next spawn prompt, not only
|
|
231
|
+
there.
|
|
232
|
+
11. **`.caddis/kb/environment-map.md`, INLINE AND VERBATIM.** Hosts, which login works, where other
|
|
233
|
+
repositories actually live. It is short, it is the first thing an incoming Hub needs, and it is
|
|
234
|
+
the category most often missing — one incoming Hub searched the filesystem for a repository that
|
|
235
|
+
lived in Gitea, and the user had to stop it. A pointer is not enough here: this is exactly the
|
|
236
|
+
file a cold session does not know to open.
|
|
237
|
+
|
|
238
|
+
**Write it to `.caddis/advisory-hub-reports/hub-NN.spawn.md`** (frontmatter `type: hub-spawn`,
|
|
239
|
+
`hub: NN`), then print it. Until this file existed, every succession prompt lived and died in chat —
|
|
240
|
+
which made two of this command's own instructions unimplementable: "rotate the trap by checking the
|
|
241
|
+
last spawn prompt" had nothing to check, and the ledger conservation check below had nothing to diff
|
|
242
|
+
against.
|
|
243
|
+
|
|
244
|
+
Print the prompt in a fenced block, ready to paste. **Say plainly that it starts a NEW session** — a
|
|
245
|
+
Hub spawned inside the outgoing session's context inherits exactly the staleness this whole mechanism
|
|
246
|
+
exists to shed.
|
|
247
|
+
|
|
248
|
+
### Check the prompt before you hand it over
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_gate.py" handover-check \
|
|
252
|
+
--doc .caddis/advisory-hub-reports/hub-NN.spawn.md
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
It fails when the prompt names a file that does not exist. **Validate the DOCUMENT, not just the
|
|
256
|
+
reader.** The context self-check in Step 4 proves the incoming Hub read carefully; it proves nothing
|
|
257
|
+
about whether what it read was true. One incoming Hub passed a thirteen-question check on a handover
|
|
258
|
+
containing four factual errors — it found them *despite* the check, not because of it.
|
|
259
|
+
|
|
260
|
+
### The single-writer rule — state it in the prompt
|
|
261
|
+
|
|
262
|
+
**The outgoing Hub stops writing to the repository the moment the succession prompt is issued.** Say
|
|
263
|
+
so in the prompt itself, so both sides know which one owns the tree.
|
|
264
|
+
|
|
265
|
+
This is not tidiness. Two sessions committed to one repository concurrently and the incoming Hub's
|
|
266
|
+
work landed inside the outgoing Hub's commit. Only committed objects are safe from another session's
|
|
267
|
+
checkout; a shared working tree is process-shared state, not session-private.
|
|
268
|
+
|
|
269
|
+
## Step 5 — report
|
|
270
|
+
|
|
271
|
+
Output: the audit result (candidates → gaps → where each landed), the succession table update, what is
|
|
272
|
+
carried open, and the prompt. Then stop.
|
|
273
|
+
|
|
274
|
+
**Do not begin validating the next phase.** You are the outgoing Hub; that work belongs to the session
|
|
275
|
+
about to be spawned, and doing it here re-creates the context problem you just solved.
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## Anti-patterns
|
|
280
|
+
|
|
281
|
+
- **Spawning without the audit.** The prompt will look fine and quietly omit the session's best
|
|
282
|
+
technique.
|
|
283
|
+
- **Writing the prompt from memory.** Build it from the files; memory is what is being discarded.
|
|
284
|
+
- **Handing over a stale carried-open list.** An item that was closed hours ago and still appears
|
|
285
|
+
teaches the new Hub to distrust the whole list.
|
|
286
|
+
- **Waiting until context is nearly gone.** The audit needs room. Spawn early and cheaply.
|
|
287
|
+
- **Continuing to work after generating the prompt.** Two Hubs holding the role is worse than one.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: validate-phase
|
|
3
|
+
description: Advisory Hub phase validation — consume a phase report, RE-DERIVE its claims independently, and return ACCEPT / ACCEPT-WITH-CORRECTION / REJECT
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /caddis:validate-phase — the Advisory Hub validates a phase (never trusts it)
|
|
7
|
+
|
|
8
|
+
> **THE RULE: re-derive, do not trust.** A phase report is a self-assessment. Reading it and nodding
|
|
9
|
+
> makes you a rubber stamp, and a rubber stamp is worse than no check at all — it manufactures false
|
|
10
|
+
> confidence. Every step below exists to prevent exactly that. Skipping the re-derivation is the one way
|
|
11
|
+
> this command can fail at its actual job while still producing a plausible-looking verdict.
|
|
12
|
+
|
|
13
|
+
Full methodology, templates, and rationale: the **`advisory-hub`** skill. This command is the thin,
|
|
14
|
+
operational driver — run it after an implementing session (usually `/caddis:implement` in Advisory-Hub
|
|
15
|
+
mode) has filed a phase report.
|
|
16
|
+
|
|
17
|
+
## Step 0 — resolve inputs
|
|
18
|
+
|
|
19
|
+
Use **$ARGUMENTS** if given. Otherwise, find the newest `phase-*.report.md` file in
|
|
20
|
+
`.caddis/advisory-hub-reports/` that has no matching `phase-NN.verdict.md` sibling yet — that is the
|
|
21
|
+
one awaiting validation. Read its `PLAN:` and `ADVISORY CTX:` header fields and load both files.
|
|
22
|
+
|
|
23
|
+
**If no `<slug>-advisory-context.md` exists** for the plan named in the report: say so explicitly, offer
|
|
24
|
+
to bootstrap one from the `advisory-hub` skill's §A template, and continue in **degraded mode** — state in
|
|
25
|
+
the verdict exactly which checks (§4 locked-decision adjudication, §5 safety-rule re-check) were
|
|
26
|
+
unavailable without it. Never silently skip a check without recording that you skipped it.
|
|
27
|
+
|
|
28
|
+
**A degraded verdict must be machine-distinguishable, not just annotated in prose.** Write
|
|
29
|
+
`verdict: accept-degraded` (not plain `accept`) in the frontmatter. `/caddis:implement` reads only the
|
|
30
|
+
`verdict:` field to decide whether the next phase may start, so a degraded accept spelled `accept` is
|
|
31
|
+
indistinguishable from a full one — the gate cannot tell a partial check from a real one, which is
|
|
32
|
+
precisely the false confidence this whole pattern exists to prevent. Use `reject-degraded` likewise if
|
|
33
|
+
you are rejecting without the context doc.
|
|
34
|
+
|
|
35
|
+
## Step 1 — read the report once as a document
|
|
36
|
+
|
|
37
|
+
Before validating a single claim, check the report against itself: does CROSS-REVIEW agree with
|
|
38
|
+
DEVIATIONS? Does MODEL/LANE name a vendor's model that doesn't match the claimed lane? On the reference
|
|
39
|
+
run this pattern's design was validated against, two of three real findings in one phase came from
|
|
40
|
+
exactly this kind of internal contradiction — not from re-checking the code.
|
|
41
|
+
|
|
42
|
+
## Step 2 — re-derive (the Hub validation checklist)
|
|
43
|
+
|
|
44
|
+
Run every item in the `advisory-hub` skill's §D checklist yourself:
|
|
45
|
+
1. Re-derive every VALUE CHECK using the method advisory-context §3a names — actually run it, don't read
|
|
46
|
+
the reported result.
|
|
47
|
+
2. Re-run the exit gates, at minimum the fast ones (unit tests, lint, type-check).
|
|
48
|
+
3. `git log` / `git show --stat` the commits — do they match the phase's claimed touches? Anything
|
|
49
|
+
unexpected, especially tooling/config/CI that never appeared in DEVIATIONS?
|
|
50
|
+
4. Re-check every rule in advisory-context §5, or record `N/A — none declared`.
|
|
51
|
+
5. Flag any deviation that touches a §4 locked decision — this is step 3 below, not your call to make here.
|
|
52
|
+
6. Flag any surprise that contradicts the plan's `## Current state` — this is step 4 below.
|
|
53
|
+
7. If this milestone boundary ships to a real deployed environment, smoke-test it there, not in dev.
|
|
54
|
+
|
|
55
|
+
Also apply the `advisory-hub` skill's §E techniques where they fit — mutation-test any seam a new test
|
|
56
|
+
claims to prove, and if a cross-review provider timed out, try the other configured provider before
|
|
57
|
+
recording "inconclusive."
|
|
58
|
+
|
|
59
|
+
## Step 3 — adjudicate deviations
|
|
60
|
+
|
|
61
|
+
For each deviation the report lists: is it a locked decision in advisory-context §4? If so, this is a
|
|
62
|
+
**Hub decision, never the implementer's** — rule allowed / reverted / plan amended, and record the reason.
|
|
63
|
+
|
|
64
|
+
## Step 4 — plan drift
|
|
65
|
+
|
|
66
|
+
If the report's SURPRISES / CONTRADICTIONS section is non-empty: correct the plan file's
|
|
67
|
+
`## Current state` **now, in this step** — do not defer it to a note in the verdict. This is the Hub's
|
|
68
|
+
job and the step most likely to be skipped (`advisory-hub` skill §F).
|
|
69
|
+
|
|
70
|
+
## Step 5 — write the verdict
|
|
71
|
+
|
|
72
|
+
Write `.caddis/advisory-hub-reports/phase-NN.verdict.md` beside the report, using the `advisory-hub`
|
|
73
|
+
skill's §C template in full, including the mandatory **WHAT IS NOW STRUCTURAL** table.
|
|
74
|
+
|
|
75
|
+
> **Give it OKF frontmatter — `type` is REQUIRED and its absence is a defect.**
|
|
76
|
+
> Keep it flat (scalar `key: value` only; nested maps and lists defeat simple parsers):
|
|
77
|
+
> ```yaml
|
|
78
|
+
> ---
|
|
79
|
+
> type: phase-verdict
|
|
80
|
+
> plan: <path to the plan>
|
|
81
|
+
> phase: 12 # or 10-11 for a batched pair
|
|
82
|
+
> milestone: M4
|
|
83
|
+
> verdict: accept | accept-with-correction | reject
|
|
84
|
+
> ---
|
|
85
|
+
> ```
|
|
86
|
+
> `verdict` is the one field a tool can read to answer *"was this phase signed off"* without parsing prose — and a prose scraper gets that wrong quietly.
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
## Step 6 — push every correction into `advisory-context.md`
|
|
90
|
+
|
|
91
|
+
A correction that lives only in this verdict file dies with the session that reads it; a correction told
|
|
92
|
+
to the implementing session dies with that session too, which has already closed. Every correction in
|
|
93
|
+
"WHAT IS NOW STRUCTURAL" must actually be landed in the named section of `advisory-context.md` in this
|
|
94
|
+
step, not just described.
|
|
95
|
+
|
|
96
|
+
## Step 7 — update the reports-directory index
|
|
97
|
+
|
|
98
|
+
Add or update this phase's row in `.caddis/advisory-hub-reports/README.md` (Phase | Report | Verdict |
|
|
99
|
+
Outcome | Date).
|
|
100
|
+
|
|
101
|
+
## Rules
|
|
102
|
+
|
|
103
|
+
- **Fail closed.** A gate you could not re-run is `NOT RE-RUN`, never `PASS`. A claim you could not
|
|
104
|
+
reproduce is `UNVERIFIABLE`, never `AGREES: YES`.
|
|
105
|
+
- **Never accept a claim on the report's own word.** That is the one failure mode this command exists to
|
|
106
|
+
prevent.
|
|
107
|
+
- If a cross-review provider times out, try the other configured provider before recording
|
|
108
|
+
"inconclusive" — a single provider's outage is not grounds for skipping independent review.
|
|
109
|
+
- **The Hub is not exempt from its own contract.** If a fault traces back to advice the Hub itself gave
|
|
110
|
+
earlier, the verdict says so plainly rather than attributing it to the implementer.
|
|
111
|
+
- Read-only toward the implementing session — it has already closed. Corrections land in files
|
|
112
|
+
(`advisory-context.md`, the plan), never fed back to a session that no longer exists.
|
|
@@ -16,7 +16,10 @@ Assume they are a skilled developer, but know almost nothing about our toolset o
|
|
|
16
16
|
|
|
17
17
|
**Context:** This should be run in a dedicated worktree (created by brainstorming skill).
|
|
18
18
|
|
|
19
|
-
**
|
|
19
|
+
> **Prefer `/caddis:feature-plan`.** It is the canonical planning entry point and produces a plan
|
|
20
|
+
> the harness can resume, track and gate. This skill remains for free-form planning prose.
|
|
21
|
+
|
|
22
|
+
**Save plans to:** `.caddis/plans/YYYY-MM-DD-<feature-name>.md`
|
|
20
23
|
|
|
21
24
|
**Document metadata:** Before creating or updating a plan, apply `.github/instructions/document-frontmatter.instructions.md`. The YAML frontmatter block must be the first content in the file. New plans require `Original Author`, `Creation Date`, and `Creating Model`; revised plans must preserve those fields and add or update `Last Author`, `Last Updated`, and `Last Model Used`.
|
|
22
25
|
|
|
@@ -215,7 +218,7 @@ The "Current State" column tells agents what exists and whether to modify or lea
|
|
|
215
218
|
|
|
216
219
|
- `path/to/file.ext` — {why this file is needed}
|
|
217
220
|
- `path/to/file.ext` (from Phase N-1)
|
|
218
|
-
- `.
|
|
221
|
+
- `.caddis/plans/{this-plan}.md` (this file)
|
|
219
222
|
|
|
220
223
|
### Phase Prompt
|
|
221
224
|
|
|
@@ -333,7 +336,7 @@ Walk through every FR, NFR, risk, and design decision from ALL input documents.
|
|
|
333
336
|
**Agent context:** You are the `@{agent-name}` agent. Load `.github/project-config.md` before starting.
|
|
334
337
|
|
|
335
338
|
**Read these files FIRST (in order):**
|
|
336
|
-
1. `.
|
|
339
|
+
1. `.caddis/plans/{plan-file}.md` — **THIS PLAN** — read "Phase N — Step M"
|
|
337
340
|
2. {Architecture/PRD doc} — {specific sections}
|
|
338
341
|
3. {Target file(s)} — current state
|
|
339
342
|
|
|
@@ -370,7 +373,7 @@ Walk through every FR, NFR, risk, and design decision from ALL input documents.
|
|
|
370
373
|
|
|
371
374
|
After saving the plan, offer execution choice:
|
|
372
375
|
|
|
373
|
-
**"Plan complete and saved to `.
|
|
376
|
+
**"Plan complete and saved to `.caddis/plans/<filename>.md`. Two execution options:**
|
|
374
377
|
|
|
375
378
|
**1. This session** — I implement each task sequentially, reviewing between tasks
|
|
376
379
|
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
"""caddis warm-start hook for agy (Antigravity) — PreInvocation event.
|
|
3
3
|
|
|
4
4
|
Ports the relay half of claude-harness/hooks/inject_relay.py. agy has NO SessionStart event, so the
|
|
5
|
-
nearest equivalent is PreInvocation with `invocationNum ==
|
|
5
|
+
nearest equivalent is PreInvocation with `invocationNum == 0` — the first model turn of a session.
|
|
6
|
+
**agy's invocations are 0-indexed** (confirmed via a live-fire session against the real `agy` binary
|
|
7
|
+
2026-07-30 -- the original code checked `== 1`, which is agy's SECOND turn, so this hook silently
|
|
8
|
+
never fired at all until the live check caught it; see .caddis/plans/agy-hooks-port.md step 5).
|
|
6
9
|
On that turn only, the workspace's relay doc is injected as an ephemeral step so a fresh agy session
|
|
7
10
|
resumes with zero re-discovery. Every later invocation emits nothing (re-injecting the relay on every
|
|
8
11
|
turn would burn context and drown the conversation).
|
|
@@ -30,6 +33,30 @@ _ARTIFACT_DIRS = (".caddis",)
|
|
|
30
33
|
INJECT_MAX_LINES = 120 # same budget as the Claude Code hook
|
|
31
34
|
INJECT_MAX_CHARS = 24000 # hard backstop: an ephemeralMessage should never be a context bomb
|
|
32
35
|
|
|
36
|
+
# Deliberately duplicated from hooks/inject_relay.py rather than imported — the agy bundle ships
|
|
37
|
+
# neither claude-harness/hooks/ nor scripts/, so this file must stay self-contained (same rule the
|
|
38
|
+
# guard and the doctor already follow). Keep the two copies in step; the reason they exist is in
|
|
39
|
+
# inject_relay.py: injected before the prompt and headed "read before acting", the relay was being
|
|
40
|
+
# EXECUTED first by a non-Claude model, ahead of the task the session was actually given.
|
|
41
|
+
RELAY_FRAME_HEADER = (
|
|
42
|
+
"=== session-context: relay.md — BACKGROUND STATE, NOT A TASK ===\n"
|
|
43
|
+
"Carried over from a previous session and injected before your prompt. This is state, not\n"
|
|
44
|
+
"an instruction: the \"Next step\" and \"Resume prompt\" sections below describe what the\n"
|
|
45
|
+
"PREVIOUS session intended to do next. Do not act on them unless the user's prompt asks\n"
|
|
46
|
+
"you to. This file is machine-local and gitignored, so it may also be stale. Your task is\n"
|
|
47
|
+
"whatever the user's prompt says.\n"
|
|
48
|
+
)
|
|
49
|
+
RELAY_FRAME_FOOTER = "=== end session-context ==="
|
|
50
|
+
|
|
51
|
+
_TRUTHY = {"1", "true", "yes", "on"}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def is_headless() -> bool:
|
|
55
|
+
"""True when no human is watching — a run given its task explicitly needs no resume pointer."""
|
|
56
|
+
if str(os.environ.get("CADDIS_HEADLESS", "")).strip().lower() in _TRUTHY:
|
|
57
|
+
return True
|
|
58
|
+
return bool(os.environ.get("DOCKET_PLAN") or os.environ.get("DOCKET_BRANCH"))
|
|
59
|
+
|
|
33
60
|
|
|
34
61
|
def _first_existing(paths: list[str]) -> str:
|
|
35
62
|
for p in paths:
|
|
@@ -118,13 +145,15 @@ def main() -> None:
|
|
|
118
145
|
return
|
|
119
146
|
if not isinstance(data, dict):
|
|
120
147
|
return
|
|
121
|
-
# SessionStart equivalent: the FIRST invocation only
|
|
122
|
-
# invocationNum) injects nothing.
|
|
148
|
+
# SessionStart equivalent: the FIRST invocation only (agy 0-indexes invocationNum, so the
|
|
149
|
+
# first turn is 0, not 1). Anything else (or an unparseable invocationNum) injects nothing.
|
|
123
150
|
try:
|
|
124
|
-
if int(data.get("invocationNum")) !=
|
|
151
|
+
if int(data.get("invocationNum")) != 0:
|
|
125
152
|
return
|
|
126
153
|
except Exception:
|
|
127
154
|
return
|
|
155
|
+
if is_headless():
|
|
156
|
+
return
|
|
128
157
|
workspaces = data.get("workspacePaths") or []
|
|
129
158
|
if not (isinstance(workspaces, list) and workspaces):
|
|
130
159
|
return
|
|
@@ -135,8 +164,8 @@ def main() -> None:
|
|
|
135
164
|
text = open(relay, encoding="utf-8").read().strip()
|
|
136
165
|
if not text:
|
|
137
166
|
return
|
|
138
|
-
message = ("
|
|
139
|
-
+
|
|
167
|
+
message = (RELAY_FRAME_HEADER + "\n" + truncate_relay(text)
|
|
168
|
+
+ "\n\n" + RELAY_FRAME_FOOTER)
|
|
140
169
|
payload = json.dumps({"injectSteps": [{"ephemeralMessage": message}]})
|
|
141
170
|
sys.stdout.write(payload)
|
|
142
171
|
except Exception:
|
|
@@ -62,13 +62,13 @@ Every stage produces a **persistent artefact** (markdown file, commit, test run)
|
|
|
62
62
|
| Requirements | Spec / feature file | Supplied by operator (e.g. `nextprompt.md`) |
|
|
63
63
|
| Quick-Win Triage | Commit with passing tests | Git history |
|
|
64
64
|
| Architecture | ADR (Architecture Decision Record) | Inside the plan document |
|
|
65
|
-
| Planning | Plan document (phases, steps, files) | `.
|
|
65
|
+
| Planning | Plan document (phases, steps, files) | `.caddis/plans/<feature>.md` |
|
|
66
66
|
| Fidelity Audit | Gap table (0 gaps = pass) | Inside the plan document |
|
|
67
67
|
| Risk Assessment | Risk register (scored risks) | Inside the plan document |
|
|
68
68
|
| Implementation Prompts | Embedded copy-paste prompts | Inside the plan document |
|
|
69
69
|
| Implementation | Code + tests per phase | Git commits per phase |
|
|
70
70
|
| Code Review | Review report | Chat session or plan annotation |
|
|
71
|
-
| Debug / Polish | Fix-up plan (issues A–N) | `.
|
|
71
|
+
| Debug / Polish | Fix-up plan (issues A–N) | `.caddis/plans/<feature>-fixup.md` |
|
|
72
72
|
|
|
73
73
|
---
|
|
74
74
|
|
|
@@ -181,7 +181,7 @@ Spec Input
|
|
|
181
181
|
- What to change (specific enough to implement without guessing)
|
|
182
182
|
- Expected test additions
|
|
183
183
|
- Verification command
|
|
184
|
-
4. Place plan in `.
|
|
184
|
+
4. Place plan in `.caddis/plans/<feature-name>.md`
|
|
185
185
|
|
|
186
186
|
#### 2b. Fidelity Audit
|
|
187
187
|
After authoring, audit the plan against the spec:
|
|
@@ -265,7 +265,7 @@ Score each identified risk:
|
|
|
265
265
|
1. Start a **new chat session** (clean context)
|
|
266
266
|
2. Provide the phase prompt:
|
|
267
267
|
```
|
|
268
|
-
Read .
|
|
268
|
+
Read .caddis/plans/<feature>.md and implement Phase N.
|
|
269
269
|
Run pytest after every file change. All tests must pass before commit.
|
|
270
270
|
```
|
|
271
271
|
3. Implement Agent reads the plan, executes numbered steps
|
|
@@ -285,7 +285,7 @@ The plan document should contain **copy-paste prompts** for each phase. This rem
|
|
|
285
285
|
```markdown
|
|
286
286
|
### Phase 2 Prompt (copy into new chat)
|
|
287
287
|
|
|
288
|
-
> Read `.
|
|
288
|
+
> Read `.caddis/plans/my-feature.md`, specifically Phase 2 (steps 5–9).
|
|
289
289
|
> Implement each step in order. Run `pytest tests/ -x -q` after each file edit.
|
|
290
290
|
> When all steps pass, commit with message:
|
|
291
291
|
> `feat(cards): phase 2 — insight card refactoring`
|
|
@@ -338,7 +338,7 @@ The plan document should contain **copy-paste prompts** for each phase. This rem
|
|
|
338
338
|
- Root cause
|
|
339
339
|
- Proposed fix (specific enough to implement)
|
|
340
340
|
- Acceptance criteria
|
|
341
|
-
3. **Write fix-up plan** — Place in `.
|
|
341
|
+
3. **Write fix-up plan** — Place in `.caddis/plans/<feature>-fixup.md`
|
|
342
342
|
4. **Execute** — Implement Agent works through issues sequentially
|
|
343
343
|
5. **Verify** — Run full test suite + visual inspection
|
|
344
344
|
6. **Commit** — `fix(<scope>): post-track cross-component polish`
|
|
@@ -562,7 +562,7 @@ Load .github/skills/workflow/agent-orchestration/SKILL.md for the methodology."
|
|
|
562
562
|
```
|
|
563
563
|
Operator opens new chat:
|
|
564
564
|
|
|
565
|
-
"Read .
|
|
565
|
+
"Read .caddis/plans/<feature>.md and implement Phase N.
|
|
566
566
|
Run pytest after each file change. Commit when all tests pass.
|
|
567
567
|
Use message: feat(<scope>): phase N — <summary>"
|
|
568
568
|
```
|
|
@@ -575,7 +575,7 @@ Operator opens new chat:
|
|
|
575
575
|
"All implementation phases for <feature> are complete.
|
|
576
576
|
Audit all changed files for cross-component issues.
|
|
577
577
|
Catalogue each issue (A–N) with root cause, fix, and acceptance criteria.
|
|
578
|
-
Write the fix-up plan to .
|
|
578
|
+
Write the fix-up plan to .caddis/plans/<feature>-fixup.md"
|
|
579
579
|
```
|
|
580
580
|
|
|
581
581
|
### Absorbing Mid-Flight Changes
|
|
@@ -584,7 +584,7 @@ Write the fix-up plan to .github/plans/<feature>-fixup.md"
|
|
|
584
584
|
Operator opens new chat:
|
|
585
585
|
|
|
586
586
|
"I independently added <change> to <file(s)>.
|
|
587
|
-
Read .
|
|
587
|
+
Read .caddis/plans/<feature>.md and update it to absorb this change.
|
|
588
588
|
Trace every affected step, update embedded prompts, re-verify fidelity."
|
|
589
589
|
```
|
|
590
590
|
|