cohorte 3.0.0-dev.8 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/CHANGELOG.md +1637 -0
  2. package/README.md +322 -62
  3. package/bin/cli.js +213 -0
  4. package/bin/report.js +141 -0
  5. package/core/agents/cohorte-profile-reader.md +40 -0
  6. package/core/agents/cohorte-release.md +61 -0
  7. package/core/agents/cohorte-review.md +200 -0
  8. package/core/agents/implementer.template.md +154 -0
  9. package/core/commands/cohorte-align-ds.md +33 -0
  10. package/core/commands/cohorte-audit.md +74 -0
  11. package/core/commands/cohorte-brainstorm.md +73 -0
  12. package/core/commands/cohorte-build.md +248 -0
  13. package/core/commands/cohorte-doctor.md +135 -0
  14. package/core/commands/cohorte-fix.md +80 -0
  15. package/core/commands/cohorte-fleet.md +111 -0
  16. package/core/commands/cohorte-init-pipeline.md +30 -0
  17. package/core/commands/cohorte-intake.md +92 -0
  18. package/core/commands/cohorte-patch.md +118 -0
  19. package/core/commands/cohorte-refactor.md +122 -0
  20. package/core/commands/cohorte-retro.md +85 -0
  21. package/core/commands/cohorte-revert.md +104 -0
  22. package/core/commands/cohorte-review.md +239 -0
  23. package/core/commands/cohorte-ship.md +167 -0
  24. package/core/commands/cohorte-spec.md +114 -0
  25. package/core/commands/cohorte-update-pipeline.md +119 -0
  26. package/core/commands/cohorte-verify.md +106 -0
  27. package/core/hooks/gate.py +3236 -0
  28. package/core/templates/agent-handoff.md +34 -0
  29. package/core/templates/brainstorm-return.md +42 -0
  30. package/core/templates/decisions.template.md +42 -0
  31. package/core/templates/design-brief.md +37 -0
  32. package/core/templates/patch.template.md +95 -0
  33. package/core/templates/pr-body.md +25 -0
  34. package/core/templates/review-feedback.md +46 -0
  35. package/core/templates/spec.template.md +109 -0
  36. package/core/templates/steps/init-pipeline/01-detect-stack.md +53 -0
  37. package/core/templates/steps/init-pipeline/02-interview-gaps.md +78 -0
  38. package/core/templates/steps/init-pipeline/03-draft-profile.md +10 -0
  39. package/core/templates/steps/init-pipeline/04-write-render.md +95 -0
  40. package/core/templates/steps/init-pipeline/05-report.md +11 -0
  41. package/core/templates/steps/review-pr/01-pr-mode.md +54 -0
  42. package/core/workflows/audit.js +311 -0
  43. package/core/workflows/loop.js +692 -0
  44. package/core/workflows/refactor.js +398 -0
  45. package/core/workflows/review.js +505 -0
  46. package/install.ps1 +72 -0
  47. package/install.sh +69 -0
  48. package/lib/doctor.js +506 -0
  49. package/lib/install.js +386 -0
  50. package/lib/project.js +359 -0
  51. package/lib/render.js +121 -0
  52. package/lib/versions.js +145 -0
  53. package/lib/yaml.js +183 -0
  54. package/package.json +36 -17
  55. package/profile/PIPELINE.template.md +288 -0
  56. package/profile/SCHEMA.md +30 -0
  57. package/profile/cohorte.config.template.yaml +43 -0
  58. package/profile/schema/dead-agents.md +29 -0
  59. package/profile/schema/decisions.md +23 -0
  60. package/profile/schema/deferred.md +22 -0
  61. package/profile/schema/feature-diff.md +20 -0
  62. package/profile/schema/kanban.md +95 -0
  63. package/profile/schema/metrics.md +23 -0
  64. package/profile/schema/output-discipline.md +21 -0
  65. package/profile/schema/preflight.md +81 -0
  66. package/profile/schema/profile-block.md +103 -0
  67. package/profile/schema/project-kinds.md +89 -0
  68. package/profile/schema/readiness.md +17 -0
  69. package/profile/schema/reconcile.md +64 -0
  70. package/profile/schema/release-notes.md +29 -0
  71. package/profile/schema/rendering.md +48 -0
  72. package/profile/schema/retrieval.md +58 -0
  73. package/profile/schema/spec-status.md +79 -0
  74. package/profile/schema/specialization.md +41 -0
  75. package/profile/schema/verify.md +115 -0
  76. package/profile/schema/workflows.md +78 -0
  77. package/scripts/feature-diff.sh +118 -0
  78. package/scripts/kanban-move.sh +349 -0
  79. package/scripts/metrics/collect.mjs +542 -0
  80. package/scripts/metrics/prices.json +42 -0
  81. package/scripts/new-feature.sh.template +122 -0
  82. package/scripts/preflight.sh +114 -0
  83. package/scripts/remove-feature.sh.template +56 -0
  84. package/scripts/verify-run.sh +509 -0
  85. package/assets/manifest.json +0 -203
  86. package/assets/migrations/config/README.md +0 -12
  87. package/assets/migrations/state/0001_init.sql +0 -154
  88. package/assets/prompts/README.md +0 -11
  89. package/assets/prompts/agents/brainstormer.md +0 -3
  90. package/assets/prompts/agents/fixer.md +0 -7
  91. package/assets/prompts/agents/implementer.md +0 -12
  92. package/assets/prompts/agents/reviewer.md +0 -8
  93. package/assets/prompts/agents/security-reviewer.md +0 -7
  94. package/assets/prompts/agents/spec-author.md +0 -3
  95. package/assets/prompts/phases/build.md +0 -5
  96. package/assets/prompts/phases/review.md +0 -5
  97. package/assets/prompts/phases/test.md +0 -5
  98. package/assets/prompts/system.md +0 -11
  99. package/assets/schemas/agent-output.schema.json +0 -225
  100. package/assets/schemas/auth-status.schema.json +0 -87
  101. package/assets/schemas/command-result.schema.json +0 -192
  102. package/assets/schemas/commands.schema.json +0 -959
  103. package/assets/schemas/config.schema.json +0 -2281
  104. package/assets/schemas/doctor-report.schema.json +0 -104
  105. package/assets/schemas/events.schema.json +0 -8514
  106. package/assets/schemas/fake-script.schema.json +0 -549
  107. package/assets/schemas/inspect.schema.json +0 -3133
  108. package/assets/schemas/manifest.schema.json +0 -79
  109. package/assets/schemas/ownership.schema.json +0 -52
  110. package/assets/schemas/policy-verdict.schema.json +0 -282
  111. package/assets/schemas/project-model.schema.json +0 -783
  112. package/assets/schemas/project-status.schema.json +0 -217
  113. package/assets/schemas/reconcile-plan.schema.json +0 -154
  114. package/assets/schemas/run-diff.schema.json +0 -177
  115. package/assets/schemas/run-snapshot-manifest.schema.json +0 -2104
  116. package/assets/schemas/run-state.schema.json +0 -1755
  117. package/assets/schemas/runtime-capabilities.schema.json +0 -1545
  118. package/assets/schemas/sandbox-capabilities.schema.json +0 -116
  119. package/assets/schemas/skill.schema.json +0 -87
  120. package/assets/schemas/spec.schema.json +0 -202
  121. package/assets/schemas/tool-catalogue.schema.json +0 -655
  122. package/assets/schemas/trust-record.schema.json +0 -38
  123. package/assets/skills/README.md +0 -9
  124. package/assets/skills/inspect-surface.md +0 -4
  125. package/dist/agent-host.mjs +0 -2187
  126. package/dist/agent-host.mjs.map +0 -1
  127. package/dist/bundle-manifest.json +0 -128
  128. package/dist/chunks/__host-DgGPyco9.mjs +0 -18
  129. package/dist/chunks/__host-DgGPyco9.mjs.map +0 -1
  130. package/dist/chunks/align-ds-r_X_1aQ_.mjs +0 -93
  131. package/dist/chunks/align-ds-r_X_1aQ_.mjs.map +0 -1
  132. package/dist/chunks/approve-Cv135UqI.mjs +0 -19
  133. package/dist/chunks/approve-Cv135UqI.mjs.map +0 -1
  134. package/dist/chunks/audit-B4ZWQ_DI.mjs +0 -179
  135. package/dist/chunks/audit-B4ZWQ_DI.mjs.map +0 -1
  136. package/dist/chunks/auth-BT5oVp76.mjs +0 -132
  137. package/dist/chunks/auth-BT5oVp76.mjs.map +0 -1
  138. package/dist/chunks/auth-Dnlksuo5.mjs +0 -141
  139. package/dist/chunks/auth-Dnlksuo5.mjs.map +0 -1
  140. package/dist/chunks/brainstorm-SJwOIEif.mjs +0 -123
  141. package/dist/chunks/brainstorm-SJwOIEif.mjs.map +0 -1
  142. package/dist/chunks/build-C_-mbZfD.mjs +0 -19
  143. package/dist/chunks/build-C_-mbZfD.mjs.map +0 -1
  144. package/dist/chunks/cancel-KV_cpsqS.mjs +0 -15
  145. package/dist/chunks/cancel-KV_cpsqS.mjs.map +0 -1
  146. package/dist/chunks/canonical-C8UxeEmB.mjs +0 -57
  147. package/dist/chunks/canonical-C8UxeEmB.mjs.map +0 -1
  148. package/dist/chunks/catalogue-IaCJdfB8.mjs +0 -1549
  149. package/dist/chunks/catalogue-IaCJdfB8.mjs.map +0 -1
  150. package/dist/chunks/compose-DRKjQcn0.mjs +0 -7333
  151. package/dist/chunks/compose-DRKjQcn0.mjs.map +0 -1
  152. package/dist/chunks/config-Cqu5XQoP.mjs +0 -96
  153. package/dist/chunks/config-Cqu5XQoP.mjs.map +0 -1
  154. package/dist/chunks/contract-DjssDPpS.mjs +0 -335
  155. package/dist/chunks/contract-DjssDPpS.mjs.map +0 -1
  156. package/dist/chunks/contract-bQ9FJl4N.mjs +0 -123
  157. package/dist/chunks/contract-bQ9FJl4N.mjs.map +0 -1
  158. package/dist/chunks/deny-ClTxSvHJ.mjs +0 -15
  159. package/dist/chunks/deny-ClTxSvHJ.mjs.map +0 -1
  160. package/dist/chunks/diff-Qw0II0sj.mjs +0 -101
  161. package/dist/chunks/diff-Qw0II0sj.mjs.map +0 -1
  162. package/dist/chunks/discover-BZPolSZG.mjs +0 -21
  163. package/dist/chunks/discover-BZPolSZG.mjs.map +0 -1
  164. package/dist/chunks/doctor-DcDFPvQM.mjs +0 -222
  165. package/dist/chunks/doctor-DcDFPvQM.mjs.map +0 -1
  166. package/dist/chunks/fix-C9roGiQz.mjs +0 -82
  167. package/dist/chunks/fix-C9roGiQz.mjs.map +0 -1
  168. package/dist/chunks/fleet-yWHQY2ya.mjs +0 -297
  169. package/dist/chunks/fleet-yWHQY2ya.mjs.map +0 -1
  170. package/dist/chunks/gc-BBXlBF5w.mjs +0 -161
  171. package/dist/chunks/gc-BBXlBF5w.mjs.map +0 -1
  172. package/dist/chunks/init--FxxkrcT.mjs +0 -63
  173. package/dist/chunks/init--FxxkrcT.mjs.map +0 -1
  174. package/dist/chunks/inspect-Buby4cQD.mjs +0 -22
  175. package/dist/chunks/inspect-Buby4cQD.mjs.map +0 -1
  176. package/dist/chunks/intake-C1pesxCJ.mjs +0 -12
  177. package/dist/chunks/intake-C1pesxCJ.mjs.map +0 -1
  178. package/dist/chunks/logs-Giq5sUau.mjs +0 -25
  179. package/dist/chunks/logs-Giq5sUau.mjs.map +0 -1
  180. package/dist/chunks/loop-BWsUpyus.mjs +0 -212
  181. package/dist/chunks/loop-BWsUpyus.mjs.map +0 -1
  182. package/dist/chunks/migrate-DuYCAbE3.mjs +0 -33
  183. package/dist/chunks/migrate-DuYCAbE3.mjs.map +0 -1
  184. package/dist/chunks/models-Btp6X2YZ.mjs +0 -24
  185. package/dist/chunks/models-Btp6X2YZ.mjs.map +0 -1
  186. package/dist/chunks/obsidian-BHLkXx_H.mjs +0 -235
  187. package/dist/chunks/obsidian-BHLkXx_H.mjs.map +0 -1
  188. package/dist/chunks/patch-sAgVqjpx.mjs +0 -50
  189. package/dist/chunks/patch-sAgVqjpx.mjs.map +0 -1
  190. package/dist/chunks/pause-BASBfKLO.mjs +0 -16
  191. package/dist/chunks/pause-BASBfKLO.mjs.map +0 -1
  192. package/dist/chunks/policy-Du7WVBFX.mjs +0 -139
  193. package/dist/chunks/policy-Du7WVBFX.mjs.map +0 -1
  194. package/dist/chunks/providers-Dx78imKj.mjs +0 -19
  195. package/dist/chunks/providers-Dx78imKj.mjs.map +0 -1
  196. package/dist/chunks/reconcile-BHn66X3C.mjs +0 -50
  197. package/dist/chunks/reconcile-BHn66X3C.mjs.map +0 -1
  198. package/dist/chunks/refactor-DV3RfGjk.mjs +0 -153
  199. package/dist/chunks/refactor-DV3RfGjk.mjs.map +0 -1
  200. package/dist/chunks/render-DyZr5Lgi.mjs +0 -53
  201. package/dist/chunks/render-DyZr5Lgi.mjs.map +0 -1
  202. package/dist/chunks/resume-GJQRb2Eb.mjs +0 -15
  203. package/dist/chunks/resume-GJQRb2Eb.mjs.map +0 -1
  204. package/dist/chunks/retro-Dr-2RTNN.mjs +0 -78
  205. package/dist/chunks/retro-Dr-2RTNN.mjs.map +0 -1
  206. package/dist/chunks/retry-CLrUem1H.mjs +0 -15
  207. package/dist/chunks/retry-CLrUem1H.mjs.map +0 -1
  208. package/dist/chunks/review-ZsBqp3vZ.mjs +0 -35
  209. package/dist/chunks/review-ZsBqp3vZ.mjs.map +0 -1
  210. package/dist/chunks/run-BGabwbDL.mjs +0 -109
  211. package/dist/chunks/run-BGabwbDL.mjs.map +0 -1
  212. package/dist/chunks/run-tool-C3rAv4XF.mjs +0 -26
  213. package/dist/chunks/run-tool-C3rAv4XF.mjs.map +0 -1
  214. package/dist/chunks/scan-C5uDr7Yq.mjs +0 -167
  215. package/dist/chunks/scan-C5uDr7Yq.mjs.map +0 -1
  216. package/dist/chunks/schema-Bq9qtgsd.mjs +0 -583
  217. package/dist/chunks/schema-Bq9qtgsd.mjs.map +0 -1
  218. package/dist/chunks/send-BdnJ85Nz.mjs +0 -19
  219. package/dist/chunks/send-BdnJ85Nz.mjs.map +0 -1
  220. package/dist/chunks/ship-BizfUe62.mjs +0 -140
  221. package/dist/chunks/ship-BizfUe62.mjs.map +0 -1
  222. package/dist/chunks/shutdown-BM92Iyv2.mjs +0 -15
  223. package/dist/chunks/shutdown-BM92Iyv2.mjs.map +0 -1
  224. package/dist/chunks/skip-DZG5kpcH.mjs +0 -18
  225. package/dist/chunks/skip-DZG5kpcH.mjs.map +0 -1
  226. package/dist/chunks/spec-C2h3U64g.mjs +0 -65
  227. package/dist/chunks/spec-C2h3U64g.mjs.map +0 -1
  228. package/dist/chunks/spec-path-tptqR7W8.mjs +0 -10
  229. package/dist/chunks/spec-path-tptqR7W8.mjs.map +0 -1
  230. package/dist/chunks/src-Bfr1yzsn.mjs +0 -1689
  231. package/dist/chunks/src-Bfr1yzsn.mjs.map +0 -1
  232. package/dist/chunks/src-CPW2_Ons.mjs +0 -5487
  233. package/dist/chunks/src-CPW2_Ons.mjs.map +0 -1
  234. package/dist/chunks/src-Cu3TxNob.mjs +0 -783
  235. package/dist/chunks/src-Cu3TxNob.mjs.map +0 -1
  236. package/dist/chunks/src-DNsLSxgm.mjs +0 -928
  237. package/dist/chunks/src-DNsLSxgm.mjs.map +0 -1
  238. package/dist/chunks/src-DbS9gkJy.mjs +0 -117
  239. package/dist/chunks/src-DbS9gkJy.mjs.map +0 -1
  240. package/dist/chunks/src-yi5whv3n.mjs +0 -2118
  241. package/dist/chunks/src-yi5whv3n.mjs.map +0 -1
  242. package/dist/chunks/status-SMjiOMYy.mjs +0 -29
  243. package/dist/chunks/status-SMjiOMYy.mjs.map +0 -1
  244. package/dist/chunks/tail-BuhT-2PH.mjs +0 -25
  245. package/dist/chunks/tail-BuhT-2PH.mjs.map +0 -1
  246. package/dist/chunks/update-BXIppsbi.mjs +0 -16
  247. package/dist/chunks/update-BXIppsbi.mjs.map +0 -1
  248. package/dist/chunks/update-pipeline-Du-Gu1Pl.mjs +0 -56
  249. package/dist/chunks/update-pipeline-Du-Gu1Pl.mjs.map +0 -1
  250. package/dist/cli.mjs +0 -186
  251. package/dist/cli.mjs.map +0 -1
