@mmerterden/multi-agent-pipeline 19.1.3 → 20.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 (138) hide show
  1. package/CHANGELOG.md +150 -7
  2. package/README.md +60 -50
  3. package/README.tr.md +55 -46
  4. package/docs/adr/0002-instruction-driven-flag.md +6 -5
  5. package/docs/adr/0005-lazy-phase-docs.md +2 -2
  6. package/docs/adr/0008-installer-modularization-and-secret-leak-defense.md +1 -0
  7. package/docs/adr/0009-claude-stack-skills-plugin-only.md +1 -1
  8. package/docs/adr/0010-own-code-graph.md +5 -4
  9. package/docs/adr/0012-macos-only.md +2 -2
  10. package/docs/adr/0013-lsp-code-intelligence.md +2 -2
  11. package/docs/adr/0014-six-phase-consolidation.md +9 -9
  12. package/docs/adr/0015-one-pipeline-no-depth-answer.md +83 -0
  13. package/docs/adr/0016-the-run-shape-is-asked-not-typed.md +69 -0
  14. package/docs/adr/README.md +18 -16
  15. package/docs/architecture.md +2 -2
  16. package/docs/ecosystem.md +8 -9
  17. package/docs/facts.json +5 -8
  18. package/docs/features.md +4 -5
  19. package/docs/token-budget-history.md +1 -1
  20. package/install/_common.mjs +14 -6
  21. package/install/_mcp-register.mjs +1 -1
  22. package/install/_plugin-skills.mjs +3 -4
  23. package/install/copilot.mjs +5 -5
  24. package/install/templates/copilot-instructions.md +7 -16
  25. package/manifest.json +135 -138
  26. package/package.json +1 -1
  27. package/pipeline/commands/multi-agent/SKILL.md +6 -8
  28. package/pipeline/commands/multi-agent/analysis/SKILL.md +2 -0
  29. package/pipeline/commands/multi-agent/analysis-jira/SKILL.md +2 -0
  30. package/pipeline/commands/multi-agent/analysis-resolve/SKILL.md +2 -0
  31. package/pipeline/commands/multi-agent/autopilot/SKILL.md +2 -0
  32. package/pipeline/commands/multi-agent/autopilot-on/SKILL.md +2 -0
  33. package/pipeline/commands/multi-agent/autopilot-status/SKILL.md +1 -1
  34. package/pipeline/commands/multi-agent/build-optimize/SKILL.md +2 -0
  35. package/pipeline/commands/multi-agent/channels/SKILL.md +1 -1
  36. package/pipeline/commands/multi-agent/create-jira/SKILL.md +2 -0
  37. package/pipeline/commands/multi-agent/design-check/SKILL.md +1 -1
  38. package/pipeline/commands/multi-agent/forget/SKILL.md +2 -0
  39. package/pipeline/commands/multi-agent/garbage-collect/SKILL.md +4 -2
  40. package/pipeline/commands/multi-agent/help/SKILL.md +21 -27
  41. package/pipeline/commands/multi-agent/ios-coding-standard/SKILL.md +5 -4
  42. package/pipeline/commands/multi-agent/issue/SKILL.md +2 -0
  43. package/pipeline/commands/multi-agent/jira/SKILL.md +2 -0
  44. package/pipeline/commands/multi-agent/language/SKILL.md +2 -0
  45. package/pipeline/commands/multi-agent/prune-logs/SKILL.md +2 -0
  46. package/pipeline/commands/multi-agent/purge/SKILL.md +2 -0
  47. package/pipeline/commands/multi-agent/resume/SKILL.md +177 -48
  48. package/pipeline/commands/multi-agent/save/SKILL.md +2 -0
  49. package/pipeline/commands/multi-agent/setup/SKILL.md +4 -4
  50. package/pipeline/commands/multi-agent/stack/SKILL.md +2 -0
  51. package/pipeline/commands/multi-agent/sync/SKILL.md +6 -7
  52. package/pipeline/commands/multi-agent/test-screenshots/SKILL.md +2 -0
  53. package/pipeline/commands/multi-agent/uninstall/SKILL.md +2 -0
  54. package/pipeline/commands/sim-test.md +4 -4
  55. package/pipeline/lib/repo-hygiene.sh +1 -1
  56. package/pipeline/multi-agent-refs/analysis/locked.md +2 -2
  57. package/pipeline/multi-agent-refs/analysis/render.md +1 -1
  58. package/pipeline/multi-agent-refs/analysis/resolve.md +1 -1
  59. package/pipeline/multi-agent-refs/analysis/synthesis.md +1 -1
  60. package/pipeline/multi-agent-refs/analysis-template.md +1 -1
  61. package/pipeline/multi-agent-refs/channels/jira.md +8 -8
  62. package/pipeline/multi-agent-refs/component-dispatch.md +0 -8
  63. package/pipeline/multi-agent-refs/cross-cli-contract.md +10 -11
  64. package/pipeline/multi-agent-refs/features/base-branch-evidence.md +2 -2
  65. package/pipeline/multi-agent-refs/features/external-context-injection.md +2 -0
  66. package/pipeline/multi-agent-refs/features/review-delta.md +1 -1
  67. package/pipeline/multi-agent-refs/features/review-multi-repo.md +3 -3
  68. package/pipeline/multi-agent-refs/features/scope-check.md +1 -1
  69. package/pipeline/multi-agent-refs/features/skill-conformance.md +1 -1
  70. package/pipeline/multi-agent-refs/features/stack-skill-routing.md +1 -1
  71. package/pipeline/multi-agent-refs/features/visual-evidence.md +2 -1
  72. package/pipeline/multi-agent-refs/features/worktree-finalize.md +1 -1
  73. package/pipeline/multi-agent-refs/generate-issue.md +2 -0
  74. package/pipeline/multi-agent-refs/issue-jira-triad.md +2 -0
  75. package/pipeline/multi-agent-refs/keychain.md +2 -0
  76. package/pipeline/multi-agent-refs/knowledge.md +0 -7
  77. package/pipeline/multi-agent-refs/outside-the-pipeline.md +1 -1
  78. package/pipeline/multi-agent-refs/payload-contracts.md +1 -1
  79. package/pipeline/multi-agent-refs/phases/modes.md +32 -108
  80. package/pipeline/multi-agent-refs/phases/operations.md +3 -1
  81. package/pipeline/multi-agent-refs/phases/phase-0-init.md +23 -42
  82. package/pipeline/multi-agent-refs/phases/phase-1-plan.md +10 -21
  83. package/pipeline/multi-agent-refs/phases/phase-2-dev.md +13 -44
  84. package/pipeline/multi-agent-refs/phases/phase-3-review.md +19 -22
  85. package/pipeline/multi-agent-refs/phases/phase-4-commit.md +6 -6
  86. package/pipeline/multi-agent-refs/phases/phase-5-report.md +2 -2
  87. package/pipeline/multi-agent-refs/phases.md +9 -11
  88. package/pipeline/multi-agent-refs/progress-contract.md +1 -1
  89. package/pipeline/multi-agent-refs/readiness-review.md +2 -0
  90. package/pipeline/multi-agent-refs/rules.md +2 -2
  91. package/pipeline/multi-agent-refs/tracker-contract.md +9 -40
  92. package/pipeline/multi-agent-refs/wiki-capture.md +3 -2
  93. package/pipeline/preferences-template.json +2 -2
  94. package/pipeline/rules/figma-pipeline.md +1 -1
  95. package/pipeline/schemas/agent-state.schema.json +5 -10
  96. package/pipeline/schemas/migrations/prefs-2.7.0-to-2.8.0.mjs +33 -0
  97. package/pipeline/schemas/phases.json +3 -24
  98. package/pipeline/schemas/prefs.schema.json +5 -5
  99. package/pipeline/scripts/autopilot-runner.mjs +6 -7
  100. package/pipeline/scripts/build-references.mjs +3 -3
  101. package/pipeline/scripts/build-stack-plugins.mjs +1 -1
  102. package/pipeline/scripts/bulk-read.sh +6 -4
  103. package/pipeline/scripts/cost-table.json +1 -1
  104. package/pipeline/scripts/doctor.mjs +4 -4
  105. package/pipeline/scripts/gc-refs.sh +1 -1
  106. package/pipeline/scripts/gen-mode-dispatch.mjs +11 -41
  107. package/pipeline/scripts/learnings-ledger.mjs +1 -1
  108. package/pipeline/scripts/match-skills.mjs +4 -4
  109. package/pipeline/scripts/memory-load.sh +3 -3
  110. package/pipeline/scripts/migrate-prefs.mjs +18 -17
  111. package/pipeline/scripts/phase-tracker.sh +2 -2
  112. package/pipeline/scripts/phase0-exit-gate.mjs +1 -1
  113. package/pipeline/scripts/plan-coverage-gate.mjs +6 -6
  114. package/pipeline/scripts/run-aggregator.mjs +3 -3
  115. package/pipeline/scripts/runs-index.mjs +7 -7
  116. package/pipeline/scripts/scope-check-gate.mjs +1 -1
  117. package/pipeline/scripts/smoke-schema-validation.sh +9 -12
  118. package/pipeline/scripts/usage-report.mjs +5 -7
  119. package/pipeline/scripts/validate-analysis-doc.mjs +3 -3
  120. package/pipeline/scripts/worktree-finalize.sh +2 -2
  121. package/pipeline/scripts/write-state.mjs +22 -11
  122. package/pipeline/skills/.skill-manifest.json +9 -21
  123. package/pipeline/skills/.skills-index.json +6 -39
  124. package/pipeline/skills/shared/README.md +5 -8
  125. package/pipeline/skills/shared/core/multi-agent/SKILL.md +10 -13
  126. package/pipeline/skills/shared/core/multi-agent-autopilot-status/SKILL.md +1 -1
  127. package/pipeline/skills/shared/core/multi-agent-channels/SKILL.md +4 -5
  128. package/pipeline/skills/shared/core/multi-agent-help/SKILL.md +13 -16
  129. package/pipeline/skills/shared/core/multi-agent-ios-coding-standard/SKILL.md +2 -3
  130. package/pipeline/skills/shared/core/multi-agent-resume/SKILL.md +51 -15
  131. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +6 -6
  132. package/pipeline/skills/skills-index.md +3 -6
  133. package/pipeline/commands/multi-agent/local/SKILL.md +0 -132
  134. package/pipeline/commands/multi-agent/local-autopilot/SKILL.md +0 -142
  135. package/pipeline/commands/multi-agent/resume-local/SKILL.md +0 -114
  136. package/pipeline/skills/shared/core/multi-agent-local/SKILL.md +0 -41
  137. package/pipeline/skills/shared/core/multi-agent-local-autopilot/SKILL.md +0 -55
  138. package/pipeline/skills/shared/core/multi-agent-resume-local/SKILL.md +0 -51
