@caddis/cli 0.4.52 → 0.4.54

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 (111) hide show
  1. package/bundles/antigravity-plugin/CADDIS-GLOSSARY.md +1 -0
  2. package/bundles/antigravity-plugin/guard_agy.py +184 -0
  3. package/bundles/antigravity-plugin/plugin.json +1 -1
  4. package/bundles/antigravity-plugin/repo_freshness.py +132 -5
  5. package/bundles/antigravity-plugin/scripts/caddis_budget.py +283 -0
  6. package/bundles/antigravity-plugin/scripts/caddis_checkout_guard.py +227 -0
  7. package/bundles/antigravity-plugin/scripts/caddis_docs_pr.py +284 -0
  8. package/bundles/antigravity-plugin/scripts/caddis_exit.py +2 -0
  9. package/bundles/antigravity-plugin/scripts/caddis_fleet.py +439 -0
  10. package/bundles/antigravity-plugin/scripts/caddis_frontmatter.py +1 -0
  11. package/bundles/antigravity-plugin/scripts/caddis_gate.py +255 -195
  12. package/bundles/antigravity-plugin/scripts/caddis_glossary.py +3 -3
  13. package/bundles/antigravity-plugin/scripts/caddis_governor.py +48 -4
  14. package/bundles/antigravity-plugin/scripts/caddis_inventory.py +38 -0
  15. package/bundles/antigravity-plugin/scripts/caddis_lanes.py +411 -127
  16. package/bundles/antigravity-plugin/scripts/caddis_lineage_publish.py +458 -0
  17. package/bundles/antigravity-plugin/scripts/caddis_merge_chain.py +237 -0
  18. package/bundles/antigravity-plugin/scripts/caddis_notify.py +125 -0
  19. package/bundles/antigravity-plugin/scripts/caddis_prod_check.py +380 -0
  20. package/bundles/antigravity-plugin/scripts/caddis_redact.py +99 -0
  21. package/bundles/antigravity-plugin/scripts/caddis_relay_git.py +2 -2
  22. package/bundles/antigravity-plugin/scripts/caddis_review.py +1309 -0
  23. package/bundles/antigravity-plugin/scripts/caddis_roadmap.py +2109 -0
  24. package/bundles/antigravity-plugin/scripts/caddis_roadmap_page.py +676 -0
  25. package/bundles/antigravity-plugin/scripts/caddis_roadmap_run.py +2605 -0
  26. package/bundles/antigravity-plugin/scripts/caddis_routing.py +7 -6
  27. package/bundles/antigravity-plugin/scripts/caddis_rows.py +476 -0
  28. package/bundles/antigravity-plugin/scripts/caddis_spawn.py +8 -9
  29. package/bundles/antigravity-plugin/scripts/caddis_spend.py +415 -0
  30. package/bundles/antigravity-plugin/scripts/caddis_tidy.py +357 -20
  31. package/bundles/antigravity-plugin/scripts/caddis_todo.py +55 -0
  32. package/bundles/antigravity-plugin/scripts/caddis_workstreams.py +178 -19
  33. package/bundles/antigravity-plugin/scripts/caddis_worktree_close.py +349 -0
  34. package/bundles/antigravity-plugin/scripts/check_doc_coverage.py +0 -56
  35. package/bundles/antigravity-plugin/scripts/claudster_doctor.py +1 -1
  36. package/bundles/antigravity-plugin/scripts/enforcement_inventory.py +0 -1
  37. package/bundles/antigravity-plugin/scripts/oss_review.py +2 -2
  38. package/bundles/antigravity-plugin/scripts/roadmap-recheck.ps1 +89 -0
  39. package/bundles/antigravity-plugin/scripts/roadmap-run.ps1 +88 -0
  40. package/bundles/antigravity-plugin/scripts/setup_project_ai.py +43 -1
  41. package/bundles/antigravity-plugin/session_end_agy.py +3 -3
  42. package/bundles/antigravity-plugin/skills/_registry.md +4 -6
  43. package/bundles/antigravity-plugin/skills/best-practices/agents/best-practices-referencer.md +1 -1
  44. package/bundles/antigravity-plugin/skills/best-practices/agents/codebase-context-builder.md +1 -1
  45. package/bundles/antigravity-plugin/skills/best-practices/agents/task-intent-analyzer.md +1 -1
  46. package/bundles/antigravity-plugin/skills/catchup/SKILL.md +11 -0
  47. package/bundles/antigravity-plugin/skills/cloud-phases/SKILL.md +1 -1
  48. package/bundles/antigravity-plugin/skills/cross-review/SKILL.md +5 -2
  49. package/bundles/antigravity-plugin/skills/feature-plan/SKILL.md +35 -83
  50. package/bundles/antigravity-plugin/skills/fleet-close/SKILL.md +167 -0
  51. package/bundles/antigravity-plugin/skills/fleet-open/SKILL.md +110 -0
  52. package/bundles/antigravity-plugin/skills/gh-cli/SKILL.md +2 -1
  53. package/bundles/antigravity-plugin/skills/handoff/SKILL.md +177 -48
  54. package/bundles/antigravity-plugin/skills/implement/SKILL.md +87 -147
  55. package/bundles/antigravity-plugin/skills/migrate-dir/SKILL.md +4 -3
  56. package/bundles/antigravity-plugin/skills/mmr/SKILL.md +5 -2
  57. package/bundles/antigravity-plugin/skills/office-documents-official/SKILL.md +24 -0
  58. package/bundles/antigravity-plugin/skills/park/SKILL.md +0 -1
  59. package/bundles/antigravity-plugin/skills/pr-merge/SKILL.md +28 -20
  60. package/bundles/antigravity-plugin/skills/prd/SKILL.md +2 -10
  61. package/bundles/antigravity-plugin/skills/refactoring/SKILL.md +2 -1
  62. package/bundles/antigravity-plugin/skills/review-pr/SKILL.md +1 -1
  63. package/bundles/antigravity-plugin/skills/roadmap/SKILL.md +260 -0
  64. package/bundles/antigravity-plugin/skills/roadmap/assets/plan-resume-prompt.md +77 -0
  65. package/bundles/antigravity-plugin/skills/roadmap/assets/render-check.template.mjs +68 -0
  66. package/bundles/antigravity-plugin/skills/roadmap/assets/review-protocol.md +78 -0
  67. package/bundles/antigravity-plugin/skills/roadmap/assets/roadmap.template.md +32 -0
  68. package/bundles/antigravity-plugin/skills/roadmap/assets/value-check.template.py +161 -0
  69. package/bundles/antigravity-plugin/skills/ship/SKILL.md +16 -16
  70. package/bundles/antigravity-plugin/skills/ship-merge/SKILL.md +15 -5
  71. package/bundles/antigravity-plugin/skills/ship-pr/SKILL.md +36 -16
  72. package/bundles/antigravity-plugin/skills/spawn-session/SKILL.md +4 -8
  73. package/bundles/antigravity-plugin/warm_start_agy.py +1 -3
  74. package/bundles/antigravity-plugin-extras/plugin.json +1 -1
  75. package/bundles/antigravity-plugin-extras/skills/_registry.md +1 -2
  76. package/bundles/antigravity-plugin-extras/skills/agent-orchestration/SKILL.md +5 -5
  77. package/bundles/antigravity-plugin-extras/skills/cross-review/SKILL.md +5 -2
  78. package/bundles/antigravity-plugin-extras/skills/runner-move/SKILL.md +214 -0
  79. package/bundles/codex/.codex/skills/coding/refactoring/SKILL.md +2 -1
  80. package/bundles/codex/.codex/skills/devops/gh-cli/SKILL.md +2 -1
  81. package/bundles/codex/.codex/skills/docs/office-documents-official/SKILL.md +24 -0
  82. package/bundles/codex/.codex/skills/workflow/best-practices/agents/best-practices-referencer.md +1 -1
  83. package/bundles/codex/.codex/skills/workflow/best-practices/agents/codebase-context-builder.md +1 -1
  84. package/bundles/codex/.codex/skills/workflow/best-practices/agents/task-intent-analyzer.md +1 -1
  85. package/bundles/codex/.codex/skills/workflow/roadmap/SKILL.md +260 -0
  86. package/bundles/codex/.codex/skills/workflow/roadmap/assets/plan-resume-prompt.md +77 -0
  87. package/bundles/codex/.codex/skills/workflow/roadmap/assets/render-check.template.mjs +68 -0
  88. package/bundles/codex/.codex/skills/workflow/roadmap/assets/review-protocol.md +78 -0
  89. package/bundles/codex/.codex/skills/workflow/roadmap/assets/roadmap.template.md +32 -0
  90. package/bundles/codex/.codex/skills/workflow/roadmap/assets/value-check.template.py +161 -0
  91. package/bundles/codex/AGENTS.md +5 -4
  92. package/bundles/manifest.json +3 -3
  93. package/package.json +1 -1
  94. package/bundles/antigravity-plugin/skills/advisory-hub/SKILL.md +0 -233
  95. package/bundles/antigravity-plugin/skills/advisory-hub/reference/context-template.md +0 -214
  96. package/bundles/antigravity-plugin/skills/advisory-hub/reference/hub-handbook.md +0 -233
  97. package/bundles/antigravity-plugin/skills/advisory-hub/reference/report-contract.md +0 -94
  98. package/bundles/antigravity-plugin/skills/advisory-hub/reference/succession.md +0 -118
  99. package/bundles/antigravity-plugin/skills/resume/SKILL.md +0 -6
  100. package/bundles/antigravity-plugin/skills/review/SKILL.md +0 -6
  101. package/bundles/antigravity-plugin/skills/spawn-hub/SKILL.md +0 -341
  102. package/bundles/antigravity-plugin/skills/statusline/SKILL.md +0 -6
  103. package/bundles/antigravity-plugin/skills/validate-phase/SKILL.md +0 -143
  104. package/bundles/antigravity-plugin-extras/skills/data-lineage/SKILL.md +0 -158
  105. package/bundles/antigravity-plugin-extras/skills/data-lineage/scripts/convert_doc_to_confluence.py +0 -1430
  106. package/bundles/antigravity-plugin-extras/skills/golden-plan/SKILL.md +0 -586
  107. package/bundles/codex/.codex/skills/workflow/advisory-hub/SKILL.md +0 -233
  108. package/bundles/codex/.codex/skills/workflow/advisory-hub/reference/context-template.md +0 -214
  109. package/bundles/codex/.codex/skills/workflow/advisory-hub/reference/hub-handbook.md +0 -233
  110. package/bundles/codex/.codex/skills/workflow/advisory-hub/reference/report-contract.md +0 -94
  111. package/bundles/codex/.codex/skills/workflow/advisory-hub/reference/succession.md +0 -118