@@ -0,0 +1,167 @@
1
+ ---
2
+ model: sonnet
3
+ description: At a SHIP verdict, dispatch the release agent to commit, push, and open the PR (with your confirmation).
4
+ argument-hint: <feature_id>
5
+ ---
6
+
7
+ You are the **lead**. Ship feature **$ARGUMENTS**. This is the outward-facing gate.
8
+
9
+ > Read `PIPELINE.md` §`vcs` (host, remote, default_branch, feature_branch_prefix) **and
10
+ > §`release_notes`** — §2b below is skipped or required based on it, and skipping it when it is
11
+ > required opens a PR that CI fails on arrival.
12
+ >
13
+ > **Kanban** (`<core>/pipeline/schema/kanban.md`) is mirrored in **explicit steps** below, not as an afterthought:
14
+ > §1 moves the card → **Ship**; §4 moves it → **Shipped** and writes the PR number. Both are one
15
+ > call to `<core>/pipeline/scripts/kanban-move.sh auto …`, which resolves the board from the config itself and exits 0 with a
16
+ > `kanban: <reason>` line when there is none. **Never decide "no board is configured" without running
17
+ > it** — a ship session that inferred that, having opened neither the config nor `PIPELINE.md`, is
18
+ > exactly how a merged feature's card stayed in "Ready to build". Do not skip §4's move either.
19
+
20
+ ## 0. Re-entry — a spec already past this command
21
+
22
+ `grep '^status:' specs/$ARGUMENTS.md` first. `shipped` means a PR is (or was) open — reconcile it
23
+ instead of shipping twice: `gh pr view <the branch §1 resolves> --json state,mergedAt,url` (no `gh` /
24
+ not github ⇒ ask the human what happened to the PR):
25
+ - `MERGED` ⇒ set `status: merged` (`<core>/pipeline/schema/spec-status.md`) and say so; go straight to §5's teardown.
26
+ - `OPEN` ⇒ nothing to ship again: go to §5's CI watch (a red check routes per §5).
27
+ - `CLOSED` (not merged) ⇒ ask the human: reopen and continue (`/cohorte-fix` on what killed it), or
28
+ drop it — then set `status: abandoned`. Never decide that alone.
29
+ - **No PR for the branch** — §2 flipped the status but the release never completed (the release
30
+ agent died, or the human stopped it): go to **§3** (the review gate passed before the flip, and
31
+ the §2b release note is now in the tree, so re-running §1's freshness check would call the
32
+ verdict stale for a file this command wrote). Confirm with the human first.
33
+
34
+ `merged` / `abandoned` ⇒ done already: say so and stop. Anything else ⇒ §1.
35
+
36
+ ## 1. Pre-flight (confirm before doing anything irreversible)
37
+
38
+ - **The review gate — read `specs/reports/$ARGUMENTS.verdict.json`, never the chat.** It is the review's
39
+ machine contract (`/cohorte-review` §3). Ship only when ALL hold, and name the first that fails:
40
+ - `verdict` is `SHIP` and there is no `aborted` key (a preflight-red or empty-diff run certifies
41
+ nothing);
42
+ - `unreviewed` is `[]` (a dead reviewer read nothing);
43
+ - `severity.HIGH` and `severity.MEDIUM` are both `0` — a SHIP that still carries them is not a
44
+ clean bill (route: `/cohorte-fix $ARGUMENTS`, or the human explicitly parks MEDIUMs through
45
+ `/cohorte-review`'s park step, which rewrites this file);
46
+ - the spec front-matter carries `reviewed_base` **and** `reviewed_digest` — the review writes the
47
+ stamp only on a clean bill, so a SHIP without it is a review that did not certify this code.
48
+ File absent ⇒ no review ran on this checkout: stop, `/cohorte-review $ARGUMENTS`. **Only when
49
+ `verdict.json` is absent AND the spec carries no stamp AND predates the gate** (a legacy spec from
50
+ before the verdict file existed) may the human confirm shipping on their own word — ask, and say
51
+ that nothing certified it.
52
+ - **Freshness gate** — the reviewed code must be exactly what ships. Recompute
53
+ `<core>/pipeline/scripts/feature-diff.sh --base <reviewed_base> --digest` (the same script that
54
+ wrote the stamp — untracked files included, `specs/` + `.claude/` excluded; a bare `git diff`
55
+ would miss every new file) and compare to `reviewed_digest`. **Match** ⇒ source unchanged since
56
+ the SHIP verdict, proceed. **Mismatch** (or a non-zero exit) ⇒ source (or the contract) was edited
57
+ after review — the verdict is **stale**: stop and tell the human to re-run
58
+ `/cohorte-review $ARGUMENTS`. A stamp written before `feature-diff.sh` existed was computed without
59
+ untracked files and will mismatch once — the re-review re-stamps it.
60
+ - **Migrations need a way back.** `<core>/pipeline/scripts/verify-run.sh rollback-check specs/$ARGUMENTS.md`
61
+ — exit 1 (`migrations: true` with an empty `## Rollback`) ⇒ **refuse**: back to `/cohorte-spec` to
62
+ fill it. No human override: a migration nobody can undo is decided before ship, not at it.
63
+ - **Runtime gate** (`<core>/pipeline/schema/verify.md` §Ship). Not configured — `verify.enabled: false`, or
64
+ none of `commands.smoke`/`commands.e2e`/`commands.dev`+`commands.dev_ready` (and no `migrations: true`
65
+ with a `commands.migrate`) ⇒ skip silently. Otherwise read `specs/reports/$ARGUMENTS.verify.json`:
66
+ - `verdict` `FAIL` ⇒ **refuse**, stale or not, naming the failing checks: `/cohorte-fix`, then
67
+ `/cohorte-review` and `/cohorte-verify` again. Only a newer run clears it.
68
+ - `PASS` and its `digest` equals the spec's `reviewed_digest` ⇒ proceed silently.
69
+ - Absent, `SKIPPED`, or a `PASS` whose `digest` differs ⇒ ask: **"not verified at runtime — ship
70
+ anyway?"** (say which case, and that `/cohorte-verify $ARGUMENTS` would settle it). Ship only on yes.
71
+ - **DoD gate (verify, don't tick — `/cohorte-review` owns the ticking, `/cohorte-verify` the
72
+ `· runtime` items).** Read `specs/$ARGUMENTS.md`
73
+ §`Acceptance criteria / DoD`; if any item is still `- [ ]`, list the open ones and ask the human to
74
+ confirm shipping anyway (they may be deferred on purpose — e.g. a UI item on a backend-only feature).
75
+ All `- [x]` ⇒ proceed silently.
76
+ - Show `git status` + `<core>/pipeline/scripts/feature-diff.sh --default <default_branch> --numstat`
77
+ (what ships, new files included); confirm the branch is `<prefix>$ARGUMENTS`, where `<prefix>`
78
+ is `vcs.patch_branch_prefix` (falling back to `fix/` on a profile that predates the key) when the
79
+ spec front-matter carries `kind: patch`, and `vcs.feature_branch_prefix` otherwise. Resolve it once
80
+ here and pass the **literal** branch to §3's dispatch — the release agent must not re-derive it.
81
+ - **Ask the human to confirm** they want to commit, push, and open the PR. Wait for yes.
82
+ - After the yes: `<core>/pipeline/scripts/kanban-move.sh auto $ARGUMENTS ship`. Report what it
83
+ printed — `moved #…` or `kanban: <reason>` — never a guess about which happened.
84
+
85
+ ## 2. Mark the spec shipped (BEFORE dispatch, so it ships in the same commit)
86
+
87
+ Once the human confirms, edit `specs/$ARGUMENTS.md` front-matter `status: → shipped` — **before**
88
+ dispatching the release agent, so the status flip is part of the tree it commits (otherwise it lands
89
+ uncommitted after the PR opens). Only flip after the human's "yes"; if they decline, leave it.
90
+
91
+ ## 2b. Write the release note (only if `release_notes.enabled` — same reason: it must ship in the commit)
92
+
93
+ `release_notes.enabled: false` (or `tool: none`) ⇒ skip this section entirely, silently.
94
+
95
+ Otherwise **you** write it — never the release agent, never the implementers. Picking the bump is
96
+ project policy and the prose is outward-facing copy; both are the lead's, exactly like the contract.
97
+ See `<core>/pipeline/schema/release-notes.md`.
98
+
99
+ - Write `<release_notes.dir>/<release_notes.filename>` (`<feature_id>` substituted), front-matter
100
+ carrying the **single** key `release_notes.anchor_package` and the chosen level, then the prose body
101
+ in `release_notes.language`.
102
+ - **Choose the level** against `release_notes.guidance`, and refuse any level in
103
+ `release_notes.forbid_levels` (a `0.x` repo forbidding `major` declares the rupture `minor`).
104
+ - **Ambiguous between two defensible levels?** State your reading in one line and **ask the human to
105
+ pick** before writing. A wrong bump becomes a published version number.
106
+ - A `kind: patch` spec is a `patch` bump by default — that is what the level means. It is a default,
107
+ not a rule: a bug fix that changes documented behaviour is still a `minor`, and one that removes it
108
+ is still breaking. Say which you chose when it isn't `patch`.
109
+ - The body describes what changed **for the user**, from the spec §1/§2 — no client names, no internal
110
+ paths, no exploitable attack vector, no file lists.
111
+ - If the feature genuinely must move no version, use `release_notes.empty_cmd` instead. Prefer that to
112
+ skipping: the CI job wants a file, not a version.
113
+ - Then say in one line which level you chose and why — this is the human's last chance to correct it
114
+ before it is committed.
115
+
116
+ > **Why this is its own gate.** The requirement usually lives in the project's `<memory>`, which this
117
+ > flow never reads. Skip it and everything below still "succeeds": commit, push, PR opened, kanban card
118
+ > moved to **Shipped** — and CI red on a job nobody watched. The feature reads as shipped while being
119
+ > unmergeable.
120
+
121
+ ## 3. Dispatch the `cohorte-release` agent
122
+
123
+ Spawn one agent (`subagent_type: cohorte-release`):
124
+ "Release feature `$ARGUMENTS` on branch
125
+ `<the branch §1 resolved>`. Read `PIPELINE.md` §vcs first. Spec: `specs/$ARGUMENTS.md` (already
126
+ `status: shipped` — stage it). Write conventional commit(s), push (no force), open the PR (use `gh` if
127
+ `host: github` + available; else emit the compare URL + drafted PR body from `<core>/templates/pr-body.md`).
128
+ Stage **all** the feature's changes including `specs/$ARGUMENTS.md` and, if `release_notes.enabled`, the
129
+ release note at `<release_notes.dir>/<release_notes.filename>` — it is already written, stage it as-is and
130
+ never author or edit one yourself. Never edit source, never force-push, never run migrations."
131
+
132
+ ## 4. Relay + move the card to Shipped (do not skip)
133
+
134
+ Print the release agent's report: commit SHA(s), pushed branch, PR URL (or compare URL + drafted body).
135
+ Confirm `specs/$ARGUMENTS.md` was committed as `status: shipped` (part of the release commit), and — if
136
+ `release_notes.enabled` — that the release note is in that same commit
137
+ (`git show <sha> --stat | grep <release_notes.dir>`). Missing ⇒ commit and push it now, before §5's CI
138
+ watch, rather than letting the job go red.
139
+
140
+ **Move the card to Shipped — required, and verify it actually moved.** Run
141
+ `<core>/pipeline/scripts/kanban-move.sh auto $ARGUMENTS shipped --pr <num>`, which **appends the PR
142
+ number** so the line reads `- [ ] <title> #$ARGUMENTS — PR #<num>`. Take `<num>` from the PR URL
143
+ (`…/pull/13` ⇒ `13`); **always pass it when a PR was created** (the `gh` path) — it is what a
144
+ board reader turns into a PR link. If only a compare URL was emitted (no PR yet), drop `--pr`.
145
+
146
+ Then **read the script's own output**, which is the verification: `moved #$ARGUMENTS -> Shipped
147
+ (PR #<num>)` means done, and a `kanban: <reason>` line means the mirror is off and says why. Both are
148
+ exit 0 and they are not interchangeable — say which one you got. Only if it moved, confirm placement
149
+ with a **grep for `#$ARGUMENTS`** on the board it named (with surrounding heading context —
150
+ `grep -B20 '#$ARGUMENTS' | grep '^##'`, or an offset-limited Read around the match): exactly one card,
151
+ under the `shipped` heading — never re-read the whole board into context.
152
+
153
+ ## 5. After the PR — CI gate + teardown
154
+
155
+ - If `host: github` and `gh` is available, watch the PR's checks (`gh pr checks <url> --watch`) and
156
+ report the result — the human merges only on green. A red check ⇒ back to `/cohorte-fix $ARGUMENTS`,
157
+ **except** a red `release_notes.ci_job`: that one is this command's own miss, not a code finding —
158
+ write the note per §2b, commit, push, and re-watch. Never send a missing release note through `/cohorte-fix`.
159
+ - Once the PR is **merged** (the human says so, or §0's `gh pr view` shows `MERGED`): set the spec's
160
+ `status: merged` (and `pr: <num>` — `/cohorte-revert` finds the merge commit from it) and commit that one line on the default branch when the human next commits there
161
+ (or leave it to `/cohorte-doctor`'s reconcile — it does the same check). If `isolation.enabled`, propose the teardown —
162
+ `scripts/remove-feature.sh $ARGUMENTS` (add `--drop-db` to also drop the feature db; kept by
163
+ default). It removes the worktree, deletes the merged branch, frees the slot. Never run it before
164
+ the merge is confirmed, and only with the human's go-ahead (the gate will ask anyway).
165
+ - Feature closed — **recommend a `/clear`** before starting the next one; nothing from this session
166
+ is needed again (spec `merged`, board updated). `specs/reports/$ARGUMENTS.*` is a gitignored
167
+ buffer and can be deleted now.
@@ -0,0 +1,114 @@
1
+ ---
2
+ description: Interactively capture a frozen feature spec (or apply a review return) into specs/<id>.md.
3
+ argument-hint: [paste brainstorm return OR review report]
4
+ ---
5
+
6
+ You run the **spec** step in the main thread — interactive, with the human. Pasted input below:
7
+
8
+ **$ARGUMENTS**
9
+
10
+ > Read `PIPELINE.md` first: `contract` (mechanism/path — so §5 names the right schema types),
11
+ > `design.enabled` (whether §8 matters), and §Conventions. Use `specs/_template.md` as the section list.
12
+ >
13
+ > **Decision journal** (`<core>/pipeline/schema/decisions.md`): read `specs/_decisions.md` §Live if it exists — one
14
+ > line per standing decision, so it is cheap. It is the ONLY place the project's transverse rules
15
+ > live; a spec that contradicts one silently un-decides it. Absent ⇒ nothing to honour yet.
16
+ >
17
+ > **Kanban** (`<core>/pipeline/schema/kanban.md`): when the spec opens, run
18
+ > `<core>/pipeline/scripts/kanban-move.sh auto <feature_id> spec --title "<human title>"`; on freeze
19
+ > (`status: frozen`, Mode A), the same call with `ready`. `auto` resolves the board from the config itself and exits 0 with a
20
+ > `kanban: <reason>` line when there is none — so **never decide "no board is configured" without
21
+ > running it**.
22
+
23
+ Detect the mode from the pasted content:
24
+
25
+ ## Mode A — new spec (input is a brainstorm return, or empty)
26
+
27
+ 1. If empty, look for a staged brainstorm return first — `specs/reports/*-brainstorm.md` (where
28
+ `/cohorte-brainstorm` stages its output); one match ⇒ read it and confirm, several ⇒ ask which. None ⇒
29
+ ask the human to paste the return (or describe the feature) and wait.
30
+ 2. **Take the `feature_id` from the return's front-matter** (or its staged filename,
31
+ `<feature_id>-brainstorm.md`) — **never re-derive it**: the brainstorm (or `/cohorte-intake`
32
+ before it) already created the kanban card `#<feature_id>`, and a new slug forks a second card
33
+ and strands the first. Only when there is no return (a described feature, or a return predating
34
+ the front-matter) derive a kebab-case slug, and confirm it.
35
+ 2b. **Size budget — a spec is a contract, not a novel.** Target ≤ ~300 lines; hard-think at 500.
36
+ Every implementer re-reads the whole spec on every first build, so each extra line is paid
37
+ `surfaces × dispatches` times. If the feature genuinely needs more, that's the signal it is TWO
38
+ features: propose a split (e.g. `<id>-core` + `<id>-admin`, each independently shippable, the
39
+ second consuming the first's contract) and let the human pick. Trim the usual bloat before
40
+ writing: exhaustive UI walkthroughs (the design brief carries those), restated conventions
41
+ (PIPELINE.md carries those), speculative edge cases nobody asked for.
42
+ 3. Walk the human through each section of `specs/_template.md`, **section by section**, with focused
43
+ questions. The critical one is **§5 API CONTRACT** — pin down every endpoint/interface (method, path,
44
+ auth/role, request fields with types/validation, success envelope + data shape, and every error case),
45
+ and name the exact schema/types that will live in the contract file (`contract.path/<id>.<ext>` in the
46
+ profile's `mechanism`). Don't move on until frontend and backend could each build from it with zero
47
+ further questions. _If `contract.enabled` is false, capture the interface precisely in prose instead._
48
+ 4. Capture the **design brief** content (only if `design.enabled` / the feature has UI): screens,
49
+ states, components, responsive notes — it will be authored to `specs/design/<id>.md` in step 6;
50
+ spec §8 carries only a short summary + the pointer `> full brief: specs/design/<id>.md` (so
51
+ non-design surfaces never re-read the full brief on every dispatch).
52
+ 4b. **New-surface heads-up.** If the feature clearly introduces an area no existing `surfaces[].path`
53
+ owns (a new service/app/top-level module), note it in the spec (a line in the relevant task section:
54
+ `> needs new surface: <proposed key/path>`). Don't render agents here — `/cohorte-build` §1.5 auto-reconciles
55
+ it. This is just so the human isn't surprised when `/cohorte-build` proposes a new agent.
56
+ 4c. **Migrations → a way back.** If §4 adds or alters a migration (or the contract changes what is
57
+ persisted), set `migrations: true` in the front-matter and fill `## Rollback` with the human —
58
+ what to revert, what data is lost or irreversible, the exact down step on the dev DB
59
+ (`commands.migrate_down` when it fits). `<core>/pipeline/schema/verify.md` §Migrations. Before the
60
+ freeze, `<core>/pipeline/scripts/verify-run.sh rollback-check specs/<id>.md` must exit 0 —
61
+ `/cohorte-ship` refuses the spec otherwise. Tag DoD lines only a running app can prove
62
+ `· runtime: <check>` (see the template's §9 note), and drop the template's runtime lines that
63
+ do not apply: `rollback` without `migrations: true`, and `e2e` when the profile has no
64
+ `commands.e2e` (retag it `smoke`, or bare `· runtime` for a human check).
65
+ 5. When the human validates, **freeze**: write `specs/<id>.md` (`status: frozen`, front-matter filled).
66
+ Create the file — do not ask the human to. **Postcondition:** `grep -q '^status: frozen' specs/<id>.md`
67
+ — if it fails the freeze didn't land; fix it before pointing the human at `/cohorte-build`.
68
+ 5b. **Record the transverse decisions — the journal, not a summary.** Walk what the interview settled
69
+ and keep ONLY the decisions that **outlive this feature**: a rule the next spec would otherwise
70
+ re-litigate or contradict (auth model, id/naming scheme, where a kind of state lives, an error
71
+ convention, a deliberate non-goal that binds future features). Typical yield: **0–3 lines**; zero
72
+ is a normal, healthy outcome for a feature that decided nothing new — never invent lines to fill
73
+ the section. Append them to `specs/_decisions.md` §Live (create the file from
74
+ `<core>/templates/decisions.template.md` on first use), each exactly:
75
+ `- <YYYY-MM-DD> · <area> · <decision> — because <reason> · <feature_id>`
76
+ - **Never** duplicate what §5, `PIPELINE.md` §Conventions or the code already states — the journal
77
+ carries the *non-obvious rule*, not the feature's content. A line that restates a spec section is
78
+ a line every future `/cohorte-spec` pays for and learns nothing from.
79
+ - **Contradicting an existing line** is allowed but never silent: tell the human which line this
80
+ feature overrides, get their go-ahead, then append the new line with
81
+ `· supersedes <YYYY-MM-DD> <area>` and move the old one to `## Superseded`.
82
+ - Append with one `>>` Bash call, not a full-file rewrite (the file is append-only, and reading it
83
+ back to re-write it is the one way to make a bounded file expensive).
84
+ 6. Author the **design brief** — `specs/design/<id>.md`, rendered via
85
+ `<core>/templates/design-brief.md`.
86
+ _Only if `design.enabled` / the feature has UI; skip entirely for a backend-only feature._
87
+ - **Write it to `specs/design/<id>.md`** (the authored artifact, versioned with the spec; spec §8
88
+ holds the summary + pointer). Create the file — do not ask the human to. Keep it in the
89
+ `specs/design/` subfolder, **not** `specs/<id>....md`: the `specs/*.md` glob that drives the
90
+ kanban backfill and `/cohorte-doctor` is non-recursive, so a brief in the subfolder never gets mistaken
91
+ for a spec (no phantom card, no bogus stage). Overwrite it on every freeze.
92
+ - Print ONLY the path + a one-line summary — never echo the brief into chat (it would sit in this
93
+ session's history; echo it only if the human asks). Tell the human: copy it from
94
+ `specs/design/<id>.md` into the design tool (if any — typically a fresh design project for this
95
+ feature), then run `/cohorte-build <id>` and hand its design gate the resulting page link(s) — a full
96
+ `https://claude.ai/design/p/<projectId>?file=<file>` link carries its own project + page, no
97
+ profile change needed. (They can also paste the links into the spec's `design_files` themselves.)
98
+ **Recommend a `/clear` before `/cohorte-build`** — the frozen spec + `specs/design/<id>.md` are the whole
99
+ handoff.
100
+
101
+ ## Mode B — review return (input is a REVIEW REPORT)
102
+
103
+ 1. Read the report — pasted as input, or (whenever nothing is pasted) read from
104
+ `specs/reports/<id>.md`, where `/cohorte-review` stages its last report. Identify `feature_id` from its
105
+ header; open `specs/<id>.md`.
106
+ 2. Append each finding to the spec's **`## Remediation`**, one per line:
107
+ `- [ ] <severity> · <file:line> · <spec-violation|quality|security|complexity> · <concrete fix>`
108
+ (Keep prior items; add the new round under a dated/numbered subheading.)
109
+ 3. If a finding implies the **contract** must change, update §5 and flag it so the lead re-authors the
110
+ contract file.
111
+ 4. Set `status: in-review`. Tell the human to run `/cohorte-build <id>` to re-dispatch fresh agents.
112
+ **Recommend a `/clear` before `/cohorte-build`** — the spec is the whole handoff.
113
+
114
+ In both modes the spec is the single source of truth; agents are stateless and read only it + the diff.
@@ -0,0 +1,119 @@
1
+ ---
2
+ model: sonnet
3
+ description: Refresh the machine-wide pipeline core, re-wire this repo (gate, pointer) and reconcile its generated files — /cohorte-init-pipeline stays one-time.
4
+ argument-hint: [path-to-local-checkout]
5
+ ---
6
+
7
+ You are the **pipeline updater**. Refresh the machine-wide core to the latest published version, re-wire
8
+ this repo against it, then bring the repo's generated files up to the new core (§3.5) — additively, never
9
+ clobbering the human's choices — so `/cohorte-init-pipeline` never needs re-running for an upgrade.
10
+ The installer never touches `PIPELINE.md`, the surface agents, `gate-config.json` or the filled `<config>`.
11
+
12
+ ## 1. Current version
13
+
14
+ Read `<core>/pipeline/VERSION` (a semver) and this repo's `<state>/pipeline.json` `core_version`. Note
15
+ both. A pointer that still carries `"mode": "bundled"` or `"mode": "global"` is a **2.x repo**: §2b
16
+ migrates it.
17
+
18
+ ## 2. Run the update
19
+
20
+ ```sh
21
+ npm i -g cohorte@latest && cohorte update # refresh the CLI, then the machine-wide core
22
+ ```
23
+
24
+ If `cohorte` is not on PATH, `npx cohorte@latest update` does the same. If `$ARGUMENTS` is a path to a
25
+ local checkout of the cohorte repo (it contains `bin/cli.js`), run `node <path>/bin/cli.js update`
26
+ instead — useful when iterating on the pipeline itself. `cohorte update` exits non-zero and changes
27
+ nothing if `~/.claude/settings.json` is not valid JSON: show the error and stop.
28
+
29
+ ## 2b. Re-wire this repo — run `<sync>`
30
+
31
+ Always, from the repo root (one Bash call), and show its output. It refreshes the committed gate
32
+ (`.claude/hooks/cohorte-gate.py`) and its registration, bumps the `<state>/pipeline.json` pointer,
33
+ writes `<state>/profile.json` from the current `PIPELINE.md`, and keeps the `.gitignore` entries.
34
+ On a **2.x repo** it also removes the vendored core (`.claude/pipeline/`,
35
+ `.claude/templates/`, `.claude/workflows/`, `.claude/commands/cohorte-*.md`, `.claude/agents/{review,release,profile-reader}.md`,
36
+ `.claude/hooks/gate.py`): files git tracks unmodified are deleted (git keeps them), anything else is moved
37
+ to `.claude/cohorte-legacy-backup/`. Tell the human to commit the result.
38
+
39
+ If this repo's surface agents are missing from `<agents>/` but exist in `~/.claude/agents/` (a 2.x
40
+ "global" repo rendered them there), re-render them into `<agents>/` in §3.5 — do not copy the global
41
+ files, render from the current template — and tell the human the global copies can be deleted once no
42
+ other repo uses them.
43
+
44
+ ## 3. Report old → new
45
+
46
+ Re-read the VERSION file(s) and print `old → new`. If unchanged, say the core was already up to date.
47
+
48
+ Then print **What's new**: read the installed `<core>/pipeline/CHANGELOG.md` and show the entries
49
+ between the old and new versions (most recent first). File absent ⇒ the old core predates 0.1.14 —
50
+ skip silently.
51
+
52
+ ## 3.5 Reconcile this repo's generated files
53
+
54
+ Only when the current repo has a `PIPELINE.md`: run the **Reconcile procedure** from the installed
55
+ `<core>/pipeline/schema/reconcile.md` — top up the profile's machine block with new fields at their defaults
56
+ (one batched question set for any genuinely new human decision — e.g. choosing a `retrieval` provider,
57
+ or the **quiet command variants**: `test_quiet_cmd`/`lint_quiet_cmd` + `commands.test_quiet`/
58
+ `lint_quiet`, proposing the detected bridled forms per `<core>/pipeline/schema/output-discipline.md`; `gate.preflight` tops up
59
+ silently at its defaults), re-render the surface agents from the current `implementer.template.md`
60
+ (this refreshes each agent's **baked §Conventions slice** — required after any hand-edit of the
61
+ profile's prose).
62
+ Additively patch the `settings.json` permissions and `gate-config.json` (including the `preflight`
63
+ block and the workflow-agent `allow` entries from init step 5) — never the gate hook entries, `<sync>`
64
+ owns those — and run any newly-added capability's wiring (e.g. Serena's project-scope `claude mcp add`).
65
+ Verify the refreshed core actually carries `<workflows>/cohorte-review.js` + `<fixed-agents>/cohorte-profile-reader.md`
66
+ — missing means the update half-ran: re-run `cohorte update`. Even when no capability is new, **re-run the retrieval provider's
67
+ health check** (`<core>/pipeline/schema/retrieval.md`: CLI resolvable from PATH, `.mcp.json` entry present —
68
+ upgrading a bare `serena` entry to the PATH-proof launcher form, `.serena/` gitignored, server
69
+ actually connected) and repair whatever fails — wiring that worked at
70
+ init can rot (PATH changes, uninstalls, hand-edits). **Then run `<sync>` once more** — §2b ran it
71
+ before the top-up, so `<state>/profile.json` (the parsed machine block the agents read) still
72
+ describes the old profile; this second run regenerates it. Report what was reconciled; if nothing was
73
+ missing, say so. This is why `/cohorte-init-pipeline` never needs re-running for a core upgrade.
74
+
75
+ Four of the §Reconcile steps matter specifically here:
76
+
77
+ - **Local-artifact hygiene** (§Reconcile step 8): gitignore + untrack the pipeline's runtime files
78
+ (`<state>/preflight.ok`, `<state>/pipeline-metrics.jsonl`, `specs/reports/`). A tracked
79
+ `preflight.ok` — what every pre-2.0.0 install ends up with once a release agent stages `.claude/` —
80
+ makes the phase gate ask on every single review dispatch, so fix it here and say so.
81
+
82
+ - **Spec-template top-up** (§Reconcile step 7): `specs/_template.md` was seeded at install and never
83
+ refreshed since, so add the front-matter fields the current `templates/spec.template.md` has and the
84
+ repo's copy lacks — and drop `loop_pass`/`loop_phase`, retired with the 2.2.0 conversational loop driver —
85
+ front-matter only, never the body.
86
+
87
+ - **Global config seed** (§Reconcile step 5): if `<config>` is absent, seed it
88
+ from the template so the kanban + shared-vault config has a home. Never clobber an existing filled
89
+ file. Report what was seeded. Then **scrub the retired `telemetry:` block** if the existing file
90
+ still has one (every install seeded before 2.3.0 does) — one targeted Edit deleting the block and
91
+ its comment header, nothing else touched. That capability was removed in 2.3.0, sender included,
92
+ so the block is dead config: nothing reads it, and an `enabled: true` left sitting in a file the
93
+ human may open reads as though data were still leaving the machine. Say you removed it.
94
+ - **Kanban sync** (§Reconcile step 6): resolve this project's board with
95
+ `<core>/pipeline/scripts/kanban-move.sh --check` — it prints either the board path or the exact
96
+ missing link. **Not linked** → offer to link/create a board (confirm the vault + `<folder>/Tasks.md`,
97
+ write the `boards` entry, create the board file per `<core>/pipeline/schema/kanban.md`). **Linked** → verify the board file
98
+ exists (recreate if the human confirms) and its columns match `kanban.columns` (repair drift). Either
99
+ way, run the §Kanban **full sync/backfill** from `specs/*.md` — one
100
+ `kanban-move.sh auto <id> <stage>` per spec, `<stage>` from the status mapping — this is what adds
101
+ every already-developed feature to the board and repositions cards to match each spec's `status`.
102
+ Report cards added / moved / already-correct. Skip silently if `kanban.enabled` is false and the
103
+ human doesn't want to turn it on.
104
+ - **A project renamed since its last update loses its board silently** — `boards` is keyed by the
105
+ profile `name`, so a `name:` edit orphans the old entry and no lookup matches the new one. When
106
+ `--check` finds no entry for `<name>` but `boards` holds exactly one other key whose board file
107
+ exists, say so and offer to re-key it rather than creating a second board.
108
+
109
+ ## 4. Tell the human the follow-ups
110
+
111
+ - **Restart / reload the coding-agent session** so it picks up updated commands, agents, and any
112
+ newly-registered MCP server.
113
+ - **Other repos using the global core:** their core is already fresh, but reconcile is per-repo — run
114
+ `/cohorte-update-pipeline` inside each (it will skip the already-done core update and just reconcile).
115
+ - **Commit** the reconciled files (`PIPELINE.md`, `.claude/` — including `.claude/profile.json` —,
116
+ `.mcp.json` if added) so teammates get them.
117
+ - The kanban config is global and user-scoped
118
+ (`<config>`) — never committed. The core update never touches it; only the
119
+ reconcile above seeds the file and writes kanban board links (into that global file, not the repo).
@@ -0,0 +1,106 @@
1
+ ---
2
+ model: sonnet
3
+ description: Run the app between review and ship (migrations, dev server, smoke/e2e, screenshots) and tick only the runtime DoD items it has evidence for.
4
+ argument-hint: <feature_id>
5
+ ---
6
+
7
+ You are the **lead**. Verify feature **$ARGUMENTS** at runtime, which is the step that actually
8
+ runs the app. Rules: `<core>/pipeline/schema/verify.md`. Read it before §2's call if it is not in
9
+ your context already.
10
+
11
+ > **No kanban move.** The board has no verify column and the card stays in Review. This command
12
+ > calls no `kanban-move.sh` on purpose.
13
+ >
14
+ > **The script does the process work.** Everything below goes through
15
+ > `<core>/pipeline/scripts/verify-run.sh`:
16
+ > - Never start, probe or kill a server yourself, and never run a migration outside it.
17
+ > - Never touch git (no checkout, commit, push or merge).
18
+ > - Never point an `.env` at another database.
19
+ > - A server left behind is stopped with `verify-run.sh stop $ARGUMENTS`, not with `kill`.
20
+
21
+ ## 0. Configured?
22
+
23
+ Read `<state>/profile.json` (fall back to `PIPELINE.md`'s `yaml pipeline-profile` block). Verify
24
+ applies only when both hold:
25
+ - `verify.enabled` is not `false`;
26
+ - the profile has `commands.smoke`, `commands.e2e`, or `commands.dev` **with** `commands.dev_ready`,
27
+ or the spec has `migrations: true` and the profile has a `commands.migrate`.
28
+
29
+ Otherwise say "no runtime commands in the profile, so there is nothing to verify (and `/cohorte-ship`
30
+ will not ask)" and stop.
31
+
32
+ ## 1. Inputs
33
+
34
+ - `specs/$ARGUMENTS.md` must exist. `status: merged` or `abandoned` ⇒ stop (a merged feature is
35
+ undone with `/cohorte-revert`, not re-verified). Any other status is fine. Verify normally follows
36
+ a `SHIP` verdict, but nothing forbids an earlier run.
37
+ - From the front-matter, take `migrations` (absent means `false`) and `reviewed_base`.
38
+ - `reviewed_base` present ⇒ pass it as `--digest-base`; `/cohorte-ship` compares that digest
39
+ with `reviewed_digest`.
40
+ - Absent ⇒ omit `--digest-base`, and say that ship will treat this run as unanchored.
41
+ - Touched surfaces: `<core>/pipeline/scripts/feature-diff.sh --default <default_branch> --name-only`,
42
+ grouped by `surfaces[].path`. Only their `verify.surfaces.<key>` hints are used.
43
+ - **In a feature worktree** (`git rev-parse --git-dir` ≠ `--git-common-dir`) with
44
+ `isolation.enabled`, substitute the slot's ports into every URL, as described in
45
+ `<core>/pipeline/schema/verify.md` §Ports.
46
+
47
+ ## 2. One call
48
+
49
+ Build it from the profile and leave out each bracketed part whose input is `""` or absent. Run it
50
+ in one Bash call with the **timeout at 600000 ms**:
51
+
52
+ ```
53
+ <core>/pipeline/scripts/verify-run.sh run $ARGUMENTS --digest-base <reviewed_base> \
54
+ [--migrate "<commands.migrate>" [--migrate-down "<commands.migrate_down, else commands.rollback>"] \
55
+ --db <verify.db, default local> --db-per-worktree <isolation.db_per_worktree, default false> \
56
+ --slots <isolation.registry, default .worktrees/slots.tsv>] \
57
+ [--dev "<commands.dev>" --ready "<commands.dev_ready>"] \
58
+ [--check "smoke=<commands.smoke>"] [--check "smoke:<key>=<verify.surfaces.<key>.smoke>"]… \
59
+ [--check "e2e=<commands.e2e>"] \
60
+ [--screenshot "<key><path>=<base_url><path>"]… \
61
+ [--skip "rollback=no commands.migrate_down in the profile"] \
62
+ --ready-timeout <verify.ready_timeout_seconds, 90> --check-timeout <verify.check_timeout_seconds, 600>
63
+ ```
64
+
65
+ - The `--migrate…` group goes in **only** when the spec says `migrations: true`. Add `--skip
66
+ "rollback=…"` when it does but the profile has no down command.
67
+ - `--screenshot` is left out when `verify.screenshots: off`. Use one per `verify.surfaces.<key>.paths`
68
+ entry of a touched surface. The `base_url` defaults to `dev_ready`'s origin.
69
+ - `--dev` without `--ready` is a usage error by design.
70
+
71
+ Route on the exit code:
72
+ - **4**: the gate would ask. The script printed the commands and started nothing. Show the human
73
+ that list and ask once. On yes, re-run the identical call plus `--confirmed`. On no, stop.
74
+ - **2**: usage. Fix the call. Never improvise the steps by hand.
75
+ - **0 / 1 / 3** (PASS / FAIL / SKIPPED): read `specs/reports/$ARGUMENTS.verify.json`. Keep only
76
+ `verdict`, `reason` and each check's `name · status · note` in context. On a FAIL, `tail -40` the
77
+ failing check's `log` and nothing else.
78
+
79
+ ## 3. Tick the runtime DoD items it proved
80
+
81
+ Go through the spec's `## 9. Acceptance criteria / DoD`, handling only the `- [ ]` lines that carry
82
+ `· runtime`:
83
+ - A line with `· runtime: <check>` ⇒ tick it (`- [x]`) **only** if verify.json has at least one
84
+ check named `<check>` or `<check>:…`, and all of them are `PASS`. Leave everything else alone. A
85
+ `SKIPPED` check proves nothing.
86
+ - A bare `· runtime` is never ticked. It needs a human eye.
87
+ - Never tick an untagged line, never untick a line, and edit nothing else in the spec.
88
+
89
+ Append to `specs/reports/$ARGUMENTS.verify.md`, under `## DoD`, one line per runtime item:
90
+ - a ticked item: `- [x] <item> — evidence: <log path>`;
91
+ - an open item: `- [ ] <item> — needs a human eye (evidence: <screenshot paths, or none>)`.
92
+
93
+ ## 4. Report
94
+
95
+ One line for the verdict and one per check (`<name> · <status> · <note>`), then the items you
96
+ ticked. Then route:
97
+ - **PASS** ⇒ `/cohorte-ship $ARGUMENTS`. Name any bare `· runtime` items the human should look at
98
+ first, with their screenshot paths.
99
+ - **FAIL** ⇒ a runtime finding. Have the human run `/cohorte-fix $ARGUMENTS` with the failing
100
+ check's line and log path pasted. After the fix, `/cohorte-review` and then `/cohorte-verify`
101
+ again (the code changed, so both verdicts are stale). `/cohorte-ship` blocks until a newer run
102
+ passes.
103
+ - **SKIPPED** ⇒ say why (the `reason`, or the gate-denied checks). `/cohorte-ship` will ask the
104
+ human whether to ship unverified.
105
+
106
+ **Recommend a `/clear`.** The verdict, logs and ticks are all on disk.