cohorte 2.10.1 → 3.0.0-dev.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 (211) hide show
  1. package/README.md +7 -0
  2. package/assets/manifest.json +193 -0
  3. package/assets/migrations/config/README.md +12 -0
  4. package/assets/migrations/state/0001_init.sql +154 -0
  5. package/assets/prompts/README.md +11 -0
  6. package/assets/prompts/agents/fixer.md +7 -0
  7. package/assets/prompts/agents/implementer.md +12 -0
  8. package/assets/prompts/agents/reviewer.md +8 -0
  9. package/assets/prompts/agents/security-reviewer.md +7 -0
  10. package/assets/prompts/phases/build.md +5 -0
  11. package/assets/prompts/phases/review.md +5 -0
  12. package/assets/prompts/phases/test.md +5 -0
  13. package/assets/prompts/system.md +11 -0
  14. package/assets/schemas/agent-output.schema.json +225 -0
  15. package/assets/schemas/auth-status.schema.json +87 -0
  16. package/assets/schemas/command-result.schema.json +192 -0
  17. package/assets/schemas/commands.schema.json +952 -0
  18. package/assets/schemas/config.schema.json +2259 -0
  19. package/assets/schemas/doctor-report.schema.json +104 -0
  20. package/assets/schemas/events.schema.json +8514 -0
  21. package/assets/schemas/fake-script.schema.json +549 -0
  22. package/assets/schemas/inspect.schema.json +3133 -0
  23. package/assets/schemas/manifest.schema.json +79 -0
  24. package/assets/schemas/ownership.schema.json +52 -0
  25. package/assets/schemas/policy-verdict.schema.json +282 -0
  26. package/assets/schemas/project-model.schema.json +783 -0
  27. package/assets/schemas/project-status.schema.json +217 -0
  28. package/assets/schemas/reconcile-plan.schema.json +155 -0
  29. package/assets/schemas/run-diff.schema.json +177 -0
  30. package/assets/schemas/run-snapshot-manifest.schema.json +2104 -0
  31. package/assets/schemas/run-state.schema.json +1755 -0
  32. package/assets/schemas/runtime-capabilities.schema.json +1545 -0
  33. package/assets/schemas/sandbox-capabilities.schema.json +116 -0
  34. package/assets/schemas/skill.schema.json +87 -0
  35. package/assets/schemas/spec.schema.json +202 -0
  36. package/assets/schemas/tool-catalogue.schema.json +655 -0
  37. package/assets/schemas/trust-record.schema.json +38 -0
  38. package/assets/skills/README.md +9 -0
  39. package/assets/skills/inspect-surface.md +4 -0
  40. package/dist/agent-host.mjs +50 -0
  41. package/dist/agent-host.mjs.map +1 -0
  42. package/dist/bundle-manifest.json +102 -0
  43. package/dist/chunks/__host-DgGPyco9.mjs +18 -0
  44. package/dist/chunks/__host-DgGPyco9.mjs.map +1 -0
  45. package/dist/chunks/approve-Cv135UqI.mjs +19 -0
  46. package/dist/chunks/approve-Cv135UqI.mjs.map +1 -0
  47. package/dist/chunks/auth-BT5oVp76.mjs +132 -0
  48. package/dist/chunks/auth-BT5oVp76.mjs.map +1 -0
  49. package/dist/chunks/auth-D8rCVY33.mjs +84 -0
  50. package/dist/chunks/auth-D8rCVY33.mjs.map +1 -0
  51. package/dist/chunks/brainstorm-CU10T1tm.mjs +7 -0
  52. package/dist/chunks/brainstorm-CU10T1tm.mjs.map +1 -0
  53. package/dist/chunks/cancel-KV_cpsqS.mjs +15 -0
  54. package/dist/chunks/cancel-KV_cpsqS.mjs.map +1 -0
  55. package/dist/chunks/canonical-C8UxeEmB.mjs +57 -0
  56. package/dist/chunks/canonical-C8UxeEmB.mjs.map +1 -0
  57. package/dist/chunks/catalogue-BvwSrM_j.mjs +1549 -0
  58. package/dist/chunks/catalogue-BvwSrM_j.mjs.map +1 -0
  59. package/dist/chunks/compose-Cr0hP0qm.mjs +7303 -0
  60. package/dist/chunks/compose-Cr0hP0qm.mjs.map +1 -0
  61. package/dist/chunks/config-DefHA2Lw.mjs +96 -0
  62. package/dist/chunks/config-DefHA2Lw.mjs.map +1 -0
  63. package/dist/chunks/contract-B0ra2-bm.mjs +295 -0
  64. package/dist/chunks/contract-B0ra2-bm.mjs.map +1 -0
  65. package/dist/chunks/contract-vYbwYr0Y.mjs +123 -0
  66. package/dist/chunks/contract-vYbwYr0Y.mjs.map +1 -0
  67. package/dist/chunks/deny-ClTxSvHJ.mjs +15 -0
  68. package/dist/chunks/deny-ClTxSvHJ.mjs.map +1 -0
  69. package/dist/chunks/diff-Qw0II0sj.mjs +101 -0
  70. package/dist/chunks/diff-Qw0II0sj.mjs.map +1 -0
  71. package/dist/chunks/discover-30Ciya_0.mjs +20 -0
  72. package/dist/chunks/discover-30Ciya_0.mjs.map +1 -0
  73. package/dist/chunks/doctor-DfCrKpfT.mjs +222 -0
  74. package/dist/chunks/doctor-DfCrKpfT.mjs.map +1 -0
  75. package/dist/chunks/fix-D4Tj8RVA.mjs +18 -0
  76. package/dist/chunks/fix-D4Tj8RVA.mjs.map +1 -0
  77. package/dist/chunks/gc-BBXlBF5w.mjs +161 -0
  78. package/dist/chunks/gc-BBXlBF5w.mjs.map +1 -0
  79. package/dist/chunks/init-Okz4mlhW.mjs +30 -0
  80. package/dist/chunks/init-Okz4mlhW.mjs.map +1 -0
  81. package/dist/chunks/inspect-Buby4cQD.mjs +22 -0
  82. package/dist/chunks/inspect-Buby4cQD.mjs.map +1 -0
  83. package/dist/chunks/logs-Giq5sUau.mjs +25 -0
  84. package/dist/chunks/logs-Giq5sUau.mjs.map +1 -0
  85. package/dist/chunks/migrate-DRoFUg53.mjs +19 -0
  86. package/dist/chunks/migrate-DRoFUg53.mjs.map +1 -0
  87. package/dist/chunks/models-Btp6X2YZ.mjs +24 -0
  88. package/dist/chunks/models-Btp6X2YZ.mjs.map +1 -0
  89. package/dist/chunks/pause-BASBfKLO.mjs +16 -0
  90. package/dist/chunks/pause-BASBfKLO.mjs.map +1 -0
  91. package/dist/chunks/policy-DUIgzF3W.mjs +139 -0
  92. package/dist/chunks/policy-DUIgzF3W.mjs.map +1 -0
  93. package/dist/chunks/providers-Dx78imKj.mjs +19 -0
  94. package/dist/chunks/providers-Dx78imKj.mjs.map +1 -0
  95. package/dist/chunks/reconcile-BfD785gd.mjs +26 -0
  96. package/dist/chunks/reconcile-BfD785gd.mjs.map +1 -0
  97. package/dist/chunks/render-DyZr5Lgi.mjs +53 -0
  98. package/dist/chunks/render-DyZr5Lgi.mjs.map +1 -0
  99. package/dist/chunks/resume-GJQRb2Eb.mjs +15 -0
  100. package/dist/chunks/resume-GJQRb2Eb.mjs.map +1 -0
  101. package/dist/chunks/retry-CLrUem1H.mjs +15 -0
  102. package/dist/chunks/retry-CLrUem1H.mjs.map +1 -0
  103. package/dist/chunks/review-BDdjb6kB.mjs +17 -0
  104. package/dist/chunks/review-BDdjb6kB.mjs.map +1 -0
  105. package/dist/chunks/run-CgTWYlcd.mjs +82 -0
  106. package/dist/chunks/run-CgTWYlcd.mjs.map +1 -0
  107. package/dist/chunks/run-tool-C3rAv4XF.mjs +26 -0
  108. package/dist/chunks/run-tool-C3rAv4XF.mjs.map +1 -0
  109. package/dist/chunks/schema-C9QbUW4H.mjs +578 -0
  110. package/dist/chunks/schema-C9QbUW4H.mjs.map +1 -0
  111. package/dist/chunks/send-BdnJ85Nz.mjs +19 -0
  112. package/dist/chunks/send-BdnJ85Nz.mjs.map +1 -0
  113. package/dist/chunks/ship-DTuLGoaJ.mjs +19 -0
  114. package/dist/chunks/ship-DTuLGoaJ.mjs.map +1 -0
  115. package/dist/chunks/shutdown-BM92Iyv2.mjs +15 -0
  116. package/dist/chunks/shutdown-BM92Iyv2.mjs.map +1 -0
  117. package/dist/chunks/skip-DZG5kpcH.mjs +18 -0
  118. package/dist/chunks/skip-DZG5kpcH.mjs.map +1 -0
  119. package/dist/chunks/spec-Bq0P3jVh.mjs +20 -0
  120. package/dist/chunks/spec-Bq0P3jVh.mjs.map +1 -0
  121. package/dist/chunks/src-CId6kMsY.mjs +1689 -0
  122. package/dist/chunks/src-CId6kMsY.mjs.map +1 -0
  123. package/dist/chunks/src-CfAOde7C.mjs +5403 -0
  124. package/dist/chunks/src-CfAOde7C.mjs.map +1 -0
  125. package/dist/chunks/src-Cu3TxNob.mjs +783 -0
  126. package/dist/chunks/src-Cu3TxNob.mjs.map +1 -0
  127. package/dist/chunks/src-DcU4IXMe.mjs +117 -0
  128. package/dist/chunks/src-DcU4IXMe.mjs.map +1 -0
  129. package/dist/chunks/src-JxawBQBn.mjs +446 -0
  130. package/dist/chunks/src-JxawBQBn.mjs.map +1 -0
  131. package/dist/chunks/src-s7YRvk0t.mjs +2116 -0
  132. package/dist/chunks/src-s7YRvk0t.mjs.map +1 -0
  133. package/dist/chunks/status-SMjiOMYy.mjs +29 -0
  134. package/dist/chunks/status-SMjiOMYy.mjs.map +1 -0
  135. package/dist/chunks/tail-BuhT-2PH.mjs +25 -0
  136. package/dist/chunks/tail-BuhT-2PH.mjs.map +1 -0
  137. package/dist/chunks/update-BXIppsbi.mjs +16 -0
  138. package/dist/chunks/update-BXIppsbi.mjs.map +1 -0
  139. package/dist/cli.mjs +175 -0
  140. package/dist/cli.mjs.map +1 -0
  141. package/package.json +17 -32
  142. package/CHANGELOG.md +0 -1461
  143. package/bin/cli.js +0 -817
  144. package/bin/report.js +0 -141
  145. package/core/adapter/render.js +0 -415
  146. package/core/agents/implementer.template.md +0 -142
  147. package/core/agents/profile-reader.md +0 -50
  148. package/core/agents/release.md +0 -58
  149. package/core/agents/review.md +0 -179
  150. package/core/commands/cohorte-align-ds.md +0 -33
  151. package/core/commands/cohorte-audit.md +0 -58
  152. package/core/commands/cohorte-brainstorm.md +0 -70
  153. package/core/commands/cohorte-build.md +0 -219
  154. package/core/commands/cohorte-doctor.md +0 -194
  155. package/core/commands/cohorte-fix.md +0 -80
  156. package/core/commands/cohorte-fleet.md +0 -103
  157. package/core/commands/cohorte-init-pipeline.md +0 -31
  158. package/core/commands/cohorte-intake.md +0 -92
  159. package/core/commands/cohorte-patch.md +0 -118
  160. package/core/commands/cohorte-refactor.md +0 -59
  161. package/core/commands/cohorte-retro.md +0 -85
  162. package/core/commands/cohorte-review.md +0 -270
  163. package/core/commands/cohorte-ship.md +0 -122
  164. package/core/commands/cohorte-spec.md +0 -101
  165. package/core/commands/cohorte-update-pipeline.md +0 -165
  166. package/core/hooks/gate.py +0 -588
  167. package/core/runtimes/claude.json +0 -74
  168. package/core/runtimes/codex.json +0 -85
  169. package/core/runtimes/cursor.json +0 -76
  170. package/core/runtimes/gemini.json +0 -76
  171. package/core/runtimes/opencode.json +0 -73
  172. package/core/templates/agent-handoff.md +0 -34
  173. package/core/templates/brainstorm-return.md +0 -36
  174. package/core/templates/decisions.template.md +0 -42
  175. package/core/templates/design-brief.md +0 -44
  176. package/core/templates/patch.template.md +0 -86
  177. package/core/templates/pr-body.md +0 -25
  178. package/core/templates/review-feedback.md +0 -38
  179. package/core/templates/spec.template.md +0 -87
  180. package/core/templates/steps/init-pipeline/01-detect-stack.md +0 -44
  181. package/core/templates/steps/init-pipeline/02-interview-gaps.md +0 -55
  182. package/core/templates/steps/init-pipeline/03-draft-profile.md +0 -10
  183. package/core/templates/steps/init-pipeline/04-write-render.md +0 -145
  184. package/core/templates/steps/init-pipeline/05-report.md +0 -12
  185. package/core/workflows/audit.js +0 -240
  186. package/core/workflows/loop.js +0 -641
  187. package/core/workflows/refactor.js +0 -276
  188. package/core/workflows/review.js +0 -456
  189. package/install.ps1 +0 -103
  190. package/install.sh +0 -114
  191. package/lib/doctor.js +0 -534
  192. package/lib/runtime.js +0 -139
  193. package/lib/versions.js +0 -149
  194. package/lib/yaml.js +0 -129
  195. package/profile/PIPELINE.template.md +0 -259
  196. package/profile/SCHEMA.md +0 -735
  197. package/profile/cohorte.config.template.yaml +0 -43
  198. package/scripts/assert-gate-hook.mjs +0 -75
  199. package/scripts/kanban-move.sh +0 -313
  200. package/scripts/metrics/collect.mjs +0 -531
  201. package/scripts/metrics/prices.json +0 -42
  202. package/scripts/new-feature.sh.template +0 -98
  203. package/scripts/preflight.sh +0 -124
  204. package/scripts/remove-feature.sh.template +0 -56
  205. package/scripts/test-adapter.mjs +0 -437
  206. package/scripts/test-gate.mjs +0 -443
  207. package/scripts/test-kanban.mjs +0 -304
  208. package/scripts/test-lib.mjs +0 -356
  209. package/scripts/test-metrics.mjs +0 -156
  210. package/scripts/test-workflows.mjs +0 -758
  211. package/scripts/validate-core.mjs +0 -325