@@ -8,6 +8,72 @@ description: End-of-session handoff — capture exact state so the next session
8
8
  You are ending a work session. Produce/refresh this workstream's resume doc (`.caddis/relay/<name>.md`) so the next session
9
9
  (you, a future you, or another agent on any tool) can resume immediately. This is the anti-context-rot checkpoint.
10
10
 
11
+ Several sessions to close together? Run `/caddis:fleet-close` in one of them instead; it asks each session to run this
12
+ command and collects one restart sheet.
13
+
14
+ ## Step 0 — is this a shared checkout?
15
+ Another session may have uncommitted edits in this checkout. A handoff that commits here can carry
16
+ them into its commit, so check first, before Step 1.
17
+
18
+ 1. Write this session's own files to a temp file: copy the list under `## Files changed this session`
19
+ in `.caddis/session-state/<session-id>.md` (the `` - `path` `` lines can be copied as they are).
20
+ No state file or no list means an empty file.
21
+ 2. Run:
22
+ ```
23
+ python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_checkout_guard.py" shared --root . --own-files <temp-file>
24
+ ```
25
+ It prints `SHARED: yes <reason>` or `SHARED: no` and exits 0. It says yes when the root `AGENTS.md`
26
+ has a line `Shared checkout: yes`, or when `git status` lists a path this session did not change.
27
+ 3. **On `SHARED: no`,** do the steps below as written.
28
+ 4. **On `SHARED: yes`,** write NO tracked file in this checkout. Run:
29
+ ```
30
+ python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_docs_pr.py" start --repo .
31
+ ```
32
+ It makes a new worktree from `origin/<default>` on a `docs/handoff-<utc>` branch and prints
33
+ `WORKTREE: <path>`. That worktree is this session's only; no other session's edits can enter it.
34
+ Then, in the steps below:
35
+ - Step 1: tell the `knowledge-transfer` subagent to edit files ONLY under the `WORKTREE:` path.
36
+ - Step 3, point 4: run `caddis_rows.py set --file <worktree>/.caddis/open-work.md ...`, and make the
37
+ plan's Tracker edit in `<worktree>/.caddis/plans/<feature>.md`, not in this checkout.
38
+ - Step 4: skip `caddis_tidy.py --apply` (report `skipped: shared checkout`).
39
+ - Step 6: skip `caddis_todo.py reconcile` (report `skipped: shared checkout`; it writes tracked
40
+ `.caddis/todo-list/` files and has no worktree option).
41
+ - Step 6b: skip `session_state.py prune` (report `skipped: shared checkout`).
42
+ - Step 6c: run `--reindex` in the worktree (it edits the tracked `DOC-MAP.md`).
43
+ - The relay stays in this checkout: `.caddis/relay/` is local and gitignored.
44
+ After Step 6c, run:
45
+ ```
46
+ python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_docs_pr.py" finish --worktree <path> --title "docs(handoff): <name> session notes" --body "Handoff doc edits from a shared checkout."
47
+ ```
48
+ It commits only the worktree's changed files, pushes, opens a PR, and prints `PR: <url>` and one
49
+ `FILE: <path>` line per file (or `PR: none` when nothing changed). It always removes the worktree, and
50
+ it never merges. On a failure it prints `PATCH: <path>` with the edits; report that path. Put the
51
+ `PR:` line and the file list in your final report, under `Docs PR needed:`.
52
+
53
+ ## Checklist
54
+ The handoff is a fixed checklist. Every row ends as `done`, `skipped: <reason>` or `failed: <error>`, and
55
+ Step 8 prints all 13 in this order. Never drop a row from the report, even when its step did not apply.
56
+
57
+ | # | Row | What it is | Shared checkout (Step 0) |
58
+ |---|---|---|---|
59
+ | 1 | `knowledge-transfer` | Step 1 | edits only in the Step 0 worktree |
60
+ | 2 | `plan-tracker` | the plan's Tracker row (Rules) | edit in the Step 0 worktree |
61
+ | 3 | `open-work-row` | Step 3, point 4: `caddis_rows.py set` | `--file <worktree>/...` |
62
+ | 4 | `relay` | Step 3: the relay, written from scratch with current state only | the relay is local; runs |
63
+ | 5 | `tasks-file` | Step 3c | runs |
64
+ | 6 | `kb-index` | Step 6c: refresh the KB index | in the Step 0 worktree |
65
+ | 7 | `violations-report` | Step 6c: report standing violations, each with a one-line fix command | runs (report only) |
66
+ | 8 | `todo-reconcile` | Step 6: `caddis_todo.py reconcile` | `skipped: shared checkout` |
67
+ | 9 | `usage-record` | Step 6b: `session_state.py usage` | runs |
68
+ | 10 | `tidy-apply` | Step 4: `caddis_tidy.py --apply` | `skipped: shared checkout` |
69
+ | 11 | `state-prune` | Step 6b: `session_state.py prune` | `skipped: shared checkout` |
70
+ | 12 | `prune-list` | Step 6b: `caddis_tidy.py --prune`, list only | runs (lists, never applies) |
71
+ | 13 | `handover-check` | Step 5 | runs |
72
+
73
+ `tidy-apply`, `state-prune` and `todo-reconcile` run only on `SHARED: no`. Handoff never runs
74
+ `caddis_tidy.py --prune --apply` on its own, in any checkout; only the user can ask for it (Step 6b). In a
75
+ shared checkout the report also lists every tracked file Step 1 changed, under `Docs PR needed:`.
76
+
11
77
  ## Step 1 — capture learnings FIRST (knowledge-transfer)
