@mmerterden/multi-agent-pipeline 21.0.0 → 21.1.1

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 (54) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +8 -6
  3. package/README.tr.md +8 -6
  4. package/docs/architecture.md +3 -3
  5. package/docs/ecosystem.md +12 -12
  6. package/docs/facts.json +10 -9
  7. package/docs/features.md +1 -1
  8. package/install/claude.mjs +8 -1
  9. package/install/templates/claude-hooks.json +12 -1
  10. package/manifest.json +57 -41
  11. package/package.json +1 -1
  12. package/pipeline/agents/plan-critic.md +1 -1
  13. package/pipeline/commands/multi-agent/address-review/SKILL.md +183 -0
  14. package/pipeline/commands/multi-agent/sync/SKILL.md +3 -3
  15. package/pipeline/commands/multi-agent/update/SKILL.md +6 -4
  16. package/pipeline/multi-agent-refs/cross-cli-contract.md +4 -4
  17. package/pipeline/multi-agent-refs/features/approach-choice.md +61 -0
  18. package/pipeline/multi-agent-refs/features/root-cause.md +98 -0
  19. package/pipeline/multi-agent-refs/features/usage-reporting.md +1 -1
  20. package/pipeline/multi-agent-refs/features/visual-evidence.md +14 -0
  21. package/pipeline/multi-agent-refs/help/en.md +3 -2
  22. package/pipeline/multi-agent-refs/help/tr.md +3 -2
  23. package/pipeline/multi-agent-refs/phases/phase-1-plan.md +6 -4
  24. package/pipeline/multi-agent-refs/phases/phase-2-dev.md +2 -0
  25. package/pipeline/office/toolkit.json +1 -1
  26. package/pipeline/rules/debugging.md +10 -7
  27. package/pipeline/rules/outside-the-pipeline.md +1 -1
  28. package/pipeline/rules/tdd.md +4 -7
  29. package/pipeline/schemas/agent-state.schema.json +91 -0
  30. package/pipeline/schemas/prefs.schema.json +13 -1
  31. package/pipeline/schemas/toolkit-path-params.json +79 -1
  32. package/pipeline/scripts/_stack-routing.mjs +2 -0
  33. package/pipeline/scripts/approach-choice.mjs +232 -0
  34. package/pipeline/scripts/gate-ledger.mjs +30 -1
  35. package/pipeline/scripts/pr-threads.mjs +537 -0
  36. package/pipeline/scripts/pr-write-guard.mjs +139 -0
  37. package/pipeline/scripts/pr-write-guard.sh +34 -0
  38. package/pipeline/scripts/root-cause-gate.mjs +354 -0
  39. package/pipeline/skills/.skill-manifest.json +17 -5
  40. package/pipeline/skills/.skills-index.json +35 -2
  41. package/pipeline/skills/shared/README.md +8 -5
  42. package/pipeline/skills/shared/core/multi-agent-address-review/SKILL.md +44 -0
  43. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +3 -3
  44. package/pipeline/skills/shared/core/multi-agent-update/SKILL.md +6 -4
  45. package/pipeline/skills/shared/external/humanizer/SKILL.md +48 -6
  46. package/pipeline/skills/shared/external/humanizer/evals/evals.json +13 -0
  47. package/pipeline/skills/shared/external/humanizer/references/turkish.md +88 -0
  48. package/pipeline/skills/shared/external/store-screenshots/SKILL.md +252 -0
  49. package/pipeline/skills/shared/external/store-screenshots/evals/evals.json +47 -0
  50. package/pipeline/skills/shared/external/thesis-writing/SKILL.md +140 -0
  51. package/pipeline/skills/shared/external/thesis-writing/evals/evals.json +40 -0
  52. package/pipeline/skills/shared/external/thesis-writing/references/review-checklist.md +33 -0
  53. package/pipeline/skills/shared/external/thesis-writing/references/turkish-thesis-conventions.md +65 -0
  54. package/pipeline/skills/skills-index.md +4 -1
package/CHANGELOG.md CHANGED
@@ -16,6 +16,34 @@ Internal file-layout changes that don't affect the slash-command surface are sti
16
16
 
17
17
  ## [Unreleased]
18
18
 
