@mmerterden/multi-agent-pipeline 23.5.0 → 23.7.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 (58) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +7 -6
  3. package/README.tr.md +7 -6
  4. package/docs/architecture.md +8 -6
  5. package/docs/ecosystem.md +15 -15
  6. package/docs/engineering.md +1 -1
  7. package/docs/facts.json +11 -10
  8. package/docs/features.md +1 -1
  9. package/package.json +1 -1
  10. package/pipeline/commands/multi-agent/SKILL.md +3 -2
  11. package/pipeline/commands/multi-agent/resume/SKILL.md +2 -0
  12. package/pipeline/commands/multi-agent/review-rounds/SKILL.md +94 -0
  13. package/pipeline/commands/multi-agent/sync/SKILL.md +3 -3
  14. package/pipeline/lib/usage-names.generated.mjs +12 -0
  15. package/pipeline/multi-agent-refs/_input-parser.md +1 -1
  16. package/pipeline/multi-agent-refs/component-dispatch.md +2 -2
  17. package/pipeline/multi-agent-refs/cross-cli-contract.md +3 -3
  18. package/pipeline/multi-agent-refs/features/autopilot-circuit-breaker.md +4 -4
  19. package/pipeline/multi-agent-refs/features/review-delta.md +1 -1
  20. package/pipeline/multi-agent-refs/features/review-rounds.md +40 -0
  21. package/pipeline/multi-agent-refs/features/rework-escalation.md +5 -4
  22. package/pipeline/multi-agent-refs/features/usage-reporting.md +1 -1
  23. package/pipeline/multi-agent-refs/help/en.md +4 -2
  24. package/pipeline/multi-agent-refs/help/tr.md +4 -2
  25. package/pipeline/multi-agent-refs/orchestrator/copilot-pipeline.md +1 -1
  26. package/pipeline/multi-agent-refs/outside-the-pipeline.md +2 -1
  27. package/pipeline/multi-agent-refs/phases/operations.md +1 -1
  28. package/pipeline/multi-agent-refs/phases/phase-0-init.md +1 -1
  29. package/pipeline/multi-agent-refs/phases/phase-2-dev.md +4 -4
  30. package/pipeline/multi-agent-refs/phases/phase-3-review.md +7 -3
  31. package/pipeline/multi-agent-refs/resume/details.md +2 -0
  32. package/pipeline/multi-agent-refs/toolkit-tools.md +1 -0
  33. package/pipeline/office/index.html +2 -2
  34. package/pipeline/office/toolkit.json +1 -1
  35. package/pipeline/rules/outside-the-pipeline.md +1 -1
  36. package/pipeline/schemas/agent-state.schema.json +19 -1
  37. package/pipeline/schemas/phases.json +2 -2
  38. package/pipeline/schemas/prefs.schema.json +15 -3
  39. package/pipeline/schemas/token-budget.json +2 -2
  40. package/pipeline/schemas/toolkit-path-params.json +40 -1
  41. package/pipeline/scripts/_stack-routing.mjs +1 -0
  42. package/pipeline/scripts/gen-facts.mjs +9 -4
  43. package/pipeline/scripts/health-report.mjs +35 -8
  44. package/pipeline/scripts/review-rounds.mjs +592 -0
  45. package/pipeline/scripts/rework-escalation.mjs +7 -3
  46. package/pipeline/scripts/usage-health.mjs +10 -1
  47. package/pipeline/scripts/validate-state.mjs +19 -11
  48. package/pipeline/skills/.skill-manifest.json +13 -5
  49. package/pipeline/skills/.skills-index.json +23 -1
  50. package/pipeline/skills/shared/README.md +7 -5
  51. package/pipeline/skills/shared/core/multi-agent/SKILL.md +3 -3
  52. package/pipeline/skills/shared/core/multi-agent-resume/SKILL.md +1 -1
  53. package/pipeline/skills/shared/core/multi-agent-review-rounds/SKILL.md +92 -0
  54. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +3 -3
  55. package/pipeline/skills/shared/external/ink-animation/SKILL.md +230 -0
  56. package/pipeline/skills/shared/external/ink-animation/evals/evals.json +41 -0
  57. package/pipeline/skills/skills-index.md +3 -1
  58. package/manifest.json +0 -2056
@@ -55,6 +55,7 @@ import { invokedDirectly } from "../lib/invoked-directly.mjs";
55
55
  import { readRegularJson } from "../lib/regular-file.mjs";
56
56
  import { gatesActive } from "../lib/unattended.mjs";
57
57
  import { updateState } from "./gate-ledger.mjs";