12
78
  **Before** gathering git signals or writing relay.md, decide on `knowledge-transfer` — and the default
13
79
  is to run it.
@@ -36,7 +102,7 @@ committed before its generator last changed. Paste the parts a next session need
36
102
  them from memory.
37
103
 
38
104
  **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
105
+ remembered, so it was only ever as complete as that memory. Bringing one successor session to a usable state took
40
106
  nine corrective round trips and the user caught six of them — including *"the handover listed no
41
107
  reports, documents, KB notes or scripts"*. None of those are judgement calls; every one is a
42
108
  directory listing. An agent recalls **what it did**; a generator enumerates **what exists**, and
@@ -53,39 +119,7 @@ clean phase boundary and lose or double-do the work.
53
119
  tracker shows plan A in progress, but the work moved to plan B), suggest the user run `/digress` to park
54
120
  plan A on the workstream stack — so its exact resume point survives and `/catchup [name]` can pop it back later.
55
121
 
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
-
88
- ## Step 2c — was any of it the harness?
122
+ ## Step 2b — was any of it the harness?
89
123
 
90
124
  <!-- shared:harness-friction-question — keep byte-identical across commands; a test pins it -->
91
125
  **One question, asked here because here is where you are already reflecting.** The observations
@@ -103,6 +137,9 @@ Nothing to say is the normal answer. Say nothing and move on — this must not b
103
137
  <!-- /shared:harness-friction-question -->