19
+ ## [21.1.1] - 2026-11-08
20
+
21
+ ### Fixed
22
+
23
+ - `/multi-agent:update` step 3, with its Copilot copy, reads the tarball name from `npm pack --json` on stdout and sends npm's notices to `npm-pack.log` beside the download, printed only when the download fails. With stderr merged into the captured output, a notice written without a line end ran into the file name, so no line held the name alone and the update stopped with "npm pack reported no tarball". `test/update-pack-tarball.test.mjs` runs the block from both copies against a stand-in npm that writes such a notice.
24
+
25
+ ## [21.1.0] - 2026-11-08
26
+
27
+ ### Added
28
+
29
+ - `thesis-writing` and `store-screenshots` knowledge skills, shipped in ai-common-toolkit 0.9.0 and routed through `COMMON_SKILLS`: a thesis or long paper from setup to defense with the toolkit's `thesis_*` checks, and App Store and Google Play screenshot sets rendered and checked with `store_screenshot_*`. Both need `@mmerterden/multi-agent-mcp` 4.1.0.
30
+ - Visual evidence covers personal data before upload (`features/visual-evidence.md` 5a): a field that must not reach a ticket or a PR is boxed with `mcp__multi-agent__media_redact` and the redacted copy is uploaded; a redaction that fails leaves the artefact out with a gap line.
31
+ - `/multi-agent:address-review`: answers human review threads on our own open GitHub PR. `pr-threads.mjs` fetches the unresolved, current threads (a PR that is closed, merged or someone else's exits 4), holds the verdicts to their contract (one per thread; `fix`, `pushback` or `question`; `file:line` anchors that resolve and quote their line; a pushback reply cites code; no reply opens with praise or thanks), renders the draft, and makes each GitHub write (a push, a reply, a resolve) only with the token its `propose` computed from the live thread or branch. Unattended runs end at the draft: `propose` and `apply` exit 5. `propose` and `apply` refuse a PR that is closed, merged or someone else's (exit 4), `apply` judged on the live PR; a push goes only to the checkout's remote whose URL is the PR's head repository, a PR from a fork and a head branch that is the default branch or `main`, `master`, `develop` or `release/*` are refused, and the push token binds the remote and the directory. Every GitHub read is live: the CLI has no flag that substitutes a recorded response. Threads read their newest 50 comments (`last:`), so `lastCommentId` is the newest one; a GraphQL `errors` response is an error. The host asks too: `pr-write-guard.sh` (PreToolUse on Bash, registered by install) answers every `pr-threads.mjs apply`, also inside `bash -c`, after `env`, through a variable, with the name split by quotes or backslashes or spelled as a glob, and inline code (`node -e`) that names the script, with `ask` naming the PR and the operation, and with `deny` under `MULTI_AGENT_UNATTENDED=1`. Fixes are made test first. Like every outward-writing command it runs `usage-access.mjs` first.
32
+ - Bugfix root-cause gate (`root-cause-gate.mjs`, `features/root-cause.md`): before any fix, Phase 2 writes the symptom, the hypothesis and the origin `file:line`, backed by an observed failure; `check` resolves every reference. Each fix attempt is recorded by its diff; the third consecutive failed attempt since the last green one exits 4 and a fourth is refused until the person answers the design question (`reset --decision`). The gate ledger holds a bugfix commit to it: the unattended commit check and the attended pre-commit check both fail while `state.rootCause` is missing, not passing or escalated. Unattended, the run parks on the `phase-2/root-cause` question. `state.rootCause` carries the summary.
33
+ - Phase 1 Step 3.5, approach choice (`approach-choice.mjs`, `features/approach-choice.md`, `prefs.global.approachChoice.enabled`, default on): a free-text task with no analysis document behind it gets two or three written approaches with pros, cons, modules and a file estimate; the person picks, and autopilot takes the recommended one with `--why` and records it in `decisions[]`. `state.approachChoice` keeps the rejected approaches, which the plan critic's cheaper-alternative lens starts from.
34
+ - Compliance eval cases for root cause, verification and receiving review (`pipeline/eval/compliance/{root-cause,verification,review}.json`), six scenarios beside the existing TDD, debugging and reply-shape cases.
35
+
36
+ ### Changed
37
+
38
+ - `humanizer` 1.3.0: a fuller Turkish pattern table with its own reference (`references/turkish.md`).
39
+ - facts, `toolkit-path-params.json` and the office's toolkit version follow toolkit 4.1.0: 250 tools. The always-on description ceiling is 99000.
40
+ - `rules/debugging.md` requires a written root cause with an observed failure before the fix and stops after three failed fixes; `rules/tdd.md` adds "claim only what ran" and drops the bug-fix protocol line that `debugging.md` already states.
41
+
42
+ ### Fixed
43
+
44
+ - `/multi-agent:update` step 3, with its Copilot copy, takes the tarball name from the one `npm pack` output line that is a bare `.tgz` name. It took the last line, so an npm notice or warning printed after the name became the path and the update stopped with "npm pack reported no tarball". `test/update-pack-tarball.test.mjs` runs the line from both copies against output with notices and warnings around the name.
45
+ - `pr-write-guard.mjs` answers `--help` and `-h` with its usage, as every script CLI does.
46
+
19
47
  ## [21.0.0] - 2026-11-08
20
48
 
21
49
  Major release. The companion MCP server is renamed: its id is `multi-agent`, its tools are `mcp__multi-agent__*` and its package is `@mmerterden/multi-agent-mcp`, so permission rules, hooks and guard rules that name the old id change. Install and update migrate an existing machine and keep the old and new permission prefixes side by side until the old registration is gone. The office is local only: phone pairing, Web Push and the phone device API are removed, `/multi-agent:office-pair` is gone, and the client contract moves to 2.0.0 (`supportedMajors` `[2, 1]`). `/multi-agent:autopilot` is removed in favour of the `autopilot` modifier, and the 23 skill rename aliases announced for this release are gone.
package/README.md CHANGED
@@ -158,7 +158,7 @@ The discipline behind all of this - bounded loops, evidence gates, token-budgete
158
158
 
159
159
  ## Commands
160
160
 
161
- `/multi-agent` plus <!-- fact:commandCount -->71<!-- /fact --> sub-commands. `/multi-agent:help` renders the same catalog in your terminal, in your `outputLanguage`.
161
+ `/multi-agent` plus <!-- fact:commandCount -->72<!-- /fact --> sub-commands. `/multi-agent:help` renders the same catalog in your terminal, in your `outputLanguage`.
162
162
 
163
163
  ### Pipeline entries
164
164
 
@@ -189,6 +189,7 @@ The discipline behind all of this - bounded loops, evidence gates, token-budgete
189
189
  | ---------------------------------- | ------------------------------------------------------------------------------------------- |
190
190
  | `/multi-agent:review` | Parallel review of a branch diff or a PR; inline comments + approve/needs-work on PR input |
191
191
  | `/multi-agent:review-jira` | Grade a Jira issue's readiness for development, comment the gaps |
192
+ | `/multi-agent:address-review` | Answer human review on your own open PR: verify each thread, fix test-first or push back with a `file:line`; every reply, resolve and push approved one at a time, drafts only in autopilot |
192
193
  | `/multi-agent:review-priority` | Grade a team's open bug priorities against its rule file. Read-only; one approved change at a time |
193
194
  | `/multi-agent:review-issue` | Same grading for a GitHub issue |
194
195
  | `/multi-agent:review-analysis` | Review a written analysis document; findings cite the Locked rule they break |
@@ -482,17 +483,17 @@ This enables the matching plugin (+ the shared `ai-common` plugin) in the repo's
482
483
 
483
484
  ## Tool support
484
485
 
485
- The pipeline runs natively on **Claude Code**, **Copilot CLI** and **Codex CLI** - all three install from the same `pipeline/` source and get the same <!-- fact:commandCount -->71<!-- /fact --> commands.
486
+ The pipeline runs natively on **Claude Code**, **Copilot CLI** and **Codex CLI** - all three install from the same `pipeline/` source and get the same <!-- fact:commandCount -->72<!-- /fact --> commands.
486
487
 
487
488
  | Tool | Flag | What it installs |
488
489
  | ----------- | -------------------- | ------------------------------------------------------------------------------------------------------ |
489
490
  | Claude Code | `--claude` (default) | slash commands + skills + agents + the enforcement hooks (secret scan, agent-guard, read-size gate, run-scope guard, run-stop guard) |
490
- | Copilot CLI | `--copilot` | instructions + <!-- fact:commandCount -->71<!-- /fact --> sub-command skills + scripts |
491
- | Codex CLI | `--codex` | one router skill + <!-- fact:commandCount -->71<!-- /fact --> specs as refs + <!-- fact:agentCount -->11<!-- /fact --> agent TOML + `AGENTS.md` block + `codex mcp add` |
491
+ | Copilot CLI | `--copilot` | instructions + <!-- fact:commandCount -->72<!-- /fact --> sub-command skills + scripts |
492
+ | Codex CLI | `--codex` | one router skill + <!-- fact:commandCount -->72<!-- /fact --> specs as refs + <!-- fact:agentCount -->11<!-- /fact --> agent TOML + `AGENTS.md` block + `codex mcp add` |
492
493
 
493
494
  Filter skills by stack with `--platform=ios\|android\|all`.
494
495
 
495
- **Why Codex gets one skill and not <!-- fact:commandCount -->71<!-- /fact -->.** Codex assembles every discovered skill's name
496
+ **Why Codex gets one skill and not <!-- fact:commandCount -->72<!-- /fact -->.** Codex assembles every discovered skill's name
496
497
  and description into a single prompt block and drops entries when it overflows, with no
497
498
  error. Measured on 0.145: installing one plugin that declares 142 skills surfaced only
498
499
  75 of them and evicted an unrelated user skill. So on Codex the pipeline ships a single
@@ -530,6 +531,7 @@ The **secret scan** runs as a `PreToolUse` hook on Claude Code (hard-blocks a co
530
531
  | --- | --- | --- | --- |
531
532
  | `pre-commit-check.sh` (secret scan, owned paths, attended build/test evidence, unattended ledger) | PreToolUse `Bash` | none: pre-push check | none: pre-push check |
532
533
  | `agent-guard.sh` (attribution, force-push, skipped git hooks, argv secrets, closure confirmations, read-only repos, your own `guardRules`, unattended policy) | PreToolUse `Bash`, file edits, fetch and toolkit tools | none | none |
534
+ | `pr-write-guard.sh` (asks before `/multi-agent:address-review` writes to GitHub, denies it unattended) | PreToolUse `Bash` | none: the engine's own propose/apply token stands alone | none |
533
535
  | `run-scope-guard.sh` (Figma phase rule, worktree boundary warning) | PreToolUse Figma tools, file edits | none: the phase records its own MCP calls | none |
534
536
  | `run-stop-guard.sh` (no silent stop mid-run) | Stop | none: halts stay the phase's own write | none |
535
537
  | `task-mirror.sh` (native task list into the run tracker, so the office shows it) | PostToolUse `TaskCreate`/`TaskUpdate` | none: the phase calls `phase-tracker.sh task` itself | none: the phase calls `phase-tracker.sh task` itself |
@@ -552,7 +554,7 @@ Installing the pipeline is not only useful when you run it. Open an ordinary ses
552
554
 
553
555
  - **Services you already onboarded.** The token `setup` mapped is readable now - resolve the logical name through `credential-store.sh` and fetch the issue, the page, the log. **Reads are ordinary work; writes are not.** Posting a Jira comment, editing an issue or opening a PR goes through the pipeline commands, because the rules that make those safe (never auto-close, `Ref:` not `Closes:`, humanizer on outward prose) live there.
554
556
  - **The stack skills `/multi-agent:stack` enabled for the repo.** Each toolkit's own `index` skill routes; the pipeline keeps no copy of that table.
555
- - **The `multi-agent` MCP.** <!-- fact:toolCount -->238<!-- /fact --> tools, most of them for a running app - screen state, crash logs, design comparison, store pre-submission, web scraping and browser test states. Several measure instead of judging by eye: WCAG contrast (`design_contrast_check`), layout shift across themes or a mirrored locale (`ios_visual_diff` with `mode: "layout"`), store listing limits (`store_listing_lint`), review themes with verbatim quotes (`store_review_themes`) and whether security findings cite real lines (`security_evidence_check`, with `security_sarif_export` for code-scanning views). The learnings ledger and the code graph are readable through it too (`learnings_*`, `graph_*`).
557
+ - **The `multi-agent` MCP.** <!-- fact:toolCount -->250<!-- /fact --> tools, most of them for a running app - screen state, crash logs, design comparison, store pre-submission, web scraping and browser test states. Several measure instead of judging by eye: WCAG contrast (`design_contrast_check`), layout shift across themes or a mirrored locale (`ios_visual_diff` with `mode: "layout"`), store listing limits (`store_listing_lint`), review themes with verbatim quotes (`store_review_themes`) and whether security findings cite real lines (`security_evidence_check`, with `security_sarif_export` for code-scanning views). The learnings ledger and the code graph are readable through it too (`learnings_*`, `graph_*`).
556
558
 
557
559
  Uninstall preserves this layer: the tokens, the reader that opens them, the mapping that names them, and the MCP registration. Removing the pipeline should not cost you the credentials you onboarded through it.
558
560
 
package/README.tr.md CHANGED
@@ -157,7 +157,7 @@ Koşunun kendisinde ayarlanabilen tek şey autopilot; geri kalan her şey kendi
157
157
 
158
158
  ## Komutlar
159
159
 
160
- `/multi-agent` ve <!-- fact:commandCount -->71<!-- /fact --> alt komut. `/multi-agent:help` aynı katalogu terminalde, `outputLanguage` ayarına göre gösterir.
160
+ `/multi-agent` ve <!-- fact:commandCount -->72<!-- /fact --> alt komut. `/multi-agent:help` aynı katalogu terminalde, `outputLanguage` ayarına göre gösterir.
161
161
 
162
162
  ### Pipeline girişleri
163
163
 
@@ -188,6 +188,7 @@ Koşunun kendisinde ayarlanabilen tek şey autopilot; geri kalan her şey kendi
188
188
  | ---------------------------------- | ------------------------------------------------------------------------------------------------ |
189
189
  | `/multi-agent:review` | Branch diff'i veya PR üzerinde paralel review; PR girdisinde inline yorum + approve/needs-work |
190
190
  | `/multi-agent:review-jira` | Bir Jira issue'sunun geliştirmeye hazırlığını puanlar, eksikleri yorum olarak yazar |
191
+ | `/multi-agent:address-review` | Kendi açık PR'ındaki insan review'unu yanıtlar: her thread'i doğrular, önce testle düzeltir ya da `file:line` ile itiraz eder; her cevap, resolve ve push tek tek onaylanır, autopilot'ta yalnızca taslak |
191
192
  | `/multi-agent:review-priority` | Ekibin açık bug priority'lerini kural dosyasına göre denetler. Salt okur; her seferinde tek onaylı değişiklik |
192
193
  | `/multi-agent:review-issue` | Aynı puanlama, GitHub issue'su için |
193
194
  | `/multi-agent:review-analysis` | Yazılmış analiz dokümanını review eder; bulgular ihlal edilen Locked kuralını gösterir |
@@ -480,17 +481,17 @@ Bu, ilgili plugin'i (+ ortak `ai-common` plugin'ini) repo'nun `.claude/settings.
480
481
 
481
482
  ## Araç desteği
482
483
 
483
- Pipeline **Claude Code**, **Copilot CLI** ve **Codex CLI** üzerinde native çalışır - üçü de aynı `pipeline/` kaynağından kurulur ve aynı <!-- fact:commandCount -->71<!-- /fact --> komutu alır.
484
+ Pipeline **Claude Code**, **Copilot CLI** ve **Codex CLI** üzerinde native çalışır - üçü de aynı `pipeline/` kaynağından kurulur ve aynı <!-- fact:commandCount -->72<!-- /fact --> komutu alır.
484
485
 
485
486
  | Araç | Bayrak | Ne kurar |
486
487
  | ----------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------- |
487
488
  | Claude Code | `--claude` (varsayılan) | slash komutları + skill'ler + agent'lar + üç `PreToolUse` hook'u (secret scan, agent-guard, okuma-boyutu geçidi) |
488
- | Copilot CLI | `--copilot` | talimatlar + <!-- fact:commandCount -->71<!-- /fact --> alt-komut skill'i + script'ler |
489
- | Codex CLI | `--codex` | bir router skill + ref olarak <!-- fact:commandCount -->71<!-- /fact --> spec + <!-- fact:agentCount -->11<!-- /fact --> agent TOML + `AGENTS.md` bloğu + `codex mcp add` |
489
+ | Copilot CLI | `--copilot` | talimatlar + <!-- fact:commandCount -->72<!-- /fact --> alt-komut skill'i + script'ler |
490
+ | Codex CLI | `--codex` | bir router skill + ref olarak <!-- fact:commandCount -->72<!-- /fact --> spec + <!-- fact:agentCount -->11<!-- /fact --> agent TOML + `AGENTS.md` bloğu + `codex mcp add` |
490
491
 
491
492
  Skill'leri stack'e göre filtrele: `--platform=ios\|android\|all`.
492
493
 
493
- **Codex neden <!-- fact:commandCount -->71<!-- /fact --> değil de tek bir skill alıyor.** Codex, keşfettiği her skill'in adını
494
+ **Codex neden <!-- fact:commandCount -->72<!-- /fact --> değil de tek bir skill alıyor.** Codex, keşfettiği her skill'in adını
494
495
  ve açıklamasını tek bir prompt bloğuna toplar ve blok taştığında girdileri hatasızca
495
496
  düşürür. 0.145 üzerinde ölçüldü: 142 skill deklare eden bir plugin kurulduğunda sadece
496
497
  75'i yüzeye çıktı ve alakasız bir kullanıcı skill'i tahliye edildi. Bu yüzden Codex'te
@@ -529,6 +530,7 @@ triage notu bunu belirtir.
529
530
  | --- | --- | --- | --- |
530
531
  | `pre-commit-check.sh` (secret taraması, sahipli yollar, attended build/test kanıtı, unattended defteri) | PreToolUse `Bash` | yok: pre-push kontrolü | yok: pre-push kontrolü |
531
532
  | `agent-guard.sh` (atıf, force-push, atlanan git hook'ları, argv'de secret, kapanış onayları, salt okunur repolar, kendi `guardRules` kuralların, unattended politikası) | PreToolUse `Bash`, dosya düzenlemeleri, fetch ve toolkit araçları | yok | yok |
533
+ | `pr-write-guard.sh` (`/multi-agent:address-review` GitHub'a yazmadan önce sorar, gözetimsizde reddeder) | PreToolUse `Bash` | yok: motorun kendi propose/apply token'ı tek başına kalır | yok |
532
534
  | `run-scope-guard.sh` (Figma faz kuralı, worktree sınırı uyarısı) | PreToolUse Figma araçları, dosya düzenlemeleri | yok: faz kendi MCP çağrılarını kaydeder | yok |
533
535
  | `run-stop-guard.sh` (koşu ortasında sessizce durmaz) | Stop | yok: duraklama fazın kendi yazımı olarak kalır | yok |
534
536
  | `task-mirror.sh` (terminaldeki görev listesini koşunun takipçisine yazar, ofis de onu gösterir) | PostToolUse `TaskCreate`/`TaskUpdate` | yok: faz `phase-tracker.sh task`'ı kendisi çağırır | yok: faz `phase-tracker.sh task`'ı kendisi çağırır |
@@ -550,7 +552,7 @@ Pipeline'ı kurmak yalnız onu çalıştırdığında işe yaramıyor. Sıradan
550
552
 
551
553
  - **Zaten onboard ettiğin servisler.** `setup`'ın eşlediği token okunabilir durumda - mantıksal adı `credential-store.sh` ile çöz, issue'yu, sayfayı, logu getir. **Okuma sıradan iş, yazma değil.** Jira yorumu, issue düzenleme ve PR açma pipeline komutlarından geçer, çünkü onları güvenli kılan kurallar (issue asla otomatik kapanmaz, `Closes:` değil `Ref:`, dışa dönük metinde humanizer) orada yaşıyor.
552
554
  - **`/multi-agent:stack`'in bu repo için açtığı stack skilleri.** Yönlendirmeyi her toolkit'in kendi `index` skill'i yapar; pipeline o tablonun kopyasını tutmaz.
553
- - **`multi-agent` MCP.** <!-- fact:toolCount -->238<!-- /fact --> araç, çoğu çalışan uygulama için - ekran durumu, crash logu, tasarım karşılaştırma, store ön-kontrolü, web kazıma ve tarayıcı test durumları. Bazı kontrolleri gözle değil ölçümle yapar. WCAG kontrastı `design_contrast_check` ile, tema ya da RTL değişince kayan yerleşim `ios_visual_diff` (`mode: "layout"`) ile ölçülür. Mağaza metni sınırlarını `store_listing_lint` denetler. `store_review_themes` yorumları temalara ayırır ve alıntıyı birebir bırakır. Güvenlik bulgularının gerçek satırlara dayandığını `security_evidence_check` doğrular; `security_sarif_export` kod tarama ekranları için SARIF yazar. Öğrenim kaydı (`learnings_*`) ve kod grafiği (`graph_*`) de buradan okunur.
555
+ - **`multi-agent` MCP.** <!-- fact:toolCount -->250<!-- /fact --> araç, çoğu çalışan uygulama için - ekran durumu, crash logu, tasarım karşılaştırma, store ön-kontrolü, web kazıma ve tarayıcı test durumları. Bazı kontrolleri gözle değil ölçümle yapar. WCAG kontrastı `design_contrast_check` ile, tema ya da RTL değişince kayan yerleşim `ios_visual_diff` (`mode: "layout"`) ile ölçülür. Mağaza metni sınırlarını `store_listing_lint` denetler. `store_review_themes` yorumları temalara ayırır ve alıntıyı birebir bırakır. Güvenlik bulgularının gerçek satırlara dayandığını `security_evidence_check` doğrular; `security_sarif_export` kod tarama ekranları için SARIF yazar. Öğrenim kaydı (`learnings_*`) ve kod grafiği (`graph_*`) de buradan okunur.
554
556
 
555
557
  Uninstall bu katmanı korur: token'lar, onları açan okuyucu, adlarını tutan eşleme ve MCP kaydı. Pipeline'ı kaldırmak, onun üzerinden onboard ettiğin credential'ları kaybetmek anlamına gelmemeli.
556
558
 
@@ -115,7 +115,7 @@ graph TB
115
115
  end
116
116
 
117
117
  subgraph "Pipeline Specs"
118
- CMD[commands/<br/>71 command files]
118
+ CMD[commands/<br/>72 command files]
119
119
  AGT[agents/<br/>11 agent personas]
120
120
  RUL[rules/<br/>13 domain rules]
121
121
  PHS[multi-agent-refs/phases/<br/>phase specs + contracts]
@@ -207,8 +207,8 @@ repo and the website, plus the two independently shipped repos
207
207
  ```mermaid
208
208
  graph TD
209
209
  CC["Claude Code<br/>(source of truth)"]
210
- COP["Copilot CLI<br/>(instructions + 71 sub-command skills)"]
211
- COD["Codex CLI<br/>(1 router skill + 71 refs)"]
210
+ COP["Copilot CLI<br/>(instructions + 72 sub-command skills)"]
211
+ COD["Codex CLI<br/>(1 router skill + 72 refs)"]
212
212
  REPO["Pipeline Repo<br/>(npm package)"]
213
213
  WEB["Website"]
214
214
  PLUGREPO["multi-agent-plugins<br/>(6 plugins, own repo)"]
package/docs/ecosystem.md CHANGED
@@ -5,9 +5,9 @@ separately, wired together at install time and at run time:
5
5
 
6
6
  | Repo | What it owns | Ships as |
7
7
  |---|---|---|
8
- | **`multi-agent-pipeline`** (this repo) | Orchestration: the <!-- fact:phaseCount -->6<!-- /fact -->-phase flow, the <!-- fact:commandCount -->71<!-- /fact --> slash commands, quality gates, review/triage, cross-CLI parity | npm package (`@mmerterden/multi-agent-pipeline`), installs itself onto Claude Code / Copilot CLI / Codex CLI |
8
+ | **`multi-agent-pipeline`** (this repo) | Orchestration: the <!-- fact:phaseCount -->6<!-- /fact -->-phase flow, the <!-- fact:commandCount -->72<!-- /fact --> slash commands, quality gates, review/triage, cross-CLI parity | npm package (`@mmerterden/multi-agent-pipeline`), installs itself onto Claude Code / Copilot CLI / Codex CLI |
9
9
  | **`multi-agent-plugins`** | Stack knowledge: per-platform component/lifecycle skills (iOS, Android, Frontend, Backend) + shared knowledge | Claude Code marketplace, 6 independently-versioned plugins |
10
- | **`multi-agent-mcp`** | The pipeline's hands on devices and browsers: <!-- fact:toolCount -->238<!-- /fact --> MCP tools across <!-- fact:toolFamilyCount -->24<!-- /fact --> families (simulator/emulator control, end-to-end locators and assertions, memory, crash diagnostics, accessibility audit, store compliance and listing lint, web automation and scraping, Figma-vs-mock design audit with contrast checks, code intelligence, a code graph, a learnings ledger, wallet passes, an agent-DSL batch runner, a full-text context index with text-to-image rendering, provider-backed and community research, opt-in social reading, verified hand-off of simple text tasks to free models, video key frames and transcripts, offline security scoring with evidence checks, SARIF export and MCP config launch-selector audits, read-only access to related repositories at their latest branch, travel document fixtures, a voice channel, App Store Connect and Play Console APIs, virtual iPhones, offline facts about builds you own) | npm package, registered as a standard stdio MCP server on every host |
10
+ | **`multi-agent-mcp`** | The pipeline's hands on devices and browsers: <!-- fact:toolCount -->250<!-- /fact --> MCP tools across <!-- fact:toolFamilyCount -->25<!-- /fact --> families (simulator/emulator control, end-to-end locators and assertions, memory, crash diagnostics, accessibility audit, store compliance and listing lint, web automation and scraping, Figma-vs-mock design audit with contrast checks, code intelligence, a code graph, a learnings ledger, wallet passes, an agent-DSL batch runner, a full-text context index with text-to-image rendering, provider-backed and community research, opt-in social reading, verified hand-off of simple text tasks to free models, video key frames and transcripts, offline security scoring with evidence checks, SARIF export and MCP config launch-selector audits, read-only access to related repositories at their latest branch, travel document fixtures, a voice channel, App Store Connect and Play Console APIs, virtual iPhones, offline facts about builds you own) | npm package, registered as a standard stdio MCP server on every host |
11
11
 
12
12
  None of the three depends on the others at the code level. They compose through two
13
13
  narrow contracts: the **Skill tool** (pipeline → plugin, at Phase 2) and the **MCP
@@ -19,7 +19,7 @@ Either can be swapped or removed without touching the other two's source.
19
19
  graph LR
20
20
  subgraph PIPE ["multi-agent-pipeline (orchestrator)"]
21
21
  direction TB
22
- PHASES["6 phases · 71 commands"]
22
+ PHASES["6 phases · 72 commands"]
23
23
  GATES["deterministic gates + review triage"]
24
24
  end
25
25
 
@@ -70,8 +70,8 @@ only those:
70
70
  graph TD
71
71
  CC["Claude Code<br/>~/.claude/commands/multi-agent/<br/>(source of truth)"]
72
72
 
73
- CC -->|"Step 2: copy + reformat<br/>71 sub-command skills"| COP["Copilot CLI<br/>~/.copilot/skills/"]
74
- CC -->|"Step 2b: transform<br/>(install.js --codex)"| COD["Codex CLI<br/>1 router skill + 71 refs<br/>+ 11 agent TOML"]
73
+ CC -->|"Step 2: copy + reformat<br/>72 sub-command skills"| COP["Copilot CLI<br/>~/.copilot/skills/"]
74
+ CC -->|"Step 2b: transform<br/>(install.js --codex)"| COD["Codex CLI<br/>1 router skill + 72 refs<br/>+ 11 agent TOML"]
75
75
  CC -->|"Step 3: genericize<br/>(strip personal data)"| REPO["multi-agent-pipeline repo<br/>pipeline/"]
76
76
  CC -->|"Step 4: version + feature sync"| WEB["Website<br/>projects.ts / i18n.tsx"]
77
77
 
@@ -113,7 +113,7 @@ hand-authored *inside* `multi-agent-plugins` and are never touched by sync.
113
113
  <!-- facts: skillCount="skills - single authoring source" -->
114
114
  ```mermaid
115
115
  graph TD
116
- EXT["pipeline/skills/shared/external/<br/>171 skills - single authoring source<br/>(the pipeline's own phases read these too)"]
116
+ EXT["pipeline/skills/shared/external/<br/>173 skills - single authoring source<br/>(the pipeline's own phases read these too)"]
117
117
 
118
118
  EXT -->|"cross-stack skills"| COMMONP["ai-common-toolkit"]
119
119
  EXT -->|"outside facts for analysis"| ANAP["ai-analyst-toolkit"]
@@ -136,7 +136,7 @@ graph TD
136
136
  style EXT fill:#ffd,stroke:#333
137
137
  ```
138
138
 
139
- Together the plugins carry more skills than the <!-- fact:skillCount -->171<!-- /fact -->-skill source because each
139
+ Together the plugins carry more skills than the <!-- fact:skillCount -->173<!-- /fact -->-skill source because each
140
140
  plugin also carries its own authored `reference/`, `workflow/` and `tools/`
141
141
  skills and an `index` router. A vendored knowledge skill ships in exactly one
142
142
  plugin: cross-stack skills go to `ai-common-toolkit` rather than into every
@@ -162,7 +162,7 @@ measurements behind this table):
162
162
 
163
163
  | | Claude Code | Copilot CLI | Codex CLI |
164
164
  |---|---|---|---|
165
- | **Pipeline commands** | <!-- fact:commandCount -->71<!-- /fact --> slash-command skills, native | <!-- fact:commandCount -->71<!-- /fact --> sub-command skills, `multi-agent-{cmd}` naming, copied in | 1 router skill (`multi-agent`) + <!-- fact:commandCount -->71<!-- /fact --> command specs as reference files - Codex silently truncates its skills block past a few dozen entries, so sub-commands are not peer skills here |
165
+ | **Pipeline commands** | <!-- fact:commandCount -->72<!-- /fact --> slash-command skills, native | <!-- fact:commandCount -->72<!-- /fact --> sub-command skills, `multi-agent-{cmd}` naming, copied in | 1 router skill (`multi-agent`) + <!-- fact:commandCount -->72<!-- /fact --> command specs as reference files - Codex silently truncates its skills block past a few dozen entries, so sub-commands are not peer skills here |
166
166
  | **Stack plugins** | Marketplace plugin, loaded natively, resolved by `.claude/settings.json` enabled-list | Enabled plugin's authored skills copied flat into `~/.copilot/skills/`; `knowledge/` **not** re-copied (already delivered via `shared/external`) | Copied as reference files under `~/.codex/multi-agent-refs/skills/`, plugin-prefixed on name clash (e.g. `architecture` → `ai-ios-toolkit-architecture`) |
167
167
  | **Component dispatch (Phase 3)** | Marketplace plugin's `create-component`/`create-screen` skill via the Skill tool | No plugin loader - the enabled stack plugin's authored skills (incl. `create-component`) are copied flat into `~/.copilot/skills/` at install time (the old frozen `figma-*` copies are pruned, they were never a fallback) | Not part of the enforced parity axis; classification + state-shape must match, skill *inventory* does not |
168
168
  | **multi-agent-mcp** | `claude mcp add multi-agent -- npx -y @mmerterden/multi-agent-mcp` | `copilot mcp add multi-agent -- npx -y @mmerterden/multi-agent-mcp` | `codex mcp add multi-agent -- npx -y @mmerterden/multi-agent-mcp` (skipped with a warning if `codex` isn't on `PATH`) |
@@ -239,8 +239,8 @@ Detail: [`unattended-security.md`](../pipeline/multi-agent-refs/features/unatten
239
239
 
240
240
  ### multi-agent-mcp's tools, by category
241
241
 
242
- <!-- fact:toolCount -->238<!-- /fact --> tools in <!-- fact:toolFamilyCount -->24<!-- /fact --> families, counted from the server's own `tools/list` response
243
- at toolkit <!-- fact:toolkitVersion -->4.0.0<!-- /fact --> rather than from a README. Three families are defined in
242
+ <!-- fact:toolCount -->250<!-- /fact --> tools in <!-- fact:toolFamilyCount -->25<!-- /fact --> families, counted from the server's own `tools/list` response
243
+ at toolkit <!-- fact:toolkitVersion -->4.1.0<!-- /fact --> rather than from a README. Three families are defined in
244
244
  modules the main file only spreads in, so a count taken from the source reads
245
245
  low; the response is the only place the whole surface appears at once. A
246
246
  family is the prefix every tool name carries.
@@ -257,8 +257,8 @@ skill or a command such as `multi-agent:review`. Both qualified forms
257
257
  let `lint-mcp-refs.mjs` check that the tool exists.
258
258
 
259
259
  The families can be narrowed per host: `MCP_TOOLKIT_CAPS` serves only the named
260
- ones, and unset serves all <!-- fact:toolCount -->238<!-- /fact -->. A frontend repo that sets `web,code,context`
261
- sees 50 tools instead of <!-- fact:toolCount -->238<!-- /fact -->, which matters because every registered server's
260
+ ones, and unset serves all <!-- fact:toolCount -->250<!-- /fact -->. A frontend repo that sets `web,code,context`
261
+ sees 50 tools instead of <!-- fact:toolCount -->250<!-- /fact -->, which matters because every registered server's
262
262
  tool list is charged against the context window on every turn.
263
263
 
264
264
  | Family | Tools | Primary pipeline consumers |
package/docs/facts.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$comment": "Generated by pipeline/scripts/gen-facts.mjs. Do not hand-edit: the site reads this, and a number edited here instead of at its source is the drift this file removes.",
3
3
  "generatedAt": "2026-11-08",
4
- "version": "21.0.0",
4
+ "version": "21.1.1",
5
5
  "phaseSchema": 2,
6
6
  "phases": [
7
7
  {
@@ -36,22 +36,23 @@
36
36
  "analysis": [0, 1, 2, 3, 4, 5]
37
37
  },
38
38
  "reworkCap": 3,
39
- "commandCount": 71,
40
- "skillCount": 171,
41
- "skillCountAll": 245,
39
+ "commandCount": 72,
40
+ "skillCount": 173,
41
+ "skillCountAll": 248,
42
42
  "agentCount": 11,
43
43
  "hosts": ["Claude Code", "Codex CLI", "Copilot CLI"],
44
- "toolCount": 238,
44
+ "toolCount": 250,
45
45
  "toolCategories": {
46
46
  "ios": 42,
47
47
  "web": 38,
48
+ "store": 35,
48
49
  "android": 34,
49
- "store": 32,
50
50
  "vphone": 10,
51
+ "media": 9,
51
52
  "code": 8,
52
53
  "design": 8,
53
54
  "graph": 8,
54
- "media": 7,
55
+ "thesis": 7,
55
56
  "repo": 6,
56
57
  "voice": 6,
57
58
  "binary": 5,
@@ -68,6 +69,6 @@
68
69
  "social": 1,
69
70
  "test": 1
70
71
  },
71
- "pluginSkillCount": 267,
72
- "toolkitVersion": "4.0.0"
72
+ "pluginSkillCount": 269,
73
+ "toolkitVersion": "4.1.0"
73
74
  }
package/docs/features.md CHANGED
@@ -54,7 +54,7 @@ The install is not only useful while `/multi-agent` is running. `rules/outside-t
54
54
 
55
55
  - **Onboarded service credentials.** Resolve the logical name through `credential-store.sh` and read the issue, page or log. Writes route through the pipeline commands, which carry the rules that make them safe - issues are never auto-closed, PR bodies use `Ref:`, outward prose goes through the humanizer.
56
56
  - **The stack skills enabled for this repo.** Each toolkit's own `index` skill routes. The pipeline reads the effective `enabledPlugins` rather than keeping a stack table, so a seventh toolkit needs no code change.
57
- - **The `multi-agent` MCP.** <!-- fact:toolCount -->238<!-- /fact --> tools, most of them for a running app.
57
+ - **The `multi-agent` MCP.** <!-- fact:toolCount -->250<!-- /fact --> tools, most of them for a running app.
58
58
 
59
59
  Uninstall preserves the whole layer - tokens, the reader that opens them, the mapping that names them, the MCP registration. It is 1.5 kB of always-loaded text; the detail lives in a ref that loads on demand, and a gate keeps both under a ceiling because every byte there is paid by every session.
60
60
 
@@ -759,7 +759,7 @@ export function quotePipelineHookCommands(hooks) {
759
759
  * The run-scoped hooks the installer registers beside the two gates above:
760
760
  * run-stop-guard.sh (Stop), task-mirror.sh (TaskCreate / TaskUpdate),
761
761
  * answer-check.sh (AskUserQuestion, in every session: it only adds context),
762
- * file-context.sh (after a Read, and before a Read, Grep or Glob), run-scope-guard.sh (Figma MCP tools, file edits, Figma over HTTP, direct run-state writes in Bash or WebFetch, and subagent spawns against the cost budget), note-skill-use.sh (after a Skill call, ok or failed) and note-mcp-failure.sh (after a failed MCP tool call). The run hooks are silent outside a pipeline run (file-context also runs everywhere when prefs.global.fileContext.enabled is true) and fail open, so
762
+ * file-context.sh (after a Read, and before a Read, Grep or Glob), pr-write-guard.sh (asks before a pr-threads.mjs apply writes to GitHub, denies it unattended), run-scope-guard.sh (Figma MCP tools, file edits, Figma over HTTP, direct run-state writes in Bash or WebFetch, and subagent spawns against the cost budget), note-skill-use.sh (after a Skill call, ok or failed) and note-mcp-failure.sh (after a failed MCP tool call). The run hooks are silent outside a pipeline run (file-context also runs everywhere when prefs.global.fileContext.enabled is true) and fail open, so
763
763
  * registering them by default changes nothing until a run is active. note-skill-use.sh runs in every
764
764
  * session, records only the skill name, outcome, time, host and repo folder name into the local
765
765
  * skill-usage log, and is off with prefs.global.skillUsage.enabled false. note-mcp-failure.sh
@@ -830,6 +830,13 @@ export const RUN_HOOKS = [
830
830
  timeout: 10,
831
831
  statusMessage: "Checking the call against the run's phase and state file...",
832
832
  },
833
+ {
834
+ event: "PreToolUse",
835
+ matcher: "Bash",
836
+ script: "pr-write-guard.sh",
837
+ timeout: 10,
838
+ statusMessage: "Checking for a GitHub write that needs your approval...",
839
+ },
833
840
  {
834
841
  event: "PostToolUse",
835
842
  matcher: "Skill",
@@ -1,5 +1,5 @@
1
1
  {
2
- "_readme": "Recommended Claude Code hooks for multi-agent-pipeline. `install` registers the pre-commit and agent-guard gates, the run-scoped run-stop-guard / run-scope-guard hooks, the task-mirror hook, the file-context hook, the skill-usage hook and the MCP failure hook itself (install/claude.mjs configureSettings, RUN_HOOKS); /multi-agent:setup offers to merge the rest of this block. Merge the `hooks` object into your ~/.claude/settings.json to make these deterministic PreToolUse gates real (exit 2 blocks the tool call). A PreToolUse matcher is a regex over the TOOL NAME, so each gate registers on a tool name and reads the command from its stdin payload. Three PreToolUse gates ship here: (1) pre-commit-check.sh on Bash, which acts only on a `git commit` and blocks a secret in the staged diff; (2) agent-guard.sh on Bash, on Edit|Write|NotebookEdit, and on WebFetch plus every multi-agent MCP tool (WebFetch|mcp__multi-agent__.*). Always, it blocks AI/assistant attribution in a commit message and a force-push, delete or mirror push to a protected branch (main/master/develop), including one inside a subshell or a `bash -c` / `eval` line. With MULTI_AGENT_UNATTENDED=1 in the hook's environment it also applies the unattended policy: no push, PR or tracker write, no Keychain read, no fetch outside the host allowlist (curl, WebFetch, the toolkit's web tools, agent_run_steps and open_url), no package install, and no write into a protected path (features/unattended-security.md); (3) check-read-size.sh on Read|Bash, which inspects Read plus the shell commands that read a file whole (cat/head/tail/sed), returns immediately for everything else, and routes an oversized read to a cheap worker instead of the caller's own rung; it is inert until `prefs.global.bulkRead.mode` is set to observe or enforce. Failure behaviour: pre-commit-check.sh and check-read-size.sh fail open on an internal error. agent-guard.sh fails open when attended, so a guard bug cannot break a legitimate tool call, and fails closed under MULTI_AGENT_UNATTENDED=1, where nobody is there to notice a gap. None of the three executes the inspected command, and none needs run-specific arguments. The other deterministic gates (evidence, consensus, intent, learnings) take run-specific arguments and are phase-enforced by the pipeline instead. Three capture hooks ship alongside them and block nothing: (4) SessionEnd runs capture-flush.sh --if-stale, which writes a run's triage findings and durable learnings into the per-repo stores when the run ended before Phase 5, where those writes otherwise happen; the same hook runs note-session.sh, which records the mechanical shape of a session outside the pipeline (tools used, commands that failed, calls the user refused). (4b) SubagentStop and PostToolUseFailure run note-agent-event.sh, which appends one row to the same session notes as the event happens: a subagent's type, id, the bound run's task id and its last message cut to 200 characters (secret-scanned; a hit stores the row without the message), or a failed tool's name and its command's first program word, never an argument or error text. (5) PreCompact runs capture-flush.sh without --if-stale: a compaction summarizes the conversation mid-phase, so it is the moment unflushed findings are at risk, and both writes are idempotent, so a finished run costs two no-op writes. The staleness test exists only so a session exit does not re-flush a run that already finished. (6) SessionStart runs capture-resume.sh, which prints at most two lines: an unfinished run and how to resume it, and a stale pipeline-observation queue. No capture hook calls a model or reads a payload - note-session.sh keeps a command's first word and an exit code, never an argument or any output - and all exit 0 on every path, because a hook that fails a session over bookkeeping costs more than the bookkeeping. A run-scoped PreToolUse gate ships too: (2b) run-scope-guard.sh on every Figma MCP tool (mcp__.*[Ff]igma.*) denies a Figma call above phases.json thresholds.mcpAllowedThroughPhase for the run bound to the session, unless the run is in analysis mode, and records each allowed call into telemetry.mcpCalls[]; on Edit|Write|NotebookEdit the same script warns, attended only, when the target is outside the bound run's worktree (additionalContext for the model, systemMessage for the user; the call proceeds). On Agent|Task, with prefs.global.costBudget.enabled true, it asks before a subagent starts while the bound run's estimated spend is over the ceiling (denies with onExceed halt) and adds a note for the model from the warn threshold. On Bash|WebFetch|AskUserQuestion it denies a question from a bound autopilot run, a Figma read over HTTP (figma.com or api.figma.com) under the same phase rule, and, in any session, a direct write to agent-state.json or tracker-state.json (Edit/Write, a shell redirect or tee), since write-state.mjs is their only writer; the shell wrapper starts node only when the payload mentions Figma or a state file. Outside a run it is silent, and it fails open. One PostToolUse hook ships as well and blocks nothing: (7) edit-syntax-gate.sh on Edit|Write|MultiEdit parses the file the edit just wrote (swiftc -parse, node --check, py_compile into a temp dir, JSON.parse, bash -n; Kotlin skipped) under a 2 s deadline and, when it no longer parses, hands the model the error as PostToolUse additionalContext; it exits 0 on every path, stays silent when a parser is missing or slow, and is inert until `prefs.global.editSyntaxGate.enabled` is true. A second PostToolUse hook blocks nothing either: (7b) task-mirror.sh on TaskCreate|TaskUpdate mirrors the native task list into the tracker of the run bound to the session (phase-tracker.sh task, tracker-contract.md, \"Mirroring the host's task list\"), skipping phase tiles, so the office panel shows the same list; silent outside a run, exit 0 on every path. A third blocks nothing: (7c) file-context.sh on Read (PostToolUse, and PreToolUse on Read|Grep|Glob) hands the model, once per file per session, what the repo's memory says about the file it reads or searches (ledger facts whose scope covers it, its latest review findings, its open known limits from debt-ledger.mjs) as additionalContext inside an <untrusted-data> block, after the secret scan and fitted to the host's 10,000-character hook output limit; a Grep with a path, or a Glob whose literal directory is inside the repo, is mapped to at most five files the stores know, and a whole-repo search gets nothing; inside a run bound to the session by default, everywhere with prefs.global.fileContext.enabled true, never with it false; exit 0 on every path. A fourth blocks nothing: (7d) answer-check.sh on AskUserQuestion names, as PostToolUse additionalContext, every question the user submitted without a choice, so an empty answer is asked again instead of resolved to the Recommended option; it runs in every session, since it only adds context, and exits 0 on every path. A fifth blocks nothing: (7e) graph-hint.sh on Grep|Glob (PreToolUse) adds, once per session, one line pointing at `/multi-agent:graph ask` and mcp__multi-agent__graph_query when the call searches the whole repo for a bare identifier and a current code graph (graphFreshness: build commit is HEAD, no indexed file changed) exists for the repo; silent with prefs.global.codeGraph.enabled false; exit 0 on every path. A sixth blocks nothing: (7f) note-skill-use.sh on Skill (PostToolUse and PostToolUseFailure) appends one row to the local <log root>/skill-usage.jsonl: the skill name (kept only when it matches a strict charset and length and carries no credential pattern, else the call is dropped), ok or error, the time, the host and the repo folder name (null outside a git repository and for a repository in prefs.global.memory.excludeProjects), never the arguments, the prompt or any output; past 1 MiB the log moves to skill-usage.jsonl.1; off with prefs.global.skillUsage.enabled false or prefs.global.usageLog.optOut true; it reads stdin for at most 1.5 s and exits 0 on every path. skill-usage.mjs summary and prune-candidates read it. A seventh blocks nothing: (7g) note-mcp-failure.sh on mcp__.* (PostToolUseFailure) appends one row to the local <log root>/mcp-failures.jsonl: the server and tool from the tool name (dropped unless both match a strict charset and length and carry no credential pattern), the time and a closed error class (the host's interrupt flag first, then a refusal by the user or the permission layer, then a JSON-RPC code in the error text, then a message opening with invalid or validation, then an HTTP status, then fixed patterns), never the arguments, the output or the error text itself; it probes nothing, is written by the same code as the skill-usage log, so it has the same 1 MiB cap and .1 generation, rotates under its own mcp-failures.jsonl.lock, never follows a symlink at the log path, is off with prefs.global.mcpFailures.enabled false or prefs.global.usageLog.optOut true, and exits 0 on every path; doctor's mcp-failures check reads it. One Stop hook ships as well: (8) run-stop-guard.sh answers {\"decision\":\"block\"} when the session driving an active pipeline run (bound through agent-state.json sessionId or hostSessionId, never by a worktree match) tries to stop while the run is in_progress below its mode's last phase with no haltReason or waitingFor; the reason says to finish the current phase, record the wait, or record a halt. A turn that ends on a question to the user, a session with background tasks or crons, and prefs.global.stopGuard.enabled false are never held, and run-stop-guard.sh is not registered on SubagentStop: a subagent's stop is the dispatching session's business. After three consecutive blocks it records the halt itself (status paused, haltReason <phase>:stop-guard), which write-state clears when the run advances a phase. It never blocks outside a run and fails open, with a line in <log root>/hook-failures.log, on any error. These registrations are Claude Code's; README \"Hooks per host\" lists which have no equivalent elsewhere. On Codex only the syntax gate is offered, from codex-hooks.json through host-hooks.mjs; Copilot CLI gets none, since as of 1.0.45 it discards postToolUse output; the other gates are Claude Code only. multi-agent:setup offers to merge this block.",
2
+ "_readme": "Recommended Claude Code hooks for multi-agent-pipeline. `install` registers the pre-commit and agent-guard gates, the run-scoped run-stop-guard / run-scope-guard hooks, the task-mirror hook, the file-context hook, the skill-usage hook and the MCP failure hook itself (install/claude.mjs configureSettings, RUN_HOOKS); /multi-agent:setup offers to merge the rest of this block. Merge the `hooks` object into your ~/.claude/settings.json to make these deterministic PreToolUse gates real (exit 2 blocks the tool call). A PreToolUse matcher is a regex over the TOOL NAME, so each gate registers on a tool name and reads the command from its stdin payload. Three PreToolUse gates ship here: (1) pre-commit-check.sh on Bash, which acts only on a `git commit` and blocks a secret in the staged diff; (2) agent-guard.sh on Bash, on Edit|Write|NotebookEdit, and on WebFetch plus every multi-agent MCP tool (WebFetch|mcp__multi-agent__.*). Always, it blocks AI/assistant attribution in a commit message and a force-push, delete or mirror push to a protected branch (main/master/develop), including one inside a subshell or a `bash -c` / `eval` line. With MULTI_AGENT_UNATTENDED=1 in the hook's environment it also applies the unattended policy: no push, PR or tracker write, no Keychain read, no fetch outside the host allowlist (curl, WebFetch, the toolkit's web tools, agent_run_steps and open_url), no package install, and no write into a protected path (features/unattended-security.md); (3) check-read-size.sh on Read|Bash, which inspects Read plus the shell commands that read a file whole (cat/head/tail/sed), returns immediately for everything else, and routes an oversized read to a cheap worker instead of the caller's own rung; it is inert until `prefs.global.bulkRead.mode` is set to observe or enforce. Failure behaviour: pre-commit-check.sh and check-read-size.sh fail open on an internal error. agent-guard.sh fails open when attended, so a guard bug cannot break a legitimate tool call, and fails closed under MULTI_AGENT_UNATTENDED=1, where nobody is there to notice a gap. None of the three executes the inspected command, and none needs run-specific arguments. The other deterministic gates (evidence, consensus, intent, learnings) take run-specific arguments and are phase-enforced by the pipeline instead. Three capture hooks ship alongside them and block nothing: (4) SessionEnd runs capture-flush.sh --if-stale, which writes a run's triage findings and durable learnings into the per-repo stores when the run ended before Phase 5, where those writes otherwise happen; the same hook runs note-session.sh, which records the mechanical shape of a session outside the pipeline (tools used, commands that failed, calls the user refused). (4b) SubagentStop and PostToolUseFailure run note-agent-event.sh, which appends one row to the same session notes as the event happens: a subagent's type, id, the bound run's task id and its last message cut to 200 characters (secret-scanned; a hit stores the row without the message), or a failed tool's name and its command's first program word, never an argument or error text. (5) PreCompact runs capture-flush.sh without --if-stale: a compaction summarizes the conversation mid-phase, so it is the moment unflushed findings are at risk, and both writes are idempotent, so a finished run costs two no-op writes. The staleness test exists only so a session exit does not re-flush a run that already finished. (6) SessionStart runs capture-resume.sh, which prints at most two lines: an unfinished run and how to resume it, and a stale pipeline-observation queue. No capture hook calls a model or reads a payload - note-session.sh keeps a command's first word and an exit code, never an argument or any output - and all exit 0 on every path, because a hook that fails a session over bookkeeping costs more than the bookkeeping. A GitHub write gate ships too: (2a) pr-write-guard.sh on Bash answers `ask`, naming the PR and the operation, when the command runs `pr-threads.mjs apply` (directly, through a variable, inside `bash -c`, after `env` or as `node <path>`), so /multi-agent:address-review cannot reply, resolve or push without the person approving that one write at the host; with MULTI_AGENT_UNATTENDED=1 it answers `deny`. Every other Bash call gets no output, and it exits 0 on every path. A run-scoped PreToolUse gate ships too: (2b) run-scope-guard.sh on every Figma MCP tool (mcp__.*[Ff]igma.*) denies a Figma call above phases.json thresholds.mcpAllowedThroughPhase for the run bound to the session, unless the run is in analysis mode, and records each allowed call into telemetry.mcpCalls[]; on Edit|Write|NotebookEdit the same script warns, attended only, when the target is outside the bound run's worktree (additionalContext for the model, systemMessage for the user; the call proceeds). On Agent|Task, with prefs.global.costBudget.enabled true, it asks before a subagent starts while the bound run's estimated spend is over the ceiling (denies with onExceed halt) and adds a note for the model from the warn threshold. On Bash|WebFetch|AskUserQuestion it denies a question from a bound autopilot run, a Figma read over HTTP (figma.com or api.figma.com) under the same phase rule, and, in any session, a direct write to agent-state.json or tracker-state.json (Edit/Write, a shell redirect or tee), since write-state.mjs is their only writer; the shell wrapper starts node only when the payload mentions Figma or a state file. Outside a run it is silent, and it fails open. One PostToolUse hook ships as well and blocks nothing: (7) edit-syntax-gate.sh on Edit|Write|MultiEdit parses the file the edit just wrote (swiftc -parse, node --check, py_compile into a temp dir, JSON.parse, bash -n; Kotlin skipped) under a 2 s deadline and, when it no longer parses, hands the model the error as PostToolUse additionalContext; it exits 0 on every path, stays silent when a parser is missing or slow, and is inert until `prefs.global.editSyntaxGate.enabled` is true. A second PostToolUse hook blocks nothing either: (7b) task-mirror.sh on TaskCreate|TaskUpdate mirrors the native task list into the tracker of the run bound to the session (phase-tracker.sh task, tracker-contract.md, \"Mirroring the host's task list\"), skipping phase tiles, so the office panel shows the same list; silent outside a run, exit 0 on every path. A third blocks nothing: (7c) file-context.sh on Read (PostToolUse, and PreToolUse on Read|Grep|Glob) hands the model, once per file per session, what the repo's memory says about the file it reads or searches (ledger facts whose scope covers it, its latest review findings, its open known limits from debt-ledger.mjs) as additionalContext inside an <untrusted-data> block, after the secret scan and fitted to the host's 10,000-character hook output limit; a Grep with a path, or a Glob whose literal directory is inside the repo, is mapped to at most five files the stores know, and a whole-repo search gets nothing; inside a run bound to the session by default, everywhere with prefs.global.fileContext.enabled true, never with it false; exit 0 on every path. A fourth blocks nothing: (7d) answer-check.sh on AskUserQuestion names, as PostToolUse additionalContext, every question the user submitted without a choice, so an empty answer is asked again instead of resolved to the Recommended option; it runs in every session, since it only adds context, and exits 0 on every path. A fifth blocks nothing: (7e) graph-hint.sh on Grep|Glob (PreToolUse) adds, once per session, one line pointing at `/multi-agent:graph ask` and mcp__multi-agent__graph_query when the call searches the whole repo for a bare identifier and a current code graph (graphFreshness: build commit is HEAD, no indexed file changed) exists for the repo; silent with prefs.global.codeGraph.enabled false; exit 0 on every path. A sixth blocks nothing: (7f) note-skill-use.sh on Skill (PostToolUse and PostToolUseFailure) appends one row to the local <log root>/skill-usage.jsonl: the skill name (kept only when it matches a strict charset and length and carries no credential pattern, else the call is dropped), ok or error, the time, the host and the repo folder name (null outside a git repository and for a repository in prefs.global.memory.excludeProjects), never the arguments, the prompt or any output; past 1 MiB the log moves to skill-usage.jsonl.1; off with prefs.global.skillUsage.enabled false or prefs.global.usageLog.optOut true; it reads stdin for at most 1.5 s and exits 0 on every path. skill-usage.mjs summary and prune-candidates read it. A seventh blocks nothing: (7g) note-mcp-failure.sh on mcp__.* (PostToolUseFailure) appends one row to the local <log root>/mcp-failures.jsonl: the server and tool from the tool name (dropped unless both match a strict charset and length and carry no credential pattern), the time and a closed error class (the host's interrupt flag first, then a refusal by the user or the permission layer, then a JSON-RPC code in the error text, then a message opening with invalid or validation, then an HTTP status, then fixed patterns), never the arguments, the output or the error text itself; it probes nothing, is written by the same code as the skill-usage log, so it has the same 1 MiB cap and .1 generation, rotates under its own mcp-failures.jsonl.lock, never follows a symlink at the log path, is off with prefs.global.mcpFailures.enabled false or prefs.global.usageLog.optOut true, and exits 0 on every path; doctor's mcp-failures check reads it. One Stop hook ships as well: (8) run-stop-guard.sh answers {\"decision\":\"block\"} when the session driving an active pipeline run (bound through agent-state.json sessionId or hostSessionId, never by a worktree match) tries to stop while the run is in_progress below its mode's last phase with no haltReason or waitingFor; the reason says to finish the current phase, record the wait, or record a halt. A turn that ends on a question to the user, a session with background tasks or crons, and prefs.global.stopGuard.enabled false are never held, and run-stop-guard.sh is not registered on SubagentStop: a subagent's stop is the dispatching session's business. After three consecutive blocks it records the halt itself (status paused, haltReason <phase>:stop-guard), which write-state clears when the run advances a phase. It never blocks outside a run and fails open, with a line in <log root>/hook-failures.log, on any error. These registrations are Claude Code's; README \"Hooks per host\" lists which have no equivalent elsewhere. On Codex only the syntax gate is offered, from codex-hooks.json through host-hooks.mjs; Copilot CLI gets none, since as of 1.0.45 it discards postToolUse output; the other gates are Claude Code only. multi-agent:setup offers to merge this block.",
3
3
  "hooks": {
4
4
  "PreToolUse": [
5
5
  {
@@ -58,6 +58,17 @@
58
58
  }
59
59
  ]
60
60
  },
61
+ {
62
+ "matcher": "Bash",
63
+ "hooks": [
64
+ {
65
+ "type": "command",
66
+ "command": "bash \"$HOME/.claude/scripts/pr-write-guard.sh\"",
67
+ "timeout": 10,
68
+ "statusMessage": "Checking for a GitHub write that needs your approval..."
69
+ }
70
+ ]
71
+ },
61
72
  {
62
73
  "matcher": "Read|Bash",
63
74
  "hooks": [