@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,7 +1,7 @@
1
1
  ---
2
2
  name: multi-agent-ios-coding-standard
3
3
  language: en
4
- description: "Audit an iOS module against the shared coding-standard registry (99 stable-ID rules), produce a remediation plan, then hand off to /multi-agent or :local. Use for a standards pass on a module, or when a review needs rule IDs rather than opinions."
4
+ description: "Audit an iOS module against the shared coding-standard registry (99 stable-ID rules), produce a remediation plan, then hand off to /multi-agent. Use for a standards pass on a module, or when a review needs rule IDs rather than opinions."
5
5
  user-invocable: true
6
6
  argument-hint: "[module name or path]"
7
7
  ---
@@ -237,10 +237,9 @@ Show a concise version of the plan to the user too.
237
237
 
238
238
  | Option | What it does |
239
239
  |---|---|
240
- | `/multi-agent:local` | No worktree; branches from the main development branch, fixes on the current checkout |
241
240
  | `/multi-agent` | Opens a worktree; fixes on a fresh branch + PR |
242
241
 
243
- Both ask Full or Short at Phase 0 Step 7.5; a standards sweep is usually already scoped, so Short is the common answer.
242
+ Both run the whole pipeline; a standards sweep is usually already scoped, so Phase 1 has little to say and its document is short.
244
243
 
245
244
  Invoke the chosen command with the plan file as the task input, branching off the repo's main
246
245
  development branch (e.g. `chore/<module>-coding-standard`). The dev pipeline applies the fixes,
@@ -1,31 +1,67 @@
1
1
  ---
2
2
  name: multi-agent-resume
3
3
  language: en
4
- 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."
4
+ 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."
5
5
  user-invocable: true
6
- argument-hint: "[#id] - optional: task ID (e.g. #2). If omitted, the most recent paused task is used."
6
+ argument-hint: "[#id | PROJ-12345] [--base <branch>] [autopilot] - no argument: pick from the list"
7
7
  ---
8
8
 
9
- # multi-agent resume - Resume Paused Task
9
+ # multi-agent resume - Continue Unfinished Work
10
10
 
11
11
  **Input**: $ARGUMENTS
12
12
 
13
- Resume a paused or failed task from the last successful phase.
13
+ Unfinished work arrives from two directions, and which one applies is a property of the repository, not of how the command was typed:
14
+
15
+ - **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.
16
+ - **Work exists on the current branch with no run behind it.** Nothing to resume, so the **pipeline tail** runs over the diff. Plan and Dev never run; the diff is the Dev output.
17
+
18
+ Step 1 finds both and asks, so the user does not have to know which case they are in before asking the question.
19
+
20
+ ## Input
21
+
22
+ ```bash
23
+ multi-agent resume # list everything resumable, pick one
24
+ multi-agent resume #2 # a tracked run by task number
25
+ multi-agent resume PROJ-12345 # a tracked run by Jira id, or bind the tail to that id
26
+ multi-agent resume --base develop # tail path: override the base branch for the diff
27
+ multi-agent resume autopilot # no gate prompts: auto-fix, auto-PR, auto-comment
28
+ ```
14
29
 
15
30
  ## Steps
16
31
 
17
- 1. **Find task** - Parse `#N` from the argument, or find the most recent worktree with `status != "done"`
32
+ 1. **Build the resumable list, then ask.** Source A: every `agent-state.json` under `$HOME/.claude/logs/multi-agent/{project}/` with `status != "done"`, each row showing task id, the phase it stopped inside, its workspace (worktree path, or `local`), age, and `haltReason` when set. Source B: the current branch, when `git diff <base>...HEAD` plus working-tree changes is non-empty **and** no Source A run owns that branch. An argument naming a run selects it directly; an argument naming nothing resumable is an error, never a silent fall-through to the tail. Nothing in either source: `ERR: nothing to resume` - do not ask.
33
+
34
+ Ask per `$HOME/.claude/multi-agent-refs/picker-contract.md` (Copilot CLI: `$HOME/.claude/lib/ask-choice.sh`). Breadcrumb `Step 1/1: which unfinished work to pick up` above the picker, in `outputLanguage`; labels carry the task id and branch name verbatim, and the run branches on which row was selected rather than on the label text. A single row is still a question and needs a genuine second option: **Show every run** (drops the `status != "done"` filter) when the only row is a stopped run, **Pick a stopped run instead** when the only row is the branch diff.
35
+
36
+ 2. **Tracked run - read and validate state.** `validate-state.mjs` first; on non-zero exit do NOT guess a phase. Read `currentPhase`, `status`, `haltReason`, `circuitBreaker`, `autopilot`. Heal a stale worktree lock before continuing - unless `worktreeRemovedAt` is set, in which case the artefacts live under `artifactsPath` and the worktree must not be recreated.
37
+
38
+ 3. **Tracked run - load context** from durable artifacts, never from conversation memory: the latest `## Handoff` block in `agent-log.md` first, per-phase findings as the fallback, `git log --oneline -10` to ground what was actually committed.
39
+
40
+ 4. **Tracked run - rebuild the phase tiles** from `tracker-state.json`, never re-initialized. Copilot CLI: a single `phase-tracker.sh render`.
41
+
42
+ 5. **Tracked run - continue.** Read `state.waitingFor` FIRST: when it names a step (`maturity`, `user-channels-choice`, `local-test`), the run re-enters THAT step. `currentPhase + 1` is the fallback, not the rule. Clear `waitingFor` in the same write that records the answer.
43
+
44
+ 6. **Untracked branch work - resolve context.** Base branch: `--base` → `figma-config.project.baseBranch` → `develop` → upstream/merge-base. Jira id from the argument or the branch name. State under `$HOME/.claude/logs/multi-agent/{project}/{taskId}/`. No worktree is created.
45
+
46
+ 7. **Untracked branch work - run the tail.**
47
+
48
+ ```
49
+ Phase 0: Init → project/branch detect, base + diff, Jira id, state (NO worktree)
50
+ Phase 3: Review → the Verify gate first (stack-aware build + existing tests; SUCCESS required), then
51
+ parallel review (GPT + Opus + Sonnet) + triage
52
+ Phase 4: Commit → commit remaining changes + push + open PR if none exists
53
+ Phase 5: Report → technical analysis + Jira comment with test scenarios (channels: Jira / PR / Confluence / Wiki)
54
+ ```
55
+
56
+ The build that Dev's exit gate would have run happens inside Review instead, because there is no Dev run to inherit a log from.
18
57
 