104
138
 
105
139
  ## Step 3 — write the resume doc (overwrite) with exactly these sections
140
+ Write the relay from scratch with the current state only. Never append to the old text: git keeps the
141
+ history, and the relay has a 4,000-character budget (`caddis_budget.py`).
142
+
106
143
  > **Where to write:** this session's own workstream relay, `.caddis/relay/<name>.md`, through the
107
144
  > locked script — never with a plain file edit, which would skip the conflict check. `.caddis/relay.md`
108
145
  > is a generated index of all workstreams; do not write it by hand.
@@ -111,7 +148,7 @@ Nothing to say is the normal answer. Say nothing and move on — this must not b
111
148
  > `session_id` and `--session-id`. Never guess one: a wrong id disables session matching.
112
149
  >
113
150
  > 1. **Name the workstream** (active plan's `feature`, else the branch; the script prints nothing
114
- > on the default branch with no plan — then ask the user for a short name):
151
+ > on the default branch with no plan — run `caddis_workstreams.py list` (`python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_workstreams.py" list`) to show existing workstreams, then ask the user which one to use or for a short name):
115
152
  > `python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_workstreams.py" resolve --plan <feature> --branch <branch> --default-branch <main>`
116
153
  > 2. **Legacy repo:** if `.caddis/relay.md` exists and does not start with