@@ -1,122 +0,0 @@
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** (SCHEMA.md §Kanban) 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
- ## 1. Pre-flight (confirm before doing anything irreversible)
21
-
22
- - Confirm the latest `/cohorte-review` returned **SHIP** (no CRITICAL, no security). If not reviewed, or the
23
- verdict was REVISE/BLOCK, stop and say so.
24
- - **Freshness gate** — the reviewed code must be exactly what ships. If the spec front-matter carries
25
- `reviewed_base` + `reviewed_digest`, recompute
26
- `git diff <reviewed_base> -- . ':(exclude)specs/' | sha256sum | cut -c1-16` (`shasum -a 256`
27
- then the first 16 hex chars where there is no `sha256sum` — macOS) and compare to
28
- `reviewed_digest`. **Match** ⇒ source unchanged since the SHIP verdict, proceed. **Mismatch** ⇒ source
29
- (or the contract) was edited after review — the verdict is **stale**: stop and tell the human to re-run
30
- `/cohorte-review $ARGUMENTS` before shipping. Missing fields (spec predates the gate) ⇒ skip, don't block.
31
- - **DoD gate (verify, don't tick — `/cohorte-review` owns the ticking).** Read `specs/$ARGUMENTS.md`
32
- §`Acceptance criteria / DoD`; if any item is still `- [ ]`, list the open ones and ask the human to
33
- confirm shipping anyway (they may be deferred on purpose — e.g. a UI item on a backend-only feature).
34
- All `- [x]` ⇒ proceed silently.
35
- - Show `git status` + `git diff --stat`; confirm the branch is `<prefix>$ARGUMENTS`, where `<prefix>`
36
- is `vcs.patch_branch_prefix` (falling back to `fix/` on a profile that predates the key) when the
37
- spec front-matter carries `kind: patch`, and `vcs.feature_branch_prefix` otherwise. Resolve it once
38
- here and pass the **literal** branch to §3's dispatch — the release agent must not re-derive it.
39
- - **Ask the human to confirm** they want to commit, push, and open the PR. Wait for yes.
40
- - After the yes: `<core>/pipeline/scripts/kanban-move.sh auto $ARGUMENTS ship`. Report what it
41
- printed — `moved #…` or `kanban: <reason>` — never a guess about which happened.
42
-
43
- ## 2. Mark the spec shipped (BEFORE dispatch, so it ships in the same commit)
44
-
45
- Once the human confirms, edit `specs/$ARGUMENTS.md` front-matter `status: → shipped` — **before**
46
- dispatching the release agent, so the status flip is part of the tree it commits (otherwise it lands
47
- uncommitted after the PR opens). Only flip after the human's "yes"; if they decline, leave it.
48
-
49
- ## 2b. Write the release note (only if `release_notes.enabled` — same reason: it must ship in the commit)
50
-
51
- `release_notes.enabled: false` (or `tool: none`) ⇒ skip this section entirely, silently.
52
-
53
- Otherwise **you** write it — never the release agent, never the implementers. Picking the bump is
54
- project policy and the prose is outward-facing copy; both are the lead's, exactly like the contract.
55
- See SCHEMA.md §Release notes.
56
-
57
- - Write `<release_notes.dir>/<release_notes.filename>` (`<feature_id>` substituted), front-matter
58
- carrying the **single** key `release_notes.anchor_package` and the chosen level, then the prose body
59
- in `release_notes.language`.
60
- - **Choose the level** against `release_notes.guidance`, and refuse any level in
61
- `release_notes.forbid_levels` (a `0.x` repo forbidding `major` declares the rupture `minor`).
62
- - **Ambiguous between two defensible levels?** State your reading in one line and **ask the human to
63
- pick** before writing. A wrong bump becomes a published version number.
64
- - A `kind: patch` spec is a `patch` bump by default — that is what the level means. It is a default,
65
- not a rule: a bug fix that changes documented behaviour is still a `minor`, and one that removes it
66
- is still breaking. Say which you chose when it isn't `patch`.
67
- - The body describes what changed **for the user**, from the spec §1/§2 — no client names, no internal
68
- paths, no exploitable attack vector, no file lists.
69
- - If the feature genuinely must move no version, use `release_notes.empty_cmd` instead. Prefer that to
70
- skipping: the CI job wants a file, not a version.
71
- - Then say in one line which level you chose and why — this is the human's last chance to correct it
72
- before it is committed.
73
-
74
- > **Why this is its own gate.** The requirement usually lives in the project's `<memory>`, which this
75
- > flow never reads. Skip it and everything below still "succeeds": commit, push, PR opened, kanban card
76
- > moved to **Shipped** — and CI red on a job nobody watched. The feature reads as shipped while being
77
- > unmergeable.
78
-
79
- ## 3. Dispatch the `release` agent
80
-
81
- Spawn one agent (`subagent_type: release`, or the equivalent dispatch for this runtime):
82
- "Release feature `$ARGUMENTS` on branch
83
- `<the branch §1 resolved>`. Read `PIPELINE.md` §vcs first. Spec: `specs/$ARGUMENTS.md` (already
84
- `status: shipped` — stage it). Write conventional commit(s), push (no force), open the PR (use `gh` if
85
- `host: github` + available; else emit the compare URL + drafted PR body from `<core>/templates/pr-body.md`).
86
- Stage **all** the feature's changes including `specs/$ARGUMENTS.md` and, if `release_notes.enabled`, the
87
- release note at `<release_notes.dir>/<release_notes.filename>` — it is already written, stage it as-is and
88
- never author or edit one yourself. Never edit source, never force-push, never run migrations."
89
-
90
- ## 4. Relay + move the card to Shipped (do not skip)
91
-
92
- Print the release agent's report: commit SHA(s), pushed branch, PR URL (or compare URL + drafted body).
93
- Confirm `specs/$ARGUMENTS.md` was committed as `status: shipped` (part of the release commit), and — if
94
- `release_notes.enabled` — that the release note is in that same commit
95
- (`git show <sha> --stat | grep <release_notes.dir>`). Missing ⇒ commit and push it now, before §5's CI
96
- watch, rather than letting the job go red.
97
-
98
- **Move the card to Shipped — required, and verify it actually moved.** Run
99
- `<core>/pipeline/scripts/kanban-move.sh auto $ARGUMENTS shipped --pr <num>`, which **appends the PR
100
- number** so the line reads `- [ ] <title> #$ARGUMENTS — PR #<num>`. Take `<num>` from the PR URL
101
- (`…/pull/13` ⇒ `13`); **always pass it when a PR was created** (the `gh` path) — it is what a
102
- board reader turns into a PR link. If only a compare URL was emitted (no PR yet), drop `--pr`.
103
-
104
- Then **read the script's own output**, which is the verification: `moved #$ARGUMENTS -> Shipped
105
- (PR #<num>)` means done, and a `kanban: <reason>` line means the mirror is off and says why. Both are
106
- exit 0 and they are not interchangeable — say which one you got. Only if it moved, confirm placement
107
- with a **grep for `#$ARGUMENTS`** on the board it named (with surrounding heading context —
108
- `grep -B20 '#$ARGUMENTS' | grep '^##'`, or an offset-limited Read around the match): exactly one card,
109
- under the `shipped` heading — never re-read the whole board into context.
110
-
111
- ## 5. After the PR — CI gate + teardown
112
-
113
- - If `host: github` and `gh` is available, watch the PR's checks (`gh pr checks <url> --watch`) and
114
- report the result — the human merges only on green. A red check ⇒ back to `/cohorte-fix $ARGUMENTS`,
115
- **except** a red `release_notes.ci_job`: that one is this command's own miss, not a code finding —
116
- write the note per §2b, commit, push, and re-watch. Never send a missing release note through `/cohorte-fix`.
117
- - Once the human confirms the PR is **merged**: if `isolation.enabled`, propose the teardown —
118
- `scripts/remove-feature.sh $ARGUMENTS` (add `--drop-db` to also drop the feature db; kept by
119
- default). It removes the worktree, deletes the merged branch, frees the slot. Never run it before
120
- the merge is confirmed, and only with the human's go-ahead (the gate will ask anyway).
121
- - Feature closed — **recommend a `/clear`** before starting the next one; nothing from this session
122
- is needed again (spec `shipped`, PR merged, board updated).
@@ -1,101 +0,0 @@
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** (SCHEMA.md §Decisions): 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** (SCHEMA.md §Kanban): 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. Derive a `feature_id` (kebab-case slug). Confirm it.
31
- 2b. **Size budget — a spec is a contract, not a novel.** Target ≤ ~300 lines; hard-think at 500.
32
- Every implementer re-reads the whole spec on every first build, so each extra line is paid
33
- `surfaces × dispatches` times. If the feature genuinely needs more, that's the signal it is TWO
34
- features: propose a split (e.g. `<id>-core` + `<id>-admin`, each independently shippable, the
35
- second consuming the first's contract) and let the human pick. Trim the usual bloat before
36
- writing: exhaustive UI walkthroughs (the design brief carries those), restated conventions
37
- (PIPELINE.md carries those), speculative edge cases nobody asked for.
38
- 3. Walk the human through each section of `specs/_template.md`, **section by section**, with focused
39
- questions. The critical one is **§5 API CONTRACT** — pin down every endpoint/interface (method, path,
40
- auth/role, request fields with types/validation, success envelope + data shape, and every error case),
41
- and name the exact schema/types that will live in the contract file (`contract.path/<id>.<ext>` in the
42
- profile's `mechanism`). Don't move on until frontend and backend could each build from it with zero
43
- further questions. _If `contract.enabled` is false, capture the interface precisely in prose instead._
44
- 4. Capture the **design brief** content (only if `design.enabled` / the feature has UI): screens,
45
- states, components, responsive notes — it will be authored to `specs/design/<id>.md` in step 6;
46
- spec §8 carries only a short summary + the pointer `> full brief: specs/design/<id>.md` (so
47
- non-design surfaces never re-read the full brief on every dispatch).
48
- 4b. **New-surface heads-up.** If the feature clearly introduces an area no existing `surfaces[].path`
49
- owns (a new service/app/top-level module), note it in the spec (a line in the relevant task section:
50
- `> needs new surface: <proposed key/path>`). Don't render agents here — `/cohorte-build` §1.5 auto-reconciles
51
- it. This is just so the human isn't surprised when `/cohorte-build` proposes a new agent.
52
- 5. When the human validates, **freeze**: write `specs/<id>.md` (`status: frozen`, front-matter filled).
53
- Create the file — do not ask the human to. **Postcondition:** `grep -q '^status: frozen' specs/<id>.md`
54
- — if it fails the freeze didn't land; fix it before pointing the human at `/cohorte-build`.
55
- 5b. **Record the transverse decisions — the journal, not a summary.** Walk what the interview settled
56
- and keep ONLY the decisions that **outlive this feature**: a rule the next spec would otherwise
57
- re-litigate or contradict (auth model, id/naming scheme, where a kind of state lives, an error
58
- convention, a deliberate non-goal that binds future features). Typical yield: **0–3 lines**; zero
59
- is a normal, healthy outcome for a feature that decided nothing new — never invent lines to fill
60
- the section. Append them to `specs/_decisions.md` §Live (create the file from
61
- `<core>/templates/decisions.template.md` on first use), each exactly:
62
- `- <YYYY-MM-DD> · <area> · <decision> — because <reason> · <feature_id>`
63
- - **Never** duplicate what §5, `PIPELINE.md` §Conventions or the code already states — the journal
64
- carries the *non-obvious rule*, not the feature's content. A line that restates a spec section is
65
- a line every future `/cohorte-spec` pays for and learns nothing from.
66
- - **Contradicting an existing line** is allowed but never silent: tell the human which line this
67
- feature overrides, get their go-ahead, then append the new line with
68
- `· supersedes <YYYY-MM-DD> <area>` and move the old one to `## Superseded`.
69
- - Append with one `>>` Bash call, not a full-file rewrite (the file is append-only, and reading it
70
- back to re-write it is the one way to make a bounded file expensive).
71
- 6. Author the **design brief** — `specs/design/<id>.md`, rendered via
72
- `<core>/templates/design-brief.md`.
73
- _Only if `design.enabled` / the feature has UI; skip entirely for a backend-only feature._
74
- - **Write it to `specs/design/<id>.md`** (the authored artifact, versioned with the spec; spec §8
75
- holds the summary + pointer). Create the file — do not ask the human to. Keep it in the
76
- `specs/design/` subfolder, **not** `specs/<id>....md`: the `specs/*.md` glob that drives the
77
- kanban backfill and `/cohorte-doctor` is non-recursive, so a brief in the subfolder never gets mistaken
78
- for a spec (no phantom card, no bogus stage). Overwrite it on every freeze.
79
- - Print ONLY the path + a one-line summary — never echo the brief into chat (it would sit in this
80
- session's history; echo it only if the human asks). Tell the human: copy it from
81
- `specs/design/<id>.md` into the design tool (if any — typically a fresh design project for this
82
- feature), then run `/cohorte-build <id>` and hand its design gate the resulting page link(s) — a full
83
- `https://claude.ai/design/p/<projectId>?file=<file>` link carries its own project + page, no
84
- profile change needed. (They can also paste the links into the spec's `design_files` themselves.)
85
- **Recommend a `/clear` before `/cohorte-build`** — the frozen spec + `specs/design/<id>.md` are the whole
86
- handoff.
87
-
88
- ## Mode B — review return (input is a REVIEW REPORT)
89
-
90
- 1. Read the report — pasted as input, or (whenever nothing is pasted) read from
91
- `specs/reports/<id>.md`, where `/cohorte-review` stages its last report. Identify `feature_id` from its
92
- header; open `specs/<id>.md`.
93
- 2. Append each finding to the spec's **`## Remediation`**, one per line:
94
- `- [ ] <severity> · <file:line> · <spec-violation|quality|security|complexity> · <concrete fix>`
95
- (Keep prior items; add the new round under a dated/numbered subheading.)
96
- 3. If a finding implies the **contract** must change, update §5 and flag it so the lead re-authors the
97
- contract file.
98
- 4. Set `status: in-review`. Tell the human to run `/cohorte-build <id>` to re-dispatch fresh agents.
99
- **Recommend a `/clear` before `/cohorte-build`** — the spec is the whole handoff.
100
-
101
- In both modes the spec is the single source of truth; agents are stateless and read only it + the diff.
@@ -1,165 +0,0 @@
1
- ---
2
- model: sonnet
3
- description: Refresh this runtime's global or project-local pipeline core, then reconcile the project's 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 installed pipeline core to the latest version of the pipeline
8
- repo. The installer's `--update` mode never touches generated files: `PIPELINE.md`, rendered surface agents,
9
- `gate-config.json`, `settings.json`, and the filled `<config>` are all preserved.
10
- YOU then bring those generated files up to the new core yourself (§3.5) — additively, never clobbering
11
- the human's choices — so `/cohorte-init-pipeline` never needs re-running for an upgrade.
12
-
13
- ## 1. Detect the install scope + current version
14
-
15
- - **Global** install ⇒ `<core>/pipeline/VERSION` exists. **Bundled** ⇒ this repo's
16
- `<core>/pipeline/VERSION` exists. (Both can exist; prefer the bundled one when running inside such a
17
- repo, and update both if the human wants.)
18
- - **Never migrate a repo between bundled and global mode on your own.** Updating means refreshing the
19
- core *in its current mode*. Only migrate (e.g. delete a bundled core in favor of the global one) if
20
- the human explicitly asks — and confirm before deleting anything, since it rewrites the repo's
21
- committed `.claude/` and the `pipeline.json` pointer teammates rely on.
22
- - Read the VERSION file(s) — a semver like `0.1.0`, possibly suffixed `(abc1234)` for from-main
23
- installs, or a bare commit hash on old cores. If missing, note "unknown (pre-versioning)".
24
-
25
- ## 2. Run the update
26
-
27
- <!-- cohorte:if runtime:codex -->
28
- Preserve the existing install scope and explicitly select Codex:
29
-
30
- - Local source checkout supplied: `node <path>/bin/cli.js update --runtime=codex [--global]`.
31
- - Published release: `npm i -g cohorte@latest`, then `cohorte update --runtime=codex [--global]`.
32
-
33
- Expand `[--global]` to `--global` only for a global core; otherwise omit it. Run from the target
34
- project, or pass its path. Keep the user's normal `CODEX_HOME`. The global core and generic
35
- agents may be shared, but reconciliation always writes surface agents in this project's
36
- `.codex/agents/*.toml`.
37
- <!-- cohorte:else -->
38
- - If `$ARGUMENTS` is a path to a local checkout of the pipeline repo (contains `core/` + `install.sh`),
39
- run from there — useful when iterating on the pipeline itself:
40
-
41
- ```sh
42
- sh <path>/install.sh --update --global # global core
43
- sh <path>/install.sh --update # bundled core of the current repo
44
- ```
45
-
46
- - Otherwise use the published npm package (preferred — installs the latest tagged release):
47
-
48
- ```sh
49
- npm i -g cohorte@latest # the CLI itself, refreshed
50
- cohorte update --global # global core
51
- cohorte update # bundled core of the current repo
52
- ```
53
-
54
- If `cohorte` is not on PATH, `npx cohorte@latest update [--global]` runs the same thing
55
- without installing anything.
56
-
57
- - If npm is unavailable, fall back to piping the installer from the repo's latest `main`:
58
-
59
- ```sh
60
- curl -fsSL https://raw.githubusercontent.com/TheBidouilleAgency/cohorte/main/install.sh | sh -s -- --update --global
61
- # bundled: … | sh -s -- --update
62
- ```
63
-
64
- (The piped installer clones the repo itself; `-s --` forwards the flags.)
65
- <!-- cohorte:endif -->
66
-
67
- ## 3. Report old → new
68
-
69
- Re-read the VERSION file(s) and print `old → new`. If unchanged, say the core was already up to date.
70
-
71
- **Sync the pointer — in BOTH modes.** If this repo has a `<state>/pipeline.json` whose `core_version`
72
- differs from the core you just installed, rewrite that one field (leave every other field untouched)
73
- and tell the human to commit it. In **bundled** mode the installer already did it; in **global** mode
74
- **nothing does** — the installer refreshes one shared core and cannot know which repos point at it,
75
- so before 1.2.5 the field simply drifted forever (a repo on a current core still claiming `1.0.0`).
76
- `/cohorte-doctor` check 1 requires the pointer to be coherent with the VERSION file, so a drifted field reads
77
- as a broken install when nothing is broken.
78
-
79
- Then print **What's new**: read the installed `<core>/pipeline/CHANGELOG.md` and show the entries
80
- between the old and new versions (most recent first). File absent ⇒ the old core predates 0.1.14 —
81
- skip silently.
82
-
83
- ## 3.5 Reconcile this repo's generated files
84
-
85
- Only when the current repo has a `PIPELINE.md`: run the **Reconcile procedure** from the installed
86
- `pipeline/SCHEMA.md` §Reconcile — top up the profile's machine block with new fields at their defaults
87
- (one batched question set for any genuinely new human decision — e.g. choosing a `retrieval` provider,
88
- or the **quiet command variants**: `test_quiet_cmd`/`lint_quiet_cmd` + `commands.test_quiet`/
89
- `lint_quiet`, proposing the detected bridled forms per §Output discipline; `gate.preflight` tops up
90
- silently at its defaults), re-render the surface agents from the current `implementer.template.md`
91
- (this refreshes each agent's **baked §Conventions slice** — required after any hand-edit of the
92
- profile's prose).
93
- <!-- cohorte:if runtime:codex -->
94
- Write surface agents as `.codex/agents/*.toml`, validate TOML, and preserve explicit Codex model
95
- choices (legacy Anthropic aliases mean inheritance). Patch `<state>/gate-config.json` and
96
- verify the selected scope's hook covers shell and `spawn_agent`/`Agent`; do not duplicate it.
97
- Verify `<fixed-agents>/profile-reader.toml` and the other shipped generic agents. Workflows are
98
- unavailable on Codex and their absence is expected. Reconcile MCP in `.codex/config.toml` using
99
- SCHEMA.md §Code retrieval, preserving unrelated configuration and checking actual connectivity.
100
- If a previous install wrote this project's agents globally, compare ownership/content before
101
- moving them locally; never remove unrelated global agents or overwrite modified local copies.
102
- Remove project-only `CODEX_HOME` workarounds only after verifying native discovery. Do not copy
103
- authentication into the repository. Report what changed and anything still unverified.
104
- <!-- cohorte:else -->
105
- Additively patch `settings.json`/`gate-config.json` (including the `preflight`
106
- block and the workflow-agent `allow` entries from init step 5), and run any newly-added capability's
107
- wiring (e.g. Serena's project-scope `claude mcp add`). Verify the refreshed core actually carries
108
- `<core>/workflows/` + `agents/profile-reader.md` — missing means the update half-ran: re-run the
109
- installer. Even when no capability is new, **re-run the retrieval provider's
110
- health check** (SCHEMA.md §Code retrieval: CLI resolvable from PATH, `.mcp.json` entry present —
111
- upgrading a bare `serena` entry to the PATH-proof launcher form, `.serena/` gitignored, server
112
- actually connected) and repair whatever fails — wiring that worked at
113
- init can rot (PATH changes, uninstalls, hand-edits). Report what was reconciled; if nothing was
114
- missing, say so. This is why `/cohorte-init-pipeline` never needs re-running for a core upgrade.
115
- <!-- cohorte:endif -->
116
-
117
- Four of the §Reconcile steps matter specifically here:
118
-
119
- - **Local-artifact hygiene** (§Reconcile step 8): gitignore + untrack the pipeline's runtime files
120
- (`<state>/preflight.ok`, `<state>/pipeline-metrics.jsonl`, `specs/reports/`). A tracked
121
- `preflight.ok` — what every pre-2.0.0 install ends up with once a release agent stages `.claude/` —
122
- makes the phase gate ask on every single review dispatch, so fix it here and say so.
123
-
124
- - **Spec-template top-up** (§Reconcile step 7): `specs/_template.md` was seeded at install and never
125
- refreshed since, so add the front-matter fields the current `templates/spec.template.md` has and the
126
- repo's copy lacks — and drop `loop_pass`/`loop_phase`, retired with `/cohorte-loop` in 2.2.0 —
127
- front-matter only, never the body.
128
-
129
- - **Global config seed** (§Reconcile step 5): if `<config>` is absent, seed it
130
- from the template so the kanban + shared-vault config has a home. Never clobber an existing filled
131
- file. Report what was seeded. Then **scrub the retired `telemetry:` block** if the existing file
132
- still has one (every install seeded before 2.3.0 does) — one targeted Edit deleting the block and
133
- its comment header, nothing else touched. That capability was removed in 2.3.0, sender included,
134
- so the block is dead config: nothing reads it, and an `enabled: true` left sitting in a file the
135
- human may open reads as though data were still leaving the machine. Say you removed it.
136
- - **Kanban sync** (§Reconcile step 6): resolve this project's board with
137
- `<core>/pipeline/scripts/kanban-move.sh --check` — it prints either the board path or the exact
138
- missing link. **Not linked** → offer to link/create a board (confirm the vault + `<folder>/Tasks.md`,
139
- write the `boards` entry, create the board file per §Kanban). **Linked** → verify the board file
140
- exists (recreate if the human confirms) and its columns match `kanban.columns` (repair drift). Either
141
- way, run the §Kanban **full sync/backfill** from `specs/*.md` — one
142
- `kanban-move.sh auto <id> <stage>` per spec, `<stage>` from the status mapping — this is what adds
143
- every already-developed feature to the board and repositions cards to match each spec's `status`.
144
- Report cards added / moved / already-correct. Skip silently if `kanban.enabled` is false and the
145
- human doesn't want to turn it on.
146
- - **A project renamed since its last update loses its board silently** — `boards` is keyed by the
147
- profile `name`, so a `name:` edit orphans the old entry and no lookup matches the new one. When
148
- `--check` finds no entry for `<name>` but `boards` holds exactly one other key whose board file
149
- exists, say so and offer to re-key it rather than creating a second board.
150
-
151
- ## 4. Tell the human the follow-ups
152
-
153
- - **Restart / reload the coding-agent session** so it picks up updated commands, agents, and any
154
- newly-registered MCP server.
155
- - **Other repos using the global core:** their core is already fresh, but reconcile is per-repo — run
156
- `/cohorte-update-pipeline` inside each (it will skip the already-done core update and just reconcile).
157
- <!-- cohorte:if runtime:codex -->
158
- - **Commit** the reconciled `PIPELINE.md`, `.codex/agents/*.toml`, `.codex/config.toml` if added,
159
- and versioned `<state>` files. Never commit auth or session state.
160
- <!-- cohorte:else -->
161
- - **Commit** the reconciled files (`PIPELINE.md`, `.claude/`, `.mcp.json` if added) so teammates get them.
162
- <!-- cohorte:endif -->
163
- - The kanban config is global and user-scoped
164
- (`<config>`) — never committed. The core update never touches it; only the
165
- reconcile above seeds the file and writes kanban board links (into that global file, not the repo).