19
- 2. **Read state** - Parse `agent-state.json`:
20
- - `currentPhase` - last completed phase
21
- - `status` - `paused` | `failed` | `in_progress`
22
- - `autopilot` - preserve the mode
58
+ ## Notes
23
59
 
24
- 3. **Load context** - Read the findings of previous phases from `agent-log.md`:
25
- - Phase 1 analysis → use in Phase 2+
26
- - Phase 1 plan → use in Phase 2+
27
- - Phase 3 code → already present in the worktree
60
+ - Build+Test is the automated success gate (the interactive device user-test is `multi-agent:manual-test`). If the repo has no tests, it reports "no tests present" - never fabricates results.
61
+ - `autopilot` (or `prefs.global.resume.autoFix == true`) auto-fixes triage-accepted blocking/important findings and re-reviews the fix before advancing.
62
+ - Commit/PR follows house rules: conventional message, `Ref: #N` (never Closes/Fixes), NO AI/bot attribution. PR opened only if one does not already exist.
63
+ - Full phase contract lives in the Claude Code command `commands/multi-agent/resume/SKILL.md`; this skill is the Copilot-CLI counterpart.
28
64
 
29
- 4. **Continue the pipeline** - Start from where it left off (same pipeline as the main multi-agent command)
65
+ ## Required: outward-facing payload contracts
30
66
 
31
- 5. **Log**: `🔄 Resumed PROJ-{id} from Phase {N}`
67
+ 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.
@@ -32,8 +32,8 @@ Run all steps automatically:
32
32
  ```
33
33
  Step 0: DOCTOR node $HOME/.claude/scripts/doctor.mjs - exit 2 or 4 STOPS the sync
34
34
  Step 1: DETECT Compare timestamps, find stale targets
35
- Step 2: COPILOT Claude Code -> Copilot CLI (instructions + 60 sub-command skills)
36
- Step 2b: CODEX Claude Code -> Codex CLI (1 router skill + 60 specs as refs + 8 agent TOML)
35
+ Step 2: COPILOT Claude Code -> Copilot CLI (instructions + 57 sub-command skills)
36
+ Step 2b: CODEX Claude Code -> Codex CLI (1 router skill + 57 specs as refs + 8 agent TOML)
37
37
  Step 3: REPO Claude Code -> pipeline repo (genericized, personal data scrub)
38
38
  Step 3d: DEV-TOOLKIT Companion MCP server -> detect movement, ship gates, commit + publish
39
39
  Step 4: WEBSITE Version + phase/model counts -> {website-host} (i18n + projects.ts)
@@ -63,7 +63,7 @@ If nothing is stale -> report "All targets up to date" and stop.
63
63
  - `copilot-instructions.md`: general development instructions + pipeline summary section
64
64
  - `multi-agent-pipeline/pipeline/`: generic open-source version (NO personal data)
65
65
  3. **Sync shared sections** (Claude <-> Copilot):
66
- - Pipeline entries table (base / :local / :autopilot / :local-autopilot) + the Full-or-Short depth question
66
+ - Pipeline entries table (base / :autopilot)
67
67
  - Project detection (URL-based + cwd-based)
68
68
  - Figma pipeline flow
69
69
  - Git conventions (author, branch, commit format)
@@ -228,15 +228,15 @@ When invoked with the `release` argument:
228
228
  |-------------|-------------|
229
229
  | `~/.claude/commands/multi-agent/{cmd}/SKILL.md` | `~/.copilot/skills/multi-agent-{cmd}/SKILL.md` |
230
230
 
231
- **60 commands are synced** (canonical inventory - must match `cross-cli-contract.md` section 1; drift = contract violation):
231
+ **57 commands are synced** (canonical inventory - must match `cross-cli-contract.md` section 1; drift = contract violation):
232
232
 
233
233
  ```
234
234
  analysis, analysis-jira, analysis-resolve, autopilot, autopilot-off,
235
235
  autopilot-on, autopilot-status, build-optimize, channels, complaint-analysis,
236
236
  create-jira, design-check, diff-explain, doctor, feedback, forget,
237
237
  garbage-collect, graph, help, ios-coding-standard, issue, jira, kill,
238
- language, local, local-autopilot, log, manual-test, model, prune-logs,
239
- prune-prompts, purge, refactor, resume, resume-local, review,
238
+ language, log, manual-test, model, prune-logs,
239
+ prune-prompts, purge, refactor, resume, review,
240
240
  review-analysis, review-issue, review-jira, route-off, route-on,
241
241
  route-status, routines, save, scan, search,
242
242
  setup, stack, status, steer, store-ready, sync, test, test-accessibility,
@@ -3,7 +3,7 @@
3
3
  > Auto-generated by `pipeline/scripts/build-skills-index.mjs` - do not hand-edit.
4
4
  > Regenerate with `node pipeline/scripts/build-skills-index.mjs`.