117
154
  > `<!-- caddis-workstream-index-v1 -->`, or an old `/digress` stack `.caddis/workstreams.json`
@@ -120,11 +157,21 @@ Nothing to say is the normal answer. Say nothing and move on — this must not b
120
157
  > to the user and stop.
121
158
  > 3. **Read the stored version's hash** before you compose: `caddis_workstreams.py hash <name>`
122
159
  > (prints `none` for a new workstream).
123
- > 4. **Write** the relay below to a temp file, then
124
- > `caddis_workstreams.py write <name> <temp-file> --expected-hash <hash>`. Exit 1 means another
125
- > session changed the relay since step 3: it prints the diff and writes nothing. Show the diff,
126
- > merge by hand, and retry with the new hash. Never force it.
127
- > 5. **Refresh the index:** `caddis_workstreams.py render-index --session-id <id> --branch <branch>`.
160
+ > 4. **Open-work rows** (only when `.caddis/open-work.md` exists and its frontmatter says
161
+ > `type: open-work`): first set each row this session
162
+ > finished, by id and column name, never by hand:
163
+ > `python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_rows.py" set --file .caddis/open-work.md --id <row id> --col Status=done --col Evidence=<evidence>`.
164
+ > In a shared checkout (Step 0), use `--file <worktree>/.caddis/open-work.md` instead.
165
+ > **Order of work:** when the repo has a roadmap (`caddis_roadmap.py list` prints a slug), the
166
+ > roadmap on origin is the order of work. Write the relay's "Next step (exact)" as
167
+ > `next: top open item of roadmap <slug> (caddis_roadmap.py status --roadmap <slug>)`. Never copy a
168
+ > list of open items into the relay.
169
+ > 5. **Write** the relay below to a temp file, then
170
+ > `python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_workstreams.py" put <name> <temp-file> --require-status --expected-hash <hash>`.
171
+ > It refuses a relay whose last line is not a valid status line (see "Programme triggers" below).
172
+ > Exit 1 also means another session changed the relay since step 3: it prints the diff and writes
173
+ > nothing. Show the diff, merge by hand, and retry with the new hash. Never force it.
174
+ > 6. **Refresh the index:** `caddis_workstreams.py render-index --session-id <id> --branch <branch>`.
128
175
  >