58
+ import { DEFAULT_ROUNDS, resolveForRun } from "./review-rounds.mjs";
58
59
  import { prefsPath } from "../lib/prefs-value.mjs";
59
60
  import { ArgsError, parseArgs } from "../lib/args.mjs";
60
61
  import { exitOnHelp } from "../lib/cli-help.mjs";
@@ -63,7 +64,6 @@ exitOnHelp(import.meta.url);
63
64
 
64
65
  export const LADDER = Object.freeze(["fable", "opus", "sonnet", "haiku"]);
65
66
  export const DEFAULT_MAX_TIER = "opus";
66
- export const DEFAULT_MAX_ITERATIONS = 3;
67
67
  const BUDGET_OK = new Set(["ok", "disabled"]);
68
68
 
69
69
  /**
@@ -98,7 +98,7 @@ function settings(prefs) {
98
98
  */
99
99
  export function decide({
100
100
  iteration,
101
- maxIterations = DEFAULT_MAX_ITERATIONS,
101
+ maxIterations = DEFAULT_ROUNDS,
102
102
  stillPresent = 0,
103
103
  currentTier,
104
104
  ladder = LADDER,
@@ -231,9 +231,13 @@ async function main(argv) {
231
231
  const iteration = int(opts, "iteration", undefined);
232
232
  if (iteration === undefined) throw new UsageError("--iteration is required");
233
233
  const prefs = readRegularJson(opts.prefs || prefsPath(), {}) || {};
234
+ const limit = resolveForRun({
235
+ prefs,
236
+ state: opts.state ? readRegularJson(opts.state, null) : null,
237
+ }).value;
234
238
  const decision = decide({
235
239
  iteration,
236
- maxIterations: int(opts, "max-iterations", DEFAULT_MAX_ITERATIONS),
240
+ maxIterations: int(opts, "max-iterations", limit),
237
241
  stillPresent: int(opts, "still-present", 0),
238
242
  currentTier: opts["current-tier"],
239
243
  budget:
@@ -122,6 +122,15 @@ export function normalizeSummary(raw, _opts = {}) {
122
122
  return { generatedAt, overall, items };
123
123
  }
124
124
 
125
+ /**
126
+ * The reason id of a section message: the lead id of a message built from
127
+ * several parts when it is in the catalogue, else the message's own id.
128
+ */
129
+ function reasonOfMessage(message) {
130
+ const lead = reasonId(message?.lead);
131
+ return lead === "other" ? message?.id : lead;
132
+ }
133
+
125
134
  /**
126
135
  * health-report's document mapped to the contract: one item per section, the
127
136
  * reason being the id of the section's message (`other` when it carries none).
@@ -131,7 +140,7 @@ export function summaryFromReport(doc, _opts = {}) {
131
140
  const items = doc.sections.map((s) => ({
132
141
  id: s?.id,
133
142
  status: s?.status,
134
- reason: s?.message?.id,
143
+ reason: reasonOfMessage(s?.message),
135
144
  }));
136
145
  return normalizeSummary({ generatedAt: doc.generatedAt, overall: doc.status, items });
137
146
  }
@@ -126,21 +126,29 @@ async function main() {
126
126
  errors.push(`phases["${k}"] must be an object`);
127
127
  continue;
128
128
  }
129
- // The rework cap. Every phase doc says "hard-kill at retryCount === 3"
130
- // and the schema writes `maximum: 3`, but nothing read either: a fourth
131
- // round produced a state that violates the schema and passed this
132
- // validator, which is the one place that could have said so.
133
- //
134
- // What this does NOT do is stop the loop - that is the orchestrator's
135
- // job and it stays prose. What it does is make an over-cap state fail
136
- // instead of being carried forward as if it were fine.
137
- if (v.retryCount !== undefined) {
138
- if (!Number.isInteger(v.retryCount) || v.retryCount < 0 || v.retryCount > 3) {
129
+ // retryCount counts build retries (cap 3); reworkCount counts review
130
+ // reworks (cap 3, the ceiling of the review limit). Both are the
131
+ // schema's integer 0..3, checked here because a state that violates
132
+ // them must fail resume instead of being carried forward.
133
+ for (const [field, what] of [
134
+ ["retryCount", "the build-retry cap"],
135
+ ["reworkCount", "the review rework cap"],
136
+ ]) {
137
+ if (v[field] === undefined) continue;
138
+ if (!Number.isInteger(v[field]) || v[field] < 0 || v[field] > 3) {
139
139
  errors.push(
140
- `phases["${k}"].retryCount must be integer 0..3 (the rework cap), got ${JSON.stringify(v.retryCount)}`,
140
+ `phases["${k}"].${field} must be integer 0..3 (${what}), got ${JSON.stringify(v[field])}`,
141
141
  );
142
142
  }
143
143
  }
144
+ if (
145
+ v.reworkForIteration !== undefined &&
146
+ (!Number.isInteger(v.reworkForIteration) || v.reworkForIteration < 0)
147
+ ) {
148
+ errors.push(
149
+ `phases["${k}"].reworkForIteration must be a whole number from 0, got ${JSON.stringify(v.reworkForIteration)}`,
150
+ );
151
+ }
144
152
  }
145
153
  }
146
154
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-11-11T12:36:57Z",
4
- "skillCount": 256,
3
+ "generatedAt": "2026-11-13T14:56:51Z",
4
+ "skillCount": 258,
5
5
  "entries": [
6
6
  {
7
7
  "path": "shared/core/apple-archive-compliance/SKILL.md",
@@ -185,7 +185,7 @@
185
185
  },
186
186
  {
187
187
  "path": "shared/core/multi-agent-resume/SKILL.md",
188
- "sha256": "26a0e128e878c23e9c6cd64e35f791b9e6d896518a331cf804f1b56a8237820e"
188
+ "sha256": "ae78ee0e09fc85e61a104bd0c656f8d46611cc5569a7d9ae297f1fa4aa461d47"
189
189
  },
190
190
  {
191
191
  "path": "shared/core/multi-agent-review-analysis/SKILL.md",
@@ -203,6 +203,10 @@
203
203
  "path": "shared/core/multi-agent-review-priority/SKILL.md",
204
204
  "sha256": "386996319752c7377a11592ef56dd00c2bb345781716434a2d436b31c6fbfdb1"
205
205
  },
206
+ {
207
+ "path": "shared/core/multi-agent-review-rounds/SKILL.md",
208
+ "sha256": "f85daf54721ae152e6e2b75c7ba22a2b27008deaed40cdd2ebeb10e54947af5e"
209
+ },
206
210
  {
207
211
  "path": "shared/core/multi-agent-review/SKILL.md",
208
212
  "sha256": "a7e0b71491ee7d8cd9f7f501884f919dfcf609553bf17401620bb2f0a9ed964d"
@@ -293,7 +297,7 @@
293
297
  },
294
298
  {
295
299
  "path": "shared/core/multi-agent-sync/SKILL.md",
296
- "sha256": "60d347888d9b8fc9efd761d436e2b03ba9d87c13fd5e00bb19f445b6b5f046e4"
300
+ "sha256": "92932f294cb308e7096041120bcb561336f870b056705bf53313200518cb94e7"
297
301
  },
298
302
  {
299
303
  "path": "shared/core/multi-agent-test-accessibility/SKILL.md",
@@ -333,7 +337,7 @@
333
337
  },
334
338
  {
335
339
  "path": "shared/core/multi-agent/SKILL.md",
336
- "sha256": "4e633fff2e140d5433133128e9a1fbcc3b449ed4954ac37d18e3d0aeccbfcbe2"
340
+ "sha256": "be85b49c6699db2869564c8453c1387ecd5c73bdbeeb45d7e3bcf0b02a74c65c"
337
341
  },
338
342
  {
339
343
  "path": "shared/external/accessibility-compliance-accessibility-audit/SKILL.md",
@@ -643,6 +647,10 @@
643
647
  "path": "shared/external/humanizer/SKILL.md",
644
648
  "sha256": "a2be491e7a27e61af1df11141b8e86659387242d7be5626c42eae0544265830e"
645
649
  },
650
+ {
651
+ "path": "shared/external/ink-animation/SKILL.md",
652
+ "sha256": "9b8ac225397c3e915a77be3ae510285437094d0c5fa0dc75045ef18010c6178a"
653
+ },
646
654
  {
647
655
  "path": "shared/external/ios-accessibility/SKILL.md",
648
656
  "sha256": "ea7471eafdd0845edfe9973a6ece9320498ee5f29dd8ee3353bbbc11fc05c889"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "skillCount": 256,
3
+ "skillCount": 258,
4
4
  "entries": [
5
5
  {
6
6
  "name": "accessibility-compliance-accessibility-audit",
@@ -871,6 +871,17 @@
871
871
  "triggerPaths": [],
872
872
  "relativePath": "shared/external/humanizer/SKILL.md"
873
873
  },
874
+ {
875
+ "name": "ink-animation",
876
+ "description": "Builds a hand-inked procedural line animation from a scene description: walking or running figures, trees, houses, lamps, clouds, birds, a sun or moon and a day cycle, as one self-contained animated SVG or HTML file or an MP4. Use when a small looping line-art scene is wanted. Not for tracing a phot",
877
+ "platform": null,
878
+ "group": "external",
879
+ "plugin": "ai-common-toolkit",
880
+ "invokeAs": "ai-common-toolkit:ink-animation",
881
+ "triggerKeywords": [],
882
+ "triggerPaths": [],
883
+ "relativePath": "shared/external/ink-animation/SKILL.md"
884
+ },
874
885
  {
875
886
  "name": "ios-accessibility",
876
887
  "description": "VoiceOver, Voice Control, Switch Control and Full Keyboard Access in SwiftUI, UIKit and AppKit: labels, traits, grouping, focus restore, Dynamic Type, Large Content Viewer, rotors, custom actions, accessibility checks and Nutrition Labels. Use when implementing, reviewing or auditing accessibility (",
@@ -1641,6 +1652,17 @@
1641
1652
  "triggerPaths": [],
1642
1653
  "relativePath": "shared/core/multi-agent-review-priority/SKILL.md"
1643
1654
  },
1655
+ {
1656
+ "name": "multi-agent-review-rounds",
1657
+ "description": "Set how often review sends work back, 1 to 3 (default 2). Use when changing review rounds.",
1658
+ "platform": null,
1659
+ "group": "core",
1660
+ "plugin": null,
1661
+ "invokeAs": "multi-agent-review-rounds",
1662
+ "triggerKeywords": [],
1663
+ "triggerPaths": [],
1664
+ "relativePath": "shared/core/multi-agent-review-rounds/SKILL.md"
1665
+ },
1644
1666
  {
1645
1667
  "name": "multi-agent-route-off",
1646
1668
  "description": "Disable model routing and keep its rules, so turning it back on does not re-ask for the same configuration. Use when asked to turn model routing off.",
@@ -2,24 +2,24 @@
2
2
 
3
3
  Single source of truth for skills delivered to both Claude Code (`~/.claude/skills/`) and Copilot CLI (`~/.copilot/skills/`) by the installer.
4
4
 
5
- **Total:** 256 skills (83 core + 173 external). Auto-generated by `scripts/gen-skills-index.mjs` - do not edit by hand.
5
+ **Total:** 258 skills (84 core + 174 external). Auto-generated by `scripts/gen-skills-index.mjs` - do not edit by hand.
6
6
 
7
7
  ## Directory layout
8
8
 
9
- - **`core/`** - 83 `multi-agent*` orchestration skills that are pipeline-critical. Edits here are core-code changes.
10
- - **`external/`** - 173 iOS / Android / generic skills that ship into the stack plugins.
9
+ - **`core/`** - 84 `multi-agent*` orchestration skills that are pipeline-critical. Edits here are core-code changes.
10
+ - **`external/`** - 174 iOS / Android / generic skills that ship into the stack plugins.
11
11
  - Install destinations (ADR-0009): Claude Code gets NO local copy of `external/` - it loads those skills from the `multi-agent-plugins` marketplace, namespaced (`ai-<stack>-toolkit:<name>`); only the two compliance catalogs from `core/` land in `~/.claude/skills/`. Copilot CLI and Codex CLI receive a flat copy filtered to the enabled stacks. `external/` remains the single authoring source that `build-stack-plugins.mjs` publishes from.
12
12
 
13
13
  Source layout is logical grouping only - skill discovery at runtime is unchanged.
14
14
 
15
15
  ## Categories
16
16
 
17
- - [Pipeline Orchestration](#pipeline-orchestration) - 83
17
+ - [Pipeline Orchestration](#pipeline-orchestration) - 84
18
18
  - [iOS / Apple Ecosystem](#ios-apple-ecosystem) - 95
19
19
  - [Android / Kotlin](#android-kotlin) - 16
20
20
  - [Web](#web) - 10
21
21
  - [Backend / API](#backend-api) - 11
22
- - [Cross-cutting](#cross-cutting) - 41
22
+ - [Cross-cutting](#cross-cutting) - 42
23
23
 
24
24
  ## Pipeline Orchestration
25
25
 
@@ -77,6 +77,7 @@ Source layout is logical grouping only - skill discovery at runtime is unchang
77
77
  | [`multi-agent-review-issue`](./core/multi-agent-review-issue/) | `core` | Assess whether a GitHub issue is ready for multi-agent development: fetch it, grade scope / acceptance criteria / repro / design / API / sta |
78
78
  | [`multi-agent-review-jira`](./core/multi-agent-review-jira/) | `core` | Assess whether a Jira issue is ready for multi-agent development: fetch it, grade scope / acceptance criteria / repro / design / API / stack |
79
79
  | [`multi-agent-review-priority`](./core/multi-agent-review-priority/) | `core` | Review a team's open Jira bug priorities against its rule file: read-only by default, one report per team, one approved change at a time. In |
80
+ | [`multi-agent-review-rounds`](./core/multi-agent-review-rounds/) | `core` | Set how often review sends work back, 1 to 3 (default 2). Use when changing review rounds. |
80
81
  | [`multi-agent-route-off`](./core/multi-agent-route-off/) | `core` | Disable model routing and keep its rules, so turning it back on does not re-ask for the same configuration. Use when asked to turn model rou |
81
82
  | [`multi-agent-route-on`](./core/multi-agent-route-on/) | `core` | Enable policy-driven model routing: pick a strategy, a scope, and the rules that say which rung a call lands on. Use when asked to turn mode |
82
83
  | [`multi-agent-route-status`](./core/multi-agent-route-status/) | `core` | Report model routing: whether it is armed, which rule applies where, which rung the last dispatches took, and what this run has cost. Use wh |
@@ -290,6 +291,7 @@ Source layout is logical grouping only - skill discovery at runtime is unchang
290
291
  | [`github-actions-templates`](./external/github-actions-templates/) | `external` | Authoring GitHub Actions workflows: triggers, matrices, caching, concurrency, least-privilege permissions, SHA pinning, OIDC, reusable workf |
291
292
  | [`handle-request`](./external/handle-request/) | `external` | Adds the test handles a scenario needs and answers each request with ADDED, ALREADY or COULD NOT ADD plus file:line or reason. Identity valu |
292
293
  | [`humanizer`](./external/humanizer/) | `external` | Removes AI writing patterns so text reads as human-written: inflated language, filler phrases, AI vocabulary, mechanical structure, sycophan |
294
+ | [`ink-animation`](./external/ink-animation/) | `external` | Builds a hand-inked procedural line animation from a scene description: walking or running figures, trees, houses, lamps, clouds, birds, a s |
293
295
  | [`localization-reuse-map`](./external/localization-reuse-map/) | `external` | Localization reuse map for one redesigned screen on iOS, Android and web: new keys set against each platform's legacy key, legacy values and |
294
296
  | [`package-build-audit`](./external/package-build-audit/) | `external` | Finds SwiftPM causes of slow builds: graph shape, plugins, module variants, cycles, umbrella modules, macro cascades and pins, as recommend- |
295
297
  | [`pdfkit`](./external/pdfkit/) | `external` | PDFKit on iOS: PDFView display and SwiftUI wrapping, creating and editing PDFDocument and PDFPage, highlight, note, signature and form annot |
@@ -2,7 +2,7 @@
2
2
  name: multi-agent
3
3
  description: "Task orchestrator: runs the full pipeline from a Jira ID or GitHub Issue URL - analysis → plan → TDD development → parallel review (Fable + Opus + Sonnet on Claude Code, GPT + Opus + Sonnet on Copilot CLI) → commit → log. Every step is written to agent-log.md. Use when given a Jira ID, a GitHub issue or a free-text task and the whole pipeline should run."
4
4
  user-invocable: true
5
- argument-hint: 'PROJ-12345 feature/PROJ-12345-order-filter | https://github.com/.../issues/316 | "task text" [autopilot [--loop N]] | status | log #1 | resume #1 | kill #1 | clear-logs | purge | review'
5
+ argument-hint: 'PROJ-12345 feature/PROJ-12345-order-filter | https://github.com/.../issues/316 | "task text" [autopilot [--loop N]] [--review-rounds N] | status | log #1 | resume #1 | kill #1 | clear-logs | purge | review'
6
6
  metadata:
7
7
  language: en
8
8
  ---
@@ -27,7 +27,7 @@ ACCESS_LINE=$(node "$HOME/.copilot/scripts/usage-access.mjs"); ACCESS_RC=$?
27
27
 
28
28
  `status`, `log [id]`, `resume [id]`, `review` (current diff only), the `autopilot` flag, and no args / `help`. `kill [id]` and `purge` are user-only commands, and `clear-logs` is superseded: name `/multi-agent-kill`, `/multi-agent-purge` or `/multi-agent-prune-logs` for the user to type and stop. Anything else is a task input (Jira ID + branch, GitHub issue URL or number, free text) and enters Phase 0.
29
29
 
30
- **Quoting**: For a double-quoted first argument, strip the surrounding double quotes and unescape (`\"` becomes `"`, and `\\` becomes `\` before a quote or at the end). If the resulting value as a whole is a Jira key, a Jira or GitHub issue URL, `repo#N` or `#N`, it is that structured reference; otherwise it is free text, and a structured token inside a sentence stays free text. Everything after the closing quote is modifiers (`autopilot`, `--loop N`, the branch name after a Jira key) (`$HOME/.claude/multi-agent-refs/_input-parser.md` "Quoting").
30
+ **Quoting**: For a double-quoted first argument, strip the surrounding double quotes and unescape (`\"` becomes `"`, and `\\` becomes `\` before a quote or at the end). If the resulting value as a whole is a Jira key, a Jira or GitHub issue URL, `repo#N` or `#N`, it is that structured reference; otherwise it is free text, and a structured token inside a sentence stays free text. Everything after the closing quote is modifiers (`autopilot`, `--loop N`, `--review-rounds N`, the branch name after a Jira key) (`$HOME/.claude/multi-agent-refs/_input-parser.md` "Quoting").
31
31
 
32
32
  ## Task operations
33
33
 
@@ -88,7 +88,7 @@ Run all **8 sequential interactive steps** in `$HOME/.claude/multi-agent-refs/ph
88
88
 
89
89
  - **1 Plan**: analysis (`explorer`), planning, then the **Plan Approval Gate** (interactive only): clarification max 2 rounds, approval loop `onayla` / `iptal` / free-text.
90
90
  - **2 Dev**: TDD per todo, build, max 3 fix attempts.
91
- - **3 Review**: three parallel reviewers + one triage pass; blocking goes back to Phase 2 (max 3 iterations). Interactive user test via `AskUserQuestion`, saying yes removes the worktree and checks the branch out: `$HOME/.claude/multi-agent-refs/orchestrator/phase-3-user-test.md`.
91
+ - **3 Review**: three parallel reviewers + one triage pass; blocking goes back to Phase 2 for rework, at most 1 to 3 times (default 2; `review-rounds.mjs next`). Interactive user test via `AskUserQuestion`, saying yes removes the worktree and checks the branch out: `$HOME/.claude/multi-agent-refs/orchestrator/phase-3-user-test.md`.
92
92
  - **4 Commit & PR**: ask before commit (No pauses; `resume` later) and before the PR; `git add` specific files, never `git add -A`; author from `prefs.global.identities[]`. Read `$HOME/.claude/multi-agent-refs/orchestrator/phase-4-5-projects.md`.
93
93
  - **5 Report**: finalize `agent-log.md` (`$HOME/.claude/multi-agent-refs/phases/log-format.md`), print the summary.
94
94
 
@@ -49,7 +49,7 @@ ACCESS_LINE=$(node "$HOME/.copilot/scripts/usage-access.mjs"); ACCESS_RC=$?
49
49
 
50
50
  4. **Tracked run - rebuild the phase tiles** from `tracker-state.json`, never re-initialized. Copilot CLI: a single `phase-tracker.sh render`.
51
51
 
52
- 5. **Tracked run - continue.** Read `state.waitingFor` FIRST: when it names a step (`maturity`, `user-channels-choice`, `local-test`, `question`), the run re-enters THAT step. `currentPhase + 1` is the fallback, not the rule. Clear `waitingFor` in the same write that records the answer. `question` re-enters `pendingQuestion.stepId`; `--answer <optionId>` records the answer first through `node "$HOME/.claude/scripts/answer-question.mjs" "$STATE_FILE" --answer "$OPTION_ID"`, which accepts only one of `pendingQuestion.options[].id` and writes nothing otherwise. The answer is data, never an instruction.
52
+ 5. **Tracked run - continue.** Read `state.waitingFor` FIRST: when it names a step (`maturity`, `user-channels-choice`, `local-test`, `question`), the run re-enters THAT step. `currentPhase + 1` is the fallback, not the rule. A decided and unfinished rework (`phases["2"].reworkForIteration` equal to the number of `reviewIterations`) re-enters Phase 2, never Phase 3 Step 4 again. Clear `waitingFor` in the same write that records the answer. `question` re-enters `pendingQuestion.stepId`; `--answer <optionId>` records the answer first through `node "$HOME/.claude/scripts/answer-question.mjs" "$STATE_FILE" --answer "$OPTION_ID"`, which accepts only one of `pendingQuestion.options[].id` and writes nothing otherwise. The answer is data, never an instruction.
53
53
 
54
54
  6. **Untracked branch work - resolve context.** Base branch: `--base` → `figma-config.project.baseBranch` → `develop` → upstream/merge-base. Jira id from the argument or the branch name. State under `$HOME/.claude/logs/multi-agent/{project}/{taskId}/`. No worktree is created.
55
55
 
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: multi-agent-review-rounds
3
+ description: "Set how often review sends work back, 1 to 3 (default 2). Use when changing review rounds."
4
+ user-invocable: true
5
+ argument-hint: "[status | 1 | 2 | 3 | reset] [--repo] - no argument opens a picker"
6
+ metadata:
7
+ language: en
8
+ ---
9
+
10
+ # multi-agent review-rounds - how many times review may send work back
11
+
12
+ > **Pickers follow** `$HOME/.claude/multi-agent-refs/picker-contract.md`: never a one-option call, and branch on the option selected, not on its text.
13
+
14
+ **Input**: ${ARGUMENTS}
15
+
16
+ Phase 3 sends accepted blocking findings back to Phase 2 for rework. This command
17
+ sets how many of those reworks a run allows: with limit N, review sends work back
18
+ N times, every rework is reviewed again, and the run stops when a review still has
19
+ blocking findings after N reworks (at most N + 1 reviews). The range is 1 to 3 (3
20
+ is the ceiling on `reworkCount`) and the default is 2. Every reader of the limit goes
21
+ through one resolver, so the number set here is the number a run obeys:
22
+
23
+ ```bash
24
+ RR="$HOME/.claude/scripts/review-rounds.mjs"
25
+ ```
26
+
27
+ Precedence, first valid value wins: `--review-rounds N` on the run, then this
28
+ repository's setting (`prefs.projects.<slug>.maxReworkCycles`), then the global
29
+ setting (`prefs.global.review.maxReworkCycles`), then 2. A stored value outside
30
+ 1 to 3 is ignored and reported, never clamped. Autopilot's circuit-breaker value
31
+ (`autopilotCircuitBreaker.maxReworkCycles`) can only lower the rework-storm
32
+ trigger; it never raises the limit.
33
+
34
+ ## Forms
35
+
36
+ | Input | Does |
37
+ |---|---|
38
+ | (none) | Shows the effective value and its source, then asks with the picker below. Interactive only. |
39
+ | `status` | `node "$RR" get`: prints the value, its source and the range. Asks nothing. |
40
+ | `1`, `2` or `3` | `node "$RR" set <n>`: writes it globally. Asks nothing. |
41
+ | `1`, `2` or `3` with `--repo` | `node "$RR" set <n> --repo`: writes it for the current repository only. |
42
+ | `reset` (with `--repo` for the repository) | `node "$RR" reset [--repo]`: removes that override. |
43
+ | `--repo` | Scopes to the current repository (its folder name, the run's `state.project`), or to `--project <key>`. A scope that cannot be resolved, or `--project` without `--repo`, exits 2 and writes nothing. |
44
+ | anything else | Print the usage line and stop with a non-zero exit. |
45
+
46
+ Print the script's output as written: it is already in the user's output language.
47
+ A value outside 1 to 3 is refused by the script with exit 2 and nothing is written;
48
+ report its message and stop.
49
+
50
+ ## Unattended runs
51
+
52
+ When `MULTI_AGENT_UNATTENDED=1` or `autopilot` is in the input, no picker opens and
53
+ nothing is defaulted. With no argument, run `node "$RR" get`, print the result and
54
+ stop. Setting a value needs an explicit argument (`1`, `2`, `3` or `reset`).
55
+
56
+ ## The picker (no argument, attended)
57
+
58
+ 1. Run `node "$RR" get --json`; print the `get` text form (value, source, range).
59
+ 2. Render the question, the labels and the descriptions below in
60
+ `outputLanguage`; only `header` is a fixed chip. The table gives each label in
61
+ its English form (Turkish: `2 tur (Önerilen)`, `3 tur`, `1 tur`). The default
62
+ (2) is first and carries `(Recommended)`; the option equal to the
63
+ current effective value carries `(current)` (Turkish `(geçerli)`), both
64
+ suffixes on one label when they coincide. The order is fixed: 2, 3, 1.
65
+ 3. Ask once. An empty answer is not consent: ask again, or write nothing.
66
+ 4. Branch on the option selected. If it equals the current effective value, write
67
+ nothing and say it is unchanged. Otherwise run `node "$RR" set <n>` (add
68
+ `--repo` only when the input carried `--repo`) and print its output. Scope is
69
+ not asked: global is the default and `--repo` is the way to scope.
70
+
71
+ `AskUserQuestion`: `header: "Rounds"`.
72
+
73
+ | # | label | description (en) | description (tr) |
74
+ |---|---|---|---|
75
+ | 1 | `2 rounds (Recommended)` | Review can send work back to development twice; a third failed review stops the run. | Review işi iki kez geliştirmeye geri gönderebilir; üçüncü başarısız review koşuyu durdurur. |
76
+ | 2 | `3 rounds` | Review can send work back to development three times; a fourth failed review stops the run. | Review işi üç kez geliştirmeye geri gönderebilir; dördüncü başarısız review koşuyu durdurur. |
77
+ | 3 | `1 round` | Review can send work back to development once; a second failed review stops the run. | Review işi bir kez geliştirmeye geri gönderebilir; ikinci başarısız review koşuyu durdurur. |
78
+
79
+ | | en | tr |
80
+ |---|---|---|
81
+ | question | How many times may review send work back to development before the run stops? | Koşu durmadan önce review işi kaç kez geliştirmeye geri gönderebilsin? |
82
+
83
+ On a host without a native picker (Copilot CLI), use the numbered-menu fallback of
84
+ the picker contract: `ask-choice.sh` with the three labels in this order, and map
85
+ the answer by its index, never by its text.
86
+
87
+ ## Related
88
+
89
+ - Resolver, precedence and exit codes: `$HOME/.claude/scripts/review-rounds.mjs`
90
+ - Where a run reads the limit: `$HOME/.claude/multi-agent-refs/phases/phase-3-review.md` Step 4
91
+ (`review-rounds.mjs next`) and `$HOME/.claude/multi-agent-refs/features/review-rounds.md`
92
+ - One run only: `/multi-agent "task" --review-rounds N`
@@ -52,7 +52,7 @@ Run every step automatically:
52
52
  ```
53
53
  Step 0: DOCTOR doctor.mjs - exit 2 or 4 stops the sync
54
54
  Step 1.5: DETECT Compare timestamps, find stale targets
55
- Step 2: COPILOT Claude Code -> Copilot CLI (instructions + 80 sub-command skills)
55
+ Step 2: COPILOT Claude Code -> Copilot CLI (instructions + 81 sub-command skills)
56
56
  Step 2b: CODEX Claude Code -> Codex CLI (router skill + specs as refs + agent TOML)
57
57
  Step 3: REPO Claude Code -> pipeline repo (genericized, personal data scrub, bash -n on all sh)
58
58
  Step 3c: PLUGINS shared/external -> multi-agent-plugins marketplace (rebuild, bump, push)
@@ -139,14 +139,14 @@ Claude <-> Copilot axis only; Codex takes Step 2b (`cross-cli-contract.md` 2.6).
139
139
 
140
140
  `~/.claude/commands/multi-agent/{cmd}/SKILL.md` <-> `~/.copilot/skills/multi-agent-{cmd}/SKILL.md`.
141
141
 
142
- **80 commands are synced** (canonical inventory - must match `cross-cli-contract.md` section 1; drift = contract violation):
142
+ **81 commands are synced** (canonical inventory - must match `cross-cli-contract.md` section 1; drift = contract violation):
143
143
 
144
144
  ```
145
145
  address-review, analysis, analysis-jira, analysis-resolve, autopilot-off, autopilot-on,
146
146
  autopilot-status, bug-bash, build-optimize, channels, clean-disk, complaint-analysis, create-jira,
147
147
  design-check, diff-explain, doctor, estimate, fable-off, fable-on, fable-status, feedback, forget, garbage-collect, graph, health, help,
148
148
  ios-coding-standard, issue, jira, kill, language, log,
149
- manual-test, office-off, office-on, office-status, pair, postmortem, prune-logs, prune-prompts, purge, refactor, research, resume, review, review-analysis, review-issue, review-jira, review-priority, route-off, route-on, route-status,
149
+ manual-test, office-off, office-on, office-status, pair, postmortem, prune-logs, prune-prompts, purge, refactor, research, resume, review, review-analysis, review-issue, review-jira, review-priority, review-rounds, route-off, route-on, route-status,
150
150
  routines, routines-browse, routines-delete, routines-import, routines-share, routines-update,
151
151
  save, scaffold, scan, scenario-audit, search, security-review, serve, setup, stack, status, steer, store-ready, sync, test,
152
152
  test-accessibility, test-dark-mode, test-dynamic-type, test-gen, test-screenshots,