cohorte 1.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +264 -0
  2. package/LICENSE +661 -0
  3. package/README.md +269 -0
  4. package/bin/cli.js +339 -0
  5. package/core/agents/implementer.template.md +74 -0
  6. package/core/agents/release.md +51 -0
  7. package/core/agents/review.md +85 -0
  8. package/core/commands/align-ds.md +32 -0
  9. package/core/commands/audit.md +31 -0
  10. package/core/commands/brainstorm.md +48 -0
  11. package/core/commands/build.md +91 -0
  12. package/core/commands/doctor.md +50 -0
  13. package/core/commands/fix.md +62 -0
  14. package/core/commands/init-pipeline.md +32 -0
  15. package/core/commands/refactor.md +38 -0
  16. package/core/commands/review.md +68 -0
  17. package/core/commands/ship.md +68 -0
  18. package/core/commands/smoke.md +55 -0
  19. package/core/commands/spec.md +67 -0
  20. package/core/commands/update-pipeline.md +96 -0
  21. package/core/hooks/__pycache__/gate.cpython-312.pyc +0 -0
  22. package/core/hooks/gate.py +129 -0
  23. package/core/templates/agent-handoff.md +34 -0
  24. package/core/templates/brainstorm-return.md +36 -0
  25. package/core/templates/design-brief.md +35 -0
  26. package/core/templates/pr-body.md +29 -0
  27. package/core/templates/review-feedback.md +36 -0
  28. package/core/templates/spec.template.md +84 -0
  29. package/core/templates/steps/init-pipeline/01-detect-stack.md +40 -0
  30. package/core/templates/steps/init-pipeline/02-interview-gaps.md +41 -0
  31. package/core/templates/steps/init-pipeline/03-draft-profile.md +10 -0
  32. package/core/templates/steps/init-pipeline/04-write-render.md +88 -0
  33. package/core/templates/steps/init-pipeline/05-report.md +12 -0
  34. package/dashboard/README.md +54 -0
  35. package/dashboard/dist/apple-touch-icon-180.png +0 -0
  36. package/dashboard/dist/assets/index-CoBuEdy-.js +42 -0
  37. package/dashboard/dist/assets/index-DN5OGW9g.css +1 -0
  38. package/dashboard/dist/favicon-16.png +0 -0
  39. package/dashboard/dist/favicon-32.png +0 -0
  40. package/dashboard/dist/favicon-48.png +0 -0
  41. package/dashboard/dist/icon-192.png +0 -0
  42. package/dashboard/dist/icon-512.png +0 -0
  43. package/dashboard/dist/index.html +16 -0
  44. package/dashboard/server/doctor.js +266 -0
  45. package/dashboard/server/fleet.js +119 -0
  46. package/dashboard/server/index.js +306 -0
  47. package/dashboard/server/kanban.js +158 -0
  48. package/dashboard/server/versions.js +111 -0
  49. package/dashboard/server/yaml.js +126 -0
  50. package/install.ps1 +359 -0
  51. package/install.sh +301 -0
  52. package/package.json +40 -0
  53. package/profile/PIPELINE.template.md +208 -0
  54. package/profile/SCHEMA.md +303 -0
  55. package/profile/cohorte.config.template.yaml +43 -0
  56. package/scripts/new-feature.sh.template +89 -0
  57. package/scripts/remove-feature.sh.template +53 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,264 @@