5
5
 
6
- **216 skills** across 2 groups.
6
+ **213 skills** across 2 groups.
7
7
 
8
8
  | Group | Name | Platform | Description |
9
9
  |-------|------|----------|-------------|
@@ -117,17 +117,14 @@
117
117
  | core | `multi-agent-jira` | - | List open Jira issues, pick one, and launch the multi-agent pipeline. Use when a Jira issue should be picked up and started without knowing |
118
118
  | core | `multi-agent-kill` | - | Stop the given task, then remove its worktree and branch. Asks for confirmation. Use when a running or stuck task should be stopped and its |
119
119
  | core | `multi-agent-language` | - | Toggle outputLanguage (assistant explanations, picker questions, PR/Jira/Confluence bodies). promptLanguage is fixed to English; commit mess |
120
- | core | `multi-agent-local` | - | Full pipeline in local mode - no worktree, runs directly on the current branch. Use when the full pipeline should run on the current branc |
121
- | core | `multi-agent-local-autopilot` | - | Full pipeline + local + autopilot - no worktree, no confirmations, all 6 phases run end-to-end on the current branch. Use when the full pi |
122
120
  | core | `multi-agent-log` | - | Show the agent-log.md for the given task. With no ID, shows the most recent task. Use when asked what a task did, or to read its log. |
123
- | core | `multi-agent-manual-test` | - | Switch to the active task's branch and prepare it for manual testing in Xcode. Phase 5 standalone (the UI Bug Hunter lives at multi-agent-te |
121
+ | core | `multi-agent-manual-test` | - | Switch to the active task's branch and prepare it for manual testing in Xcode. Phase 3 user-test step, standalone (the UI Bug Hunter lives a |
124
122
  | core | `multi-agent-model` | - | Turn the top model rung on or off and keep the cost ledger's pricing in step with it. Use when asked to enable or disable Fable, or which mo |
125
123
  | core | `multi-agent-prune-logs` | - | Delete per-task project logs under ~/.claude/logs/multi-agent (filter by age/project/task). Audit trail + metrics are preserved. Dry-run fir |
126
124
  | core | `multi-agent-prune-prompts` | - | Zero-base prompt review: measure the always-on instruction footprint, classify every rule block, propose keep/trial-removal/delete; applies |
127
125
  | core | `multi-agent-purge` | - | ⚠️ Wipes every worktree, branch, log, and state file. Irreversible; asks for double confirmation. Use when every worktree, branch, log and s |
128
126
  | core | `multi-agent-refactor` | - | Analyse the project: extract adapted best-practices, hunt real bugs + improvement areas, check upstream drift of derived skills, research th |
