@mmerterden/multi-agent-pipeline 19.1.4 → 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 (114) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/README.md +19 -36
  3. package/README.tr.md +18 -35
  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 +5 -5
  17. package/docs/facts.json +3 -6
  18. package/docs/features.md +4 -5
  19. package/docs/token-budget-history.md +1 -1
  20. package/install/_common.mjs +9 -1
  21. package/install/templates/copilot-instructions.md +7 -16
  22. package/manifest.json +111 -114
  23. package/package.json +1 -1
  24. package/pipeline/commands/multi-agent/SKILL.md +6 -8
  25. package/pipeline/commands/multi-agent/analysis/SKILL.md +2 -0
  26. package/pipeline/commands/multi-agent/analysis-jira/SKILL.md +2 -0
  27. package/pipeline/commands/multi-agent/analysis-resolve/SKILL.md +2 -0
  28. package/pipeline/commands/multi-agent/autopilot/SKILL.md +2 -0
  29. package/pipeline/commands/multi-agent/autopilot-on/SKILL.md +2 -0
  30. package/pipeline/commands/multi-agent/autopilot-status/SKILL.md +1 -1
  31. package/pipeline/commands/multi-agent/build-optimize/SKILL.md +2 -0
  32. package/pipeline/commands/multi-agent/channels/SKILL.md +1 -1
  33. package/pipeline/commands/multi-agent/create-jira/SKILL.md +2 -0
  34. package/pipeline/commands/multi-agent/design-check/SKILL.md +1 -1
  35. package/pipeline/commands/multi-agent/forget/SKILL.md +2 -0
  36. package/pipeline/commands/multi-agent/garbage-collect/SKILL.md +4 -2
  37. package/pipeline/commands/multi-agent/help/SKILL.md +21 -27
  38. package/pipeline/commands/multi-agent/ios-coding-standard/SKILL.md +5 -4
  39. package/pipeline/commands/multi-agent/issue/SKILL.md +2 -0
  40. package/pipeline/commands/multi-agent/jira/SKILL.md +2 -0
  41. package/pipeline/commands/multi-agent/language/SKILL.md +2 -0
  42. package/pipeline/commands/multi-agent/prune-logs/SKILL.md +2 -0
  43. package/pipeline/commands/multi-agent/purge/SKILL.md +2 -0
  44. package/pipeline/commands/multi-agent/resume/SKILL.md +177 -48
  45. package/pipeline/commands/multi-agent/save/SKILL.md +2 -0
  46. package/pipeline/commands/multi-agent/stack/SKILL.md +2 -0
  47. package/pipeline/commands/multi-agent/sync/SKILL.md +6 -7
  48. package/pipeline/commands/multi-agent/test-screenshots/SKILL.md +2 -0
  49. package/pipeline/commands/multi-agent/uninstall/SKILL.md +2 -0
  50. package/pipeline/lib/repo-hygiene.sh +1 -1
  51. package/pipeline/multi-agent-refs/analysis/render.md +1 -1
  52. package/pipeline/multi-agent-refs/analysis/resolve.md +1 -1
  53. package/pipeline/multi-agent-refs/analysis/synthesis.md +1 -1
  54. package/pipeline/multi-agent-refs/analysis-template.md +1 -1
  55. package/pipeline/multi-agent-refs/component-dispatch.md +0 -8
  56. package/pipeline/multi-agent-refs/cross-cli-contract.md +10 -11
  57. package/pipeline/multi-agent-refs/features/external-context-injection.md +2 -0
  58. package/pipeline/multi-agent-refs/features/review-delta.md +1 -1
  59. package/pipeline/multi-agent-refs/features/review-multi-repo.md +3 -3
  60. package/pipeline/multi-agent-refs/features/skill-conformance.md +1 -1
  61. package/pipeline/multi-agent-refs/features/visual-evidence.md +2 -1
  62. package/pipeline/multi-agent-refs/features/worktree-finalize.md +1 -1
  63. package/pipeline/multi-agent-refs/generate-issue.md +2 -0
  64. package/pipeline/multi-agent-refs/issue-jira-triad.md +2 -0
  65. package/pipeline/multi-agent-refs/keychain.md +2 -0
  66. package/pipeline/multi-agent-refs/knowledge.md +0 -7
  67. package/pipeline/multi-agent-refs/outside-the-pipeline.md +1 -1
  68. package/pipeline/multi-agent-refs/payload-contracts.md +1 -1
  69. package/pipeline/multi-agent-refs/phases/modes.md +32 -108
  70. package/pipeline/multi-agent-refs/phases/operations.md +2 -0
  71. package/pipeline/multi-agent-refs/phases/phase-0-init.md +23 -42
  72. package/pipeline/multi-agent-refs/phases/phase-1-plan.md +7 -18
  73. package/pipeline/multi-agent-refs/phases/phase-2-dev.md +13 -44
  74. package/pipeline/multi-agent-refs/phases/phase-3-review.md +19 -22
  75. package/pipeline/multi-agent-refs/phases/phase-4-commit.md +6 -6
  76. package/pipeline/multi-agent-refs/phases/phase-5-report.md +2 -2
  77. package/pipeline/multi-agent-refs/phases.md +9 -11
  78. package/pipeline/multi-agent-refs/progress-contract.md +1 -1
  79. package/pipeline/multi-agent-refs/readiness-review.md +2 -0
  80. package/pipeline/multi-agent-refs/rules.md +1 -1
  81. package/pipeline/multi-agent-refs/tracker-contract.md +9 -40
  82. package/pipeline/multi-agent-refs/wiki-capture.md +3 -2
  83. package/pipeline/preferences-template.json +2 -2
  84. package/pipeline/rules/figma-pipeline.md +1 -1
  85. package/pipeline/schemas/agent-state.schema.json +5 -10
  86. package/pipeline/schemas/migrations/prefs-2.7.0-to-2.8.0.mjs +33 -0
  87. package/pipeline/schemas/phases.json +3 -24
  88. package/pipeline/schemas/prefs.schema.json +5 -5
  89. package/pipeline/scripts/cost-table.json +1 -1
  90. package/pipeline/scripts/gc-refs.sh +1 -1
  91. package/pipeline/scripts/gen-mode-dispatch.mjs +11 -41
  92. package/pipeline/scripts/migrate-prefs.mjs +18 -17
  93. package/pipeline/scripts/phase-tracker.sh +2 -2
  94. package/pipeline/scripts/phase0-exit-gate.mjs +1 -1
  95. package/pipeline/scripts/plan-coverage-gate.mjs +3 -3
  96. package/pipeline/scripts/run-aggregator.mjs +1 -1
  97. package/pipeline/scripts/usage-report.mjs +0 -2
  98. package/pipeline/scripts/worktree-finalize.sh +2 -2
  99. package/pipeline/skills/.skill-manifest.json +8 -20
  100. package/pipeline/skills/.skills-index.json +6 -39
  101. package/pipeline/skills/shared/README.md +5 -8
  102. package/pipeline/skills/shared/core/multi-agent/SKILL.md +8 -11
  103. package/pipeline/skills/shared/core/multi-agent-autopilot-status/SKILL.md +1 -1
  104. package/pipeline/skills/shared/core/multi-agent-help/SKILL.md +13 -16
  105. package/pipeline/skills/shared/core/multi-agent-ios-coding-standard/SKILL.md +2 -3
  106. package/pipeline/skills/shared/core/multi-agent-resume/SKILL.md +51 -15
  107. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +6 -6
  108. package/pipeline/skills/skills-index.md +3 -6
  109. package/pipeline/commands/multi-agent/local/SKILL.md +0 -132
  110. package/pipeline/commands/multi-agent/local-autopilot/SKILL.md +0 -142
  111. package/pipeline/commands/multi-agent/resume-local/SKILL.md +0 -114
  112. package/pipeline/skills/shared/core/multi-agent-local/SKILL.md +0 -41
  113. package/pipeline/skills/shared/core/multi-agent-local-autopilot/SKILL.md +0 -55
  114. 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).
