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
@@ -0,0 +1,36 @@
1
+ # REVIEW REPORT
2
+
3
+ feature_id: <feature_id>
4
+ Feature branch: <feature_branch_prefix><feature_id>
5
+ Commit SHA: <first 12 chars>
6
+
7
+ | Severity | Count | Status |
8
+ | -------- | ----- | ------ |
9
+ | CRITICAL | 0 | pass |
10
+ | HIGH | 0 | noted |
11
+ | MEDIUM | 0 | noted |
12
+ | LOW | 0 | - |
13
+
14
+ Verdict: <SHIP | REVISE | BLOCK>
15
+
16
+ ## Verdict rules
17
+
18
+ - **SHIP** — no CRITICAL and no security issue. Cleared for the human's manual QA + `/ship`.
19
+ - **REVISE** — one or more CRITICAL (spec violation / correctness). Must fix.
20
+ - **BLOCK** — a security vulnerability. Must fix immediately.
21
+
22
+ ## Findings
23
+
24
+ > Every finding is self-sufficient: a stateless agent must be able to act on it with no other
25
+ > context. Order by severity. If none, write "None."
26
+
27
+ - **[CRITICAL]** `<surface.path>/...:42` · spec-violation · <what's wrong vs spec §X> → **Fix:** <concrete change>
28
+ - **[HIGH]** `<path>:88` · quality · <issue> → **Fix:** <concrete change>
29
+ - **[BLOCK/security]** `<path>:line` · security · <vuln> → **Fix:** <concrete change>
30
+
31
+ Each finding line format (so it pastes straight into the spec's `## Remediation`):
32
+ `[<SEVERITY>] <file:line> · <spec-violation|quality|security> · <problem> → Fix: <concrete fix>`
33
+
34
+ ## Notes
35
+
36
+ <optional: patterns to watch, things verified clean; RBAC / mobile-first assessment if the profile enables them>
@@ -0,0 +1,84 @@
1
+ ---
2
+ feature_id: <slug>
3
+ title: <Feature title>
4
+ status: draft # draft → frozen → in-review → shipped
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 /review)
8
+ reviewed_digest: # sha256 (16 hex) of the reviewed source diff vs reviewed_base, specs excluded — /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 /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
+
56
+ ### <surface.key>
57
+
58
+ - …
59
+
60
+ ## 8. Design brief (the "spec return")
61
+
62
+ > Only if the project has UI. Standalone; mirrors `.claude/templates/design-brief.md`.
63
+
64
+ - **Screens / views:** …
65
+ - **Flows:** …
66
+ - **Responsive:** mobile (base) → `md:` → `lg:`
67
+ - **States:** empty · loading · error · success
68
+
69
+ ## 9. Acceptance criteria / DoD
70
+
71
+ - [ ] Every contract endpoint/interface implemented exactly
72
+ - [ ] Each surface's tests (TDD) green
73
+ - [ ] `PIPELINE.md` commands.lint · typecheck · test green
74
+ - [ ] Mobile-first / responsive verified (if UI)
75
+ - [ ] User-facing copy in `ui_language`
76
+
77
+ ## 10. Assumptions & open questions
78
+
79
+ - …
80
+
81
+ ## Remediation
82
+
83
+ > Filled by `/spec` in review-return mode; empty otherwise. Each item:
84
+ > `[ ] <SEVERITY> · <file:line> · <spec-violation|quality|security> · <concrete fix>`
@@ -0,0 +1,40 @@
1
+ # /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
+ - **DB / migrations:** migration tooling (`node ace make:migration`, `knex`, `prisma`, `alembic`,
28
+ `golang-migrate`), a `docker-compose.yml`, DB service.
29
+ - **Design system:** an existing `design-reference/` snapshot, `components/ui`, a DesignSync MCP
30
+ connection, Figma links, or none.
31
+ - **Code retrieval:** is the `serena` CLI resolvable (`command -v serena`)? If not, does
32
+ `~/.local/bin/serena` exist anyway — installed but PATH-broken (see SCHEMA.md §Code retrieval)?
33
+ `graphify`? Is either already registered in this repo's `.mcp.json` or `claude mcp list`? (Feeds
34
+ the retrieval question + Phase 4 wiring — default provider is `serena`.)
35
+ - **VCS:** `git remote -v` → host + `owner/repo`; the default branch (`git symbolic-ref refs/remotes/origin/HEAD` or `git branch`).
36
+ - **Existing `CLAUDE.md`** — read it; it may already state stack/conventions to fold in. **Existing
37
+ `PIPELINE.md`** — if present, this is a re-run: load it as the starting draft and only reconcile deltas.
38
+
39
+ Print a compact **Detection Report**: layout, surfaces (with framework + commands), contract, DB,
40
+ design, vcs. Mark each field `detected` / `guessed` / `unknown`.
@@ -0,0 +1,41 @@
1
+ # /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 `/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
+ - **Contract** — mechanism (`shared-types-zod` / `openapi` / `protobuf` / `json-schema` / `none`) and
19
+ where feature contracts are authored. If `none`, surfaces sync by the spec prose alone.
20
+ - **UI language** — language of all user-facing copy.
21
+ - **RBAC** — is there a role hierarchy? If yes, list it highest→lowest.
22
+ - **Design system** — enabled? provider (Claude Design / Figma / none) + project ids + kit/token paths.
23
+ - **Code retrieval** — confirm the provider (see SCHEMA.md §Code retrieval): `serena` (Recommended
24
+ default — live LSP symbol navigation, no index to maintain), `graphify` (persistent knowledge graph
25
+ over code + docs — better on very large or mixed code+docs repos, but needs an index step + rescans),
26
+ or `none`. Only demote from `serena` if the human objects or the provider CLI can't be installed.
27
+ - **Isolation** — build features in parallel git worktrees with per-feature DB + ports, or just in the
28
+ main checkout? If worktrees: DB-per-worktree? port bases? compose file?
29
+ - **Gate** — confirm the destructive commands to hard-deny and the ones to confirm-first (seed from the
30
+ detected DB/migration tooling + always git commit/push/merge/rebase/reset).
31
+ - **Personas** — keep the default `/brainstorm` panel, or customize members for this domain?
32
+
33
+ Prefer sensible defaults from Phase 1 as the first (Recommended) option in each question.
34
+
35
+ - **Kanban** (optional) — mirror this project's pipeline (`/brainstorm`…`/ship`) onto an Obsidian
36
+ Kanban board? If the human says yes: confirm the shared vault path (`obsidian.vault_path` in
37
+ `~/.claude/cohorte.config.yaml`; ask if empty) and the board's location inside it (default
38
+ `<ProjectName>/Tasks.md`). Phase 4 creates the board and records the link. Default: no.
39
+
40
+ > The **kanban** link is user-scoped (it points at a personal vault, so it never goes in the committed
41
+ > `PIPELINE.md`), but IS wired here because it is per-project — see Phase 4.
@@ -0,0 +1,10 @@
1
+ # /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 the installer's `pipeline/PIPELINE.template.md` (resolve
6
+ bundled-vs-global per the note above), filling the `yaml pipeline-profile`
7
+ block and every prose section from Phases 1–2. **Keep it lean**: every stateless agent re-reads this
8
+ file on every dispatch, so its length is a per-dispatch token+latency tax — terse rule-shaped
9
+ conventions, no narration, no facts derivable from the code. **Show the human the drafted
10
+ `PIPELINE.md` in a fenced block and get a go-ahead** before writing.
@@ -0,0 +1,88 @@
1
+ # /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 `CLAUDE.md`:** if `CLAUDE.md` 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
+ `CLAUDE.md` 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 `.claude/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>`, and the surface-specific blocks
13
+ (`<SURFACE_EXTRA_NEVER>`, `<SURFACE_DESIGN_INPUT>`, `<SURFACE_TDD_STEP1>` — fill design-related ones
14
+ only when `uses_design`).
15
+ Leave `review.md` + `release.md` as-is (generic).
16
+ 4. **Generate `.claude/gate-config.json`** from the `gate` block — copy all four keys verbatim:
17
+ `{"deny": [...], "ask": [...], "ask_on_default_branch": [...], "default_branch": "<vcs.default_branch>"}`.
18
+ 5. **Write `.claude/settings.json`** permissions (`ask`/`deny` lists mirroring the gate, **plus an
19
+ `allow` list of the project's read-only / verification commands** so agents don't stall on
20
+ permission prompts: the detected per-surface `test_cmd`/`lint_cmd`/`typecheck_cmd`/`build_cmd`
21
+ and repo-wide `commands.*` equivalents as `Bash(<cmd>:*)` rules, plus read-only git —
22
+ `Bash(git status:*)`, `Bash(git diff:*)`, `Bash(git log:*)`. Never allowlist anything matching a
23
+ `gate.ask`/`gate.deny` pattern. Mention the human can widen it later with
24
+ `/fewer-permission-prompts`) + the hooks, **conditioned on the install mode:**
25
+ - **bundled:** register the PreToolUse `Bash` hook `.claude/hooks/gate.py` and the PostToolUse
26
+ formatter (detected formatter).
27
+ - **global:** the PreToolUse gate hook is
28
+ already in `~/.claude/settings.json` and reads this repo's `gate-config.json` — do **not** re-register
29
+ it here (double-registration double-prompts). It no-ops where its config is absent, so one
30
+ registration serves every repo; you only supply this repo's `gate-config.json`. Still write the
31
+ PostToolUse formatter hook + the permissions.
32
+ Preserve any existing custom keys.
33
+ 6. **Wire the retrieval provider** (skip if `retrieval.provider: none`):
34
+ - **serena:** if the `serena` CLI is missing, have the human install it (`uv tool install -p 3.13
35
+ serena-agent`) — or set the provider to `none` if they decline, and say `/update-pipeline` can wire
36
+ it later. If the binary exists (e.g. `~/.local/bin/serena`) but `command -v serena` fails,
37
+ recommend the PATH fix (`uv tool update-shell`, or add `~/.local/bin` to the shell profile) for
38
+ CLI use. Then register at **project scope** (committed `.mcp.json`, portable —
39
+ `--project-from-cwd` resolves the project at server start) using the **PATH-proof launcher**
40
+ from SCHEMA.md §Code retrieval (`sh -c 'exec "$(command -v serena || echo
41
+ "$HOME/.local/bin/serena")" start-mcp-server …'` — a bare `serena` entry dies with ENOENT when
42
+ Claude Code was launched from an environment without `~/.local/bin` on PATH; Windows-native
43
+ teams use the bare form + PATH instead). If `.mcp.json` already has a bare `serena` entry,
44
+ upgrade it to the launcher form rather than skipping. Add `.serena/` to the repo's `.gitignore`
45
+ (per-machine cache/config Serena creates on first launch). On a large repo, offer the one-off
46
+ `serena project index`. Finish with the **health check** from SCHEMA.md §Code retrieval and
47
+ report each result — if the static checks pass but the server isn't connected in this session,
48
+ say a session restart is needed; never report Serena wired on registration alone.
49
+ - **graphify:** have the human install it (`uv tool install graphify` then `graphify install`),
50
+ build the initial graph (`/graphify .`), and note it needs incremental rescans (`--update`) after
51
+ big changes.
52
+ - Either way the rendered agents already carry the provider's MCP tools in their `tools:` list
53
+ (step 3 / SCHEMA §Rendering); remind the human the new MCP server appears after a session restart.
54
+ 7. **Render the isolation scripts** (if `isolation.enabled`) from the installer's
55
+ `pipeline/scripts/*.template` to this repo's `scripts/new-feature.sh` and `scripts/remove-feature.sh`,
56
+ substituting the `__TOKENS__` (project
57
+ slug, DB pattern, port bases, compose file, branch prefix, install/dev/migrate commands, per-surface
58
+ env stanzas). `chmod +x` them. If isolation is disabled, skip and note features build in the main checkout.
59
+ 8. **Ensure `specs/_template.md`** exists (copy from the installer's `templates/spec.template.md` if missing).
60
+ 9. **Write the pointer** `.claude/pipeline.json` (committed — this is how a teammate who clones the repo
61
+ knows which core to install):
62
+ `{ "pipeline": "cohorte", "mode": "<bundled|global>", "core_version": "<contents of the
63
+ installer's pipeline/VERSION>", "install": "<per mode: bundled ⇒ \"npx cohorte install\"
64
+ note that the core is committed under .claude/; global ⇒ \"npx cohorte install --global\"
65
+ (or, without npm: curl -fsSL https://raw.githubusercontent.com/TheBidouilleAgency/cohorte/main/install.sh | sh -s -- --global;
66
+ Windows: install.ps1 -Global from the same repo)> " }`.
67
+ In **global** mode also add, near the top of `CLAUDE.md`, a one-liner:
68
+ `> Pipeline: global core — run the installer above if /brainstorm etc. are missing.`
69
+ 10. **CI workflow** (if `vcs.host: github` and no existing workflow already runs the profile's
70
+ checks): with the human's go-ahead, generate `.github/workflows/pipeline-ci.yml` — on
71
+ `pull_request` to `<default_branch>`: checkout, set up the `package_manager` toolchain,
72
+ `commands.install`, then `commands.lint` · `commands.typecheck` · `commands.test` (+ per-surface
73
+ `build_cmd`s that are non-empty). Derive the setup steps from the detected stack — mirror what a
74
+ sibling workflow does if one exists. `/ship` watches these checks before the merge.
75
+ 11. **Metrics sink & report buffer:** add `.claude/pipeline-metrics.jsonl` to `.gitignore` — `/build`,
76
+ `/review`, `/fix` and `/smoke` append per-dispatch evidence there (SCHEMA §Specialization reads it).
77
+ Also add `specs/reports/` — `/review` and `/smoke` stage their last report there so a `/fix` (or
78
+ `/spec` Mode B) survives a `/clear`; it's a derived buffer, not a versioned artifact.
79
+ 12. **Design system:** if `design.enabled` with a snapshot dir, note that `/align-ds` is active; else the
80
+ `/align-ds` command will no-op with a clear message.
81
+ 13. **Kanban** (only if the human opted in at Phase 2): wire it per SCHEMA.md §Kanban, writing into the
82
+ **global** `~/.claude/cohorte.config.yaml` (never into this repo — the board points at a
83
+ personal vault). Create the file from `pipeline/cohorte.config.template.yaml` if absent; set
84
+ `kanban.enabled: true` and `obsidian.vault_path` if it was empty. Add a `kanban.boards[<PIPELINE
85
+ name>]` entry with `board: <folder>/Tasks.md`. Then **create the board file**
86
+ `<vault>/<folder>/Tasks.md` (per §Kanban) if it doesn't exist — one column per `kanban.columns`
87
+ stage, in pipeline order. Finally run the §Kanban backfill so any spec already in `specs/` lands on
88
+ the board. Report the board path + the `obsidian://` URI. Skip silently if the human declined.
@@ -0,0 +1,12 @@
1
+ # /init-pipeline · 05 Report
2
+
3
+ ### Phase 5 — Report
4
+
5
+ Print: the install mode (bundled core under `.claude/` vs global core in `~/.claude/` + the committed
6
+ `.claude/pipeline.json` pointer), the files written/rendered, the surface→agent mapping, and the
7
+ tailored workflow line, e.g.
8
+ `/brainstorm → /spec → (design) → /build <id> → test → /review → /ship`. Tell the human to sanity-check
9
+ `PIPELINE.md`, commit it, and run `/brainstorm` to start a feature. Note that this was the one-time
10
+ setup: from now on `/update-pipeline` both refreshes the core AND reconciles the generated files
11
+ (SCHEMA.md §Reconcile), and `/build` auto-grows surfaces — re-running `/init-pipeline` is only for deep
12
+ stack changes (package manager, contract mechanism, surface overhaul).
@@ -0,0 +1,54 @@
1
+ # Dashboard — architecture
2
+
3
+ A local web cockpit for the pipeline, launched with `npx cohorte dashboard`
4
+ (see the [root README](../README.md#dashboard--a-local-web-cockpit) for user-facing docs).
5
+
6
+ ## Two halves: shipped runtime vs dev build
7
+
8
+ ```
9
+ dashboard/
10
+ server/ → RUNTIME, dependency-free (node built-ins only). Shipped in the npm package.
11
+ app/ → DEV source: Vite + React. NOT shipped (see ../.npmignore-style dashboard/.npmignore).
12
+ dist/ → app/ built output. Shipped, served by server/. Git-ignored, rebuilt at publish.
13
+ ```
14
+
15
+ - **`server/`** is plain node (`http`, `fs`, `child_process`) — no deps, so `npx … dashboard`
16
+ needs no install. It serves `dist/` as static files + a small JSON/stream API.
17
+ - **`app/`** is a Vite+React app built to `dist/`. `npm run build:dashboard` (root) runs
18
+ `npm --prefix dashboard/app ci && … run build`; CI does this before `npm pack`/`publish`
19
+ (`.github/workflows/publish.yml`), and `dashboard/.npmignore` lets the git-ignored `dist/` ship.
20
+
21
+ ## Server modules (`server/`)
22
+
23
+ | File | Responsibility |
24
+ | --- | --- |
25
+ | `index.js` | HTTP server, routing, static serving (SPA fallback), streamed actions, `--host`/bind |
26
+ | `versions.js` | installed core vs npm latest (registry fetch → `npm view` fallback, 5-min cache) |
27
+ | `doctor.js` | the `/doctor` checks reimplemented in JS → `/api/state` (profile, agents, gate, hooks, …) |
28
+ | `yaml.js` | minimal block-YAML subset parser (for the `pipeline-profile` block + the config) |
29
+ | `fleet.js` | tracked-project registry (`~/.claude/cohorte-dashboard.json`) + folder browse |
30
+ | `kanban.js` | linked Obsidian board → columns/cards; PR enrichment + ship-date sort via `gh` |
31
+
32
+ ## API
33
+
34
+ Read: `GET /api/versions`, `/api/state?project=`, `/api/fleet`, `/api/browse?dir=`,
35
+ `/api/kanban?project=`. Mutate: `POST /api/projects` (add) · `DELETE /api/projects` (remove);
36
+ `POST /api/action` — `{action:'install'|'update', scope, project}` (spawns the CLI),
37
+ `{action:'reset', project, purgeSpecs}` (backup+wipe+reinstall), or
38
+ `{action:'claude', command:'/init-pipeline'|'/update-pipeline', project}` (headless `claude -p`).
39
+ Action responses stream chunked plain text ending in `__EXIT__ <code>`; the client reads the
40
+ `ReadableStream` (`app/src/api.js` `streamAction`).
41
+
42
+ ## Security
43
+
44
+ Binds `127.0.0.1` by default — the action endpoints **execute code**. `--host=ADDR` opts into
45
+ exposing it (prints a warning). CORS is not enabled: the frontend is same-origin (served by the
46
+ agent). If a hosted-frontend model is ever added, lock CORS to the exact frontend origin (never `*`),
47
+ or any site could drive the local agent.
48
+
49
+ ## Dev loop
50
+
51
+ ```sh
52
+ node bin/cli.js dashboard # terminal 1: the node API on :4317
53
+ npm --prefix dashboard/app run dev # terminal 2: Vite on :4318, proxies /api → :4317
54
+ ```