@@ -1,58 +1,187 @@
1
1
  ---
2
- description: "Resume a stopped or failed task from the phase where it left off. Use when a task stopped or failed and should carry on from where it left off."
3
- description-tr: "Durmuş veya hata almış bir görevi kaldığı fazdan devam ettirir."
4
- argument-hint: "[#id] - optional: task ID (e.g. #2). If omitted, the most recent paused task is used."
2
+ description: "Pick up unfinished work: a pipeline run that stopped mid-phase, or work already written on the current branch that never went through the pipeline. Use when a task stopped or failed, or when hand-written local work needs review, build, PR and reporting."
3
+ description-tr: "Yarım kalan işi sürdürür: ortada duran bir pipeline koşusu ya da mevcut branch'te elle yazılmış, pipeline'dan hiç geçmemiş iş."
4
+ argument-hint: "[#id | PROJ-12345] [--base <branch>] [autopilot] - no argument: pick from the list"
5
+ allowed-tools: Agent, Bash, Read, Write, Edit, Glob, Grep, TaskCreate, TaskUpdate, TaskList, TaskGet, AskUserQuestion, WebFetch, WebSearch, Skill
5
6
  ---
6
7
 
7
- # multi-agent resume - Resume Paused Task
8
+ # multi-agent resume - Continue Unfinished Work
8
9
 
9
10
  **Input**: $ARGUMENTS
10
11
 
11
- Resume a paused or failed task from the last successful phase.
12
+ > **Language (read FIRST)**: Before any status output, read `prefs.global.outputLanguage` and render every conversational line in it. `AskUserQuestion` renders its `question`, option `label`s and option `description`s in `outputLanguage`; only `header` stays English (<=12-char chip); external payload bodies follow `outputLanguage` too (identifiers, commit messages, branch names stay English). Full contract: `$HOME/.claude/multi-agent-refs/rules.md` "Language Application".
12
13
 
13
- > **Not the same as `/multi-agent:resume-local`.** `resume` continues a **tracked pipeline task** (needs its `agent-state.json`/worktree) from where it stopped. `/multi-agent:resume-local` takes **ad-hoc local work** on the current branch (no prior task required) and runs the pipeline tail - Review → Build+Test → PR → Jira report - over it.
14
+ Unfinished work reaches this command from two directions, and which one you are in is a property of the repository, not of how you typed the command:
15
+
16
+ - **A tracked run stopped.** It has an `agent-state.json`, a phase it was inside, and possibly a worktree. It resumes from where it stopped.
17
+ - **Work exists on the current branch with no run behind it.** You wrote it by hand, or a run outside the pipeline produced it. There is nothing to resume, so the **pipeline tail** runs over the diff: Review (with its build gate) → Commit/PR → Report. Plan and Dev never run; the diff already on the branch is the Dev output.
18
+
19
+ Step 1 finds both and asks. A single command means you do not have to know which case you are in before you can ask the question.
20
+
21
+ ## Input
22
+
23
+ ```bash
24
+ /multi-agent:resume # list everything resumable, pick one
25
+ /multi-agent:resume #2 # a tracked run by task number
26
+ /multi-agent:resume PROJ-12345 # a tracked run by Jira id, or bind the tail to that id
27
+ /multi-agent:resume --base develop # tail path: override the base branch for the diff
28
+ /multi-agent:resume autopilot # no gate prompts: auto-fix, auto-PR, auto-comment
29
+ ```
30
+
31
+ ## When NOT to use it
32
+
33
+ - The change is not written yet - use `/multi-agent`.
34
+ - Only the review is wanted - `/multi-agent:review`. Only the report - `/multi-agent:channels`. Only device UI testing - `/multi-agent:test` / `/multi-agent:manual-test`.
35
+ - The run is abandoned rather than paused - `/multi-agent:kill #N`, or `/multi-agent:garbage-collect --abandoned` for the Phase 0 leftovers.
14
36
 
15
37
  ## Steps
16
38
 
