cohorte 3.0.0-dev.7 → 3.0.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.
- package/CHANGELOG.md +1532 -0
- package/README.md +106 -185
- package/bin/cli.js +212 -0
- package/bin/report.js +141 -0
- package/core/agents/cohorte-profile-reader.md +50 -0
- package/core/agents/cohorte-release.md +58 -0
- package/core/agents/cohorte-review.md +174 -0
- package/core/agents/implementer.template.md +146 -0
- package/core/commands/cohorte-align-ds.md +33 -0
- package/core/commands/cohorte-audit.md +67 -0
- package/core/commands/cohorte-brainstorm.md +73 -0
- package/core/commands/cohorte-build.md +241 -0
- package/core/commands/cohorte-doctor.md +133 -0
- package/core/commands/cohorte-fix.md +80 -0
- package/core/commands/cohorte-fleet.md +111 -0
- package/core/commands/cohorte-init-pipeline.md +30 -0
- package/core/commands/cohorte-intake.md +92 -0
- package/core/commands/cohorte-patch.md +118 -0
- package/core/commands/cohorte-refactor.md +57 -0
- package/core/commands/cohorte-retro.md +85 -0
- package/core/commands/cohorte-review.md +224 -0
- package/core/commands/cohorte-ship.md +155 -0
- package/core/commands/cohorte-spec.md +105 -0
- package/core/commands/cohorte-update-pipeline.md +115 -0
- package/core/hooks/gate.py +2931 -0
- package/core/templates/agent-handoff.md +34 -0
- package/core/templates/brainstorm-return.md +42 -0
- package/core/templates/decisions.template.md +42 -0
- package/core/templates/design-brief.md +37 -0
- package/core/templates/patch.template.md +86 -0
- package/core/templates/pr-body.md +25 -0
- package/core/templates/review-feedback.md +46 -0
- package/core/templates/spec.template.md +88 -0
- package/core/templates/steps/init-pipeline/01-detect-stack.md +44 -0
- package/core/templates/steps/init-pipeline/02-interview-gaps.md +55 -0
- package/core/templates/steps/init-pipeline/03-draft-profile.md +9 -0
- package/core/templates/steps/init-pipeline/04-write-render.md +91 -0
- package/core/templates/steps/init-pipeline/05-report.md +11 -0
- package/core/templates/steps/review-pr/01-pr-mode.md +54 -0
- package/core/workflows/audit.js +306 -0
- package/core/workflows/loop.js +687 -0
- package/core/workflows/refactor.js +291 -0
- package/core/workflows/review.js +491 -0
- package/install.ps1 +72 -0
- package/install.sh +69 -0
- package/lib/doctor.js +472 -0
- package/lib/install.js +377 -0
- package/lib/project.js +322 -0
- package/lib/render.js +121 -0
- package/lib/versions.js +145 -0
- package/lib/yaml.js +174 -0
- package/package.json +36 -17
- package/profile/PIPELINE.template.md +250 -0
- package/profile/SCHEMA.md +749 -0
- package/profile/cohorte.config.template.yaml +43 -0
- package/scripts/feature-diff.sh +118 -0
- package/scripts/kanban-move.sh +307 -0
- package/scripts/metrics/collect.mjs +542 -0
- package/scripts/metrics/prices.json +42 -0
- package/scripts/new-feature.sh.template +122 -0
- package/scripts/preflight.sh +114 -0
- package/scripts/remove-feature.sh.template +56 -0
- package/assets/manifest.json +0 -203
- package/assets/migrations/config/README.md +0 -12
- package/assets/migrations/state/0001_init.sql +0 -154
- package/assets/prompts/README.md +0 -11
- package/assets/prompts/agents/brainstormer.md +0 -3
- package/assets/prompts/agents/fixer.md +0 -7
- package/assets/prompts/agents/implementer.md +0 -12
- package/assets/prompts/agents/reviewer.md +0 -8
- package/assets/prompts/agents/security-reviewer.md +0 -7
- package/assets/prompts/agents/spec-author.md +0 -3
- package/assets/prompts/phases/build.md +0 -5
- package/assets/prompts/phases/review.md +0 -5
- package/assets/prompts/phases/test.md +0 -5
- package/assets/prompts/system.md +0 -11
- package/assets/schemas/agent-output.schema.json +0 -225
- package/assets/schemas/auth-status.schema.json +0 -87
- package/assets/schemas/command-result.schema.json +0 -192
- package/assets/schemas/commands.schema.json +0 -959
- package/assets/schemas/config.schema.json +0 -2281
- package/assets/schemas/doctor-report.schema.json +0 -104
- package/assets/schemas/events.schema.json +0 -8514
- package/assets/schemas/fake-script.schema.json +0 -549
- package/assets/schemas/inspect.schema.json +0 -3133
- package/assets/schemas/manifest.schema.json +0 -79
- package/assets/schemas/ownership.schema.json +0 -52
- package/assets/schemas/policy-verdict.schema.json +0 -282
- package/assets/schemas/project-model.schema.json +0 -783
- package/assets/schemas/project-status.schema.json +0 -217
- package/assets/schemas/reconcile-plan.schema.json +0 -154
- package/assets/schemas/run-diff.schema.json +0 -177
- package/assets/schemas/run-snapshot-manifest.schema.json +0 -2104
- package/assets/schemas/run-state.schema.json +0 -1755
- package/assets/schemas/runtime-capabilities.schema.json +0 -1545
- package/assets/schemas/sandbox-capabilities.schema.json +0 -116
- package/assets/schemas/skill.schema.json +0 -87
- package/assets/schemas/spec.schema.json +0 -202
- package/assets/schemas/tool-catalogue.schema.json +0 -655
- package/assets/schemas/trust-record.schema.json +0 -38
- package/assets/skills/README.md +0 -9
- package/assets/skills/inspect-surface.md +0 -4
- package/dist/agent-host.mjs +0 -2187
- package/dist/agent-host.mjs.map +0 -1
- package/dist/bundle-manifest.json +0 -128
- package/dist/chunks/__host-DgGPyco9.mjs +0 -18
- package/dist/chunks/__host-DgGPyco9.mjs.map +0 -1
- package/dist/chunks/align-ds-r_X_1aQ_.mjs +0 -93
- package/dist/chunks/align-ds-r_X_1aQ_.mjs.map +0 -1
- package/dist/chunks/approve-Cv135UqI.mjs +0 -19
- package/dist/chunks/approve-Cv135UqI.mjs.map +0 -1
- package/dist/chunks/audit-B4ZWQ_DI.mjs +0 -179
- package/dist/chunks/audit-B4ZWQ_DI.mjs.map +0 -1
- package/dist/chunks/auth-BT5oVp76.mjs +0 -132
- package/dist/chunks/auth-BT5oVp76.mjs.map +0 -1
- package/dist/chunks/auth-Dnlksuo5.mjs +0 -141
- package/dist/chunks/auth-Dnlksuo5.mjs.map +0 -1
- package/dist/chunks/brainstorm-DasVwI1D.mjs +0 -123
- package/dist/chunks/brainstorm-DasVwI1D.mjs.map +0 -1
- package/dist/chunks/build-crOld8gE.mjs +0 -19
- package/dist/chunks/build-crOld8gE.mjs.map +0 -1
- package/dist/chunks/cancel-KV_cpsqS.mjs +0 -15
- package/dist/chunks/cancel-KV_cpsqS.mjs.map +0 -1
- package/dist/chunks/canonical-C8UxeEmB.mjs +0 -57
- package/dist/chunks/canonical-C8UxeEmB.mjs.map +0 -1
- package/dist/chunks/catalogue-IaCJdfB8.mjs +0 -1549
- package/dist/chunks/catalogue-IaCJdfB8.mjs.map +0 -1
- package/dist/chunks/compose-DRKjQcn0.mjs +0 -7333
- package/dist/chunks/compose-DRKjQcn0.mjs.map +0 -1
- package/dist/chunks/config-Cqu5XQoP.mjs +0 -96
- package/dist/chunks/config-Cqu5XQoP.mjs.map +0 -1
- package/dist/chunks/contract-DjssDPpS.mjs +0 -335
- package/dist/chunks/contract-DjssDPpS.mjs.map +0 -1
- package/dist/chunks/contract-bQ9FJl4N.mjs +0 -123
- package/dist/chunks/contract-bQ9FJl4N.mjs.map +0 -1
- package/dist/chunks/deny-ClTxSvHJ.mjs +0 -15
- package/dist/chunks/deny-ClTxSvHJ.mjs.map +0 -1
- package/dist/chunks/diff-Qw0II0sj.mjs +0 -101
- package/dist/chunks/diff-Qw0II0sj.mjs.map +0 -1
- package/dist/chunks/discover-BZPolSZG.mjs +0 -21
- package/dist/chunks/discover-BZPolSZG.mjs.map +0 -1
- package/dist/chunks/doctor-DcDFPvQM.mjs +0 -222
- package/dist/chunks/doctor-DcDFPvQM.mjs.map +0 -1
- package/dist/chunks/fix-B_oGzGVn.mjs +0 -82
- package/dist/chunks/fix-B_oGzGVn.mjs.map +0 -1
- package/dist/chunks/fleet-yWHQY2ya.mjs +0 -297
- package/dist/chunks/fleet-yWHQY2ya.mjs.map +0 -1
- package/dist/chunks/gc-BBXlBF5w.mjs +0 -161
- package/dist/chunks/gc-BBXlBF5w.mjs.map +0 -1
- package/dist/chunks/init--FxxkrcT.mjs +0 -63
- package/dist/chunks/init--FxxkrcT.mjs.map +0 -1
- package/dist/chunks/inspect-Buby4cQD.mjs +0 -22
- package/dist/chunks/inspect-Buby4cQD.mjs.map +0 -1
- package/dist/chunks/intake-Dd1KVXnO.mjs +0 -12
- package/dist/chunks/intake-Dd1KVXnO.mjs.map +0 -1
- package/dist/chunks/logs-Giq5sUau.mjs +0 -25
- package/dist/chunks/logs-Giq5sUau.mjs.map +0 -1
- package/dist/chunks/loop-BWsUpyus.mjs +0 -212
- package/dist/chunks/loop-BWsUpyus.mjs.map +0 -1
- package/dist/chunks/migrate-DuYCAbE3.mjs +0 -33
- package/dist/chunks/migrate-DuYCAbE3.mjs.map +0 -1
- package/dist/chunks/models-Btp6X2YZ.mjs +0 -24
- package/dist/chunks/models-Btp6X2YZ.mjs.map +0 -1
- package/dist/chunks/obsidian-BHLkXx_H.mjs +0 -235
- package/dist/chunks/obsidian-BHLkXx_H.mjs.map +0 -1
- package/dist/chunks/patch-sAgVqjpx.mjs +0 -50
- package/dist/chunks/patch-sAgVqjpx.mjs.map +0 -1
- package/dist/chunks/pause-BASBfKLO.mjs +0 -16
- package/dist/chunks/pause-BASBfKLO.mjs.map +0 -1
- package/dist/chunks/policy-Du7WVBFX.mjs +0 -139
- package/dist/chunks/policy-Du7WVBFX.mjs.map +0 -1
- package/dist/chunks/providers-Dx78imKj.mjs +0 -19
- package/dist/chunks/providers-Dx78imKj.mjs.map +0 -1
- package/dist/chunks/reconcile-BHn66X3C.mjs +0 -50
- package/dist/chunks/reconcile-BHn66X3C.mjs.map +0 -1
- package/dist/chunks/refactor-CoNoqLZr.mjs +0 -153
- package/dist/chunks/refactor-CoNoqLZr.mjs.map +0 -1
- package/dist/chunks/render-DyZr5Lgi.mjs +0 -53
- package/dist/chunks/render-DyZr5Lgi.mjs.map +0 -1
- package/dist/chunks/resume-GJQRb2Eb.mjs +0 -15
- package/dist/chunks/resume-GJQRb2Eb.mjs.map +0 -1
- package/dist/chunks/retro-Dr-2RTNN.mjs +0 -78
- package/dist/chunks/retro-Dr-2RTNN.mjs.map +0 -1
- package/dist/chunks/retry-CLrUem1H.mjs +0 -15
- package/dist/chunks/retry-CLrUem1H.mjs.map +0 -1
- package/dist/chunks/review-ZsBqp3vZ.mjs +0 -35
- package/dist/chunks/review-ZsBqp3vZ.mjs.map +0 -1
- package/dist/chunks/run-NGAxdsIX.mjs +0 -105
- package/dist/chunks/run-NGAxdsIX.mjs.map +0 -1
- package/dist/chunks/run-tool-C3rAv4XF.mjs +0 -26
- package/dist/chunks/run-tool-C3rAv4XF.mjs.map +0 -1
- package/dist/chunks/scan-C5uDr7Yq.mjs +0 -167
- package/dist/chunks/scan-C5uDr7Yq.mjs.map +0 -1
- package/dist/chunks/schema-Bq9qtgsd.mjs +0 -583
- package/dist/chunks/schema-Bq9qtgsd.mjs.map +0 -1
- package/dist/chunks/send-BdnJ85Nz.mjs +0 -19
- package/dist/chunks/send-BdnJ85Nz.mjs.map +0 -1
- package/dist/chunks/ship-BizfUe62.mjs +0 -140
- package/dist/chunks/ship-BizfUe62.mjs.map +0 -1
- package/dist/chunks/shutdown-BM92Iyv2.mjs +0 -15
- package/dist/chunks/shutdown-BM92Iyv2.mjs.map +0 -1
- package/dist/chunks/skip-DZG5kpcH.mjs +0 -18
- package/dist/chunks/skip-DZG5kpcH.mjs.map +0 -1
- package/dist/chunks/spec-C2h3U64g.mjs +0 -65
- package/dist/chunks/spec-C2h3U64g.mjs.map +0 -1
- package/dist/chunks/spec-path-tptqR7W8.mjs +0 -10
- package/dist/chunks/spec-path-tptqR7W8.mjs.map +0 -1
- package/dist/chunks/src-Bfr1yzsn.mjs +0 -1689
- package/dist/chunks/src-Bfr1yzsn.mjs.map +0 -1
- package/dist/chunks/src-CPW2_Ons.mjs +0 -5487
- package/dist/chunks/src-CPW2_Ons.mjs.map +0 -1
- package/dist/chunks/src-Cu3TxNob.mjs +0 -783
- package/dist/chunks/src-Cu3TxNob.mjs.map +0 -1
- package/dist/chunks/src-DNsLSxgm.mjs +0 -928
- package/dist/chunks/src-DNsLSxgm.mjs.map +0 -1
- package/dist/chunks/src-DbS9gkJy.mjs +0 -117
- package/dist/chunks/src-DbS9gkJy.mjs.map +0 -1
- package/dist/chunks/src-yi5whv3n.mjs +0 -2118
- package/dist/chunks/src-yi5whv3n.mjs.map +0 -1
- package/dist/chunks/status-SMjiOMYy.mjs +0 -29
- package/dist/chunks/status-SMjiOMYy.mjs.map +0 -1
- package/dist/chunks/tail-BuhT-2PH.mjs +0 -25
- package/dist/chunks/tail-BuhT-2PH.mjs.map +0 -1
- package/dist/chunks/update-BXIppsbi.mjs +0 -16
- package/dist/chunks/update-BXIppsbi.mjs.map +0 -1
- package/dist/chunks/update-pipeline-Du-Gu1Pl.mjs +0 -56
- package/dist/chunks/update-pipeline-Du-Gu1Pl.mjs.map +0 -1
- package/dist/cli.mjs +0 -186
- package/dist/cli.mjs.map +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# HANDOFF — <surface> · <feature_id>
|
|
2
|
+
|
|
3
|
+
<!-- REFERENCE COPY — not read at runtime. The AUTHORITATIVE shape is inlined in
|
|
4
|
+
core/agents/implementer.template.md (§"Your return"), because a rendered agent must
|
|
5
|
+
not need a second file read to know its own output format. This file exists for humans
|
|
6
|
+
reading the core; keep it byte-aligned with the template, or delete both together.
|
|
7
|
+
|
|
8
|
+
Keep it tight: the lead only acts on mismatches, test failures, remediation ticks, and TODOs.
|
|
9
|
+
Never list files one by one — the lead has `git diff --stat`. Never paste code excerpts —
|
|
10
|
+
a file:line reference is enough, the code is on disk. One line per item. -->
|
|
11
|
+
|
|
12
|
+
## Summary
|
|
13
|
+
|
|
14
|
+
<2–4 lines: what you built and the approach>
|
|
15
|
+
|
|
16
|
+
## Migrations / schema (only if any)
|
|
17
|
+
|
|
18
|
+
- `<name>` — <additive change>
|
|
19
|
+
|
|
20
|
+
## Tests
|
|
21
|
+
|
|
22
|
+
- Run: <this surface's test_cmd> · result: <pass/fail + counts>
|
|
23
|
+
|
|
24
|
+
## Contract mismatches / assumptions
|
|
25
|
+
|
|
26
|
+
<none, or describe — NEVER edit the contract; report here instead>
|
|
27
|
+
|
|
28
|
+
## Remediation addressed (fix loops only)
|
|
29
|
+
|
|
30
|
+
- <which `## Remediation` items you fixed, by file:line>
|
|
31
|
+
|
|
32
|
+
## TODO / not done
|
|
33
|
+
|
|
34
|
+
- <anything deferred, blocked, or out of scope — or "none">
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
feature_id: <kebab-case slug> # THE id downstream: /cohorte-spec takes it from here, never re-derives it
|
|
3
|
+
title: <feature title>
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# BRAINSTORM RETURN — <feature title>
|
|
7
|
+
|
|
8
|
+
> Paste this into `/cohorte-spec` (or let it read this staged file). The `feature_id` above is the
|
|
9
|
+
> kanban card's join key — `/cohorte-spec` reuses it as the spec's id, so the card never forks.
|
|
10
|
+
|
|
11
|
+
**One-liner:** <what we're building, in one sentence>
|
|
12
|
+
|
|
13
|
+
## Problem & value
|
|
14
|
+
|
|
15
|
+
<the problem, who has it, why it matters>
|
|
16
|
+
|
|
17
|
+
## Scope
|
|
18
|
+
|
|
19
|
+
- **In:** <…>
|
|
20
|
+
- **Out (non-goals):** <…>
|
|
21
|
+
|
|
22
|
+
## Roles affected
|
|
23
|
+
|
|
24
|
+
> Only if the profile has `rbac.enabled` — list the roles from `PIPELINE.md` §rbac and what each does;
|
|
25
|
+
> explicitly note the lowest-privilege experience. Omit this section if there is no RBAC.
|
|
26
|
+
|
|
27
|
+
<which roles do what>
|
|
28
|
+
|
|
29
|
+
## Rough shape
|
|
30
|
+
|
|
31
|
+
- **Data:** <entities / fields touched>
|
|
32
|
+
- **Screens:** <key screens/flows — mobile-first if the project has UI>
|
|
33
|
+
- **Interface (rough):** <endpoints / methods we'll need — refined into the contract in /cohorte-spec>
|
|
34
|
+
|
|
35
|
+
## Risks & open questions
|
|
36
|
+
|
|
37
|
+
- <risk / unknown>
|
|
38
|
+
- <open question for /cohorte-spec to resolve>
|
|
39
|
+
|
|
40
|
+
## Panel dissent (what was contested)
|
|
41
|
+
|
|
42
|
+
<the strongest disagreement the panel surfaced — so /cohorte-spec doesn't paper over it>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Decisions
|
|
2
|
+
|
|
3
|
+
> The project's **transverse decision journal** — the non-obvious rules a stateless agent would
|
|
4
|
+
> otherwise re-discover or contradict, one feature at a time. `PIPELINE.md` says *how this repo is
|
|
5
|
+
> built* (surfaces, commands, conventions); this file says *what was decided and why*.
|
|
6
|
+
>
|
|
7
|
+
> **Append-only. One line per decision. No prose blocks, no code.** The bound is the point: this file
|
|
8
|
+
> is read by `/cohorte-spec`, `/cohorte-brainstorm` and `/cohorte-audit` — the deciding stages — and by **nothing else**.
|
|
9
|
+
> Implementers and reviewers never read it: they work from the frozen contract, which already tells
|
|
10
|
+
> them what to do; handing them the rationale too would cost `surfaces × dispatches` tokens per
|
|
11
|
+
> feature for a fact they cannot act on.
|
|
12
|
+
>
|
|
13
|
+
> Line shape (≤ ~160 chars, `·`-separated, no wrapping):
|
|
14
|
+
>
|
|
15
|
+
> ```
|
|
16
|
+
> - <YYYY-MM-DD> · <area> · <the decision, imperative> — because <the reason> · <feature_id>
|
|
17
|
+
> ```
|
|
18
|
+
>
|
|
19
|
+
> `<area>` is a short tag, not a path: `auth`, `data`, `api`, `ui`, `deploy`, `naming`, `surfaces`…
|
|
20
|
+
>
|
|
21
|
+
> **Reversing a decision** never edits or deletes a line — append a superseding one and move the old
|
|
22
|
+
> one to `## Superseded`:
|
|
23
|
+
>
|
|
24
|
+
> ```
|
|
25
|
+
> - <YYYY-MM-DD> · <area> · <the new decision> — because <reason> · supersedes <YYYY-MM-DD> <area> · <feature_id>
|
|
26
|
+
> ```
|
|
27
|
+
>
|
|
28
|
+
> **Keep it bounded:** when `## Live` passes ~100 lines, move every superseded line into
|
|
29
|
+
> `## Superseded` (the audit trail survives; the section the deciding stages actually read stays
|
|
30
|
+
> short). Never summarize or merge live lines — a decision either holds or has been superseded.
|
|
31
|
+
>
|
|
32
|
+
> **What does NOT belong here:** anything the code, the tests, `PIPELINE.md` §Conventions or a spec
|
|
33
|
+
> already states; a feature-local choice (that lives in its spec); a task, a TODO or a finding (those
|
|
34
|
+
> are `## Remediation` and `specs/refactor-backlog.md`).
|
|
35
|
+
|
|
36
|
+
## Live
|
|
37
|
+
|
|
38
|
+
<!-- newest last -->
|
|
39
|
+
|
|
40
|
+
## Superseded
|
|
41
|
+
|
|
42
|
+
<!-- moved here when a line above supersedes them; never deleted -->
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# DESIGN BRIEF — <feature title> (`<feature_id>`)
|
|
2
|
+
|
|
3
|
+
> The "spec return". This is §8 of the frozen spec, standalone — `/cohorte-spec` writes it to
|
|
4
|
+
> `specs/design/<feature_id>.md` on freeze. Omit entirely if the project has no UI.
|
|
5
|
+
>
|
|
6
|
+
> **Getting it into the design tool:** paste it there yourself (see `PIPELINE.md` §design). This file
|
|
7
|
+
> stays the source of truth — it is what `/cohorte-build` reads.
|
|
8
|
+
|
|
9
|
+
**Goal:** <one line — what the user accomplishes>
|
|
10
|
+
|
|
11
|
+
**Design system:** use the existing UI kit (`PIPELINE.md` §design → `ui_kit_path`). Mobile-first.
|
|
12
|
+
|
|
13
|
+
## Screens / views
|
|
14
|
+
|
|
15
|
+
For each: purpose, who sees it (role, if RBAC), and the key elements.
|
|
16
|
+
|
|
17
|
+
- **<screen name>** — <purpose> · roles: <…>
|
|
18
|
+
- Elements: <…>
|
|
19
|
+
- States: empty · loading · error · success
|
|
20
|
+
|
|
21
|
+
## Flows
|
|
22
|
+
|
|
23
|
+
<step-by-step of the main user journey, and any role-specific variation>
|
|
24
|
+
|
|
25
|
+
## Responsive
|
|
26
|
+
|
|
27
|
+
- Mobile (base): <layout>
|
|
28
|
+
- Tablet (`md:`): <changes>
|
|
29
|
+
- Desktop (`lg:`): <changes>
|
|
30
|
+
|
|
31
|
+
## Data shown
|
|
32
|
+
|
|
33
|
+
<what fields/values appear on screen — must match the contract in spec §5>
|
|
34
|
+
|
|
35
|
+
## Notes / constraints
|
|
36
|
+
|
|
37
|
+
<accessibility · copy in the profile's `ui_language` · edge cases · theming constraints>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
feature_id: patch-<slug>
|
|
3
|
+
kind: patch # a bug fix, not a feature — /cohorte-build skips contract authoring, /cohorte-ship commits `fix(…)`
|
|
4
|
+
title: <one line: the bug, from the user's side>
|
|
5
|
+
status: draft # draft → frozen → in-progress → in-review → shipped → merged · blocked · abandoned (see SCHEMA.md §Spec status)
|
|
6
|
+
severity: <critical | major | minor> # drives nothing mechanical; it is what the human triages on
|
|
7
|
+
branch: <patch_branch_prefix><feature_id>
|
|
8
|
+
created: <YYYY-MM-DD>
|
|
9
|
+
reviewed_base: # merge-base sha at the last SHIP verdict — freshness-gate anchor (written by /cohorte-review)
|
|
10
|
+
reviewed_digest: # sha256 (16 hex) of the reviewed source diff vs reviewed_base, specs excluded — /cohorte-ship re-checks
|
|
11
|
+
design_files: [] # omit unless the fix is itself visual
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# <one line: the bug, from the user's side>
|
|
15
|
+
|
|
16
|
+
## 1. Symptom & repro
|
|
17
|
+
|
|
18
|
+
> What the user sees, and the shortest deterministic path to see it. A repro nobody can run is a
|
|
19
|
+
> hypothesis, not a bug — say so here rather than pretending otherwise.
|
|
20
|
+
|
|
21
|
+
- **Observed:** …
|
|
22
|
+
- **Expected:** …
|
|
23
|
+
- **Repro:** 1. … 2. … 3. …
|
|
24
|
+
- **Since / trigger:** <version, commit, or "unknown">
|
|
25
|
+
|
|
26
|
+
## 2. Impact
|
|
27
|
+
|
|
28
|
+
> Who is affected, how often, and whether there is a workaround. This is what justifies the patch
|
|
29
|
+
> jumping the feature queue — one or two lines.
|
|
30
|
+
|
|
31
|
+
## 3. Cause
|
|
32
|
+
|
|
33
|
+
> Confirmed or hypothesis — label which. Name the `file:line` if you have it. If the cause is
|
|
34
|
+
> unknown at freeze, say so: the implementer's first job is then to find it, and the review will
|
|
35
|
+
> check that the stated cause matches the diff.
|
|
36
|
+
|
|
37
|
+
## 4. Regression test (red first)
|
|
38
|
+
|
|
39
|
+
> The heart of a patch spec — it replaces §5 CONTRACT as the thing the diff is checked against.
|
|
40
|
+
> Name the test file and what it asserts. It must fail on the current code and pass after the fix.
|
|
41
|
+
|
|
42
|
+
- **Test:** `<path/to/test>` · asserts: …
|
|
43
|
+
- **Fails today because:** …
|
|
44
|
+
|
|
45
|
+
## 5. Contract delta
|
|
46
|
+
|
|
47
|
+
> Usually `none`. A fix that *changes* an existing contract entry describes the change here and
|
|
48
|
+
> `/cohorte-build` propagates it to every surface that names it. A fix that needs **new** contract
|
|
49
|
+
> surface area is not a patch — stop and run `/cohorte-spec` instead.
|
|
50
|
+
|
|
51
|
+
`none`
|
|
52
|
+
|
|
53
|
+
## 6. Surface tasks
|
|
54
|
+
|
|
55
|
+
> One `###` subsection per surface the fix touches — a patch may legitimately span several (an
|
|
56
|
+
> unvalidated field on the API *and* the form that sends it). Each TDD: the §4 test first.
|
|
57
|
+
|
|
58
|
+
### <surface.key>
|
|
59
|
+
|
|
60
|
+
- …
|
|
61
|
+
|
|
62
|
+
## 7. Out of scope
|
|
63
|
+
|
|
64
|
+
> The adjacent things this patch deliberately does NOT fix. This is the section that keeps a bug fix
|
|
65
|
+
> from turning into a refactor — the reviewer reads it before flagging what you left alone. Real but
|
|
66
|
+
> out-of-scope findings belong in `specs/refactor-backlog.md`, not in this diff.
|
|
67
|
+
|
|
68
|
+
- …
|
|
69
|
+
|
|
70
|
+
## 9. Acceptance criteria / DoD
|
|
71
|
+
|
|
72
|
+
> §9, not §8 — the number is load-bearing, so don't renumber it. `cohorte-review.md` and
|
|
73
|
+
> `implementer.template.md` both name "contract §5, acceptance §9" verbatim, so a patch spec pins
|
|
74
|
+
> those two sections to the feature spec's numbers and just has no §8 (the feature spec has no §7 —
|
|
75
|
+
> a gap in the sequence is normal here).
|
|
76
|
+
|
|
77
|
+
- [ ] The §4 regression test exists, and failed before the fix
|
|
78
|
+
- [ ] Each touched surface's tests (TDD) green
|
|
79
|
+
- [ ] `PIPELINE.md` commands.lint · typecheck · test green
|
|
80
|
+
- [ ] The repro in §1 no longer reproduces
|
|
81
|
+
- [ ] Nothing outside §6's surfaces changed
|
|
82
|
+
|
|
83
|
+
## Remediation
|
|
84
|
+
|
|
85
|
+
> Filled by `/cohorte-fix` from a REVIEW REPORT; empty otherwise. Each item:
|
|
86
|
+
> `[ ] <SEVERITY> · <file:line> · <spec-violation|quality|security> · <concrete fix>`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## <type>(<scope>): <feature title>
|
|
2
|
+
|
|
3
|
+
**feature_id:** `<feature_id>` · closes/relates: <issue if any>
|
|
4
|
+
|
|
5
|
+
### What & why
|
|
6
|
+
|
|
7
|
+
<2–4 lines: what this ships and the value, from the spec goal>
|
|
8
|
+
|
|
9
|
+
### Changes
|
|
10
|
+
|
|
11
|
+
> One bullet per surface (from `PIPELINE.md` §surfaces), plus the shared contract.
|
|
12
|
+
|
|
13
|
+
- **<surface.key>:** <what changed>
|
|
14
|
+
- **Shared:** `<contract.path>/<feature_id>.<ext>` <(new/changed types: names only; omit if contract.enabled is false)>
|
|
15
|
+
|
|
16
|
+
### Tests
|
|
17
|
+
|
|
18
|
+
- <per surface: test runner · coverage>
|
|
19
|
+
- <PIPELINE.md commands.lint · typecheck · test> — green
|
|
20
|
+
|
|
21
|
+
### Review
|
|
22
|
+
|
|
23
|
+
Verdict: **SHIP** · remediation rounds: <n>
|
|
24
|
+
|
|
25
|
+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# REVIEW REPORT
|
|
2
|
+
|
|
3
|
+
<!-- REFERENCE COPY — not read at runtime. The AUTHORITATIVE shape is inlined in
|
|
4
|
+
core/agents/cohorte-review.md (§"Your return"), because an agent must not need a second
|
|
5
|
+
file read to know its own output format. This file exists for humans reading the
|
|
6
|
+
core; keep it byte-aligned with the agent, or delete both together.
|
|
7
|
+
|
|
8
|
+
Everything in an HTML comment is guidance — do NOT emit it.
|
|
9
|
+
The verdict rule is stated once, in the review agent's §Severity & verdict.
|
|
10
|
+
CAPPED: max 20 findings, ONE line each (severity · file:line · type · concrete fix),
|
|
11
|
+
ZERO code excerpts — file:line is enough, the source is on disk. Overflow ⇒ keep all
|
|
12
|
+
CRITICAL/HIGH/security, fill by severity, close with one `+<n> more …` line.
|
|
13
|
+
scripts/validate-core.mjs checks this file's headings against the agent's template. -->
|
|
14
|
+
|
|
15
|
+
feature_id: <feature_id> · scope: <surface.key>
|
|
16
|
+
|
|
17
|
+
| Severity | Count |
|
|
18
|
+
| -------- | ----- |
|
|
19
|
+
| CRITICAL | 0 |
|
|
20
|
+
| HIGH | 0 |
|
|
21
|
+
| MEDIUM | 0 |
|
|
22
|
+
| LOW | 0 |
|
|
23
|
+
|
|
24
|
+
Verdict: <SHIP | REVISE | BLOCK>
|
|
25
|
+
|
|
26
|
+
## Findings
|
|
27
|
+
|
|
28
|
+
<!-- Every finding self-sufficient for a stateless agent; order by severity; "None." if none.
|
|
29
|
+
The line format pastes straight into the spec's `## Remediation`. -->
|
|
30
|
+
|
|
31
|
+
- **[CRITICAL]** `<surface.path>/...:42` · spec-violation · <what's wrong vs spec §X> → **Fix:** <concrete change>
|
|
32
|
+
- **[HIGH]** `<path>:88` · quality · <issue> → **Fix:** <concrete change>
|
|
33
|
+
- **[HIGH]** `<path>:line` · security · <vuln> → **Fix:** <concrete change>
|
|
34
|
+
- **[MEDIUM]** `<path>:line` · complexity · yagni: <what> → **Fix:** <the cheaper form>
|
|
35
|
+
|
|
36
|
+
## Deferred
|
|
37
|
+
|
|
38
|
+
<!-- Real but out of this feature's scope (agent §Deferred): worst first, "None." if none, max 10.
|
|
39
|
+
Counted in no severity row, never in the verdict — the lead routes them to the backlog. -->
|
|
40
|
+
|
|
41
|
+
- **[MEDIUM]** `<path>:line` · quality · <problem> → **Fix:** <concrete change> · out of scope: <why this feature does not own it>
|
|
42
|
+
|
|
43
|
+
## Notes
|
|
44
|
+
|
|
45
|
+
<!-- ONLY the RBAC / mobile-first assessment when the profile enables them; omit the section
|
|
46
|
+
otherwise. Never list things verified clean. -->
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
feature_id: <slug>
|
|
3
|
+
title: <Feature title>
|
|
4
|
+
status: draft # draft → frozen → in-progress → in-review → shipped → merged · blocked · abandoned (see SCHEMA.md §Spec status)
|
|
5
|
+
branch: <feature_branch_prefix><slug>
|
|
6
|
+
created: <YYYY-MM-DD>
|
|
7
|
+
reviewed_base: # merge-base sha at the last SHIP verdict — freshness-gate anchor (written by /cohorte-review)
|
|
8
|
+
reviewed_digest: # sha256 (16 hex) of the reviewed source diff vs reviewed_base, specs excluded — /cohorte-ship re-checks
|
|
9
|
+
design_files: [] # design page links — full URLs of the form https://claude.ai/design/p/<projectId>?file=<file> (each carries its own project + page); blank until designed; omit if no UI
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# <Feature title>
|
|
13
|
+
|
|
14
|
+
## 1. Goal & user story
|
|
15
|
+
|
|
16
|
+
<one paragraph: what · who · why>
|
|
17
|
+
|
|
18
|
+
## 2. Scope
|
|
19
|
+
|
|
20
|
+
**In:** …
|
|
21
|
+
**Out (non-goals):** …
|
|
22
|
+
|
|
23
|
+
## 3. Roles & permissions
|
|
24
|
+
|
|
25
|
+
> Only if `PIPELINE.md` §rbac is enabled — which roles can do what; note the lowest-privilege experience.
|
|
26
|
+
|
|
27
|
+
## 4. Data model & migrations
|
|
28
|
+
|
|
29
|
+
> Additive only (never gate.deny commands). Omit if the feature has no persistence.
|
|
30
|
+
|
|
31
|
+
| table | column | type | null? | default | notes |
|
|
32
|
+
| ----- | ------ | ---- | ----- | ------- | ----- |
|
|
33
|
+
| | | | | | |
|
|
34
|
+
|
|
35
|
+
## 5. CONTRACT (frozen)
|
|
36
|
+
|
|
37
|
+
> The only sync channel. Complete enough to build every surface independently. Uses the profile's
|
|
38
|
+
> `contract.mechanism`. If `contract.enabled` is false, capture the interface precisely in prose here.
|
|
39
|
+
|
|
40
|
+
### `<METHOD> /<path>` · auth: `<middleware/role>`
|
|
41
|
+
|
|
42
|
+
- **Request** — params / query / body: `field` · type · required? · nullable? · validation
|
|
43
|
+
- **Success** — `<status>` · response shape
|
|
44
|
+
- **Errors** — `<status>` · when (422 validation · 401 · 403 · 404 · 409 …)
|
|
45
|
+
|
|
46
|
+
<repeat per endpoint/interface>
|
|
47
|
+
|
|
48
|
+
### Contract types — lead authors `<contract.path>/<slug>.<ext>` before /cohorte-build
|
|
49
|
+
|
|
50
|
+
- `<slug>...Request` / `<slug>...Response` / `<slug>Base` … (sketch the schemas here)
|
|
51
|
+
|
|
52
|
+
## 6. Surface tasks
|
|
53
|
+
|
|
54
|
+
> One `###` subsection per surface in `PIPELINE.md` §surfaces (e.g. backend, frontend), each TDD.
|
|
55
|
+
> Surfaces are subsections of §6, never top-level sections — §5, §8 and §9 are referenced by number
|
|
56
|
+
> across the whole pipeline (the implementer and reviewer agents read "contract §5, acceptance §9",
|
|
57
|
+
> `/cohorte-spec` writes the design brief summary into §8), so a third surface must not become a §7
|
|
58
|
+
> or §8 of its own. (§7 is deliberately absent here — the patch template uses it for Out of scope.)
|
|
59
|
+
|
|
60
|
+
### <surface.key>
|
|
61
|
+
|
|
62
|
+
- …
|
|
63
|
+
|
|
64
|
+
## 8. Design brief (the "spec return")
|
|
65
|
+
|
|
66
|
+
> Only if the project has UI. Standalone; mirrors `<core>/templates/design-brief.md`.
|
|
67
|
+
|
|
68
|
+
- **Screens / views:** …
|
|
69
|
+
- **Flows:** …
|
|
70
|
+
- **Responsive:** mobile (base) → `md:` → `lg:`
|
|
71
|
+
- **States:** empty · loading · error · success
|
|
72
|
+
|
|
73
|
+
## 9. Acceptance criteria / DoD
|
|
74
|
+
|
|
75
|
+
- [ ] Every contract endpoint/interface implemented exactly
|
|
76
|
+
- [ ] Each surface's tests (TDD) green
|
|
77
|
+
- [ ] `PIPELINE.md` commands.lint · typecheck · test green
|
|
78
|
+
- [ ] Mobile-first / responsive verified (if UI)
|
|
79
|
+
- [ ] User-facing copy in `ui_language`
|
|
80
|
+
|
|
81
|
+
## 10. Assumptions & open questions
|
|
82
|
+
|
|
83
|
+
- …
|
|
84
|
+
|
|
85
|
+
## Remediation
|
|
86
|
+
|
|
87
|
+
> Filled by `/cohorte-fix` (or `/cohorte-spec` Mode B) from a REVIEW REPORT; empty otherwise. Each item:
|
|
88
|
+
> `[ ] <SEVERITY> · <file:line> · <spec-violation|quality|security> · <concrete fix>`
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# /cohorte-init-pipeline · 01 Detect the stack
|
|
2
|
+
|
|
3
|
+
### Phase 1 — Detect the stack (read-only, no questions yet)
|
|
4
|
+
|
|
5
|
+
Gather evidence, then summarize what you found. Look for:
|
|
6
|
+
|
|
7
|
+
- **Package manager & workspaces:** root `package.json` (`packageManager`, `workspaces`),
|
|
8
|
+
`pnpm-workspace.yaml`, `turbo.json`, `nx.json`, `lerna.json`; lockfiles (`pnpm-lock.yaml`,
|
|
9
|
+
`package-lock.json`, `yarn.lock`, `bun.lockb`); or non-JS: `pyproject.toml`/`requirements.txt`,
|
|
10
|
+
`go.mod`, `Cargo.toml`, `Gemfile`, `composer.json`.
|
|
11
|
+
- **Surfaces (independently-built areas):** `apps/*`, `packages/*`, `services/*`, `cmd/*`, or a single
|
|
12
|
+
root app. For each, detect its framework from its own `package.json`/config:
|
|
13
|
+
backend markers (`adonisrc.ts`, `@adonisjs/*`, `nestjs`, `express`, `fastify`, `django`, `fastapi`,
|
|
14
|
+
`rails`, `.go`), frontend markers (`vite.config.*`, `next.config.*`, `@tanstack/react-router`,
|
|
15
|
+
`angular.json`, `nuxt`, `svelte`), and its test runner (`@japa/*`, `vitest`, `jest`, `playwright`,
|
|
16
|
+
`pytest`, `go test`), linter/formatter (`eslint`, `prettier`, `biome`, `ruff`).
|
|
17
|
+
- **Split candidates (sub-surface boundaries):** inside each surface, look for a clean internal partition
|
|
18
|
+
— feature modules (`src/features/*`, `src/modules/*`, `app/(group)/*`), or independent services
|
|
19
|
+
(`services/*`, domain folders). Note the surface's rough size (module/file count) so a *large* surface
|
|
20
|
+
with a *clean* boundary can be proposed as several specialized surfaces in Phase 2. See SCHEMA.md
|
|
21
|
+
§"Specialization — when to split one surface into more agents" for the heuristic. Don't split yet — just
|
|
22
|
+
flag candidates + their would-be shared-code tree.
|
|
23
|
+
- **Per-surface commands:** derive `test`/`lint`/`format`/`typecheck`/`build` from each surface's
|
|
24
|
+
`package.json` scripts + the workspace filter syntax (e.g. `pnpm --filter <pkg> test`).
|
|
25
|
+
- **Contract mechanism:** a shared types/schema package (`packages/shared-types`, Zod/`z.`),
|
|
26
|
+
an `openapi.*`/`swagger.*` file, `.proto` files, or none.
|
|
27
|
+
- **Release notes / versioning:** a `.changeset/` directory (+ `config.json`, and whether it declares a
|
|
28
|
+
`fixed`/lockstep group — that names the anchor package), `changesets` in devDependencies, or a CI job
|
|
29
|
+
that fails a PR lacking a note (grep `.github/workflows/*` for `changeset`). Also note the root
|
|
30
|
+
`version`: a `0.y.z` product usually forbids `major`. None of these ⇒ `release_notes.enabled: false`.
|
|
31
|
+
- **DB / migrations:** migration tooling (`node ace make:migration`, `knex`, `prisma`, `alembic`,
|
|
32
|
+
`golang-migrate`), a `docker-compose.yml`, DB service.
|
|
33
|
+
- **Design system:** an existing `design-reference/` snapshot, `components/ui`, a DesignSync MCP
|
|
34
|
+
connection, Figma links, or none.
|
|
35
|
+
- **Code retrieval:** is the `serena` CLI resolvable (`command -v serena`)? If not, does
|
|
36
|
+
`~/.local/bin/serena` exist anyway — installed but PATH-broken (see SCHEMA.md §Code retrieval)?
|
|
37
|
+
`graphify`? Is either already registered in this repo's `.mcp.json` or `claude mcp list`? (Feeds
|
|
38
|
+
the retrieval question + Phase 4 wiring — default provider is `serena`.)
|
|
39
|
+
- **VCS:** `git remote -v` → host + `owner/repo`; the default branch (`git symbolic-ref refs/remotes/origin/HEAD` or `git branch`).
|
|
40
|
+
- **Existing `<memory>`** — read it; it may already state stack/conventions to fold in. **Existing
|
|
41
|
+
`PIPELINE.md`** — if present, this is a re-run: load it as the starting draft and only reconcile deltas.
|
|
42
|
+
|
|
43
|
+
Print a compact **Detection Report**: layout, surfaces (with framework + commands), contract, release
|
|
44
|
+
notes, DB, design, vcs. Mark each field `detected` / `guessed` / `unknown`.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# /cohorte-init-pipeline · 02 Interview the gaps
|
|
2
|
+
|
|
3
|
+
### Phase 2 — Interview the gaps (AskUserQuestion)
|
|
4
|
+
|
|
5
|
+
Ask ONLY what you couldn't confidently detect. Batch related questions. Cover:
|
|
6
|
+
|
|
7
|
+
- **Surfaces & ownership** — confirm the surface list and each one's path + owning agent name. (If a
|
|
8
|
+
single-app repo, one surface.) Confirm the `tools` each agent needs (add `DesignSync` only to a
|
|
9
|
+
surface with `uses_design: true`), and each surface's `model` tier: `sonnet` (Recommended default —
|
|
10
|
+
implementers mostly apply a frozen contract, which Sonnet handles at a fraction of the Opus-lead
|
|
11
|
+
cost), `haiku` for purely mechanical surfaces (scaffolding), `inherit` only for surfaces with real
|
|
12
|
+
design decisions worth running on the lead's model.
|
|
13
|
+
- **Specialization (only if Phase 1 flagged a large + cleanly-separable surface)** — offer to split it
|
|
14
|
+
into specialized sub-surfaces (e.g. `web-checkout`, `web-billing`) so `/cohorte-build` runs them in parallel,
|
|
15
|
+
per SCHEMA.md §Specialization. If the human accepts, apply the rules: **shared code (routing, global
|
|
16
|
+
state, DS kit/tokens) becomes its own single-owner surface**, and cross-slice shapes go through the
|
|
17
|
+
contract. Default to NOT splitting when boundaries are tangled or slices are tiny — coarse is fine.
|
|
18
|
+
- **Quiet commands** (never store a bare `pnpm test` as what agents execute) — for each noisy command
|
|
19
|
+
(tests, lint; per surface AND repo-wide), propose the detected **bridled variant** as the
|
|
20
|
+
Recommended option: dot/failures-only reporter (`--reporter=dot` vitest/playwright, `--silent`
|
|
21
|
+
jest, `-q` pytest, `--quiet` eslint/ruff — whatever the detected runner supports). These land in
|
|
22
|
+
`test_quiet_cmd`/`lint_quiet_cmd` + `commands.test_quiet`/`lint_quiet` and are what agents and the
|
|
23
|
+
`/cohorte-review` pre-flight actually run (SCHEMA.md §Output discipline). If the human declines or
|
|
24
|
+
the runner has no such flag, leave `""` — consumers then fall back to `<cmd> 2>&1 | tail -40`.
|
|
25
|
+
- **Contract** — mechanism (`shared-types-zod` / `openapi` / `protobuf` / `json-schema` / `none`) and
|
|
26
|
+
where feature contracts are authored. If `none`, surfaces sync by the spec prose alone.
|
|
27
|
+
- **Release notes (only if Phase 1 found a versioning tool or a note-enforcing CI job)** — confirm the
|
|
28
|
+
anchor package (a `fixed`/lockstep group means ONE key propagates to all), the note's language, and the
|
|
29
|
+
**bump policy** the lead will apply at `/cohorte-ship`: what counts as major/minor/patch here, and
|
|
30
|
+
whether any level is forbidden (a `0.y.z` product normally forbids `major` — Changesets would jump it
|
|
31
|
+
to `1.0.0` with no human deciding). Policy prose lands in `release_notes.guidance`. Nothing detected ⇒
|
|
32
|
+
don't ask; leave `release_notes.enabled: false`.
|
|
33
|
+
- **UI language** — language of all user-facing copy.
|
|
34
|
+
- **RBAC** — is there a role hierarchy? If yes, list it highest→lowest.
|
|
35
|
+
- **Design system** — enabled? provider (Claude Design / Figma / none) + project ids + kit/token paths.
|
|
36
|
+
- **Code retrieval** — confirm the provider (see SCHEMA.md §Code retrieval): `serena` (Recommended
|
|
37
|
+
default — live LSP symbol navigation, no index to maintain), `graphify` (persistent knowledge graph
|
|
38
|
+
over code + docs — better on very large or mixed code+docs repos, but needs an index step + rescans),
|
|
39
|
+
or `none`. Only demote from `serena` if the human objects or the provider CLI can't be installed.
|
|
40
|
+
- **Isolation** — build features in parallel git worktrees with per-feature DB + ports, or just in the
|
|
41
|
+
main checkout? If worktrees: DB-per-worktree? port bases? compose file?
|
|
42
|
+
- **Gate** — confirm the destructive commands to hard-deny and the ones to confirm-first (seed from the
|
|
43
|
+
detected DB/migration tooling + always git commit/push/merge/rebase/reset).
|
|
44
|
+
- **Personas** — keep the default `/cohorte-brainstorm` panel, or customize members for this domain?
|
|
45
|
+
|
|
46
|
+
Prefer sensible defaults from Phase 1 as the first (Recommended) option in each question.
|
|
47
|
+
|
|
48
|
+
- **Kanban** (optional) — mirror this project's pipeline (`/cohorte-brainstorm`…`/cohorte-ship`) onto an Obsidian
|
|
49
|
+
Kanban board? If the human says yes: confirm the shared vault path (`obsidian.vault_path` in
|
|
50
|
+
`<config>`; ask if empty) and the board's location inside it (default
|
|
51
|
+
`<ProjectName>/Tasks.md`). Phase 4 creates the board and records the link. Default: no.
|
|
52
|
+
|
|
53
|
+
> The **kanban** link is user-scoped (it points at a personal vault, so it never goes in the committed
|
|
54
|
+
> `PIPELINE.md`), but IS wired here because it is per-project — see Phase 4.
|
|
55
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# /cohorte-init-pipeline · 03 Draft the profile
|
|
2
|
+
|
|
3
|
+
### Phase 3 — Draft the profile (show, don't write yet)
|
|
4
|
+
|
|
5
|
+
Assemble the full `PIPELINE.md` from `<core>/pipeline/PIPELINE.template.md`, filling the `yaml pipeline-profile`
|
|
6
|
+
block and every prose section from Phases 1–2. **Keep it lean**: every stateless agent re-reads this
|
|
7
|
+
file on every dispatch, so its length is a per-dispatch token+latency tax — terse rule-shaped
|
|
8
|
+
conventions, no narration, no facts derivable from the code. **Show the human the drafted
|
|
9
|
+
`PIPELINE.md` in a fenced block and get a go-ahead** before writing.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# /cohorte-init-pipeline · 04 Write & render
|
|
2
|
+
|
|
3
|
+
### Phase 4 — Write & render (after go-ahead)
|
|
4
|
+
|
|
5
|
+
1. **Write `PIPELINE.md`** at the repo root (source: the installer's `pipeline/PIPELINE.template.md`).
|
|
6
|
+
2. **Wire it into `<memory>`:** if `<memory>` exists, ensure it references the profile (add a line
|
|
7
|
+
near the top: `> Project profile & pipeline facts: **@PIPELINE.md**`). If not, create a minimal
|
|
8
|
+
`<memory>` with that reference + a one-paragraph project intro.
|
|
9
|
+
3. **Render one agent per surface** — for each surface, follow SCHEMA.md §"Rendering / reconciling a
|
|
10
|
+
surface agent" (steps 2–3): render `<agents>/<agent>.md` from the installer's
|
|
11
|
+
`pipeline/implementer.template.md`, substituting `<SURFACE_AGENT>`, `<SURFACE_LABEL>`, `<SURFACE_PATH>`,
|
|
12
|
+
`<SURFACE_TOOLS>`, `<SURFACE_MODEL>`, `<PROJECT_NAME>`, `<SURFACE_CONVENTIONS>` (the surface's
|
|
13
|
+
baked convention slice — §Shared + its `### Surface:` stanza + its §Testing lines from the
|
|
14
|
+
PIPELINE.md you just wrote), and the surface-specific blocks
|
|
15
|
+
(`<SURFACE_EXTRA_NEVER>`, `<SURFACE_DESIGN_INPUT>`, `<SURFACE_TDD_STEP1>` — fill design-related ones
|
|
16
|
+
only when `uses_design`).
|
|
17
|
+
Leave the fixed agents as-is (generic, shipped by the installer under `<fixed-agents>/`). Surface
|
|
18
|
+
agents go in `<agents>/` (this repo) — never under `~/.claude/agents`, where two projects with a
|
|
19
|
+
surface of the same name would overwrite each other.
|
|
20
|
+
4. **Generate `<state>/gate-config.json`** from the `gate` block — copy all five keys verbatim:
|
|
21
|
+
`{"deny": [...], "ask": [...], "ask_on_default_branch": [...], "default_branch": "<vcs.default_branch>",
|
|
22
|
+
"preflight": {"enabled": <gate.preflight.enabled>, "agents": [...], "max_age_minutes": <n>}}`
|
|
23
|
+
(profile has no `preflight` block ⇒ omit the key — the hook then skips the phase gate).
|
|
24
|
+
5. **Write `.claude/settings.json`** permissions (`ask`/`deny` lists mirroring the gate, **plus an
|
|
25
|
+
`allow` list of the project's read-only / verification commands** so agents don't stall on
|
|
26
|
+
permission prompts — including mid-workflow, where nobody is watching a prompt: the detected
|
|
27
|
+
per-surface `test_cmd`/`lint_cmd`/`typecheck_cmd`/`build_cmd` **and their `*_quiet_cmd`
|
|
28
|
+
variants** and repo-wide `commands.*` equivalents as `Bash(<cmd>:*)` rules, plus read-only git —
|
|
29
|
+
`Bash(git status:*)`, `Bash(git diff:*)`, `Bash(git log:*)`, `Bash(git rev-parse:*)` — plus the
|
|
30
|
+
shipped pipeline scripts (`Bash(<core>/pipeline/scripts/:*)` — preflight, kanban-move;
|
|
31
|
+
a prefix rule matches a command *starting* with that path, so a `bash <path>`
|
|
32
|
+
invocation would need its own entry), and the
|
|
33
|
+
retrieval provider's MCP tools when wired (e.g. `mcp__serena`). Never allowlist anything matching
|
|
34
|
+
a `gate.ask`/`gate.deny` pattern. Mention the human can widen it later with
|
|
35
|
+
`/fewer-permission-prompts`) + the PostToolUse formatter hook (detected formatter). Do **not**
|
|
36
|
+
write the gate hook here — step 9 (`<sync>`) registers it.
|
|
37
|
+
Preserve any existing custom keys.
|
|
38
|
+
6. **Wire the retrieval provider** (skip if `retrieval.provider: none`):
|
|
39
|
+
- **serena:** if the `serena` CLI is missing, have the human install it (`uv tool install -p 3.13
|
|
40
|
+
serena-agent`) — or set the provider to `none` if they decline, and say `/cohorte-update-pipeline` can wire
|
|
41
|
+
it later. If the binary exists (e.g. `~/.local/bin/serena`) but `command -v serena` fails,
|
|
42
|
+
recommend the PATH fix (`uv tool update-shell`, or add `~/.local/bin` to the shell profile) for
|
|
43
|
+
CLI use. Then register at **project scope** (committed `.mcp.json`, portable —
|
|
44
|
+
`--project-from-cwd` resolves the project at server start) using the **PATH-proof launcher**
|
|
45
|
+
from SCHEMA.md §Code retrieval (`sh -c 'exec "$(command -v serena || echo
|
|
46
|
+
"$HOME/.local/bin/serena")" start-mcp-server …'` — a bare `serena` entry dies with ENOENT when
|
|
47
|
+
Claude Code was launched from an environment without `~/.local/bin` on PATH; Windows-native
|
|
48
|
+
teams use the bare form + PATH instead). If `.mcp.json` already has a bare `serena` entry,
|
|
49
|
+
upgrade it to the launcher form rather than skipping. Add `.serena/` to the repo's `.gitignore`
|
|
50
|
+
(per-machine cache/config Serena creates on first launch). On a large repo, offer the one-off
|
|
51
|
+
`serena project index`. Finish with the **health check** from SCHEMA.md §Code retrieval and
|
|
52
|
+
report each result — if the static checks pass but the server isn't connected in this session,
|
|
53
|
+
say a session restart is needed; never report Serena wired on registration alone.
|
|
54
|
+
- **graphify:** have the human install it (`uv tool install graphify` then `graphify install`),
|
|
55
|
+
build the initial graph (`/graphify .`), and note it needs incremental rescans (`--update`) after
|
|
56
|
+
big changes.
|
|
57
|
+
- Either way the rendered agents already carry the provider's MCP tools in their `tools:` list
|
|
58
|
+
(step 3 / SCHEMA §Rendering); remind the human the new MCP server appears after a session restart.
|
|
59
|
+
7. **Render the isolation scripts** (if `isolation.enabled`) from the installer's
|
|
60
|
+
`pipeline/scripts/*.template` to this repo's `scripts/new-feature.sh` and `scripts/remove-feature.sh`,
|
|
61
|
+
substituting the `__TOKENS__` (project
|
|
62
|
+
slug, DB pattern, port bases, compose file, branch prefix, install/dev/migrate commands, per-surface
|
|
63
|
+
env stanzas). `chmod +x` them. If isolation is disabled, skip and note features build in the main checkout.
|
|
64
|
+
8. **Wire the project: run `<sync>`** from the repo root (one Bash call) and show its output. It is
|
|
65
|
+
deterministic and idempotent: it copies the gate to `.claude/hooks/cohorte-gate.py`, registers it
|
|
66
|
+
in `.claude/settings.json` (matchers `Bash|Task|Agent` and `Write|Edit|MultiEdit`, exactly once,
|
|
67
|
+
every other hook kept), writes the `<state>/pipeline.json` pointer, adds
|
|
68
|
+
`<state>/preflight.ok`, `<state>/pipeline-metrics.jsonl` and `specs/reports/` to `.gitignore`, and
|
|
69
|
+
seeds `specs/_template.md`. If it exits non-zero (e.g. `.claude/settings.json` is not valid JSON),
|
|
70
|
+
stop and show the error — never hand-write those files instead. If `<state>/preflight.ok` is
|
|
71
|
+
already tracked: `git rm --cached <state>/preflight.ok`.
|
|
72
|
+
9. **Tell the human what to commit:** `PIPELINE.md`, `<agents>/`, `<state>/gate-config.json`,
|
|
73
|
+
`<state>/settings.json`, `.claude/hooks/cohorte-gate.py`, `<state>/pipeline.json`, `.gitignore`,
|
|
74
|
+
`<memory>`. A teammate who clones gets the gate immediately; they need `npm i -g cohorte &&
|
|
75
|
+
cohorte install` only for the commands.
|
|
76
|
+
10. **CI workflow** (if `vcs.host: github` and no existing workflow already runs the profile's
|
|
77
|
+
checks): with the human's go-ahead, generate `.github/workflows/pipeline-ci.yml` — on
|
|
78
|
+
`pull_request` to `<default_branch>`: checkout, set up the `package_manager` toolchain,
|
|
79
|
+
`commands.install`, then `commands.lint` · `commands.typecheck` · `commands.test` (+ per-surface
|
|
80
|
+
`build_cmd`s that are non-empty). Derive the setup steps from the detected stack — mirror what a
|
|
81
|
+
sibling workflow does if one exists. `/cohorte-ship` watches these checks before the merge.
|
|
82
|
+
11. **Design system:** if `design.enabled` with a snapshot dir, note that `/cohorte-align-ds` is active; else the
|
|
83
|
+
`/cohorte-align-ds` command will no-op with a clear message.
|
|
84
|
+
12. **Kanban** (only if the human opted in at Phase 2): wire it per SCHEMA.md §Kanban, writing into the
|
|
85
|
+
**global** `<config>` (never into this repo — the board points at a
|
|
86
|
+
personal vault). Create the file from `pipeline/cohorte.config.template.yaml` if absent; set
|
|
87
|
+
`kanban.enabled: true` and `obsidian.vault_path` if it was empty. Add a `kanban.boards[<PIPELINE
|
|
88
|
+
name>]` entry with `board: <folder>/Tasks.md`. Then **create the board file**
|
|
89
|
+
`<vault>/<folder>/Tasks.md` (per §Kanban) if it doesn't exist — one column per `kanban.columns`
|
|
90
|
+
stage, in pipeline order. Finally run the §Kanban backfill so any spec already in `specs/` lands on
|
|
91
|
+
the board. Report the board path + the `obsidian://` URI. Skip silently if the human declined.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# /cohorte-init-pipeline · 05 Report
|
|
2
|
+
|
|
3
|
+
### Phase 5 — Report
|
|
4
|
+
|
|
5
|
+
Print: the core version (`<core>/pipeline/VERSION`), the `<sync>` output, the files written/rendered, the surface→agent mapping, and the
|
|
6
|
+
tailored workflow line, e.g.
|
|
7
|
+
`/cohorte-brainstorm → /cohorte-spec → (design) → /cohorte-build <id> → test → /cohorte-review → /cohorte-ship`. Tell the human to sanity-check
|
|
8
|
+
`PIPELINE.md`, commit it, and run `/cohorte-brainstorm` to start a feature. Note that this was the one-time
|
|
9
|
+
setup: from now on `/cohorte-update-pipeline` both refreshes the core AND reconciles the generated files
|
|
10
|
+
(SCHEMA.md §Reconcile), and `/cohorte-build` auto-grows surfaces — re-running `/cohorte-init-pipeline` is only for deep
|
|
11
|
+
stack changes (package manager, contract mechanism, surface overhaul).
|