129
176
  > (Source checkout: `scripts/caddis_workstreams.py`.) A repo still on the pre-rename `.claudster/`
130
177
  > won't see this relay until it's converted — `/caddis:migrate-dir` does that.
@@ -154,6 +201,7 @@ generated:
154
201
  <The single next action. Include the command/phase. Add a fallback if blocked.>
155
202
 
156
203
  ## Read first on resume
204
+ Paths are relative to the repo root.
157
205
  - `<path>` — why it matters
158
206
  - `.caddis/plans/<feature>.md` — the plan + tracker
159
207
 
@@ -165,18 +213,42 @@ generated:
165
213
 
166
214
  ## Learnings captured
167
215
  knowledge-transfer: <✓ ran → files written | ✗ skipped → reason>
168
- advisory-context audit: <N candidates → M gaps → landed in <path>> | n/a (no advisory-context for this plan)
169
216
 
170
217
  ## Resume prompt
171
218
  \`\`\`
172
219
  Read .caddis/relay/<name>.md, then the plan it points to. Continue from <phase/step>. Next action: <exact>.
220
+ Load every row of .caddis/relay/<name>.tasks.md with TaskCreate.
173
221
  \`\`\`
222
+ (Keep the `Load every row` sentence only when Step 3c wrote `.caddis/relay/<name>.tasks.md`.)
223
+
224
+ STATUS: <CONTINUE | OWNER-GATE <P>-OG<n> | BLOCKED <owner> | FAILED <reason>>
225
+ ```
226
+
227
+ ## Programme triggers
228
+
229
+ Small work that does not meet a trigger skips its block.
230
+
231
+ **Trigger: Always.** The relay ends with a status line, the last non-empty line, and it is exactly one of `STATUS: CONTINUE`, `STATUS: OWNER-GATE <P>-OG<n>`, `STATUS: BLOCKED <owner>` or `STATUS: FAILED <reason>`. In Step 3, point 5, write the relay with `python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_workstreams.py" put <name> <temp-file> --require-status --expected-hash <hash>` instead of `write` (in short: put --require-status), with the same hash Step 3 read, so a peer's newer relay is never overwritten. It rejects a relay with no valid status line, and renders the index. When the repo has `.caddis/open-work.md` with `type: open-work` in its frontmatter, also set each open-work row's status with `python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_rows.py" set --file <open-work.md> --id <row id> --col Status=<status>` (in a shared checkout, the copy in the Step 0 worktree). When the status is `done`, also pass `--col Evidence=<commit, PR or test>`: caddis_rows.py refuses `done` with no Evidence.
232
+
233
+ ## Step 3c - Save the open tasks
234
+ The task list dies with the session unless it is saved. Write this session's open tasks beside
235
+ the relay:
174
236
  ```
237
+ python "${CLAUDE_PLUGIN_ROOT}/scripts/session_state.py" tasks-file --session-id <session-id> --relay <name> --root .
238
+ ```
239
+ It reads the `## Tasks` table of `.caddis/session-state/<session-id>.md`, keeps the rows that are
240
+ not `done` or `deleted`, and prints `[TASKS] <n> open task(s) -> <path>` or `[TASKS] none open`
241
+ (with no open task it deletes an old `.caddis/relay/<name>.tasks.md`). When it wrote a file, the
242
+ relay's resume prompt must hold the sentence
243
+ `Load every row of .caddis/relay/<name>.tasks.md with TaskCreate.`: Step 5 blocks a relay whose
244
+ tasks file exists and is not named. If you wrote the relay before running this, rewrite it with
245
+ Step 3, point 5.
175
246
 