17
- 1. **Find the task** - parse `#N` from the argument, or pick the most recent worktree with `status != "done"`.
18
-
19
- 2. **Read + validate state** - parse `agent-state.json`:
20
- - Validate first: `node $HOME/.claude/scripts/validate-state.mjs <state-file>` (resume-safety check, tolerant of legacy shapes). On non-zero exit, do NOT guess a phase - surface the errors and stop with `ERR: agent-state.json is unsafe to resume; inspect it or 'kill #N' and restart.`
21
- - Confirm the worktree (`worktreePath` / `projects[].worktreePath`) exists and is usable; if missing or locked, run the Phase 0 "Worktree stale-lock heal" before continuing.
22
- - **Unless `state.worktreeRemovedAt` is set.** Then the worktree was removed on purpose by Phase 4 once the PR opened, the branch is still local, and the artefacts live under `state.artifactsPath`. Do NOT heal or recreate it: read state from `artifactsPath`, and if the remaining work needs a checkout (a Phase 5 pause needs none), ask before moving the user's HEAD - they may be mid-work on another branch, which is exactly why the removal did not check the branch out.
23
- - `currentPhase` - last completed phase
24
- - `status` - `paused` | `failed` | `in_progress`
25
- - `haltReason` - if set, show it so the user knows why the run stopped; clear it on successful re-entry
26
- - `circuitBreaker` - if `tripped`, show `trigger` + `detail`, then set `tripped: false` and keep `counters`; if the same trigger fires again at the next checkpoint the breaker re-trips (no silent bypass)
27
- - `autopilot` - preserve the mode
28
-
29
- 3. **Load context** - rebuild working context from durable artifacts, never from conversation memory:
30
- - **Handoff first (v10.8.0)**: read the LATEST `## Handoff` block in `agent-log.md` - it carries done/remaining/decisions/open-findings and the exact re-entry point (phase + subStep). When present, it is the primary context source; cross-check its `Next:` line against `state.currentPhase` and trust state on mismatch (state is the machine truth, handoff is the narrative).
31
- - Fall back to per-phase findings for logs written before v10.8 (no handoff blocks):
32
- - Phase 1 analysis → use it from Phase 2+
33
- - Phase 1 plan → use it from Phase 2+
34
- - Phase 3 code → already in the worktree
35
- - Recent `git log --oneline -10` in the worktree grounds what was actually committed vs. claimed.
36
-
37
- 4. **Rebuild the phase tiles** - load `tracker-state.json` for the task (never re-init it; `$HOME/.claude/multi-agent-refs/tracker-contract.md` "Resume behaviour" + "Continuation runs"):
38
- - Claude Code: `TaskCreate` every phase from the state file in phase order, then `TaskUpdate` each to its stored status, and replace every `tasklist_id` meta with the new IDs.
39
- - Other CLIs: a single `bash $HOME/.claude/scripts/phase-tracker.sh render`.
40
-
41
- 5. **Continue the pipeline.** Read `state.waitingFor` FIRST: when it names a step, the
42
- run re-enters THAT step rather than the next phase. `currentPhase + 1` is the fallback,
43
- not the rule - a run that stopped mid-phase to ask a human has `currentPhase` pointing at
44
- the phase it is still inside, so resuming past it skips the question permanently. That
45
- was already true of Phase 5's channels pause, which documented itself as resumable
46
- through this field while this file never mentioned it.
47
-
48
- | `waitingFor` | Re-entry |
49
- |---|---|
50
- | `maturity` | Phase 0, the maturity step, with the item **re-fetched** and re-scored - an edit is a reason to look again, never proof the gap closed (`$HOME/.claude/multi-agent-refs/features/maturity-followup.md`) |
51
- | `user-channels-choice` | Phase 5, the channels multi-select, with the stored `channelsInput` |
52
- | absent | `currentPhase + 1`, as before (same pipeline as the main multi-agent command) |
53
-
54
- Clear `waitingFor` in the same write that records the answer, the moment the step is
55
- re-entered. A field that outlives the question it asked sends every later resume back
56
- to the step the user already answered.
57
-
58
- 6. **Log**: `🔄 Resumed {JIRA-KEY}-{id} from Phase {N}`
39
+ ### Step 1 - Build the resumable list, then ask
40
+
41
+ Collect both sources before rendering anything. An argument that names a run (`#N`, a Jira id, a GitHub issue number) selects it directly and skips the question; an argument that names nothing resumable is an error, never a silent fall-through to the tail.
42
+
43
+ **Source A - tracked runs.** Every `agent-state.json` under `$HOME/.claude/logs/multi-agent/{project}/` whose `status != "done"`. Each row carries what the choice actually turns on: task id, the phase it stopped inside, its workspace (the worktree path, or `local` when `worktreePath` is the project root), how long it has been sitting, and `haltReason` when set.
44
+
45
+ **Source B - untracked work on the current branch.** Resolve the base branch in order: `--base <arg>` → `figma-config.project.baseBranch` → `develop` → the branch's upstream/merge-base. The work is `git diff <base>...HEAD` plus uncommitted working-tree changes. The row appears only when that diff is non-empty **and** no Source A run already owns this branch - otherwise the same work would be offered twice under two different contracts.
46
+
47
+ **Ask.** Full rules: `$HOME/.claude/multi-agent-refs/picker-contract.md`. This is a one-step chain, so the breadcrumb is `Step 1/1: which unfinished work to pick up`, rendered in `outputLanguage` above the picker. `question`, every `label` and every `description` render in `outputLanguage`; `header` stays English (`Resume what`). Source A rows first (newest first), Source B last. Labels carry proper nouns verbatim - task id, branch name - and the run branches on which row was selected, never on the label text.
48
+
49
+ **One candidate is still a question.** A single row is asked with a genuine escape as its second option, because `AskUserQuestion` refuses a call with fewer than two declared options and discards every question batched with it:
50
+
51
+ | Only row | Second option |
52
+ |---|---|
53
+ | one stopped run | **Show every run** - re-opens with the `status != "done"` filter dropped, so a run that recorded itself finished but left work behind is still reachable |
54
+ | only the branch diff | **Pick a stopped run instead** - re-opens listing Source A unfiltered, and says so when it is empty |
55
+
56
+ Zero rows in both sources: do not ask. Stop with `ERR: nothing to resume - no stopped run for this project and no local changes on {branch} vs {base}`.
57
+
58
+ **The answer routes.** A Source A row runs Steps 2-5 and nothing else; a Source B row runs Steps 6-7 and nothing else. The two halves never both run in one invocation.
59
+
60
+ ### Step 2 - Tracked run: read and validate state
61
+
62
+ - Validate first: `node $HOME/.claude/scripts/validate-state.mjs <state-file>` (resume-safety check, tolerant of legacy shapes). On non-zero exit, do NOT guess a phase - surface the errors and stop with `ERR: agent-state.json is unsafe to resume; inspect it or 'kill #N' and restart.`
63
+ - Confirm the worktree (`worktreePath` / `projects[].worktreePath`) exists and is usable; if missing or locked, run the Phase 0 "Worktree stale-lock heal" before continuing.
64
+ - **Unless `state.worktreeRemovedAt` is set.** Then the worktree was removed on purpose by Phase 4 once the PR opened, the branch is still local, and the artefacts live under `state.artifactsPath`. Do NOT heal or recreate it: read state from `artifactsPath`, and if the remaining work needs a checkout (a Phase 5 pause needs none), ask before moving the user's HEAD - they may be mid-work on another branch, which is exactly why the removal did not check the branch out.
65
+ - `currentPhase` - last completed phase
66
+ - `status` - `paused` | `failed` | `in_progress`
67
+ - `haltReason` - if set, show it so the user knows why the run stopped; clear it on successful re-entry
68
+ - `circuitBreaker` - if `tripped`, show `trigger` + `detail`, then set `tripped: false` and keep `counters`; if the same trigger fires again at the next checkpoint the breaker re-trips (no silent bypass)
69
+ - `autopilot` - preserve the mode
70
+
71
+ ### Step 3 - Tracked run: load context
72
+
73
+ Rebuild working context from durable artifacts, never from conversation memory:
74
+
75
+ - **Handoff first**: read the LATEST `## Handoff` block in `agent-log.md` - it carries done/remaining/decisions/open-findings and the exact re-entry point (phase + subStep). When present, it is the primary context source; cross-check its `Next:` line against `state.currentPhase` and trust state on mismatch (state is the machine truth, handoff is the narrative).
76
+ - Fall back to per-phase findings for logs written before handoff blocks existed:
77
+ - Phase 1 analysis and plan → use them from Phase 2 on
78
+ - Phase 2 code → already in the worktree
79
+ - Recent `git log --oneline -10` in the worktree grounds what was actually committed vs. claimed.
80
+
81
+ ### Step 4 - Tracked run: rebuild the phase tiles
82
+
83
+ Load `tracker-state.json` for the task (never re-init it; `$HOME/.claude/multi-agent-refs/tracker-contract.md` "Resume behaviour" + "Continuation runs"):
84
+
85
+ - Claude Code: `TaskCreate` every phase from the state file in phase order, then `TaskUpdate` each to its stored status, and replace every `tasklist_id` meta with the new IDs.
86
+ - Other CLIs: a single `bash $HOME/.claude/scripts/phase-tracker.sh render`.
87
+
88
+ ### Step 5 - Tracked run: continue the pipeline
89
+
90
+ Read `state.waitingFor` FIRST: when it names a step, the run re-enters THAT step rather than the next phase. `currentPhase + 1` is the fallback, not the rule - a run that stopped mid-phase to ask a human has `currentPhase` pointing at the phase it is still inside, so resuming past it skips the question permanently.
91
+
92
+ | `waitingFor` | Re-entry |
93
+ |---|---|
94
+ | `maturity` | Phase 0, the maturity step, with the item **re-fetched** and re-scored - an edit is a reason to look again, never proof the gap closed (`$HOME/.claude/multi-agent-refs/features/maturity-followup.md`) |
95
+ | `user-channels-choice` | Phase 5, the channels multi-select, with the stored `channelsInput` |
96
+ | `local-test` | Phase 3, the user-test gate, with the checkout the gate was waiting on |
97
+ | absent | `currentPhase + 1`, as before (same pipeline as the main multi-agent command) |
98
+
99
+ Clear `waitingFor` in the same write that records the answer, the moment the step is re-entered. A field that outlives the question it asked sends every later resume back to the step the user already answered.
100
+
101
+ Log: `🔄 Resumed {JIRA-KEY}-{id} from Phase {N}`
102
+
103
+ ### Step 6 - Untracked branch work: context resolution
104
+
105
+ 1. **Project + branch:** detect project (cwd), current branch (`git branch --show-current`). No worktree is created; the work is already in this checkout.
106
+ 2. **Base + diff:** as resolved in Step 1. Abort with `ERR: no local work to resume on <branch> vs <base>` if the diff went empty between the question and the answer.
107
+ 3. **Task binding:** Jira id from the argument, else parsed from the branch name (`bugfix/PROJ-XXXX` / `feature/PROJ-XXXX`); `taskType` inferred from the diff (bugfix/feature/refactor/chore) for the report wording. GitHub issue `#N` from branch or argument when present.
108
+ 4. **Prior state (optional):** if a tracker state exists for this branch from an earlier run, load its analysis summary and Jira/issue binding to enrich the report. Never require a prior pipeline run.
109
+ 5. Persist state under `$HOME/.claude/logs/multi-agent/{project}/{taskId}/`, the same location every run uses.
110
+
111
+ ### Step 7 - Untracked branch work: run the tail
112
+
113
+ ```
114
+ Phase 0: Init → project/branch detect, base + diff, Jira id, state (no worktree)
115
+ Phase 3: Review → the Verify gate first (stack-aware build + existing tests; SUCCESS required), then
116
+ parallel review (Fable + Opus + Sonnet) + Fable triage
117
+ Phase 4: Commit → commit remaining local changes + push + open PR if none exists
118
+ Phase 5: Report → technical analysis + Jira comment with test scenarios (channels: Jira / PR / Confluence / Wiki)
119
+ ```
120
+
121
+ Phases 1 and 2 (Plan / Dev) do not run: the branch's diff is the Dev output, so the **Plan Approval Gate** has no plan to approve here. That is the only path where it is absent for a reason other than `autopilot` having nobody to ask.
122
+
123
+ **Why Review runs the build gate here.** Verify is Phase 2 Dev's exit gate, and this path has no Dev: the work arrived already written. The gate still has to run, so Review runs it before dispatching reviewers. Reviewing a branch whose build was never checked is the failure this ordering prevents.
124
+
125
+ - **Phase 3 Review** - per `$HOME/.claude/multi-agent-refs/phases/phase-3-review.md` against the resolved diff: deterministic gates (Step 1.x), stack-specific parallel reviewers (Fable + Opus + Sonnet on Claude Code; GPT + Opus + Sonnet on Copilot CLI), Fable triage → `triage.accepted`. Blocking/important accepted findings:
126
+ - interactive: present them and ask (`AskUserQuestion`) whether to fix now (loop back through a minimal Phase-2-style TDD fix) or proceed;
127
+ - `autopilot` (or `prefs.global.resume.autoFix == true`): auto-fix accepted blocking/important findings, then re-review the fix, before advancing.
128
+ - **Phase 3 Verify gate** - the **automated success gate** (the interactive device user-test is `/multi-agent:manual-test`). Stack-aware: build via `figma-config.build` (iOS scheme / Android gradle / detected backend/web build) and run the existing test suite if present (`swift test` / `xcodebuild test` / `./gradlew test` / `pytest` / `npm test` / `vitest`). Require success to advance; on failure, surface logs and (interactive) stop or (autopilot) attempt a bounded fix loop. **If the repo has no tests, report "no tests present" - never fabricate test results.**
129
+ - **Phase 4 Commit/PR** - per `$HOME/.claude/multi-agent-refs/phases/phase-4-commit.md`: stage + commit any remaining local changes with a conventional message (`{type}(scope): desc [{JIRA_KEY}-{id}]`), push, and open a PR **only if one does not already exist** for the branch. PR body per `$HOME/.claude/multi-agent-refs/rules.md` "External System Outputs" and `$HOME/.claude/rules/git-conventions.md` - `Ref: #N` / `Related: #N`, never `Closes/Fixes/Resolves`; NO AI/bot attribution anywhere.
130
+ - **Phase 5 Report** - per `$HOME/.claude/multi-agent-refs/phases/phase-5-report.md` + `channels.md`: produce the **technical analysis** and **test scenarios**, then post to the configured channels. Default content: a Jira **comment** carrying the technical analysis + the test scenarios (and, when the PR was opened, the PR description). Every body runs through the humanizer; bot/tool/AI signatures are FORBIDDEN in comments.
131
+
132
+ ## Modes
133
+
134
+ - **interactive** (default): stops at the Phase 4 gate when there are blocking/important findings; asks before committing/PR when appropriate.
135
+ - **`autopilot`**: no prompts - auto-fix accepted blocking/important findings, auto-commit/push/PR, auto-post the Jira comment.
136
+
137
+ ## Required: outward-facing payload contracts
138
+
139
+ Before writing anything outward-facing - PR body, Jira comment, Confluence page, closing report - load `$HOME/.claude/multi-agent-refs/payload-contracts.md`. It names the canonical section set for each payload, the markup dialect per surface (PR body is Markdown, Jira is wiki markup - mixing them is a defect), and the token/duration numbers the closing report must carry. Improvising a payload shape from memory is the most common failure of a run that starts in the middle.
140
+
141
+ ## Required: Phase Tracker Contract
142
+
143
+ **The phase tracker is required.** Full spec: [`$HOME/.claude/multi-agent-refs/tracker-contract.md`]($HOME/.claude/multi-agent-refs/tracker-contract.md).
144
+
145
+ A tracked run rebuilds its tiles from `tracker-state.json` (Step 4) and never re-declares a phase set. The untracked-branch path registers its own active set - `0:Init 3:Review 4:Commit 5:Report` - but NEVER resets a tracker an earlier run already built (load-or-continue; contract section "Continuation runs"):
146
+
147
+ ```bash
148
+ # Phase 0, first shell call (every CLI). init ONLY when no prior state exists -
149
+ # a task handed off from the user test inside Phase 3 ("awaiting local test")
150
+ # keeps its full phase 0-2 history (elapsed, tokens, USD).
151
+ STATE="$HOME/.claude/logs/multi-agent/${TASK_ID}/tracker-state.json"
152
+ if [ ! -f "$STATE" ]; then
153
+ bash $HOME/.claude/scripts/phase-tracker.sh init "$TASK_ID"
154
+ fi
155
+ for p in "0:Init" "3:Review" "4:Commit" "5:Report"; do
156
+ bash $HOME/.claude/scripts/phase-tracker.sh add "${p%%:*}" "${p#*:}" # idempotent: existing phases keep their history
157
+ done
158
+ bash $HOME/.claude/scripts/phase-tracker.sh update 0 in_progress
159
+
160
+ # Every phase boundary (every CLI):
161
+ bash $HOME/.claude/scripts/phase-tracker.sh update <N> in_progress|completed|failed|skipped
162
+ # After every LLM call (every CLI):
163
+ bash $HOME/.claude/scripts/phase-tracker.sh tokens <N> <in> <out> [cached]
164
+ ```
165
+
166
+ **Continuation path (prior state existed):** (1) if Phase 3 was left `in_progress` with `Now: awaiting local test (user)`, mark it `update 3 completed` + `meta 3 Result "local test done (user)"` before this run's own work (it re-opens Phase 3 with `update 3 in_progress` when the Verify gate runs; elapsed keeps the original `started_at`, which is expected); (2) print ONE line in `outputLanguage` summarizing the inherited history, e.g. `Continuing PROJ-12345: phases 0-3 finished earlier (12m, 38.4k tok, ~$0.74)` (USD via `phase-tracker.sh cost total`); (3) `render`.
167
+
168
+ ### Visual channel - Claude Code (native TaskList widget, required)
169
+
170
+ Fresh state: register one tile per phase in strict phase-number order (`0 → 3 → 4 → 5`) BEFORE any TaskUpdate, capture each `taskId`, persist via `phase-tracker.sh meta <N> tasklist_id "<taskId>"`, then flip status with `TaskUpdate` at each boundary. Out-of-order TaskCreate scrambles the tile stack. Full contract: `$HOME/.claude/multi-agent-refs/tracker-contract.md` "TaskCreate ordering (strict)".
171
+
172
+ Continuation: rebuild the FULL TaskList from the state file (completed tiles included) in phase order before any `TaskUpdate`, refreshing every `tasklist_id` meta - same as the contract's "Resume behaviour".
173
+
174
+ ### Visual channel - Copilot CLI / plain shell
175
+
176
+ No TaskList widget. After every state change call `bash $HOME/.claude/scripts/phase-tracker.sh render` (prints the bordered ANSI phase table as the last tool result). Do NOT call TaskCreate on these CLIs.
177
+
178
+ ## Examples
179
+
180
+ ```bash
181
+ /multi-agent "PROJ-12345" # a run that stops at the user-test gate
182
+ /multi-agent:resume # ... pick it back up from that gate
183
+
184
+ # ... or, with no run behind it at all:
185
+ # you write the change by hand on bugfix/PROJ-12345-flight-filter
186
+ /multi-agent:resume # review + build/test + PR + Jira analysis & test scenarios
187
+ ```
@@ -7,6 +7,8 @@ allowed-tools: Bash, Read, AskUserQuestion
7
7
 
