@mmerterden/multi-agent-pipeline 21.1.1 → 22.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 (69) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +11 -9
  3. package/README.tr.md +12 -10
  4. package/SECURITY.md +3 -3
  5. package/docs/FIGMA_PIPELINE.md +1 -1
  6. package/docs/architecture.md +8 -8
  7. package/docs/best-practices.md +27 -31
  8. package/docs/ecosystem.md +37 -31
  9. package/docs/facts.json +3 -3
  10. package/docs/features.md +9 -10
  11. package/docs/performance.md +15 -18
  12. package/docs/recovery-guide.md +6 -8
  13. package/install/_common.mjs +3 -0
  14. package/manifest.json +70 -65
  15. package/package.json +1 -1
  16. package/pipeline/agents/code-reviewer.md +1 -1
  17. package/pipeline/commands/multi-agent/SKILL.md +1 -1
  18. package/pipeline/commands/multi-agent/fable-off/SKILL.md +55 -0
  19. package/pipeline/commands/multi-agent/fable-on/SKILL.md +41 -0
  20. package/pipeline/commands/multi-agent/fable-status/SKILL.md +57 -0
  21. package/pipeline/commands/multi-agent/ios-coding-standard/SKILL.md +2 -2
  22. package/pipeline/commands/multi-agent/route-on/SKILL.md +3 -3
  23. package/pipeline/commands/multi-agent/route-status/SKILL.md +1 -1
  24. package/pipeline/commands/multi-agent/store-ready/SKILL.md +3 -1
  25. package/pipeline/commands/multi-agent/sync/SKILL.md +4 -4
  26. package/pipeline/commands/multi-agent/test/SKILL.md +2 -2
  27. package/pipeline/commands/multi-agent/test-screenshots/SKILL.md +9 -0
  28. package/pipeline/contract/manifest.json +1 -1
  29. package/pipeline/lib/model-dispatch.sh +1 -1
  30. package/pipeline/lib/model-rung.sh +59 -15
  31. package/pipeline/multi-agent-refs/android-guide.md +14 -0
  32. package/pipeline/multi-agent-refs/backend-guide.md +12 -0
  33. package/pipeline/multi-agent-refs/cross-cli-contract.md +22 -13
  34. package/pipeline/multi-agent-refs/features/doctor.md +9 -6
  35. package/pipeline/multi-agent-refs/features/model-fallback.md +13 -4
  36. package/pipeline/multi-agent-refs/features/office-threat-model.md +1 -1
  37. package/pipeline/multi-agent-refs/features/skill-conformance.md +1 -1
  38. package/pipeline/multi-agent-refs/help/en.md +4 -2
  39. package/pipeline/multi-agent-refs/help/tr.md +4 -2
  40. package/pipeline/multi-agent-refs/outside-the-pipeline.md +10 -5
  41. package/pipeline/multi-agent-refs/swiftui-guide.md +14 -0
  42. package/pipeline/multi-agent-refs/toolkit-tools.md +51 -0
  43. package/pipeline/multi-agent-refs/web-guide.md +13 -0
  44. package/pipeline/office/index.html +2 -2
  45. package/pipeline/scripts/README.md +33 -42
  46. package/pipeline/scripts/_cost-advise.mjs +1 -1
  47. package/pipeline/scripts/doctor.mjs +22 -6
  48. package/pipeline/scripts/skill-conformance.mjs +3 -3
  49. package/pipeline/skills/.skill-manifest.json +26 -18
  50. package/pipeline/skills/.skills-index.json +43 -21
  51. package/pipeline/skills/shared/README.md +12 -10
  52. package/pipeline/skills/shared/core/multi-agent-analysis/SKILL.md +1 -1
  53. package/pipeline/skills/shared/core/multi-agent-build-optimize/SKILL.md +1 -1
  54. package/pipeline/skills/shared/core/multi-agent-fable-off/SKILL.md +55 -0
  55. package/pipeline/skills/shared/core/multi-agent-fable-on/SKILL.md +41 -0
  56. package/pipeline/skills/shared/core/multi-agent-fable-status/SKILL.md +57 -0
  57. package/pipeline/skills/shared/core/multi-agent-ios-coding-standard/SKILL.md +1 -1
  58. package/pipeline/skills/shared/core/multi-agent-review/SKILL.md +1 -1
  59. package/pipeline/skills/shared/core/multi-agent-route-on/SKILL.md +3 -3
  60. package/pipeline/skills/shared/core/multi-agent-route-status/SKILL.md +1 -1
  61. package/pipeline/skills/shared/core/multi-agent-save/SKILL.md +1 -1
  62. package/pipeline/skills/shared/core/multi-agent-security-review/SKILL.md +1 -1
  63. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +4 -4
  64. package/pipeline/skills/shared/core/multi-agent-test/SKILL.md +1 -1
  65. package/pipeline/skills/shared/core/multi-agent-update/SKILL.md +1 -1
  66. package/pipeline/skills/shared/external/ios-coding-standard/SKILL.md +2 -2
  67. package/pipeline/skills/skills-index.md +10 -8
  68. package/pipeline/commands/multi-agent/model/SKILL.md +0 -80
  69. package/pipeline/skills/shared/core/multi-agent-model/SKILL.md +0 -72