129
- | core | `multi-agent-resume` | - | 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 o |
130
- | core | `multi-agent-resume-local` | - | Continue already-done LOCAL work through the pipeline tail: Review (with its build gate) → Commit/PR → Report (technical analysis + Jira tes |
127
+ | core | `multi-agent-resume` | - | Pick up unfinished work: a pipeline run that stopped mid-phase, or work already written on the current branch that never went through the pi |
131
128
  | core | `multi-agent-review` | - | Run parallel review on a branch diff or a Pull Request: 3 models on Claude Code (Fable + Opus + Sonnet), 3 models on Copilot CLI (GPT + Opus |
132
129
  | core | `multi-agent-review-analysis` | - | Review a written analysis document instead of a diff: resolve it from a path, a Confluence page or a Jira issue, run the deterministic gates |
133
130
  | core | `multi-agent-review-issue` | - | Assess whether a GitHub issue is ready for multi-agent development: fetch it, grade scope / acceptance criteria / repro / design / API / sta |
@@ -1,132 +0,0 @@
1
- ---
2
- description: "Full pipeline in local mode - no worktree, runs directly on the current branch. Use when the full pipeline should run on the current branch without creating a worktree."
3
- description-tr: "Tam pipeline lokal modda - worktree yok, doğrudan mevcut branch üzerinde çalışır."
4
- allowed-tools: Agent, Bash, Read, Write, Edit, Glob, Grep, TaskCreate, TaskUpdate, TaskList, TaskGet, AskUserQuestion, WebFetch, WebSearch, Skill
5
- ---
6
-
7
- # multi-agent local - Full Pipeline, Local Branch
8
-
9
- > **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".
10
-
11
- The full pipeline in normal mode (Plan Approval Gate + parallel review + triage included), running on the **current branch with no worktree**. Dedicated alias for the `multi-agent "task" --local` flag form. Phase 5 (User Test) is skipped because there is no worktree to check the change out from; the other seven phases all run.
12
-
13
- ## When to use it
14
-
15
- - You don't want a separate worktree open - keeps the editor / IDE in one folder
16
- - You're already on the right branch and just want pipeline discipline
17
- - Small project or prototype - the worktree overhead is unnecessary
18
-
19
- ## When NOT to use it
20
-
21
- - Multiple parallel tasks at the same time - you lose worktree isolation
22
- - Long-iteration changes on a production repo - branch-switch friction shows up
23
- - Multi-repo tasks - `--local` is locked to a single repo
24
-
25
- ## Pipeline
26
-
27
- Same phase count and order as the normal pipeline:
28
-
29
- ```
30
- Phase 0: Init → project detection, branch check, state (NO worktree)
31
- Phase 1: Plan (analysis) → codebase scan (parallel explore agents, Opus)
32
- Phase 1: Plan → task breakdown, Plan Approval Gate (approval loop)
33
- Phase 2: Dev → TDD (Sonnet), build queue
34
- Phase 3: Review → deterministic gates + parallel review + Fable triage
35
- Phase 4: Commit → pre-commit checkout prompt, commit + push + PR
36
- Phase 5: Report → Jira / Wiki / Confluence + log + knowledge/memory
37
- ```
38
-
39
- ## Delegation
40
-
41
- This command routes to the orchestrator with the `--local` flag set. The Phase 0-7 contract from `$HOME/.claude/multi-agent-refs/phases/phase-0-init.md` and the later phase docs applies as-is - only the worktree step is skipped, and `state.projects[*].worktreePath` stays `null`.
42
-
43
- Read the routing table in `$HOME/.claude/commands/multi-agent/SKILL.md` and apply Phase 0 Step 8 in local mode (no worktree: continue on the current branch, state file under `.claude/logs/multi-agent/{project}/{taskId}/`).
44
-
45
- ## Examples
46
-
47
- ```bash
48
- /multi-agent:local "PROJ-12345" # Jira
49
- /multi-agent:local "#42" # GitHub issue
50
- /multi-agent:local "LoginView dark mode fix" # Free-text
51
- ```
52
- ## Required: outward-facing payload contracts
53
-
54
- 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 the short modes.
55
-
56
- ## Required: Phase Tracker Contract
57
-
58
- **The phase tracker is mandatory** - the agent cannot skip it. Full spec: [`$HOME/.claude/multi-agent-refs/tracker-contract.md`]($HOME/.claude/multi-agent-refs/tracker-contract.md).
59
-
60
- > **Local mode:** no worktree is created, work happens on the current branch. Phase 0 Init still calls `init` - the `--local` flag is stored in tracker-state.json, and `:resume` restores the correct CWD.
61
-
62
- Two channels run in parallel at every phase boundary:
63
-
64
- 1. **State channel** (every CLI, identical): `phase-tracker.sh` writes to `tracker-state.json`. Drives `:resume`, `:log`, `:status`.
65
- 2. **Visual channel** (CLI-specific): native widget on Claude Code, ANSI render on every other CLI. Without it the user sees no phase progress.
66
-
67
- ```bash
68
- # Phase 0, very first shell call (every CLI):
69
- bash $HOME/.claude/scripts/phase-tracker.sh init "$TASK_ID"
70
- bash $HOME/.claude/scripts/phase-tracker.sh add 0 "Init"
71
- bash $HOME/.claude/scripts/phase-tracker.sh tiles
72
- bash $HOME/.claude/scripts/phase-tracker.sh update 0 in_progress
73
-
74
- # Phase 0 Step 7.5, immediately after the depth answer - the first moment this
75
- # mode knows its phase set. Full:
76
- for p in "1:Plan" "2:Dev" "3:Review" "4:Commit" "5:Report"; do
77
- bash $HOME/.claude/scripts/phase-tracker.sh add "${p%%:*}" "${p#*:}"
78
- done
79
- # Short (Analysis and Planning are not run, so they get no tile at all):
80
- for p in "2:Dev" "3:Review" "4:Commit" "5:Report"; do
81
- bash $HOME/.claude/scripts/phase-tracker.sh add "${p%%:*}" "${p#*:}"
82
- done
83
- # Then the widget, narrowed to the phases that do not have a tile yet:
84
- bash $HOME/.claude/scripts/phase-tracker.sh tiles --new
85
-
86
- # Every phase boundary (every CLI):
87
- bash $HOME/.claude/scripts/phase-tracker.sh update <N> in_progress|completed|failed|skipped
88
-
89
- # After every LLM call (every CLI):
90
- bash $HOME/.claude/scripts/phase-tracker.sh tokens <N> <in> <out> [cached]
91
- ```
92
-
93
- ### Visual channel - Claude Code (native TaskList widget, required)
94
-
95
- In Claude Code the agent MUST also drive the native TaskList widget so the user sees a sticky phase tile stack - this is the only progress signal Claude Code surfaces. Skipping these calls is the #1 source of "I don't see any phases" complaints.
96
-
97
- **TaskCreate ordering (strict)**: All TaskCreate calls in a registration batch fire in strict phase-number order BEFORE any TaskUpdate in that batch, and a later batch only ever appends phases numbered above everything already registered. This mode registers in two batches (Step -1, then Step 7.5), so `tiles --new` narrows the second one and the Phase 0 tile is never created twice. The native widget renders by creation order, not by phase number - out-of-order calls produce visually scrambled tile stacks (e.g. `1 ✓ · 2 ✓ · 4 ✓ · 0 ▶ · 3 ☐`) even when the underlying state is correct. Pre-marking phases as completed/skipped before Phase 0 starts is FORBIDDEN - register the tile in order, then flip status via TaskUpdate when the phase actually short-circuits. Full contract in `$HOME/.claude/multi-agent-refs/tracker-contract.md` section "TaskCreate ordering (strict)".
98
-
99
- ```text
100
- # Register one tile per phase, capture the taskId, persist it:
101
- for each phase in 0:Init at Step -1, then 1:Plan, 2:Dev, 3:Review, 4:Commit, 5:Report (Full) or 2:Dev, 3:Review, 4:Commit, 5:Report (Short) at Step 7.5:
102
- TaskCreate({ subject: "Phase <N>: <Name>", activeForm: "<doing-form>" })
103
- -> returns taskId
104
- bash $HOME/.claude/scripts/phase-tracker.sh meta <N> tasklist_id "<taskId>"
105
-
106
- # Phase entry - flip the tile to in_progress alongside the state update:
107
- TaskUpdate({ taskId: <saved>, status: "in_progress" })
108
- bash $HOME/.claude/scripts/phase-tracker.sh update <N> in_progress
109
-
110
- # Active sub-step inside a phase - update activeForm so the spinner header reflects what's happening now:
111
- TaskUpdate({ taskId: <saved>, activeForm: "Editing TopBarView.swift" })
112
-
113
- # Phase exit - flip to completed/failed/skipped on both channels:
114
- TaskUpdate({ taskId: <saved>, status: "completed" })
115
- bash $HOME/.claude/scripts/phase-tracker.sh update <N> completed
116
- ```
117
-
118
- `--local` mode TaskCreates all 6 phases (no phase is skipped).
119
-
120
- #### TaskCreate ordering (strict)
121
-
122
- **All TaskCreate calls in a batch fire in strict phase-number order BEFORE any TaskUpdate is applied.** For `--local` that means: Phase 0 at Step -1, then the rest in ascending order at Step 7.5 (Phase 0 → Phase 1 → Phase 2 → Phase 3 → Phase 4 → Phase 5 minus whatever the depth answer drops). The native widget renders by creation order, not by phase number - out-of-order calls produce visually scrambled tile stacks. Full ordering contract in `$HOME/.claude/multi-agent-refs/tracker-contract.md` section "TaskCreate ordering (strict)".
123
-
124
- ### Visual channel - Copilot CLI / plain shell
125
-
126
- These CLIs have no TaskList widget. After every state change the agent calls render, which prints a bordered ANSI card as the last tool result so the user sees an updated phase table:
127
-
128
- ```bash
129
- bash $HOME/.claude/scripts/phase-tracker.sh render
130
- ```
131
-
132
- Do NOT call TaskCreate on these CLIs - the tool does not exist and the call fails.
@@ -1,142 +0,0 @@
1
- ---
2
- description: "Full pipeline + local + autopilot - no worktree, no confirmations; runs all 6 phases end-to-end on the current branch. Use when the full pipeline should run on the current branch with no worktree and no prompts."
3
- description-tr: "Tam pipeline + lokal + autopilot - worktree yok, onay yok; 6 fazı mevcut branch üzerinde uçtan uca koşar (kullanıcı testi Review'ın içinde, autopilot'ta atlanır)."
4
- argument-hint: '"task" - issue URL, Jira ID, free-text, or #id (for resume)'
5
- allowed-tools: Agent, Bash, Read, Write, Edit, Glob, Grep, TaskCreate, TaskUpdate, TaskList, TaskGet, AskUserQuestion, WebFetch, WebSearch, Skill
6
- ---
7
-
8
- # multi-agent local-autopilot - Full Pipeline, Local Branch, Autonomous
9
-
10
- **Input**: $ARGUMENTS
11
-
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".
13
-
14
- Run the full pipeline **without a worktree** and **with every confirmation skipped**. All six phases execute. The user test inside Phase 3 Review is skipped - there is no worktree to check out from and no interaction to have - but it stopped being a phase of its own in v19.0.0, so nothing is dropped from the set. The `autopilot + local` combination - vs `/multi-agent:autopilot` the only difference is no worktree (work stays on the current branch); vs `/multi-agent:local` the only difference is zero interaction.
15
-
16
- ## Matrix (which one should I use?)
17
-
18
- | Command | Pipeline | Worktree | Confirmations |
19
- |---|---|---|---|
20
- | `/multi-agent "task"` | 6 phases, user test offered | ✅ | ✅ (interactive) |
21
- | `/multi-agent:autopilot "task"` | 6 phases, user test skipped | ✅ | ❌ (autopilot) |
22
- | `/multi-agent:local "task"` | 6 phases, user test offered | ❌ | ✅ (interactive) |
23
- | **`/multi-agent:local-autopilot "task"`** | **6 phases, user test skipped** | **❌** | **❌ (autopilot)** |
24
-
25
- Depth is a separate axis, asked at Phase 0 Step 7.5 rather than encoded in the command name: Full runs every phase above, Short runs Dev → Review → Test → Commit → Report. The two autopilot rows never ask and always run Full.
26
-
27
- ## What changes
28
-
29
- **vs `/multi-agent:autopilot`**: no worktree is created; work stays on the current branch. The task runs in the same editor / IDE session - no second folder.
30
-
31
- **vs `/multi-agent:local`**: Phase 2 Plan Approval Gate is skipped (the safety classifier still runs) and Phase 4 commit / PR runs without confirmation. Both modes already skip Phase 5 (User Test) because neither has a worktree, so the same seven phases execute - review / triage / build discipline are preserved.
32
-
33
- ## When to use it
34
-
35
- - You want full-pipeline discipline (parallel review + triage) on a small task but want to step away from the keyboard
36
- - Single repo + simple branch - the worktree overhead is unnecessary; autopilot + local = clean flow
37
- - Repro-to-fix loop: try things quickly in the local folder, then fire the pipeline forget-and-go on the same branch
38
-
39
- ## When NOT to use it
40
-
41
- - Multiple parallel tasks - you lose worktree isolation; branch collisions
42
- - Security-path or schema-migration changes - the Phase 2 safety classifier auto-pauses (`autopilotSafetyGate`, default on)
43
- - Multi-repo - `--local` is locked to a single repo
44
-
45
- ## Never skipped (even with autopilot + local)
46
-
47
- - 🔴 **Review-blocking finding** → auto fix + rebuild (max 3 retries)
48
- - 💥 **Build failure** → auto fix + rebuild (max 3 retries, then pause)
49
- - 🛡️ **Safety classifier pause** - for high-risk plans, asks once for manual confirmation even in autopilot
50
- - ⚠️ **Kill / Purge** → always asks for confirmation (destructive)
51
-
52
- ## Usage
53
-
54
- ```bash
55
- /multi-agent:local-autopilot "{JIRA-KEY}-12345"
56
- /multi-agent:local-autopilot https://github.com/org/repo/issues/316
57
- /multi-agent:local-autopilot "LoginView dark mode fix"
58
- /multi-agent:local-autopilot "#3" # resume a stopped task in local-autopilot mode
59
- ```
60
-
61
- ## Steps
62
-
63
- 1. **Parse input** - standard multi-agent input formats.
64
- 2. **Set both flags** - write `"autopilot": true` and `"local": true` into `agent-state.json`.
65
- 3. **Launch the multi-agent pipeline** - Phase 0 worktree step is skipped (local contract), Phase 2/5/6 confirmations are skipped (autopilot contract), Phase 4 safety classifier runs.
66
- 4. **On error** - after 3 failed retries, pause and ask the user.
67
-
68
- ## Delegation
69
-
70
- Orchestrator routing: the routing table in `$HOME/.claude/commands/multi-agent/SKILL.md` resolves `local-autopilot` as the union of the `local` + `autopilot` mode mixins. Contract details: `$HOME/.claude/multi-agent-refs/phases/phase-0-init.md` Step 6 (local branch) + `$HOME/.claude/multi-agent-refs/phases/phase-1-plan.md` Step 5 (autopilot gate skip + safety classifier).
71
- ## Required: outward-facing payload contracts
72
-
73
- 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 the short modes.
74
-
75
- ## Required: Phase Tracker Contract
76
-
77
- **The phase tracker is mandatory** - the agent cannot skip it. Full spec: [`$HOME/.claude/multi-agent-refs/tracker-contract.md`]($HOME/.claude/multi-agent-refs/tracker-contract.md).
78
-
79
- > **Autopilot mode:** user confirmations are skipped. The tracker is still mandatory - autopilot agent calls cannot skip it; skipping breaks `smoke-tracker-contract.sh`.
80
-
81
- > **Local mode:** no worktree is created, work happens on the current branch. Phase 0 Init still calls `init` - the `--local` flag is stored in tracker-state.json, and `:resume` restores the correct CWD.
82
-
83
- Two channels run in parallel at every phase boundary:
84
-
85
- 1. **State channel** (every CLI, identical): `phase-tracker.sh` writes to `tracker-state.json`. Drives `:resume`, `:log`, `:status`.
86
- 2. **Visual channel** (CLI-specific): native widget on Claude Code, ANSI render on every other CLI. Without it the user sees no phase progress.
87
-
88
- ```bash
89
- # Phase 0, very first shell call (every CLI):
90
- bash $HOME/.claude/scripts/phase-tracker.sh init "$TASK_ID"
91
- for p in "0:Init" "1:Plan" "2:Dev" "3:Review" "4:Commit" "5:Report"; do
92
- bash $HOME/.claude/scripts/phase-tracker.sh add "${p%%:*}" "${p#*:}"
93
- done
94
- bash $HOME/.claude/scripts/phase-tracker.sh update 0 in_progress
95
-
96
- # Every phase boundary (every CLI):
97
- bash $HOME/.claude/scripts/phase-tracker.sh update <N> in_progress|completed|failed|skipped
98
-
99
- # After every LLM call (every CLI):
100
- bash $HOME/.claude/scripts/phase-tracker.sh tokens <N> <in> <out> [cached]
101
- ```
102
-
103
- ### Visual channel - Claude Code (native TaskList widget, required)
104
-
105
- In Claude Code the agent MUST also drive the native TaskList widget so the user sees a sticky phase tile stack - this is the only progress signal Claude Code surfaces. Skipping these calls is the #1 source of "I don't see any phases" complaints.
106
-
107
- **TaskCreate ordering (strict)**: All TaskCreate calls in a registration batch fire in strict phase-number order BEFORE any TaskUpdate in that batch, and a later batch only ever appends phases numbered above everything already registered. The native widget renders by creation order, not by phase number - out-of-order calls produce visually scrambled tile stacks (e.g. `1 ✓ · 2 ✓ · 4 ✓ · 0 ▶ · 3 ☐`) even when the underlying state is correct. Pre-marking phases as completed/skipped before Phase 0 starts is FORBIDDEN - register the tile in order, then flip status via TaskUpdate when the phase actually short-circuits. Full contract in `$HOME/.claude/multi-agent-refs/tracker-contract.md` section "TaskCreate ordering (strict)".
108
-
109
- ```text
110
- # Register one tile per phase, capture the taskId, persist it:
111
- for each phase in 0:Init, 1:Plan, 2:Dev, 3:Review, 4:Commit, 5:Report:
112
- TaskCreate({ subject: "Phase <N>: <Name>", activeForm: "<doing-form>" })
113
- -> returns taskId
114
- bash $HOME/.claude/scripts/phase-tracker.sh meta <N> tasklist_id "<taskId>"
115
-
116
- # Phase entry - flip the tile to in_progress alongside the state update:
117
- TaskUpdate({ taskId: <saved>, status: "in_progress" })
118
- bash $HOME/.claude/scripts/phase-tracker.sh update <N> in_progress
119
-
120
- # Active sub-step inside a phase - update activeForm so the spinner header reflects what's happening now:
121
- TaskUpdate({ taskId: <saved>, activeForm: "Editing TopBarView.swift" })
122
-
123
- # Phase exit - flip to completed/failed/skipped on both channels:
124
- TaskUpdate({ taskId: <saved>, status: "completed" })
125
- bash $HOME/.claude/scripts/phase-tracker.sh update <N> completed
126
- ```
127
-
128
- `--local autopilot` mode TaskCreates all 6 phases (no phase is skipped).
129
-
130
- #### TaskCreate ordering (strict)
131
-
132
- **All TaskCreate calls in a batch fire in strict phase-number order BEFORE any TaskUpdate is applied.** For `--local autopilot` that means: Phase 0 → Phase 1 → Phase 2 → Phase 3 → Phase 4 → Phase 5. The native widget renders by creation order, not by phase number - out-of-order calls produce visually scrambled tile stacks. Full ordering contract in `$HOME/.claude/multi-agent-refs/tracker-contract.md` section "TaskCreate ordering (strict)".
133
-
134
- ### Visual channel - Copilot CLI / plain shell
135
-
136
- These CLIs have no TaskList widget. After every state change the agent calls render, which prints a bordered ANSI card as the last tool result so the user sees an updated phase table:
137
-
138
- ```bash
139
- bash $HOME/.claude/scripts/phase-tracker.sh render
140
- ```
141
-
142
- Do NOT call TaskCreate on these CLIs - the tool does not exist and the call fails.
@@ -1,114 +0,0 @@
1
- ---
2
- description: "Continue already-done LOCAL work through the pipeline tail: Review (with its build gate) → Commit/PR → Report (technical analysis + Jira test-scenario comment). No dev phase. Use when local work is already done and only review, build, commit and reporting remain."
3
- description-tr: "Halihazırda bitmiş LOKAL işi pipeline kuyruğundan geçirir: Review (build kapısıyla) → Commit/PR → Report (teknik analiz + Jira test-senaryosu yorumu). Dev fazı yok."
4
- allowed-tools: Agent, Bash, Read, Write, Edit, Glob, Grep, TaskCreate, TaskUpdate, TaskList, TaskGet, AskUserQuestion, WebFetch, WebSearch, Skill
5
- ---
6
-
7
- # multi-agent resume-local - Take Existing Branch Work Through the Pipeline Tail
8
-
9
- > **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".
10
-
11
- You already did the work locally - wrote code on the current branch and maybe tested it by hand, or committed it outside the pipeline entirely. (As of v14.0.0 a Short run reviews its own output, so this command is for work that had no pipeline run behind it, not a patch for a mode that skipped review.) `/multi-agent:resume-local` picks up from there and runs the **pipeline tail** over that existing local work in one command: parallel review, a build + test success gate, commit/push + PR, then the technical analysis and a **Jira comment with test scenarios**. It does NOT re-develop - Analysis / Planning / Dev (phases 1-3) are intentionally skipped; the diff already on the branch IS the input.
12
-
13
- ## When to use it
14
-
15
- - You ran `:local` and answered Short (which skips Review + Test) and now want the full quality tail on the same branch.
16
- - You hand-coded or hand-tested a change and want review + build/test + PR + Jira write-up without re-running dev.
17
- - You want the "reviewed, built, tested, PR'd, documented on Jira" finish with a single command.
18
-
19
- ## When NOT to use it
20
-
21
- - You haven't written the change yet - use `/multi-agent` or `/multi-agent:local`.
22
- - You only want the review, nothing else - use `/multi-agent:review`. Only the report/channels - `/multi-agent:channels`. Only device UI testing - `/multi-agent:test` / `/multi-agent:manual-test`.
23
-
24
- ## Input
25
-
26
- ```bash
27
- /multi-agent:resume-local # current branch vs its base; resolve Jira id from branch name
28
- /multi-agent:resume-local PROJ-12345 # bind to an explicit Jira id for the Phase 5 comment
29
- /multi-agent:resume-local --base develop # override the base branch for the diff
30
- /multi-agent:resume-local autopilot # no gate prompts: auto-fix blocking findings, auto-PR, auto-comment
31
- ```
32
-
33
- ## Pipeline
34
-
35
- ```
36
- Phase 0: Init → project/branch detect, resolve base + diff (work-already-done), Jira id, state (NO worktree)
37
- Phase 3: Review → the Verify gate first (stack-aware build + existing tests; SUCCESS required), then
38
- parallel review (Fable + Opus + Sonnet) + Fable triage
39
- Phase 4: Commit → commit remaining local changes + push + open PR if none exists
40
- Phase 5: Report → technical analysis + Jira comment with test scenarios (channels: Jira / PR / Confluence / Wiki)
41
- ```
42
-
43
- Phases 1-2 (Plan / Dev) are skipped by design - `ship` treats the current branch's local changes as the Phase 2 output.
44
-
45
- **Why Review runs the build gate here.** Verify is Phase 2 Dev's exit gate since v19.0.0, and this mode has no Dev: the work arrived already written. The gate still has to run, so Review runs it before dispatching reviewers, which is what Review Stage 1 did before the consolidation. Reviewing a branch whose build was never checked is the failure this ordering prevents.
46
-
47
- ## Phase 0 - Context resolution (finish-specific)
48
-
49
- 1. **Project + branch:** detect project (cwd), current branch (`git branch --show-current`). No worktree; work stays on the current branch.
50
- 2. **Base + diff:** resolve base branch in order: `--base <arg>` → `figma-config.project.baseBranch` → `develop` → the branch's upstream/merge-base. The **work under review** is `git diff <base>...HEAD` PLUS uncommitted working-tree changes (`git status`). Abort with a clear message if the diff is empty (`ERR: no local work to finish on <branch> vs <base>`).
51
- 3. **Task binding:** Jira id from the `--`/positional arg, else parse 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/arg when present.
52
- 4. **Prior state (optional):** if an `agent-state.json` / tracker-state exists for this branch (left by a prior `:local` run), load its analysis summary + Jira/issue binding to enrich the report; otherwise synthesize a minimal state over the diff. Never require a prior full-pipeline run.
53
- 5. Persist state under `.claude/logs/multi-agent/{project}/{taskId}/` (same as `--local`).
54
-
55
- ## Phase execution (reuse the existing phase contracts)
56
-
57
- - **Phase 3 Review** - run 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:
58
- - interactive: present them and ask (`AskUserQuestion`) whether to fix now (loop back through a minimal Phase-3-style TDD fix) or proceed;
59
- - `autopilot` (or `prefs.global.resumeLocal.autoFix == true`): auto-fix accepted blocking/important findings, then re-review the fix, before advancing.
60
- - **Phase 3 Verify gate** - the **automated success gate** (this is what "build+test success" means here; 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.**
61
- - **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.
62
- - **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 for `ship`: 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.
63
-
64
- ## Modes
65
-
66
- - **interactive** (default): stops at the Phase 4 gate when there are blocking/important findings; asks before committing/PR when appropriate.
67
- - **`autopilot`**: no prompts - auto-fix accepted blocking/important findings, auto-commit/push/PR, auto-post the Jira comment. Mirrors `local-autopilot`.
68
-
69
- ## Required: outward-facing payload contracts
70
-
71
- 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 the short modes.
72
-
73
- ## Required: Phase Tracker Contract
74
-
75
- **The phase tracker is required.** Full spec: [`$HOME/.claude/multi-agent-refs/tracker-contract.md`]($HOME/.claude/multi-agent-refs/tracker-contract.md). `ship` registers its active phase set - `0:Init 3:Review 4:Commit 5:Report` - but NEVER resets a tracker that an earlier run already built (load-or-continue; contract section "Continuation runs"):
76
-
77
- ```bash
78
- # Phase 0, first shell call (every CLI). init ONLY when no prior state exists -
79
- # a task handed off from the user test inside Phase 3 ("awaiting local test")
80
- # keeps its full phase 0-2 history (elapsed, tokens, USD).
81
- STATE="$HOME/.claude/logs/multi-agent/${TASK_ID}/tracker-state.json"
82
- if [ ! -f "$STATE" ]; then
83
- bash $HOME/.claude/scripts/phase-tracker.sh init "$TASK_ID"
84
- fi
85
- for p in "0:Init" "3:Review" "4:Commit" "5:Report"; do
86
- bash $HOME/.claude/scripts/phase-tracker.sh add "${p%%:*}" "${p#*:}" # idempotent: existing phases keep their history
87
- done
88
- bash $HOME/.claude/scripts/phase-tracker.sh update 0 in_progress
89
-
90
- # Every phase boundary (every CLI):
91
- bash $HOME/.claude/scripts/phase-tracker.sh update <N> in_progress|completed|failed|skipped
92
- # After every LLM call (every CLI):
93
- bash $HOME/.claude/scripts/phase-tracker.sh tokens <N> <in> <out> [cached]
94
- ```
95
-
96
- **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 finish's own work (finish re-opens it with `update 3 in_progress` when its 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`.
97
-
98
- ### Visual channel - Claude Code (native TaskList widget, required)
99
-
100
- Fresh state: register one tile per phase in strict phase-number order (`0 → 4 → 5 → 6 → 7`) 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)".
101
-
102
- Continuation: rebuild the FULL TaskList from the state file (completed 0-3 tiles included) in phase order before any `TaskUpdate`, refreshing every `tasklist_id` meta - same as the contract's "Resume behaviour".
103
-
104
- ### Visual channel - Copilot CLI / plain shell
105
-
106
- 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.
107
-
108
- ## Examples
109
-
110
- ```bash
111
- /multi-agent:local "PROJ-12345" # develop locally, then answer Short at the depth question
112
- # ... you inspect / hand-test the change ...
113
- /multi-agent:resume-local # now: review + build/test + PR + Jira analysis & test scenarios
114
- ```
@@ -1,41 +0,0 @@
1
- ---
2
- name: multi-agent-local
3
- language: en
4
- description: "Full pipeline in local mode - no worktree, runs directly on the current branch. Use when the full pipeline should run on the current branch without creating a worktree."
5
- user-invocable: true
6
- ---
7
-
8
- # multi-agent local - Full Pipeline, Local Branch
9
-
10
- Runs the full 6-phase pipeline (normal mode - including the Plan Approval Gate + parallel review + triage) on the current branch **without creating a worktree**. The dedicated equivalent of the `multi-agent "task" --local` flag form.
11
-
12
- ## When to use it
13
-
14
- - You do not want an extra open worktree - if an editor/IDE is open in the same folder, it is not disrupted
15
- - You are already on the correct branch and just want to apply the pipeline discipline
16
- - Small project / prototype - worktree overhead is unnecessary
17
-
18
- ## When NOT to use it
19
-
20
- - Multiple tasks in parallel at the same time - worktree isolation is lost
21
- - Multi-repo task - `--local` locks to a single repo
22
-
23
- ## Pipeline
24
-
25
- The same 6 phases as the normal pipeline: Init → Analysis → Planning → Dev → Review → Test → Commit → Report. Only Phase 0 Step 8 (workspace creation) continues on the current branch instead of a worktree; the `state.projects[*].worktreePath` field stays `null`.
26
-
27
- ## Delegation
28
-
29
- Delegates to the orchestrator skill (`multi-agent/SKILL.md`) with the `--local` flag. The Phase 0 Step 6 worktree step is skipped; all other phase contracts apply as is (Plan Approval Gate, three-reviewer review, triage, secret scan, PR creation).
30
-
31
- ## Examples
32
-
33
- ```bash
34
- multi-agent-local "PROJ-12345" # Jira
35
- multi-agent-local "#42" # GitHub issue
36
- multi-agent-local "LoginView dark mode fix" # Free-text
37
- ```
38
-
39
- ## Required: outward-facing payload contracts
40
-
41
- 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 the short modes.