176
247
  ## Step 4 — tidy finished artifacts
177
248
  Flip any plan/prompt's frontmatter `status:` to `done` (or `superseded`) if this session actually
178
249
  finished it — that is your judgment call; the script below never makes it and never auto-flips
179
- status. Then run:
250
+ status. In a shared checkout (Step 0), make the `status:` flip in the Step 0 worktree copy of the plan,
251
+ never in this checkout. Then run (skip it in a shared checkout, Step 0: it moves tracked files):
180
252
  ```
181
253
  python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_tidy.py" --apply
182
254
  ```
@@ -184,7 +256,13 @@ python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_tidy.py" --apply
184
256
  skip this step** — it degrades open, same as the other machine gates; an older install must not
185
257
  be blocked by a script it does not have. Include its report in your output. A **collision**
186
258
  (`done/<name>` already exists) is reported by the script, not fatal — surface it, do not fail the
187
- handoff over it.
259
+ handoff over it. Exit 2 means a plan is held because its Tracker still has open rows (`held (open Tracker rows): ...` lines, from Phase 3): show those lines; finish, park (`.caddis/parking-lot/<file>.md` in the row) or mark the rows `dropped: <reason>`, or set the plan status back. Do not fail the handoff over it.
260
+
261
+ After step 4, for each item this session closed (a phase `<plan>#<n>`, a plan slug, or an open-work row id), run `mentions` to check whether another relay's Next step still names it:
262
+ ```
263
+ python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_workstreams.py" mentions --item "<item>" --except <name>
264
+ ```
265
+ Print a `WARNING:` line per hit (`WARNING: relay <other> still names closed item <item> in its Next step`). Never edit another workstream's relay (`caddis_workstreams.py mentions` only reads).
188
266
 
189
267
  ## Step 5 — check the handover you just wrote
190
268
 
@@ -197,7 +275,7 @@ report that repo's paths as missing, which is the tool being right about the wro
197
275
 
198
276
  It fails when the handover names a file that does not exist. The incoming session has **no other
199
277
  source** for those paths, so it cannot tell a typo from a real file: one live handover sent an
200
- incoming Hub looking for a prompt that was never written. Fix what it lists, then re-run.
278
+ incoming session looking for a prompt that was never written. Fix what it lists, then re-run.
201
279
 
202
280
  It also notes any generated artefact committed before its generator last changed. That is advisory,
203
281
  not blocking — but do not quote a report the note names without rebuilding it first.
@@ -219,7 +297,8 @@ python "${CLAUDE_PLUGIN_ROOT}/scripts/session_state.py" prune
219
297
  `usage` finds this session's transcript by its id and appends one token-and-skill record to
220
298
  `.caddis/usage-log.jsonl`, which `/usage-review` reads. Pass `--transcript <path>` if you know the
221
299
  path and it is not under the Claude config folder. `prune` keeps the newest 8 files in
222
- `.caddis/session-state/`; run it after Step 6, which reads this session's file. Include the
300
+ `.caddis/session-state/`; run it after Step 6, which reads this session's file. Skip `prune` in a
301
+ shared checkout (Step 0). Include the
223
302
  `[USAGE]` line in your output. Both always exit 0; if the script is missing, skip this step.
224
303
 
225
304
  Then list old local state (falls back to `scripts/caddis_tidy.py`; skip if missing):
@@ -230,6 +309,34 @@ It only lists: session-state files older than 7 days, logs over 5 MB to rotate,
230
309
  only, never deleted) orphan `.lock` files and lane worktrees older than 7 days. Include its report. **Never
231
310
  add `--apply` yourself**; deleting is the user's choice. If they ask, run `--prune --apply`.
232
311
 