8
8
  # multi-agent save - Save a Routine
9
9
 
10
+ > **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.
11
+
10
12
  **Input**: $ARGUMENTS (optional routine name)
11
13
 
12
14
  Turn a recurring, project-specific procedure into a first-class `/multi-agent:<name>` command. The saved routine is a **local-only** command (`local-only: true`) plus a registry entry in `prefs.global.routines`; it is never synced to the public repo (the `/multi-agent:sync` backstops enforce this).
@@ -70,10 +70,10 @@ per-field matrix in `$HOME/.claude/multi-agent-refs/rules.md` ("Language Applica
70
70
  English. Wizard status and the post-setup summary follow `outputLanguage`. External
71
71
  payloads remain English.
72
72
 
73
- > This paragraph used to say every prompt renders in English "per the fixed
74
- > `promptLanguage`", which contradicted the canonical matrix and produced
75
- > half-English pickers on Turkish runs: `promptLanguage` governs only the button and
76
- > chip chrome, never the question a user reads.
73
+ > `promptLanguage` governs only the button and chip chrome, never the question a
74
+ > user reads. Rendering a whole prompt in English "per the fixed
75
+ > `promptLanguage`" contradicts the matrix above and produces half-English
76
+ > pickers on Turkish runs.
77
77
 
78
78
  ### Step 0.5 - Dependency check
79
79
 
@@ -7,6 +7,8 @@ allowed-tools: Bash, Read, Edit, Write, AskUserQuestion
7
7
 
8
8
  # multi-agent stack - Select Stack(s) via Plugin Enablement
9
9
 
10
+ > **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.
11
+
10
12
  Stack skills ship as plugins in the `{owner}/multi-agent-plugins` marketplace. Selecting a stack = **enabling the matching plugin(s)** in the current repo's `.claude/settings.json` `enabledPlugins`. Two toolkits are stack-independent and always enabled alongside the stack plugin(s): `ai-common-toolkit` (accessibility audit, humanizer, Firebase) and `ai-analyst-toolkit` (GitHub and package-registry evidence, community signal for analysis work).
11
13
 
12
14
  On Claude Code the marketplace plugins are the ONLY source of stack skills - nothing is copied into `~/.claude/skills` anymore. A stack that is not enabled here is simply absent from the session. Copilot CLI and Codex CLI have no plugin loader; they receive a local copy filtered to the enabled stacks at install time, which is why step 5 below offers to refresh those copies after a change.
@@ -65,8 +65,8 @@ Run every step automatically:
65
65
  ```
66
66
  Step 0: DOCTOR doctor.mjs - exit 2 or 4 stops the sync
67
67
  Step 1.5: DETECT Compare timestamps, find stale targets
68
- Step 2: COPILOT Claude Code -> Copilot CLI (instructions + 60 sub-command skills)
69
- Step 2b: CODEX Claude Code -> Codex CLI (1 router skill + 60 specs as refs + 8 agent TOML)
68
+ Step 2: COPILOT Claude Code -> Copilot CLI (instructions + 57 sub-command skills)
69
+ Step 2b: CODEX Claude Code -> Codex CLI (1 router skill + 57 specs as refs + 8 agent TOML)
70
70
  Step 3: REPO Claude Code -> pipeline repo (genericized, personal data scrub, bash -n on all sh)
71
71
  Step 3c: PLUGINS pipeline shared/external -> multi-agent-plugins marketplace (rebuild knowledge/,
72
72
  bump changed plugins' patch version, commit + push the plugins repo)
@@ -90,7 +90,7 @@ Step 0 gate rules and why: `features/doctor.md`.
90
90
  - `copilot-instructions.md`: general development instructions + pipeline summary section
91
91
  - `multi-agent-pipeline/pipeline/`: generic open-source version (NO personal data)
92
92
  3. **Sync the shared sections** (Claude ↔ Copilot):
93
- - Pipeline entries table (base / :local / :autopilot / :local-autopilot) + the Full-or-Short depth question
93
+ - Pipeline entries table (base / :autopilot)
94
94
  - Project detection (URL-based + cwd-based)
95
95
  - Figma pipeline flow
96
96
  - Git conventions (author, branch, commit format)
@@ -494,15 +494,14 @@ same 56 specs as reference files rather than as peer skills, via Step 2b - see
494
494
  |-------------|-------------|
495
495
  | `~/.claude/commands/multi-agent/{cmd}/SKILL.md` | `~/.copilot/skills/multi-agent-{cmd}/SKILL.md` |
496
496
 
497
- **60 commands are synced** (canonical inventory - must match `cross-cli-contract.md` section 1; drift = contract violation):
497
+ **57 commands are synced** (canonical inventory - must match `cross-cli-contract.md` section 1; drift = contract violation):
498
498
 
499
499
  ```
500
500
  analysis, analysis-jira, analysis-resolve, autopilot, autopilot-off, autopilot-on,
501
501
  autopilot-status, build-optimize, channels, complaint-analysis, create-jira,
502
502
  design-check, diff-explain, doctor, feedback, forget, garbage-collect, graph, help,
503
- ios-coding-standard, issue, jira, kill, language, local, local-autopilot, log,
504
- manual-test, model, prune-logs, prune-prompts, purge, refactor, resume, resume-local,
505
- review, review-analysis, review-issue, review-jira, route-off, route-on, route-status,
503
+ ios-coding-standard, issue, jira, kill, language, log,
504
+ manual-test, model, prune-logs, prune-prompts, purge, refactor, resume, review, review-analysis, review-issue, review-jira, route-off, route-on, route-status,
506
505
  routines, save, scan, search, setup, stack, status, steer, store-ready, sync, test,
507
506
  test-accessibility, test-dark-mode, test-dynamic-type, test-screenshots,
508
507
  testflight-validation, uninstall, update
@@ -6,6 +6,8 @@ argument-hint: "[locale] - boş = tr; örn. tr | en | de | ar"
6
6
 
7
7
  # /multi-agent:test-screenshots - Locale screenshot set
8
8
 
9
+ > **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.
10
+
9
11
  Fixed-scenario alias, **parameterised by locale**. The scenario is pinned; the
10
12
  language is not, because one command per language would put a parameter in a name.
11
13
 
@@ -7,6 +7,8 @@ argument-hint: "[--dry-run] [--all-data] [--claude] [--copilot] [--target=<path>
7
7
 
8
8
  # multi-agent uninstall - Token-Preserving Uninstall
9
9
 
10
+ > **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.
11
+
10
12
  Uninstalls the pipeline itself from the system. **This is different from `:purge`:**
11
13
 
12
14
  | Command | What it removes |
@@ -188,10 +188,10 @@ file can do: the static package audit, the store's own validator, and a policy
188
188
  review against repo source. It merges both halves into one severity-grouped report
189
189
  and offers the `/multi-agent:channels` follow-up.
190
190
 
191
- The archive-compliance audit used to be duplicated here, invoking
192
- `ios_app_store_audit` with exactly the arguments the store-ready command's Gate 1
193
- uses. Two copies of one call is how the iOS path grew a second door with no Gate 2,
194
- no Gate 3 and no Android parity, so the copy is gone rather than kept in sync.
191
+ The archive-compliance audit is NOT repeated here. Invoking `ios_app_store_audit`
192
+ with the arguments the store-ready command's Gate 1 already uses would put two
193
+ copies of one call in the tree, which is how a second door opens with no Gate 2,
194
+ no Gate 3 and no Android parity behind it.
195
195
 
196
196
  **No argument (full test):**
197
197
 
@@ -8,7 +8,7 @@
8
8
  # (.multi-agent/). Only the first was ever excluded, and only by a one-line
9
9
  # guard duplicated across two phase docs and gc-worktrees.sh. The other two
10
10
  # were never excluded anywhere, which is invisible in worktree mode (the
11
- # worktree is deleted) and permanent in --local mode (nothing deletes it).
11
+ # worktree is deleted) and permanent with a local workspace (nothing deletes it).
12
12
  #
13
13
  # Functions:
14
14
  # ma_hygiene_ensure_exclusions <repo-root> Write the managed block into
@@ -46,7 +46,7 @@ behind.
46
46
  ### Full list
47
47
 
48
48
  1. **One feature per run.** Every Figma URL, Confluence page, Jira ID, and Standards source the user supplies belongs to the **same feature**. The command never asks "which feature is this for?" or "which URL is primary?". Mixed inputs covering multiple features are treated as user error: surface the conflict, stop, and ask the user to split into separate runs.
49
- 2. **Section omission rule.** Sections with zero evidence are dropped entirely; no `TBD` placeholder section. **A rendered section keeps its canonical template number**, so the set has gaps and that is correct: `1, 2, 4, 9, 13, 14, 21` is a valid rendered document. This clause used to say numbering re-flows sequentially `1..N`, which could not hold alongside Locked 30 - that decision threads ids across sections BY NUMBER (`Section 15.1 scenario`, `Section 4.4`, `Section 3/5 layout cells`), and a re-flowed document sends every one of those cross-references to the wrong section or to nothing. No emitted document ever re-flowed; the rule was the part that was wrong. What IS checked: every rendered number is a real template number, and the numbers ascend without repeating.
49
+ 2. **Section omission rule.** Sections with zero evidence are dropped entirely; no `TBD` placeholder section. **A rendered section keeps its canonical template number**, so the set has gaps and that is correct: `1, 2, 4, 9, 13, 14, 21` is a valid rendered document. Numbering does NOT re-flow sequentially `1..N`: that cannot hold alongside Locked 30, which threads ids across sections BY NUMBER (`Section 15.1 scenario`, `Section 4.4`, `Section 3/5 layout cells`), so a re-flowed document sends every one of those cross-references to the wrong section or to nothing. What IS checked: every rendered number is a real template number, and the numbers ascend without repeating.
50
50
  3. **Citation discipline.** Every quoted UI string, endpoint path, error code, or analytics event name in Sections 2-4 must carry an inline citation: `[Figma annotation <nodeId>]` for copy taken from a Dev Mode annotation, `[Figma <nodeId>]` (MCP) or `[figma-export: <project-slug>/<screen-slug>:<nodeId>]` (local source) for design strings; `file:line` for repo evidence; `Confluence:<pageId>:<heading-slug>` for spec text. **Annotation-as-copy precedence:** when the project's `figma-config` has `annotations.enabled` and a node carries a Dev Mode annotation, that annotation is the authoritative copy for the node and the visible text layer is treated as a placeholder; cite the annotation, not the layer text. Never invent copy - blank beats a guess; a node whose annotation has the base language but is missing a target language emits a Section 20 (Risks) row rather than a fabricated value. Uncited quotes are downgraded to `[label TBD - see Open Questions]` and a row is added to Section 7 Risks. Subagent prose and Code Connect snippets are not citations.
51
51
  4. **The spec is forward-looking.** Section bodies describe the new feature as drawn / specified. Findings that exist only in legacy code or the existing branch appear as `> Legacy reference: <text> (file:line)` blockquotes inside the relevant section, never as the lead sentence or a primary table row. A legacy-only finding with no forward counterpart goes to Section 7 Risks as a decision item: "current code does X; should the new feature keep, change, or drop this?".
52
52
  5. **Output default = Local file.** The Phase 3.5 output picker keeps `Local file` pre-selected. Confluence and Jira outputs are never default-selected (see `analysis-output-confluence-on-request` memory).
@@ -76,7 +76,7 @@ behind.
76
76
  27. **SwiftUI Preview block mandatory (iOS projection, SwiftUI only).** When the iOS file is produced AND the affected view is a SwiftUI view (detected via `import SwiftUI` + `: View` protocol conformance in `evidence.repoEvidence[<repo>].buckets.uiComponents`), Section 13.6 renders a Preview block table covering at minimum: canonical default (LTR Light), Dark, RTL, Dynamic Type accessibilityLarge, and one error variant. Loading state and edge-case variants are added when distinct from canonical. UIKit-only features (no SwiftUI view artefact) drop Section 13.6 with note `(N/A: UIKit-only feature)`. Preview macro convention (`#Preview` for Swift 5.9+ vs legacy `PreviewProvider`) is read from `evidence.conventions[<repo>].previewMacro`. Each Preview variant listed in Section 13.6 must have a matching row in Section 15.2 Snapshot Tests; a Preview without a snapshot row triggers a Section 20 Risk.
77
77
  28. **Variant usage explicit and bounded.** Section 6 inventory rows list which variants this feature consumes per component (concrete enum case + bool value). New Section 6.X (Variant Usage Matrix) catalogues the full variant axis vs. used subset with a rationale per excluded variant. Sections 13.6 (Preview) and 15.2 (Snapshot) cover only the used subset; expanding the variant set requires updating Section 6.X first.
78
78
  29. **Analysis as self-contained design bridge - no MCP outside analysis phase (BLOCKING, pipeline-wide).** The analysis document is the sole design source for every downstream phase. After Phase 1 of `/multi-agent:analysis` produces `analysis/<feature>-<platform>.md`, Phase 1 Plan, Phase 2 Dev, Phase 3 Review, Phase 3 Review, Phase 4 Commit, and Phase 5 Report consume only the analysis document plus repo Code Connect mappings (`*.figma.swift` / `*.figma.kt`). Calling `mcp__claude_ai_Figma__*`, hitting `api.figma.com`, or fetching a `figma.com/design/...` URL during Phase 2+ is a violation. Applies to every mode that runs Phase 2+: `/multi-agent`, `/multi-agent:autopilot`, `/multi-agent:local`, `/multi-agent:local-autopilot`, at either depth. Hard requirement (v9.0.0): Phase 2 Pre-item and Phase 3 Pre-item (BLOCKING) abort the run when the analysis document is missing. Memory: `[[mcp-only-in-analysis]]`. Generic rule rationale and access matrix: see `$HOME/.claude/rules/figma-pipeline.md` "MUST: No MCP outside analysis phase".
79
- 30. **Business-rule to acceptance-criterion to test traceability (AI + human spine).** The analysis is a development handoff that both an AI implementer and a human reviewer must act on, so it is bound by one shared-ID vocabulary. Every business rule carries a stable id `BR-<slug>-NN` (Section 4.4). Each rule maps to at least one acceptance criterion written Given / When / Then (binary - two readers must not be able to disagree on pass/fail). Each acceptance criterion maps to unit-test scenarios in Section 15.1, one row per case across happy / boundary / error / empty-nil (enumerate at least the failure modes; agents hallucinate error handling when it is omitted). The same ids thread onward: Section 15.6 UI-test flows reference the `BR-` ids and use stable selectors (accessibilityIdentifier / testTag), Section 16 accessibility items reuse those identifiers, Section 11 analytics events cite their triggering rule or story, and Section 3/5 layout cells carry token + Figma node refs. Never invent copy or values (blank beats a guess; a missing source becomes a Section 20 Open Question). **Gate:** a business rule with no acceptance criterion, or an acceptance criterion with no Section 15.1 scenario, fails the dispatch gate. There is no mode clause: the rule used to be suspended in Lite mode, which deferred the rule-to-test half to "whenever the feature is later analyzed in Full" - a debt nothing tracked and nothing ever paid. Section 15 renders when there is evidence for it and is dropped when there is not, like every other section, and the gate applies to whatever was rendered.
79
+ 30. **Business-rule to acceptance-criterion to test traceability (AI + human spine).** The analysis is a development handoff that both an AI implementer and a human reviewer must act on, so it is bound by one shared-ID vocabulary. Every business rule carries a stable id `BR-<slug>-NN` (Section 4.4). Each rule maps to at least one acceptance criterion written Given / When / Then (binary - two readers must not be able to disagree on pass/fail). Each acceptance criterion maps to unit-test scenarios in Section 15.1, one row per case across happy / boundary / error / empty-nil (enumerate at least the failure modes; agents hallucinate error handling when it is omitted). The same ids thread onward: Section 15.6 UI-test flows reference the `BR-` ids and use stable selectors (accessibilityIdentifier / testTag), Section 16 accessibility items reuse those identifiers, Section 11 analytics events cite their triggering rule or story, and Section 3/5 layout cells carry token + Figma node refs. Never invent copy or values (blank beats a guess; a missing source becomes a Section 20 Open Question). **Gate:** a business rule with no acceptance criterion, or an acceptance criterion with no Section 15.1 scenario, fails the dispatch gate. There is no mode clause. Suspending the rule for a lighter mode defers the rule-to-test half to "whenever the feature is later analyzed in Full" - a debt nothing tracks and nothing ever paid. Section 15 renders when there is evidence for it and is dropped when there is not, like every other section, and the gate applies to whatever was rendered.
80
80
 
81
81
  31. **Analysis profile selected at intake.** `state.analysisSpec.profile` is `global` (default) or `corporate`, asked once at Phase 0 Step 1b and never re-asked mid-run. `global` renders `$HOME/.claude/multi-agent-refs/analysis-template.md` (23 sections, development handoff). `corporate` renders `$HOME/.claude/multi-agent-refs/analysis-template-corporate.md` (requirements document: `IG -> UC -> FG` spine, three traceability matrices, current-to-target state with impact analysis, then Technical Analysis and Development Analysis). **Both profiles read the same `state.analysisSpec.evidence.*`** - intake, fetching, repo evidence and convention extraction are shared and profile-independent; only the projection differs. This is what keeps the two templates from drifting into two products. One run emits one profile: rendering both from a single run would produce two documents describing the same feature, and the next reader would have to decide which one is current. When only one profile is available (`prefs.global.analysisProfiles` lists one, or the corporate profile has no binding configuration), the step auto-resolves and prints its breadcrumb with the resolution noted, per the picker contract.
82
82
  32. **Corporate backbone always renders.** In the `corporate` profile the Locked 2 omission rule is replaced for Part A and the footer: those sections render even with zero evidence, carrying `N/A` when the section is genuinely out of scope for the feature and `EKLENECEK` when evidence is expected but missing. This is the point of a requirements document - a reader has to be able to tell "we considered hardware needs and there are none" from "nobody looked". Every `EKLENECEK` emits a matching Section 20 Risks and Open Questions row naming what is missing and who can answer it; an `EKLENECEK` with no such row fails the dispatch gate, because an unanswered question nobody owns is how a placeholder reaches production. **Missing inputs never block the run**: the corporate source practice of halting until every input arrives is deliberately not adopted - the document is produced with `EKLENECEK` in the gaps and the gaps are raised in Section 20. Part B follows the global omission table unchanged. In the `global` profile Locked 2 applies as written, with no placeholder of any kind.
@@ -64,7 +64,7 @@ Phase 3.2 produced the list. Sort every entry and act:
64
64
  | Bucket | Meaning | Action |
65
65
  |---|---|---|
66
66
  | A. Not searched | The evidence is reachable and this run did not look | Run the search; it closes, and never becomes a question |
67
- | B. The user knows | Channel scope, which service backs a screen, what is in scope | Ask, `AskUserQuestion`, at most 4 per call |
67
+ | B. The user knows | Channel scope, which service backs a screen, what is in scope | Ask, `AskUserQuestion` per `picker-contract.md`, at most 4 per call |
68
68
  | C. External | Final copy, a legal basis, a contract nobody has written | Record as `AS-NN` in Section 20 |
69
69
 
70
70
  **Bucket A must be empty before Phase 3.5.** A gap reaches C only with a stamp:
@@ -6,7 +6,7 @@
6
6
 
7
7
  ## New Locked decisions (this command)
8
8
 
9
- 1. **One question per `AskUserQuestion` call.** Never batch Section 20 rows. Sequential resolution keeps each decision explicit and traceable.
9
+ 1. **One question per `AskUserQuestion` call**, shaped by `picker-contract.md`. Never batch Section 20 rows. Sequential resolution keeps each decision explicit and traceable.
10
10
  2. **Up to 3 source-labeled candidates plus Defer = 4 options max.** Each candidate's `description` carries its source label: `From evidence - <doc section / citation>`, `From repo - <file:line>`, `AI reasoned - <one-line rationale>`. The auto-provided Other accepts free text and stop tokens.
11
11
  3. **Three sources, never blended.**
12
12
  - **From evidence**: the answer is already derivable from the doc's own sections and their citations (Sections 5, 6, 9, 13, 21) or from cached `state.analysisSpec.evidence.*` when the session still holds it. Cite the section or evidence bucket.
@@ -34,7 +34,7 @@ synthesizedSections = {
34
34
 
35
35
  #### Phase 2a - Pass B preview (Locked 25)
36
36
 
37
- Before Pass B renders any file, present the resolved convention table to the user via `AskUserQuestion`. The table is one row per concept, one column per selected platform.
37
+ Before Pass B renders any file, present the resolved convention table to the user via `AskUserQuestion` (`picker-contract.md`). The table is one row per concept, one column per selected platform.
38
38
 
39
39
  Example (iOS + Android selected):
40
40
 
@@ -830,7 +830,7 @@ Framework: iOS XCUITest (`waitForExistence`, identifier-driven); Android Compose
830
830
 
831
831
  ### 15.7 Manuel test senaryoları / Manual test scenarios
832
832
 
833
- The scenarios a person runs by hand. Same format the pipeline already posts as the Jira test-scenario comment (`/multi-agent:resume-local`), defined once and read by both. Omitted entirely when the feature has none (Locked 2); never rendered as an empty table.
833
+ The scenarios a person runs by hand. Same format the pipeline already posts as the Jira test-scenario comment (`/multi-agent:resume`), defined once and read by both. Omitted entirely when the feature has none (Locked 2); never rendered as an empty table.
834
834
 
835
835
  Each row is executable by someone who did not write the feature: no "verify it works", no implied setup. Cover the happy path, at least one boundary, and every failure mode that reaches the user - the same four-way split Locked 30 requires of unit tests.
836
836
 
@@ -50,9 +50,9 @@ it is the PR body (`channels/pr.md`).
50
50
  A `gaps[]` entry prints its reason on the line where the artefact would have been (`Düzeltme öncesi: ticket'ta görsel yok`). Never an empty thumbnail, never a silent omission. Contract: `$HOME/.claude/multi-agent-refs/features/visual-evidence.md`.
51
51
 
52
52
  **`test_scenarios`** - one titled scenario per acceptance criterion, each a
53
- numbered list of steps ending in the expected result. Given/When/Then was the
54
- shape here for several releases and it reads as translated English to the person
55
- who actually runs these; a tester wants a list they can follow with the app open.
53
+ numbered list of steps ending in the expected result. Not Given/When/Then: it
54
+ reads as translated English to the person who actually runs these, and a tester
55
+ wants a list they can follow with the app open.
56
56
  The heading and the text render in `outputLanguage`; this file shows the English
57
57
  skeleton:
58
58
 
@@ -176,7 +176,7 @@ The parenthesised forms are the ones that actually bite: `(x)` in a comparison t
176
176
 
177
177
  The program runs AFTER the markdown conversion above and BEFORE the POST. Order is load-bearing in both directions: run it earlier and the conversion re-introduces sequences behind it; skip it and `{{...}}` monospace does not save you, because Jira parses emoticons inside monospace too.
178
178
 
179
- Do not hand-apply this table. It was hand-applied for several releases and a smiley reached a ticket anyway - a long comment gives the eye no reason to stop on the `:)` at the end of a selector.
179
+ Do not hand-apply this table. A long comment gives the eye no reason to stop on the `:)` at the end of a selector, so the program applies it or nothing does.
180
180
 
181
181
  Lines outside these patterns pass through verbatim. Multi-paragraph blocks are joined with one blank line.
182
182
 
@@ -224,10 +224,10 @@ That script escapes every body unconditionally (`lib/jira-publish.sh:109`) and
224
224
  passes the token through a `-K` config rather than argv, so neither the escape
225
225
  nor the token handling depends on an agent remembering a step.
226
226
 
227
- This block used to be a hand-written `jq` + `curl` pair with the escape as a
228
- separate `--check` line above it, and a shipped comment rendered the Swift
229
- selector `hash(into:)` as `hash(into` plus a smiley - twice. The escaper was
230
- present, correct, and simply not run on that path: `:)` reached Jira intact and
227
+ Not a hand-written `jq` + `curl` pair with the escape as a separate `--check`
228
+ line above it. In that shape the escaper is present, correct, and simply not run
229
+ on the POST path: a Swift selector such as `hash(into:)` renders as `hash(into`
230
+ plus a smiley, because `:)` reaches Jira intact and
231
231
  Jira's wiki renderer turned it into an emoticon, which is what section
232
232
  *Emoticon escaping* below is about. A defence that has to be invoked by hand is
233
233
  a defence that is eventually not invoked.
@@ -7,7 +7,6 @@
7
7
  - [Subphase contract (dispatch-layer owned)](#subphase-contract-dispatch-layer-owned)
8
8
  - [Multi-repo report](#multi-repo-report)
9
9
  - [Failure + resume](#failure-resume)
10
- - [Short-run behaviour](#short-run-behaviour)
11
10
  - [Cross-CLI behaviour (intentional divergence)](#cross-cli-behaviour-intentional-divergence)
12
11
  <!-- /toc -->
13
12
 
@@ -79,7 +78,6 @@ Emit `→ dispatching create-component <componentName>` via the progress contrac
79
78
 
80
79
  - `figmaUrl` - primary argument (the plugin skill's `<figma-url>`)
81
80
  - the component name + the analysis Section 6 (Bileşen Envanteri) row + Section 13.1 conventions as context (the plugin skill does not re-read the pipeline's analysis doc on its own - pass what it needs)
82
- - `mode` - `"dev"` vs `"full"`, from `state.onlyDevelop`, so the plugin can elide tests/wiki on a Short run
83
81
 
84
82
  Plugin skills are user-facing lifecycle skills; they do **not** accept an `agentState` path and do **not** write `agent-state.json`. State tracking therefore moves to the dispatch layer (next section).
85
83
 
@@ -120,12 +118,6 @@ On failure (the plugin skill returns an unrecoverable build/test error, or the d
120
118
  3. Retry re-invokes the plugin skill (it is idempotent on an existing component; it reconciles rather than duplicating). There is no bundled `phase-<N>` resume anymore.
121
119
  4. Hard kill at `retryCount === 3` → surface the errors to the user, halt Phase 2. Do not loop indefinitely.
122
120
 
123
- ## Short-run behaviour
124
-
125
- When the Phase 0 Step 7.5 depth picker answered Short (`state.onlyDevelop === true`), the dispatch layer passes `mode: "dev"` so the plugin skill can elide unit tests and wiki (structural + snapshot still required; wiki deferred to Phase 5). If the plugin does not honor a `mode` hint, dispatch simply skips the post-build wiki step itself.
126
-
127
- Phase 3 runs in a Short run as it does in a Full one, and its reviewer count is **not** Phase 3's concern - the Step 1.77 scope gate decides that from diff risk, independently of `mode`. What the dispatch layer owes Phase 4 is the record of which plugin skill it delegated to, appended to `state.telemetry.skillCalls[]`, so the review can check the delivered component against the criteria that skill imposes.
128
-
129
121
  ## Cross-CLI behaviour (intentional divergence)
130
122
 
131
123
  Component dispatch is **no longer byte-identical across CLIs** and that is by design (see `cross-cli-contract.md` section 1.1):
@@ -1,7 +1,7 @@
1
1
  # Cross-CLI Contract (Claude Code · Copilot CLI · Codex CLI)
2
2
 
3
3
  <!-- toc -->
4
- - [1. Command Inventory (60 commands)](#1-command-inventory-60-commands)
4
+ - [1. Command Inventory (57 commands)](#1-command-inventory-57-commands)
5
5
  - [2. Canonical Placeholder Vocabulary](#2-canonical-placeholder-vocabulary)
6
6
  - [2.6 Intentional structural divergence - thin dispatcher vs inlined orchestrator](#26-intentional-structural-divergence---thin-dispatcher-vs-inlined-orchestrator)
7
7
  - [2.7 One command, three different meanings: `/multi-agent:model`](#27-one-command-three-different-meanings-multi-agentmodel)
@@ -20,15 +20,15 @@
20
20
 
21
21
  ---
22
22
 
23
- ## 1. Command Inventory (60 commands)
23
+ ## 1. Command Inventory (57 commands)
24
24
 
25
25
  ```
26
26
  analysis, analysis-jira, analysis-resolve, autopilot, autopilot-off,
27
27
  autopilot-on, autopilot-status, build-optimize, channels, complaint-analysis,
28
28
  create-jira, design-check, diff-explain, doctor, feedback, forget,
29
29
  garbage-collect, graph, help, ios-coding-standard, issue, jira, kill,
30
- language, local, local-autopilot, log, manual-test, model, prune-logs,
31
- prune-prompts, purge, refactor, resume, resume-local, review,
30
+ language, log, manual-test, model, prune-logs,
31
+ prune-prompts, purge, refactor, resume, review,
32
32
  review-analysis, review-issue, review-jira, route-off, route-on,
33
33
  route-status, routines, save, scan, search,
34
34
  setup, stack, status, steer, store-ready, sync, test, test-accessibility,
@@ -40,8 +40,8 @@ Categories:
40
40
 
41
41
  - **Interactive pickers** (single-purpose, not modes): `jira`, `issue`
42
42
  - **Issue generator** (one-shot, no worktree, asks type Task/Bug/Story, hard approval gate before create): `create-jira`
43
- - **Pipeline entries**: `autopilot`, `local`, `local-autopilot` (plus the bare `/multi-agent` in the dispatcher). Depth is not a command: `/multi-agent` and `local` ask Full or Short at Phase 0 Step 7.5; the two autopilot entries never ask and always run Full.
44
- - **Tail modes** (run the pipeline tail over already-done local work): `resume-local`
43
+ - **Pipeline entries**: `autopilot` (plus the bare `/multi-agent` in the dispatcher). The phase set is a property of the command, and every mode runs its whole set.
44
+ - **Tail path** (the pipeline tail over work already on a branch, no run behind it): `resume`
45
45
  - **Ops commands** (one-shot, no worktree): `status`, `log`, `kill`, `steer`, `purge`, `uninstall`, `resume`, `review`, `review-jira`, `review-issue`, `analysis`, `analysis-resolve`, `complaint-analysis`, `build-optimize`, `channels`, `scan`, `search`, `diff-explain`, `garbage-collect`, `graph`, `prune-logs`, `prune-prompts`
46
46
  - **Local audits** (worktree only to build; no commit, push, PR or channels): `design-check`, `testflight-validation`, `ios-coding-standard`. `testflight-validation` additionally never invokes `altool --upload-app` - a validation run must not be able to ship a build by accident.
47
47
  - **Meta-ops**: `setup`, `sync`, `update`, `help`, `refactor`, `test`, `stack`, `manual-test`, `language`
@@ -367,11 +367,10 @@ Given the same user input, both CLIs must produce identical parsed state:
367
367
  | `#42` or bare `42` | `input.type = "github-issue-number"`, `input.issueNo = 42` |
368
368
  | Any other string | `input.type = "free-text"`, `input.summary = <string>` |
369
369
 
370
- Modifier flags are orthogonal and compose:
371
- - `autopilot` - skip confirmations
372
- - Short depth - init → dev → review → test → commit → report (Phase 0 Step 7.5 picker, not a flag)
373
- - `--local` - no worktree
374
- - Combinations: `--local autopilot`. Short plus autopilot is NOT a combination: autopilot never asks the depth question and always runs Full.
370
+ One modifier exists:
371
+ - `autopilot` - skip confirmations, and resolve the workspace to a worktree without asking.
372
+
373
+ The workspace is not a flag. Where the branch lives is a Phase 0 Step 5b question on attended runs.
375
374
 
376
375
  ---
377
376
 
@@ -97,8 +97,8 @@ GitHub's analogue is the milestone title, read the same way.
97
97
 
98
98
  ## 2b. A filter is not a ranking
99
99
 
100
- Step 3's rule-5 list used to be narrowed with `grep -E '(develop|release|main|master)'`,
101
- which is the prefix table this whole feature exists not to have - and worse than a
100
+ Step 3's rule-5 list is NOT narrowed with `grep -E '(develop|release|main|master)'`.
101
+ That is the prefix table this whole feature exists not to have - and worse than a
102
102
  table, because it DISCARDS. A repo whose release branches read `stabilise-2.7`
103
103
  matched none of the four words, so none of its branches reached the picker, the
104
104
  convention-learner had nothing to learn from, and the version on the issue could