package/docs/features.md CHANGED
@@ -106,7 +106,7 @@ A new project starts green by the same commands every later change is judged by.
106
106
 
107
107
  ### Package Manager Resolution (Phase 2, node-shaped stacks)
108
108
 
109
- Phase 2's web test arm and its build step used to type `npm`. A repo on pnpm, yarn or bun then failed in Phase 2 - with a worktree and a branch already created - or, worse, npm resolved against a lock file it does not own and the run continued on a tree the repo's own tooling would never have produced.
109
+ Phase 2's web test arm and its build step run the repo's own package manager. A hard-coded `npm` would fail a repo on pnpm, yarn or bun in Phase 2 - with a worktree and a branch already created - or, worse, resolve against a lock file npm does not own and continue on a tree the repo's own tooling would never have produced.
110
110
 
111
111
  `scripts/package-manager.mjs` resolves it from the repo instead: `$MA_PACKAGE_MANAGER`, then `package.json#packageManager`, then a lock file, then npm - reported AS a default, never as evidence, because "npm because nothing said otherwise" and "npm because the repo committed a package-lock" are different answers. Node core only (ADR-0004): a resolver that shelled out would need a working install of the tool it is identifying. The walk goes up to the directory holding `.git` and stops there, so a monorepo's root lock file is found and a stray one in a home directory is not. Two lock files means a migration left one behind: the newest wins and both are named.
112
112
 