312
+ ## Step 6c — KB index and standing violations
313
+ Both scripts fall back to `claude-harness/scripts/check_doc_coverage.py` and `scripts/caddis_tidy.py` in a
314
+ source checkout; a script that is missing is `skipped: <script> not installed`.
315
+
316
+ Checklist row 6, `kb-index` (in a shared checkout, run it in the Step 0 worktree, before the Step 0
317
+ `finish`; it edits `DOC-MAP.md`):
318
+ ```
319
+ python "${CLAUDE_PLUGIN_ROOT}/scripts/check_doc_coverage.py" --reindex
320
+ ```
321
+ Checklist row 7, `violations-report` (all three only report; never fix files here):
322
+ ```
323
+ python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_tidy.py" --check
324
+ python "${CLAUDE_PLUGIN_ROOT}/scripts/check_doc_coverage.py"
325
+ python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_budget.py" check --root . --report
326
+ ```
327
+ `caddis_budget.py` lists each handoff-grown file over its size budget (`OVER <path>: ...; fix: <rule>`); the
328
+ `fix:` text is the one-line fix for that row.
329
+ List each violation they print with a one-line command that fixes it (for example `/caddis:kb` for an
330
+ un-indexed note, or `caddis_tidy.py --apply` for a finished artifact in the wrong folder). A violation is
331
+ not a failure of the handoff: the row is `done` when all three ran. If a script is missing, the row is
332
+ `skipped: <script> not installed`.
333
+
334
+ Then, when the repo has a roadmap (`.caddis/roadmaps/`), re-render its page so phases built by hand show too
335
+ (best effort, not a checklist row; it writes only under `~/.caddis/roadmap-pages/`, never in this checkout):
336
+ ```
337
+ python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_roadmap.py" render --all
338
+ ```
339
+
233
340
  ## Step 7 — push prompt (interactive only)
234
341
  If this is an interactive session, ask the user every time — never reuse an earlier answer:
235
342
  `Push this note for another machine? (y/N)`
@@ -242,15 +349,37 @@ index or staged files — after the secret filter passes. Report its one-line re
242
349
  `y` means do nothing. Headless runs never ask and never push (the script also refuses headless).
243
350
  On the other machine, `/catchup <name>` fetches it.
244
351
 
352
+ ## Step 8 — the checklist report
353
+ End the handoff with this block, every row filled with `done`, `skipped: <reason>` or `failed: <error>`:
354
+
355
+ ```
356
+ === HANDOFF CHECKLIST ===
357
+ 1 knowledge-transfer done | skipped: <reason> | failed: <error>
358
+ 2 plan-tracker <same three forms>
359
+ 3 open-work-row <same three forms>
360
+ 4 relay <same three forms>
361
+ 5 tasks-file <same three forms>
362
+ 6 kb-index <same three forms>
363
+ 7 violations-report <same three forms>
364
+ 8 todo-reconcile <same three forms>
365
+ 9 usage-record <same three forms>
366
+ 10 tidy-apply <same three forms>
367
+ 11 state-prune <same three forms>
368
+ 12 prune-list <same three forms>
369
+ 13 handover-check <same three forms>
370
+ Shared checkout: yes|no <reason>
371
+ ```
372
+
373
+ Then, in a shared checkout, `Docs PR needed:` with the `PR:` line and the file list from Step 0.
374
+
245
375
  ## Rules
246
376
  - **One next action, by priority ladder.** `## Next step` names exactly ONE action — not a menu. Pick it in
247
377
  order: (1) interrupted mid-phase work → finish + commit it; else (2) the active plan's next not-started
248
378
  phase; else (3) the top open question/decision. Everything else is context, not the next step.
249
379
  - Only verified facts and real paths. Mark anything unconfirmed as `Unknown`.
250
- - Update the plan's tracker rows too (status + last commit) — relay and tracker must agree.
380
+ - Update the plan's tracker rows too (status + last commit) — relay and tracker must agree. In a shared
381
+ checkout, edit the Tracker in the Step 0 worktree, never in this checkout.
251
382
  - Don't commit unless asked. Report which `.caddis/relay/<name>.md` was written and the one next action.
252
- - **Never hand off a Hub session on the strength of "the context doc is designed for this."** That is the
253
- one instinct that has been measured and found wrong. Run Step 2b's audit instead.
254
383
  - **Prune the Done section — two rules, both apply:**
255
384
  1. **Merge-based:** Phases already merged to `main` (confirmed by a tag or commit) must be compressed
256
385
  to a single line: `- **RW-N**: merged to main as vYYYY.MM.DD.N (<commit>) ✅`. Only the current