@@ -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 |
@@ -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
@@ -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
 
@@ -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
 
@@ -7,6 +7,8 @@
7
7
  - [Log line shape](#log-line-shape)
8
8
  <!-- /toc -->
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
  Phase 0 Step 1b catalogued every typed external link from the task description into `state.contextLinks[]`. Phase 1 dispatches each entry to its matching fetcher and prepends the result to the analysis prompt under a **Referenced External Sources** section, so the agent doesn't re-discover what the ticket already pointed at.
11
13
 
12
14
  ```bash
@@ -63,7 +63,7 @@ DELTA_JSON=$(node $HOME/.claude/scripts/review-delta.mjs --rounds-dir "$WORKTREE
63
63
  jq -c --argjson d "$DELTA_JSON" --argjson i "$((ITERATION-1))" \
64
64
  '{reviewIterations: (.reviewIterations | .[$i] += {delta: ($d + {computedAt: (now | todate)})})}' "$STATE_FILE" \
65
65
  | node $HOME/.claude/scripts/write-state.mjs "$STATE_FILE"
66
- $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 4 review.delta iteration=$ITERATION \
66
+ $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 3 review.delta iteration=$ITERATION \
67
67
  new=$(jq '.counts.new // 0' <<< "$DELTA_JSON") still_present=$(jq '.counts.stillPresent // 0' <<< "$DELTA_JSON") \
68
68
  resolved=$(jq '.counts.resolved // 0' <<< "$DELTA_JSON") plateau=$(jq '.plateau // false' <<< "$DELTA_JSON") tripped=$([ "$DELTA_RC" -eq 3 ] && echo true || echo false)
69
69
  ```
@@ -57,9 +57,9 @@ And log `review.diff_truncated repo=<name> bytes_dropped=<N>`. Triage receives t
57
57
 
58
58
  **Telemetry**: Per-repo build/test gate timings + a single combined review/triage call set:
59
59
  ```bash
60
- $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 4 gate.build repo=common status=pass duration_ms=$D
61
- $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 4 gate.build repo=uicomponents status=pass duration_ms=$D
62
- $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 4 review.combined_diff repos=2 bytes=$BYTES truncated=false
60
+ $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 3 gate.build repo=common status=pass duration_ms=$D
61
+ $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 3 gate.build repo=uicomponents status=pass duration_ms=$D
62
+ $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 3 review.combined_diff repos=2 bytes=$BYTES truncated=false
63
63
  ```
64
64
 
65
65
  ---
@@ -22,7 +22,7 @@ Phase 4 used to select its review criteria from `detectedStack`, a string Phase
22
22
  - The dev side and the review side could disagree about the standard without either noticing. A component built by a plugin skill was reviewed against `clean-code`.
23
23
  - "Did it do this correctly?" had no fixed denominator, so the only available answer was "it looks fine", and a reviewer that opened nothing produced the same output as a reviewer that checked everything.
24
24
 
25
- A Short run makes this sharper: it has no Phase 1 at all, so the sole input to the old selection logic was absent.
25
+ The sharper case is a document whose evidence supported few sections: the sole input to the old selection logic was then nearly empty.
26
26
 
27
27
  ## The four rules that make it work
28
28
 
@@ -123,7 +123,8 @@ section still renders, saying so.
123
123
  ## 3. After - Phase 2, not the Phase 3 user test
124
124
 
125
125
  The user test is the natural home: the simulator is already up. It is also **dropped by
126
- every `autopilot` and `--local` entry** (`phase-3-review.md` TLDR), so a capture
126
+ every `autopilot` entry and by any run whose
127
+ workspace is local** (`phase-3-review.md` TLDR), so a capture
127
128
  that lives only there produces nothing for unattended runs - which are exactly
128
129
  the runs where nobody watched the screen.
129
130
 
@@ -20,7 +20,7 @@ Removing it at PR-open is only safe because of the salvage, so the two are one s
20
20
 
21
21
  | Condition | Why it blocks |
22
22
  |---|---|
23
- | `worktreePath == projectRoot` (`--local` mode) | there is no worktree; removing it would delete the user's checkout |
23
+ | `worktreePath == projectRoot` (local workspace) | there is no worktree; removing it would delete the user's checkout |
24
24
  | cwd is inside the worktree | a shell left on a deleted inode is worse than a leftover directory, and Phase 4 legitimately `cd`s into the worktree earlier |
25
25
  | not a registered worktree of the project root | a mistyped path must not delete an unrelated directory |
26
26
  | real uncommitted changes | never discarded; see the artefact carve-out below |
@@ -9,6 +9,8 @@
9
9
 
10
10
  > **TLDR** - Shared 12-step flow for `/multi-agent:create-jira`. Asks the issue type (Task / Bug / Story), mines the target project's existing same-type issues to learn team conventions, detects the active sprint, drafts a standards-compliant issue from a fixed standard template with auto-sizing sections, asks the user about every genuinely unknown field, renders a full preview, and creates the Jira issue only after explicit approval. Creates exactly one Jira issue per run - no branches, no commits, no worktrees.
11
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
+
12
14
  Consumed by `create-jira/SKILL.md`. This ref is never invoked directly.
13
15
 
14
16
  ## Hard rules (must not regress)
@@ -9,6 +9,8 @@
9
9
  - [Cross-CLI parity](#cross-cli-parity)
10
10
  <!-- /toc -->
11
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
+
12
14
  > **TLDR** - When a GitHub issue triggers the pipeline and has no Jira ID, the `autoJiraFromGithubIssue` policy decides whether to auto-create a Jira task (and patch the GitHub issue body with the new Jira link). Phase 5 then posts a humanizer'd wiki-content summary back as a Jira comment, closing the loop. Autopilot treats `ask` as `always`.
13
15
 
14
16
  This doc is referenced from `$HOME/.claude/multi-agent-refs/phases/phase-0-init.md` Step 1 (GitHub issue input) and `$HOME/.claude/multi-agent-refs/phases/phase-5-report.md` Step 2 (component wiki). Keeps the phase docs tight and gives the triad contract a stable home.
@@ -1,5 +1,7 @@
1
1
  ## Keychain Token Registry
2
2
 
3
+ > **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.
4
+
3
5
  Tokens live in the platform-native credential store (macOS Keychain / Linux libsecret / Windows Credential Manager). Key names are resolved via **preferences mapping** - never hardcoded.
4
6
 
5
7
  ### Rule 1 - Never prompt for a token *value* mid-run
@@ -49,13 +49,6 @@ Each task teaches the project a bit more. Token cost decreases over time.
49
49
 
50
50
  They all complement each other - no conflicts.
51
51
 
52
- ### Knowledge in a Short run
53
-
54
- A Short run skips Phase 1, but knowledge **is still read**:
55
-
56
- - Knowledge files are added to the prompt before the Opus agent starts in Phase 3
57
- - Knowledge capture is still performed in Phase 5 (simplified report)
58
-
59
52
  ### Knowledge Maintenance
60
53
 
61
54
  Knowledge files grow over time. Maintenance rules:
@@ -47,7 +47,7 @@ and a review between fetch and action; an ordinary session has neither.
47
47
  | Read an issue, page, log, crash, scan result | Resolve the credential and fetch |
48
48
  | Comment on Jira, edit an issue, move a board column | `/multi-agent:channels` |
49
49
  | Create an issue | `/multi-agent:create-jira` |
50
- | Open or update a PR | a pipeline run, or `/multi-agent:resume-local` |
50
+ | Open or update a PR | a pipeline run, or `/multi-agent:resume` |
51
51
 
52
52
  The split is not bureaucracy. Outward writes carry rules that live in those commands:
53
53
  issues are never auto-closed (four approvals), PR bodies use `Ref:` and never