@@ -114,7 +114,7 @@ Every manager gets the explicit `run` form (a script named `test` or `add` would
114
114
 
115
115
  ### Maturity Follow-Up (`prefs.global.maturityFollowup`)
116
116
 
117
- The maturity check has always produced a machine-readable gap list - stable codes in `blockers[]` and `warnings[]` - and then thrown most of it away. A blocker halted the run, an autopilot queue moved to the next item, and the item stayed exactly as immature as it was found. Nobody was told, so nothing changed, so the next scan halted on the same item for the same reason.
117
+ The maturity check produces a machine-readable gap list - stable codes in `blockers[]` and `warnings[]`. The follow-up acts on it: without one, a blocker halts the run, an autopilot queue moves to the next item, and the item stays exactly as immature as it was found, so the next scan halts on the same item for the same reason.
118
118
 
119
119
  **Interactive runs ask at the step rather than ending at it**: open the item and fix it, continue without it, or abort. Continuing records which gap was waved through in `state.maturity.accepted[]` - that is what separates an informed continue from a skipped check. An answer typed into a picker improves this run and leaves the item as immature for the next person, so the step offers to write the supplied content back, as a separately approved write.
120
120
 
@@ -126,7 +126,7 @@ Warnings still auto-continue under autopilot - converting them to halts would st
126
126
 
127
127
  ### Base-Branch Evidence (Phase 0 Step 3, `prefs.global.baseBranchEvidence.enabled`)
128
128
 
129
- Step 3 used to ask one question with a list it could not vouch for. `git fetch origin` ran, its exit code was discarded, and `git branch -r` printed the remote-tracking cache either way - so on a restricted network a weeks-old local list was presented as the remote's answer, with nothing saying so. And the answer was usually derivable: an issue carrying a target version, or linking a separate issue that represents the release, already names the branch on a repo whose release branches encode the version.
129
+ Step 3 asks for the base branch with a list it can vouch for. A `git fetch origin` whose exit code is ignored leaves `git branch -r` printing the remote-tracking cache either way, so on a restricted network a weeks-old local list would read as the remote's answer. And the answer is usually derivable: an issue carrying a target version, or linking a separate issue that represents the release, already names the branch on a repo whose release branches encode the version.
130
130
 
131
131
  `base-branch-candidates.mjs` collects candidates **with the evidence behind each one**, ranks them, and the picker row's description IS the evidence - "matches version 1.51.0 from the field Target Version" and "the repository's default branch" are different answers to the same question. A human still chooses; the derivation only reorders the rows.
132
132
 
@@ -209,9 +209,8 @@ If any gate fails, fix first. Don't waste AI tokens reviewing broken code.
209
209
 
210
210
  ### Analysis Document Review (Phase 2.2 + 2.3)
211
211
 
212
- `/multi-agent:analysis` published behind a structural validator alone until v16.12.0: nothing read the
213
- document before it reached Confluence. Phase 2.2 now runs the same reviewer set and triage a code diff
214
- gets, on the draft, before the destination is even chosen. Its first question is what the run skipped -
212
+ `/multi-agent:analysis` does not publish behind a structural validator alone. Phase 2.2 runs the same
213
+ reviewer set and triage a code diff gets, on the draft, before the destination is even chosen. Its first question is what the run skipped -
215
214
  an input declared missing that nothing searched for, an open question about evidence nobody read, a gap
216
215
  with no owner, a scope call made without asking. A blocking finding returns to synthesis with dispatch
217
216
  closed; it never becomes an open question, because "the document is wrong" is not something to ask the
@@ -262,9 +261,9 @@ Existing tests are immutable during a task: deleting, renaming, or weakening an
262
261
 
263
262
  Phase 0 Step 0.6. Once per `ttlHours` window (cached, 3s-bounded curl to the npm registry), the installed version is compared against two dist-tags.
264
263
 
265
- **`latest` - automatic**, since v16.5.0. `prefs.global.updateCheck.autoUpdate` defaults to `true`: a newer version is installed before the run starts, in interactive modes and autopilot alike, and the run continues. Set `autoUpdate: false` to be asked once per `ttlHours` instead, or `updateCheck.enabled: false` to silence the check (neither disables the required-version floor).
264
+ **`latest` - automatic.** `prefs.global.updateCheck.autoUpdate` defaults to `true`: a newer version is installed before the run starts, in interactive modes and autopilot alike, and the run continues. Set `autoUpdate: false` to be asked once per `ttlHours` instead, or `updateCheck.enabled: false` to silence the check (neither disables the required-version floor).
266
265
 
267
- **`required` - blocking** (v15.14.0+). Most releases do not publish this tag and nothing changes for them. A release that changed a contract a run depends on is promoted with `npm dist-tag add <pkg>@<version> required`, and an install below that floor is not behind, it is wrong: `require-supported-version.sh` exits 3, the run halts, `/multi-agent:update` runs, and the user re-issues the command on the new version rather than continuing on docs already loaded from the old one. Interactive and autopilot behave identically. The gate fails open on every undeterminable answer (offline, blocked registry, no tag), `updateCheck.enabled: false` does not disable it, and the single override is the env var `MULTI_AGENT_ALLOW_OUTDATED=1`, which is logged in the run record. Exemptions: `update`, `setup`, `uninstall`, `help`, `status`, `log`, `search`, `routines`, `forget`, `language`.
266
+ **`required` - blocking.** Most releases do not publish this tag and nothing changes for them. A release that changed a contract a run depends on is promoted with `npm dist-tag add <pkg>@<version> required`, and an install below that floor is not behind, it is wrong: `require-supported-version.sh` exits 3, the run halts, `/multi-agent:update` runs, and the user re-issues the command on the new version rather than continuing on docs already loaded from the old one. Interactive and autopilot behave identically. The gate fails open on every undeterminable answer (offline, blocked registry, no tag), `updateCheck.enabled: false` does not disable it, and the single override is the env var `MULTI_AGENT_ALLOW_OUTDATED=1`, which is logged in the run record. Exemptions: `update`, `setup`, `uninstall`, `help`, `status`, `log`, `search`, `routines`, `forget`, `language`.
268
267
 
269
268
  ### Structured Handoff Blocks
270
269
 
@@ -384,7 +383,7 @@ All critical state files are schema-validated at read and write time:
384
383
 
385
384
  ### Smoke Test Suites
386
385
 
387
- 100+ suites, auto-discovered from `smoke-*.sh` (no hardcoded list). Representative: add-detail (body-preservation assertions), review-triage (validator exit codes), prefs (schema round-trip), state (agent-state lifecycle), metrics (telemetry emission), sync (instruction parity), secret-scan (hook patterns), phase-banner (terminal UI), token-budget (per-phase limits), phase-tracker (progress tracking).
386
+ Every `smoke-*.sh` is auto-discovered (no hardcoded list) and run by `run-smokes.mjs`. Representative: add-detail (body-preservation assertions), review-triage (validator exit codes), prefs (schema round-trip), state (agent-state lifecycle), metrics (telemetry emission), sync (instruction parity), secret-scan (hook patterns), phase-banner (terminal UI), token-budget (per-phase limits), phase-tracker (progress tracking).
388
387
 
389
388
  ### Adversarial Eval Fixtures
390
389
 
@@ -486,7 +485,7 @@ Turn a recurring, project-specific job into a first-class `/multi-agent:<name>`
486
485
 
487
486
  ### Figma / Component Generation (dispatched to marketplace plugins)
488
487
 
489
- Component + Figma-to-code work is no longer bundled in this repo. When Phase 0 classifies a task as `component`, Phase 2 dispatches it to the per-stack marketplace plugins (`ai-ios-toolkit` / `ai-android-toolkit` in the `multi-agent-plugins` marketplace) via the Skill tool. The plugin's component skill generates `{Name}Configuration.swift`, `{Name}View.swift`, `{Name}+Modifiers.swift`, `{Name}.figma.swift`, and `FIGMA.md` with a variant matrix, then runs a 14-item pre-commit checklist covering design tokens, accessibility, tests, and Code Connect.
488
+ Component + Figma-to-code work is not bundled in this repo. When Phase 0 classifies a task as `component`, Phase 2 dispatches it to the per-stack marketplace plugins (`ai-ios-toolkit` / `ai-android-toolkit` in the `multi-agent-plugins` marketplace) via the Skill tool. The plugin's component skill generates `{Name}Configuration.swift`, `{Name}View.swift`, `{Name}+Modifiers.swift`, `{Name}.figma.swift`, and `FIGMA.md` with a variant matrix, then runs a 14-item pre-commit checklist covering design tokens, accessibility, tests, and Code Connect.
490
489
 
491
490
  The plugin's cross-cutting integration skills feed component detection + implementation when the design triggers them (content: form / price / ui-patterns; interaction: navigation / overlays / bottom-sheets). Each is native-SwiftUI-first and reads project specifics (token namespaces, component paths, UI systems) from `figma-config`, including the optional `ui.navigationSystem` / `ui.overlaySystem` / `ui.sheetSystem` hooks (absent -> stock SwiftUI), so the same capabilities work on any SwiftUI codebase. The plugin's evolve-component skill reconciles an existing component against current Figma (drift-heal) and additively extends it, behind a human gate.
492
491
 
@@ -29,12 +29,12 @@ node pipeline/scripts/aggregate-metrics.mjs --phase=4
29
29
  Each event in `metrics.jsonl` is a single-line JSON object written by
30
30
  `log-metric.sh`. Events cover:
31
31
 
32
- - **Review cycles** - how many iterations of Phase 3 → Phase 4 → Phase 3 a task
32
+ - **Review cycles** - how many iterations of Phase 3 → Phase 2 → Phase 3 a task
33
33
  needed before triage approved.
34
34
  - **Triage classification** - accepted / deferred / rejected counts per review.
35
35
  - **Triage edge cases** - over-rejection guard trips, contradictions, invalid-
36
36
  JSON retries, timeouts.
37
- - **Phase 3 retries** - build / test / lint retry distribution per task.
37
+ - **Phase 2 retries** - build / test / lint retry distribution per task.
38
38
  - **Cost per model** - calls, duration, tokens in/out, broken down by model
39
39
  (Fable, Opus, Sonnet, GPT-5.4).
40
40
  - **Language preference** - distribution of EN vs TR prompts.
@@ -77,31 +77,28 @@ _Source: ~/.claude/logs/multi-agent/metrics.jsonl · Events: 421 (0 parse errors
77
77
  - **`cycles per task avg` > 2.0** - triage is rejecting too many real findings
78
78
  or Phase 3 isn't converging. Inspect the edge-cases table.
79
79
  - **Most-common edge case = `over_rejection_guard_tripped`** - the triage
80
- prompt lost scope context. Look at `phase-3-review.md:57-91`.
80
+ prompt lost scope context. The guard is in `validate-triage.mjs`; the triage
81
+ step it checks is in `phase-3-review.md`.
81
82
  - **`p95` much higher than `avg`** - a few tasks are looping 3+ times. Usually
82
- means one of: bad acceptance criteria in Phase 2, tests that flake, or
83
+ means one of: bad acceptance criteria in Phase 1, tests that flake, or
83
84
  environment-dependent build failures.
84
85
 
85
86
  ## Phase-by-Phase Token Budget
86
87
 
87
88
  Phase docs have hard-capped token limits in
88
89
  `pipeline/schemas/token-budget.json`. `smoke-token-budget.sh` enforces them.
89
- Current totals (v3.5.0):
90
-
91
- | Phase | Warn | Max | Typical |
92
- |-------|------|-----|---------|
93
- | 0 INIT | 3500 | 4000 | 3434 |
94
- | 1 ANALYSIS | 1200 | 1500 | 1315 |
95
- | 2 PLANNING | 800 | 1000 | 798 |
96
- | 3 DEV | 1500 | 1800 | 1451 |
97
- | 4 REVIEW | 1800 | 2200 | 2110 |
98
- | 5 TEST | 600 | 800 | 796 |
99
- | 6 COMMIT | 2400 | 2800 | 2537 |
100
- | 7 REPORT | 1800 | 2200 | 1851 |
101
- | **Total** | **13600** | **16300** | **~14.3k** |
90
+ One `max_tokens` ceiling per phase doc, one row per phase of the six-phase
91
+ contract; the file is the number, so read it there rather than from a copy:
92
+
93
+ ```bash
94
+ jq '.phases' pipeline/schemas/token-budget.json
95
+ ```
96
+
97
+ The warn line is not stored: the smoke computes it per phase from that phase
98
+ doc's own history of per-commit deltas.
102
99
 
103
100
  Lazy loading keeps these off the model's context until each phase actually
104
- runs - the full 14 k total is never loaded at once.
101
+ runs, so the phase docs are never loaded all at once.
105
102
 
106
103
  ## Embedding Metrics in Phase 5 Reports
107
104
 
@@ -261,7 +261,7 @@ version and tag fresh - never re-publish a consumed version.
261
261
 
262
262
  ---
263
263
 
264
- ## Worktree Corruption (v8.0.0)
264
+ ## Worktree Corruption
265
265
 
266
266
  `agent-state.json` says the task lives at `.worktrees/<id>/` but the directory
267
267
  is missing, locked, or `git worktree list` does not list it. Symptoms: `:resume`
@@ -299,7 +299,7 @@ safest path is `kill` the task (preserves logs + branch) and restart with
299
299
 
300
300
  ---
301
301
 
302
- ## Tracker State Corruption (v8.0.0)
302
+ ## Tracker State Corruption
303
303
 
304
304
  `phase-tracker.sh render` returns garbage - duplicate phases, missing
305
305
  elapsed/token fields, JSON parse errors - even though the task is healthy.
@@ -335,7 +335,7 @@ reinit. A footnote in `agent-log.md` documenting the rebuild is good practice.
335
335
 
336
336
  ---
337
337
 
338
- ## Token Rotation Mid-Pipeline (v8.0.0)
338
+ ## Token Rotation Mid-Pipeline
339
339
 
340
340
  A token (Jira / Bitbucket / GitHub / Vercel) was rotated while a long-running
341
341
  pipeline was active. Phase 4 / Phase 5 then fail with `401 Unauthorized` even
@@ -368,16 +368,14 @@ doctor` to confirm the wrapper sees the new value before retrying any deploy.
368
368
 
369
369
  ---
370
370
 
371
- ## Author Rewrite + Tag Re-Sync (v8.0.0)
371
+ ## Author Rewrite + Tag Re-Sync
372
372
 
373
373
  A series of commits (and any tags pointing at them) were authored under the
374
374
  wrong identity - typically because someone passed `git -c user.email=...` or
375
375
  the repo-local config drifted. Vercel / npm / GitHub team-membership gates
376
376
  then reject the push because the author email is not a recognized contributor.
377
377
 
378
- This is the v7.9.1 release-window incident verbatim: 7 commits across
379
- v7.7.0-v7.9.1 plus 4 annotated tags shipped with the wrong author. Recovery
380
- required a rebase + retag dance.
378
+ Recovery is a rebase of the affected range plus a retag of every tag in it.
381
379
 
382
380
  ```bash
383
381
  # 1. Confirm the repo-local identity is now what you actually want.
@@ -436,7 +434,7 @@ versions).
436
434
 
437
435
  ---
438
436
 
439
- ## Failed Push + Force-Push Decision (v8.0.0)
437
+ ## Failed Push + Force-Push Decision
440
438
 
441
439
  `git push` rejects the branch (non-fast-forward, hook rejected, branch
442
440
  protection mismatch, etc.). The pipeline is paused at Phase 4 Step 3.
@@ -735,6 +735,9 @@ export const COMMAND_RENAMES = Object.freeze({
735
735
  // repeated it.
736
736
  autopilot: "multi-agent",
737
737
  "local-autopilot": "multi-agent",
738
+ // The fable rung follows the route-on/off/status shape: fable-on and fable-off
739
+ // switch it, fable-status is what the command did with no argument.
740
+ model: "fable-status",
738
741
  });
739
742
 
740
743
  /**