1
+ # Changelog
2
+
3
+ Entries are shown by `/update-pipeline` ("What's new") after a core refresh. Keep them short,
4
+ user-facing, most recent first. One `## <version> — <YYYY-MM-DD>` section per release.
5
+
6
+ ## 1.0.0 — 2026-07-28
7
+
8
+ > **Renamed `thebidouille-agents` → `cohorte`** and cut the first stable release. The npm package,
9
+ > the CLI (`npx cohorte …`), the repo, and the user config file are all renamed. The pre-rename
10
+ > `~/.claude/thebidouille.config.yaml` and `~/.claude/thebidouille-dashboard.json` are still read as a
11
+ > fallback, so existing installs keep working — `/update-pipeline` migrates them forward on next run.
12
+
13
+ - **Repo moved to the `TheBidouilleAgency` org** (`github.com/TheBidouilleAgency/cohorte`), with a
14
+ proper logo/brand kit under `assets/` and a dashboard favicon set.
15
+
16
+ - **The research + questionnaire capability was removed from the core.** `/research`,
17
+ `/questionnaire`, their agents, templates and step files are extracted to a separate private repo
18
+ and will return later as an installable Cohorte **plugin**. `update` scrubs the now-orphaned files
19
+ from existing installs. The global config keeps only the shared Obsidian vault + the kanban mirror;
20
+ the `research:`/`questionnaire:` config keys are gone.
21
+
22
+ - **`/ship` now reliably moves the kanban card to Shipped and writes the PR number.** The
23
+ move-to-Shipped was a parenthetical in the command header, easy to skip — so shipped features could
24
+ leave their card stuck in an earlier column. It is now an explicit, verify-after step (§4): move
25
+ card `#<id>` → `shipped` **and append `PR #<num>`** (from the PR URL), then re-read the board to
26
+ confirm. The bare `#<num>` is what the dashboard renders as a clickable PR link. SCHEMA.md §Kanban
27
+ documents the shipped-card format. (`/ship` also moves the card → `ship` on confirm, in §1.)
28
+
29
+ - **Branch-aware gate — git + docker run freely on feature branches, gated only on the default
30
+ branch.** The `gate` block gains two keys: `ask_on_default_branch` (patterns confirmed *only* when
31
+ the checked-out branch is `default_branch`) and `default_branch` (default `main`). `gate.py`
32
+ resolves the current branch at run time (`git rev-parse`); an unknown branch (no repo / detached)
33
+ is treated conservatively as gated. The default profile moves git (commit/push/merge/rebase/reset)
34
+ and `docker compose` into this tier, so agents move fast on feature branches while `main` stays
35
+ protected; DB commands (`migration:run`, `db:`, `psql`) remain always-`ask`, destructive migrations
36
+ always-`deny`. Existing gate-configs without the new keys keep working unchanged. Re-run
37
+ `/update-pipeline` to regenerate `gate-config.json` with the new tier.
38
+
39
+ - **New `dashboard` subcommand — a local web cockpit for the pipeline.** Run
40
+ `npx cohorte dashboard` to open a browser view of pipeline state: a **Fleet**
41
+ overview (global core version vs npm latest + every tracked project's freshness and health
42
+ at a glance), a per-project drill-down that renders `/doctor` as a live checklist, the
43
+ **Surfaces ↔ agents** map from `PIPELINE.md`, and a **Specs board** (kanban by
44
+ `draft·frozen·in-review·shipped`). Install/update actions run the CLI and stream their output
45
+ live. Add projects by path — the set is remembered in `~/.claude/cohorte-dashboard.json`.
46
+ The runtime is dependency-free (node's built-in `http` serves a prebuilt React app); the
47
+ `/doctor` checks are reimplemented in JS so they run without a Claude session. Point it at any
48
+ pipeline-ised repo, or at nothing (it seeds the launch directory). A **folder picker** browses
49
+ the filesystem to add projects (dirs with a `PIPELINE.md` are flagged), and a **Reset pipeline**
50
+ action wipes a project's entire pipeline footprint (`.claude/`, `PIPELINE.md`, optionally
51
+ `specs/`) — backed up first to `.claude.bak-<ts>/`, the shared `~/.claude` core untouched — so a
52
+ project riddled with old-version relics can be brought back to a clean, pipeline-managed state
53
+ (then `/init-pipeline` regenerates the profile). **Init-pipeline / Update-pipeline** buttons run
54
+ those Claude Code commands headless (`claude -p … --dangerously-skip-permissions`) in the project
55
+ and stream the output. The server **binds `127.0.0.1` by default** (its actions execute code);
56
+ `--host=ADDR` exposes it with a printed security warning, `--open` launches the browser.
57
+ Projects with a linked **Obsidian Kanban board** (config `kanban.boards`) get it rendered inline —
58
+ columns + cards read straight from the vault markdown (local, no token; Notion is not a kanban
59
+ source in this pipeline, only /research archival). PR references become clickable links, enriched
60
+ with **live PR status** (open/merged/closed/draft) + date via the user's `gh` CLI (cached 60s), and
61
+ the **Shipped** column is sorted by ship date. Cards missing an explicit `#<num>` have their PR
62
+ **inferred from the branch** (`…/<feature_id>`), so historical boards light up too.
63
+
64
+ ## 0.1.27 — 2026-07-28
65
+
66
+ - **README gains a Prerequisites section.** Spells out what a new machine actually needs: Node ≥ 18 + npm
67
+ (the only hard requirement, for the `npx` installer) versus `uv` + the Serena CLI (optional, the default
68
+ retrieval provider — installed separately, independent of the `npx` core install, order irrelevant, and
69
+ the pipeline still runs without it by falling back to Grep/Read). Also documents the cloned-repo case
70
+ (Serena registration travels in the committed `.mcp.json`; just install the CLI + restart + `/doctor`).
71
+ The mechanics were already in `SCHEMA.md` §Code retrieval, but not in the human-facing onboarding doc.
72
+
73
+ ## 0.1.26 — 2026-07-28
74
+
75
+ - **The design step now references designs by full link, not a stored project id + bare filename.** A
76
+ `design_files` entry is a self-contained `https://claude.ai/design/p/<projectId>?file=<file>` link that
77
+ carries its own project (`/p/<projectId>`) and page (`?file=`); agents extract both and read it via
78
+ `DesignSync get_file(<projectId>, <file>)`. No stored `design_project` id means a design-system rebuild
79
+ (which mints a new project id) no longer breaks every spec — you just paste the new links. `design_project`
80
+ becomes an optional legacy fallback (default `none`) for old bare-filename specs. Updated across `/build`
81
+ (design gate + dispatch), `/smoke`, `/spec` + the spec template, `PIPELINE.md` (§design + conventions),
82
+ `SCHEMA.md`, and `/doctor`. Crucially, the surface-agent render step now specifies the link-based
83
+ `<SURFACE_DESIGN_INPUT>`/`<SURFACE_TDD_STEP1>` — so `/update-pipeline` re-renders design agents to resolve
84
+ from the link instead of the stale `get_file(design_project, <file>)`. Existing specs keep their bare
85
+ filenames until you replace them with links.
86
+
87
+ ## 0.1.25 — 2026-07-27
88
+
89
+ - **`research-agent` defaults to `sonnet`** instead of silently inheriting the session model (Opus). Its
90
+ work — MAP / ANALYSE / SYNTHESISE of pre-extracted text — is extraction-and-summary that Sonnet handles
91
+ well at a fraction of the cost, and `/cost` showed it was one of the two heaviest subagents. The fixed
92
+ agents were never tiered like the surfaces; this closes the biggest gap. If cross-cutting synthesis ever
93
+ needs more, the `/research` SYNTHESISE dispatch can override the model for just that pass.
94
+ - **README documents the `/clear`-safe loop** as the top token lever — since all pipeline state lives on
95
+ disk, `/clear`-ing between stages sheds the accumulated main-thread context (long >150k sessions are
96
+ expensive even cached), with the safe-to-clear boundary shown for the whole `/spec → … → /ship` loop.
97
+
98
+ ## 0.1.24 — 2026-07-27
99
+
100
+ - **The dev loop is now `/clear`-safe between every stage.** All pipeline state already lives on disk
101
+ (spec, contract, diff, Remediation checkboxes, freshness stamp), so you can `/clear` between commands
102
+ to shed the accumulated main-thread context and cut token cost — each command reloads everything from
103
+ disk. Every command now marks its handoff as safe to `/clear` before the next step.
104
+ - **`/review` and `/smoke` stage their report to `specs/reports/<id>.md`** (a gitignored buffer in its own
105
+ subfolder, like `specs/design/`) — the one context-coupling that a `/clear` used to break. `/fix` and
106
+ `/spec` Mode B read the report back from disk when the context was cleared. `/init-pipeline` gitignores
107
+ the buffer; `/doctor` reports it. The non-recursive `specs/*.md` glob skips the subfolder, so it never
108
+ shows up as a phantom kanban card or spec.
109
+
110
+ ## 0.1.23 — 2026-07-26
111
+
112
+ - **Cheaper dev loop by default — implementers now default to `sonnet`, not the Opus lead.** A surface
113
+ agent mostly applies a frozen contract, which Sonnet handles well at a fraction of the cost;
114
+ `/init-pipeline` and reconcile now default `surfaces[].model` to `sonnet`, keeping `haiku` for purely
115
+ mechanical scaffolding and `inherit` only for surfaces with real design decisions. The fixed `release`
116
+ and `questionnaire-validator` agents drop to `haiku`, `questionnaire-writer` to `sonnet`. Existing
117
+ projects pick this up on the next `/update-pipeline` (agents re-render; a `model` you set by hand is kept).
118
+ - **Stateless agents read a *slice* of `PIPELINE.md`, not the whole file.** The implementer and reviewer
119
+ now load the machine block + only the `### Shared` and their own `### Surface:` convention stanza
120
+ (+ §Testing), never the other surfaces' prose — less context re-read on every parallel dispatch.
121
+ - **Leaner fix loops.** On a `/fix` re-dispatch, a surface agent works from the self-contained open
122
+ Remediation items + the diff and reads only the files those findings name — no longer re-reading the
123
+ whole (growing) spec or re-exploring its tree.
124
+ - **Freshness gate at `/ship`.** `/review` now fingerprints the reviewed source (`reviewed_base` +
125
+ `reviewed_digest` in the spec front-matter) at a SHIP verdict, and `/ship` re-checks it — refusing to
126
+ ship if any source or contract file changed after the review, so a verdict can't go stale unnoticed.
127
+ Specs are excluded (DoD ticks + the ship status flip don't trip it); a spec predating the gate skips it.
128
+ - **Big commands lazy-load their steps (progressive disclosure).** `/init-pipeline`, `/research` and
129
+ `/questionnaire` are now thin routers (a bootstrap block + a steps table) that read each step from
130
+ `templates/steps/<command>/NN-*.md` as they reach it, instead of one monolithic body — the branchy
131
+ commands (esp. `/research`) no longer pull an unused branch into context. Pure re-partition, verified
132
+ token-for-token identical to the old bodies. No installer change (steps ride the existing `templates/` copy).
133
+ - **Machine-checkable postconditions on the two silent-failure gates** — `/spec` freeze asserts
134
+ `status: frozen` actually landed; `/build` asserts the contract file exists before dispatching agents.
135
+ - **`/review` lets git group the diff by surface** (`git diff --name-only -- <path>` + an `:(exclude)`
136
+ remainder) instead of the lead reasoning it out file by file — deterministic and cheaper.
137
+ - **`/fix` collapses fully-resolved Remediation rounds** to a one-line summary, so the spec every agent
138
+ re-reads stops growing unbounded across fix loops (rounds with any open item stay expanded).
139
+ - **New SCHEMA § "Measuring cost"** — documents `/cost` (built-in per-subagent + per-command usage share)
140
+ and the OTEL `settings.json` env block (`claude_code.token.usage` / `cost.usage`) for exact numbers.
141
+
142
+ ## 0.1.22 — 2026-07-26
143
+
144
+ - **`/spec` exports a standalone design brief** — for a UI feature, freezing the spec now also writes
145
+ §8 (the "spec return") to its own `specs/design/<id>.md`, in addition to printing the copy-paste
146
+ block. One `.md` you can open, share, or drop straight into the design tool instead of scrolling back
147
+ through the chat — regenerated on every freeze so it never drifts from the spec. Lives in the
148
+ `specs/design/` subfolder on purpose, so the non-recursive `specs/*.md` glob (kanban backfill,
149
+ `/doctor`) never mistakes it for a spec. Backend-only features are unaffected.
150
+
151
+ ## 0.1.21 — 2026-07-24
152
+
153
+ - **Reliable local-PDF reading for `/research`** — subagent nodes often lack a PDF renderer (no
154
+ poppler), which made research-agents silently fall back to a web copy of the document — fine for a
155
+ public PDF, a silent fabrication risk for a private one. `/research` now **extracts the PDF to
156
+ per-page text ONCE up front** (pure-Python `pypdf` in a throwaway venv — no system deps) and agents
157
+ read that text, never the binary PDF. A local read that fails now returns a loud `===READ-FAILED===`
158
+ instead of reconstructing from the web; the orchestrator re-extracts or surfaces it. Adds a
159
+ scanned-PDF guard (no text layer ⇒ stop, needs OCR).
160
+
161
+ ## 0.1.20 — 2026-07-24
162
+
163
+ - **`/fix` now checks off resolved Remediation items** — the lead flips `- [ ]` → `- [x]` (with a
164
+ short "fixed" note) for every item the surface agents report addressed in their handoff, and skips
165
+ already-`[x]` items when scoping the re-dispatch. Fixes two long-standing quirks: a spec whose
166
+ Remediation looked permanently open even after fixes landed, and a later `/fix` re-sending
167
+ already-fixed items from earlier rounds to the agents.
168
+ - **`/review` now ticks the §9 DoD at a SHIP verdict** — a SHIP verdict is the pipeline's statement
169
+ that the feature is done, so the lead checks off each Acceptance-criteria item its verifying stage
170
+ actually covered (conformance/copy = review, tests/lint/types = build, mobile-first/runtime = smoke),
171
+ leaving open any whose stage didn't run. `/ship` gains a matching gate: it lists any still-open DoD
172
+ item and asks before shipping (it never ticks — that's `/review`'s job).
173
+
174
+ ## 0.1.19 — 2026-07-24
175
+
176
+ - **Research decoupled from the questionnaire** — `/research` now dispatches a dedicated, standalone
177
+ **`research-agent`** (an autonomous research assistant that extracts everything important in the
178
+ source) instead of the old bi-mode `questionnaire-researcher`. The report no longer carries any
179
+ "future questionnaire" framing: the domain-brief `goal` is a research objective, and the brief
180
+ template is renamed `research-brief.md`. The blueprint step moves to its own **`questionnaire-architect`**
181
+ agent, dispatched by `/questionnaire`. New Notion archive databases are titled « Recherche ». Update
182
+ scrubs the retired `questionnaire-researcher` agent and old template automatically.
183
+ - **Multi-pass research for large sources** — `/research` now maps a big PDF into a reading plan, runs
184
+ one deep `research-agent` pass **per segment in parallel**, synthesises the cross-cutting sections,
185
+ and assembles a single report. Report length scales with the source (no fixed word-count cap), so a
186
+ dense thesis or state-of-the-art gets exhaustive coverage instead of being compressed into one pass.
187
+ Small sources and URLs still take the single-pass path.
188
+
189
+ ## 0.1.18 — 2026-07-22
190
+
191
+ - **Consolidated global config** — the research/questionnaire settings move from
192
+ `~/.claude/questionnaire.config.yaml` into one `~/.claude/cohorte.config.yaml` with
193
+ `obsidian` / `research` / `questionnaire` / `kanban` sections and a shared `obsidian.vault_path`.
194
+ The old file is still read as a fallback; `/update-pipeline` migrates it for you. The `npx`
195
+ installer now offers a quick interactive setup on a TTY.
196
+ - **Obsidian kanban mirror** — an optional per-project board mirrors the pipeline
197
+ (`/brainstorm`…`/ship`): each stage moves the feature's card across columns
198
+ (Ideas → Brainstorm → Spec → Ready to build → Building → Review → Fix → Ship → Shipped).
199
+ `/brainstorm` can pick an idea straight from the *Ideas* column; `/init-pipeline` creates + links
200
+ a board (keyed by the project's `PIPELINE.md` name); `/update-pipeline` links/repairs it and
201
+ **backfills existing `specs/` onto the board**, syncing each card to its spec's status. Enable it
202
+ via `/init-pipeline` (new project) or `/update-pipeline` (existing) — no hand-editing.
203
+
204
+ ## 0.1.17 — 2026-07-22
205
+
206
+ - **Serena dashboard no longer auto-opens** — the per-repo Serena launcher `/init-pipeline` wires now
207
+ passes `--open-web-dashboard False`. The dashboard stays available (`http://localhost:24282/dashboard/`)
208
+ but no longer pops a browser tab on every server start. The flag overrides each machine's
209
+ `serena_config.yml`, so behaviour is uniform across the team; `/update-pipeline`'s health check appends
210
+ the flag to launcher entries that predate it.
211
+
212
+ ## 0.1.16 — 2026-07-22
213
+
214
+ - **Obsidian store: research and questionnaires split** — research notes land in
215
+ `obsidian_research_folder` (default `Recherches/`, with `_sources/`), and a derived questionnaire
216
+ is now a **separate note** in `obsidian_questionnaire_folder` (default `Questionnaires/`),
217
+ wikilinked both ways with the research note. Statut lifecycle: the research note stays
218
+ `Recherche`; the questionnaire note carries `À relire` / `Bloqué` / `Approuvé`. (Replaces
219
+ 0.1.15's single `obsidian_folder` key.) Notion store unchanged — one page per run.
220
+
221
+ ## 0.1.15 — 2026-07-22
222
+
223
+ - **Obsidian store for research runs** — the research/questionnaire capability gains a `store:`
224
+ switch in `~/.claude/questionnaire.config.yaml`: `notion` (default, unchanged) or `obsidian` —
225
+ each run becomes a markdown note in `<vault>/<obsidian_folder>/` with frontmatter properties
226
+ (`run_id`, `sujet`, `cadre`, `statut`, `date`), source PDFs copied to `_sources/` for provenance.
227
+ No MCP needed; the vault path is asked once on first `/research`, then saved. Old Notion runs stay
228
+ readable — pass their URL to `/questionnaire`.
229
+
230
+ ## 0.1.14 — 2026-07-22
231
+
232
+ - **`/fix`** — scoped fix loop: appends a REVIEW REPORT (or `/smoke` failures) to the spec's
233
+ `## Remediation` and re-dispatches ONLY the surfaces with findings, instead of the full
234
+ paste-into-`/spec` + full `/build` round-trip.
235
+ - **`/smoke`** — end-to-end verification between `/build` and `/review`: infra up in the feature
236
+ worktree, migrations, real contract endpoints via curl (incl. RBAC denials), spec §8 UI flows
237
+ mobile-first, optional screenshot diff against the Claude Design pages.
238
+ - **`/doctor`** — installation diagnostic: core/pointer versions, agents↔surfaces orphans, hooks &
239
+ gate config, retrieval health, design wiring, stale worktree slots — each failure with its exact fix.
240
+ - **Dispatch metrics** — `/build`, `/review`, `/fix`, `/smoke` append per-agent JSONL evidence to
241
+ `.claude/pipeline-metrics.jsonl` (gitignored); SCHEMA §Specialization now points at it.
242
+ - **`/ship`** — watches the PR's CI checks (`gh pr checks --watch`) and, after the merge is
243
+ confirmed, proposes `scripts/remove-feature.sh` (worktree + slot teardown, db kept by default).
244
+ - **`/init-pipeline`** — generates `.github/workflows/pipeline-ci.yml` from the profile's commands
245
+ (with go-ahead) and gitignores the metrics sink.
246
+ - **CHANGELOG** — this file; shipped with the core, shown by `/update-pipeline` after an update.
247
+
248
+ ## 0.1.13 — 2026-07-22
249
+
250
+ - **`/review` is parallel** — one review agent per touched surface in a single dispatch (wall-clock =
251
+ slowest surface, not the sum); the lead merges the reports, worst verdict wins.
252
+ - **Review agent reads less** — `mcp__serena` in its toolset (harmlessly absent when a project has no
253
+ retrieval provider) and a diff-hunks-first reading rule instead of whole-file reads.
254
+
255
+ ## 0.1.12 — 2026-07-22
256
+
257
+ - **Per-feature design projects** — spec `design_files` now accepts full Claude Design links, each
258
+ carrying its own project id (extracted at `/build`'s design gate); the profile's `design_project`
259
+ becomes an optional fallback. Design each feature in a fresh project and just paste the link.
260
+
261
+ ## 0.1.11 and earlier
262
+
263
+ Pre-changelog releases: serena wiring made PATH-proof and health-checked (0.1.9–0.1.11), OIDC npm
264
+ trusted publishing (since 0.1.4). See `git log` for details.