@mmerterden/multi-agent-pipeline 18.0.0 → 19.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 (209) hide show
  1. package/CHANGELOG.md +183 -0
  2. package/README.md +34 -18
  3. package/README.tr.md +14 -16
  4. package/docs/adr/0002-instruction-driven-flag.md +1 -0
  5. package/docs/adr/0005-lazy-phase-docs.md +11 -1
  6. package/docs/adr/0008-installer-modularization-and-secret-leak-defense.md +1 -0
  7. package/docs/adr/0010-own-code-graph.md +1 -0
  8. package/docs/adr/0014-six-phase-consolidation.md +134 -0
  9. package/docs/adr/README.md +2 -1
  10. package/docs/architecture.md +37 -38
  11. package/docs/best-practices.md +1 -1
  12. package/docs/ecosystem.md +37 -26
  13. package/docs/engineering.md +1 -1
  14. package/docs/facts.json +45 -0
  15. package/docs/features.md +54 -53
  16. package/docs/performance.md +5 -5
  17. package/docs/recovery-guide.md +9 -9
  18. package/docs/token-budget-history.md +3 -1
  19. package/index.js +2 -2
  20. package/install/_codex-agents.mjs +1 -1
  21. package/install/templates/claude-hooks.json +1 -1
  22. package/install/templates/codex-instructions.md +1 -1
  23. package/install/templates/copilot-instructions.md +28 -28
  24. package/manifest.json +209 -193
  25. package/package.json +2 -2
  26. package/pipeline/agents/dev-critic.md +3 -3
  27. package/pipeline/commands/figma-to-swiftui.md +1 -1
  28. package/pipeline/commands/multi-agent/SKILL.md +8 -8
  29. package/pipeline/commands/multi-agent/analysis/SKILL.md +9 -9
  30. package/pipeline/commands/multi-agent/autopilot/SKILL.md +7 -7
  31. package/pipeline/commands/multi-agent/channels/SKILL.md +15 -15
  32. package/pipeline/commands/multi-agent/diff-explain/SKILL.md +6 -6
  33. package/pipeline/commands/multi-agent/garbage-collect/SKILL.md +1 -1
  34. package/pipeline/commands/multi-agent/graph/SKILL.md +1 -1
  35. package/pipeline/commands/multi-agent/help/SKILL.md +62 -62
  36. package/pipeline/commands/multi-agent/language/SKILL.md +2 -2
  37. package/pipeline/commands/multi-agent/local/SKILL.md +11 -11
  38. package/pipeline/commands/multi-agent/local-autopilot/SKILL.md +13 -13
  39. package/pipeline/commands/multi-agent/log/SKILL.md +2 -2
  40. package/pipeline/commands/multi-agent/manual-test/SKILL.md +9 -9
  41. package/pipeline/commands/multi-agent/model/SKILL.md +69 -0
  42. package/pipeline/commands/multi-agent/refactor/SKILL.md +3 -3
  43. package/pipeline/commands/multi-agent/resume/SKILL.md +4 -4
  44. package/pipeline/commands/multi-agent/resume-local/SKILL.md +19 -17
  45. package/pipeline/commands/multi-agent/review/SKILL.md +1 -1
  46. package/pipeline/commands/multi-agent/route-off/SKILL.md +36 -0
  47. package/pipeline/commands/multi-agent/route-on/SKILL.md +74 -0
  48. package/pipeline/commands/multi-agent/route-status/SKILL.md +56 -0
  49. package/pipeline/commands/multi-agent/setup/SKILL.md +2 -2
  50. package/pipeline/commands/multi-agent/status/SKILL.md +5 -5
  51. package/pipeline/commands/multi-agent/steer/SKILL.md +2 -2
  52. package/pipeline/commands/multi-agent/sync/SKILL.md +12 -13
  53. package/pipeline/commands/multi-agent/test/SKILL.md +1 -1
  54. package/pipeline/lib/credential-inventory.sh +1 -1
  55. package/pipeline/lib/fetch-fortify.sh +1 -1
  56. package/pipeline/lib/model-rung.sh +142 -0
  57. package/pipeline/lib/phase-schema.mjs +88 -0
  58. package/pipeline/lib/plan-todos.sh +5 -5
  59. package/pipeline/lib/route-state.sh +161 -0
  60. package/pipeline/lib/run-paths.sh +2 -2
  61. package/pipeline/multi-agent-refs/_account-picker.md +1 -1
  62. package/pipeline/multi-agent-refs/_dev-context.md +1 -1
  63. package/pipeline/multi-agent-refs/_input-parser.md +1 -1
  64. package/pipeline/multi-agent-refs/analysis/evidence.md +0 -9
  65. package/pipeline/multi-agent-refs/analysis/intake.md +1 -1
  66. package/pipeline/multi-agent-refs/analysis/locked.md +21 -22
  67. package/pipeline/multi-agent-refs/analysis/render.md +1 -1
  68. package/pipeline/multi-agent-refs/analysis/synthesis.md +12 -6
  69. package/pipeline/multi-agent-refs/android-guide.md +1 -1
  70. package/pipeline/multi-agent-refs/audit-guide.md +13 -13
  71. package/pipeline/multi-agent-refs/channels/issue-comment.md +2 -2
  72. package/pipeline/multi-agent-refs/channels/jira.md +3 -3
  73. package/pipeline/multi-agent-refs/channels/pr.md +4 -4
  74. package/pipeline/multi-agent-refs/channels/wiki.md +1 -1
  75. package/pipeline/multi-agent-refs/component-dispatch.md +3 -3
  76. package/pipeline/multi-agent-refs/cross-cli-contract.md +31 -6
  77. package/pipeline/multi-agent-refs/features/autopilot-circuit-breaker.md +4 -4
  78. package/pipeline/multi-agent-refs/features/code-graph.md +5 -5
  79. package/pipeline/multi-agent-refs/features/design-conformance.md +1 -1
  80. package/pipeline/multi-agent-refs/features/dev-critic.md +3 -3
  81. package/pipeline/multi-agent-refs/features/doctor.md +2 -2
  82. package/pipeline/multi-agent-refs/features/external-context-injection.md +3 -3
  83. package/pipeline/multi-agent-refs/features/maturity-followup.md +3 -3
  84. package/pipeline/multi-agent-refs/features/model-fallback.md +5 -5
  85. package/pipeline/multi-agent-refs/features/plan-todos.md +1 -1
  86. package/pipeline/multi-agent-refs/features/repo-map.md +1 -1
  87. package/pipeline/multi-agent-refs/features/review-delta.md +3 -3
  88. package/pipeline/multi-agent-refs/features/review-multi-repo.md +1 -1
  89. package/pipeline/multi-agent-refs/features/scope-check.md +4 -4
  90. package/pipeline/multi-agent-refs/features/skill-conformance.md +2 -2
  91. package/pipeline/multi-agent-refs/features/stack-skill-routing.md +1 -1
  92. package/pipeline/multi-agent-refs/features/verify-by-test.md +4 -4
  93. package/pipeline/multi-agent-refs/features/visual-evidence.md +19 -19
  94. package/pipeline/multi-agent-refs/features/worktree-finalize.md +6 -6
  95. package/pipeline/multi-agent-refs/issue-jira-triad.md +10 -10
  96. package/pipeline/multi-agent-refs/knowledge.md +11 -11
  97. package/pipeline/multi-agent-refs/multi-repo-integration-build.md +13 -13
  98. package/pipeline/multi-agent-refs/payload-contracts.md +8 -8
  99. package/pipeline/multi-agent-refs/phases/log-format.md +10 -10
  100. package/pipeline/multi-agent-refs/phases/modes.md +30 -30
  101. package/pipeline/multi-agent-refs/phases/operations.md +8 -8
  102. package/pipeline/multi-agent-refs/phases/phase-0-init.md +24 -24
  103. package/pipeline/multi-agent-refs/phases/phase-1-plan.md +599 -0
  104. package/pipeline/multi-agent-refs/phases/{phase-3-dev.md → phase-2-dev.md} +129 -49
  105. package/pipeline/multi-agent-refs/phases/{phase-4-review.md → phase-3-review.md} +225 -107
  106. package/pipeline/multi-agent-refs/phases/{phase-6-commit.md → phase-4-commit.md} +23 -23
  107. package/pipeline/multi-agent-refs/phases/{phase-7-report.md → phase-5-report.md} +29 -29
  108. package/pipeline/multi-agent-refs/phases.md +44 -48
  109. package/pipeline/multi-agent-refs/picker-contract.md +1 -1
  110. package/pipeline/multi-agent-refs/progress-contract.md +6 -6
  111. package/pipeline/multi-agent-refs/readiness-review.md +1 -1
  112. package/pipeline/multi-agent-refs/rules.md +7 -7
  113. package/pipeline/multi-agent-refs/swiftui-guide.md +2 -2
  114. package/pipeline/multi-agent-refs/tracker-contract.md +31 -32
  115. package/pipeline/multi-agent-refs/wiki-capture.md +14 -14
  116. package/pipeline/preferences-template.json +9 -1
  117. package/pipeline/rules/outside-the-pipeline.md +1 -1
  118. package/pipeline/schemas/agent-state.schema.json +50 -50
  119. package/pipeline/schemas/analysis-output.schema.json +2 -2
  120. package/pipeline/schemas/autopilot-config.schema.json +1 -1
  121. package/pipeline/schemas/code-graph.schema.json +1 -1
  122. package/pipeline/schemas/criteria-manifest.schema.json +1 -1
  123. package/pipeline/schemas/dev-critic-output.schema.json +1 -1
  124. package/pipeline/schemas/diff-risk.schema.json +1 -1
  125. package/pipeline/schemas/migrations/prefs-2.4.0-to-2.5.0.mjs +2 -2
  126. package/pipeline/schemas/migrations/prefs-2.6.0-to-2.7.0.mjs +31 -0
  127. package/pipeline/schemas/migrations/state-2.1.0-to-2.2.0.mjs +129 -0
  128. package/pipeline/schemas/phases.json +105 -0
  129. package/pipeline/schemas/plan-todos.schema.json +5 -5
  130. package/pipeline/schemas/planning-output.schema.json +1 -1
  131. package/pipeline/schemas/prefs.schema.json +100 -56
  132. package/pipeline/schemas/reviewer-output.schema.json +3 -3
  133. package/pipeline/schemas/route-config.schema.json +74 -0
  134. package/pipeline/schemas/scope-check.schema.json +1 -1
  135. package/pipeline/schemas/test-gap.schema.json +1 -1
  136. package/pipeline/schemas/token-budget.json +12 -18
  137. package/pipeline/schemas/triage-output.schema.json +6 -6
  138. package/pipeline/scripts/README.md +3 -3
  139. package/pipeline/scripts/_code-graph.mjs +2 -2
  140. package/pipeline/scripts/_run-paths.mjs +2 -2
  141. package/pipeline/scripts/_smoke-root.sh +1 -1
  142. package/pipeline/scripts/aggregate-metrics.mjs +1 -1
  143. package/pipeline/scripts/capture-flush.sh +8 -8
  144. package/pipeline/scripts/capture-resume.sh +3 -3
  145. package/pipeline/scripts/classify-plan-safety.mjs +1 -1
  146. package/pipeline/scripts/diff-explain.mjs +1 -1
  147. package/pipeline/scripts/doctor.mjs +2 -2
  148. package/pipeline/scripts/gc-abandoned.sh +3 -3
  149. package/pipeline/scripts/gc-tmp.sh +1 -1
  150. package/pipeline/scripts/gc-worktrees.sh +1 -1
  151. package/pipeline/scripts/gen-facts.mjs +175 -0
  152. package/pipeline/scripts/gen-mode-dispatch.mjs +32 -37
  153. package/pipeline/scripts/gen-ref-toc.mjs +1 -1
  154. package/pipeline/scripts/graph-report.mjs +1 -1
  155. package/pipeline/scripts/jira-attach.sh +1 -1
  156. package/pipeline/scripts/learn-from-transcripts.mjs +1 -1
  157. package/pipeline/scripts/learning-curve.mjs +2 -2
  158. package/pipeline/scripts/log-metric.sh +17 -4
  159. package/pipeline/scripts/memory-save.sh +1 -1
  160. package/pipeline/scripts/migrate-prefs.mjs +22 -5
  161. package/pipeline/scripts/phase-banner.sh +20 -20
  162. package/pipeline/scripts/phase-tracker.sh +7 -7
  163. package/pipeline/scripts/plan-coverage-gate.mjs +2 -2
  164. package/pipeline/scripts/render-agent-log-cost.sh +1 -1
  165. package/pipeline/scripts/render-work-summary.sh +3 -3
  166. package/pipeline/scripts/review-file-filter.mjs +1 -1
  167. package/pipeline/scripts/run-aggregator.mjs +13 -6
  168. package/pipeline/scripts/run-metrics.mjs +1 -1
  169. package/pipeline/scripts/runs-index.mjs +11 -1
  170. package/pipeline/scripts/smoke-cross-cli-behavior.sh +6 -6
  171. package/pipeline/scripts/smoke-schema-validation.sh +26 -7
  172. package/pipeline/scripts/token-budget-report.mjs +13 -2
  173. package/pipeline/scripts/triage-memory.mjs +2 -2
  174. package/pipeline/scripts/validate-analysis-doc.mjs +73 -17
  175. package/pipeline/scripts/validate-planning.mjs +1 -1
  176. package/pipeline/scripts/validate-reviewer.mjs +1 -1
  177. package/pipeline/scripts/validate-state.mjs +45 -5
  178. package/pipeline/scripts/validate-triage.mjs +3 -3
  179. package/pipeline/scripts/worktree-finalize.sh +5 -5
  180. package/pipeline/skills/.skill-manifest.json +37 -21
  181. package/pipeline/skills/.skills-index.json +49 -5
  182. package/pipeline/skills/shared/README.md +10 -6
  183. package/pipeline/skills/shared/core/apple-archive-compliance/SKILL.md +2 -2
  184. package/pipeline/skills/shared/core/google-play-compliance/SKILL.md +2 -2
  185. package/pipeline/skills/shared/core/multi-agent/SKILL.md +69 -71
  186. package/pipeline/skills/shared/core/multi-agent-autopilot/SKILL.md +3 -3
  187. package/pipeline/skills/shared/core/multi-agent-channels/SKILL.md +14 -14
  188. package/pipeline/skills/shared/core/multi-agent-diff-explain/SKILL.md +5 -5
  189. package/pipeline/skills/shared/core/multi-agent-graph/SKILL.md +1 -1
  190. package/pipeline/skills/shared/core/multi-agent-help/SKILL.md +25 -23
  191. package/pipeline/skills/shared/core/multi-agent-language/SKILL.md +2 -2
  192. package/pipeline/skills/shared/core/multi-agent-local/SKILL.md +2 -2
  193. package/pipeline/skills/shared/core/multi-agent-local-autopilot/SKILL.md +8 -8
  194. package/pipeline/skills/shared/core/multi-agent-manual-test/SKILL.md +6 -6
  195. package/pipeline/skills/shared/core/multi-agent-model/SKILL.md +71 -0
  196. package/pipeline/skills/shared/core/multi-agent-refactor/SKILL.md +3 -3
  197. package/pipeline/skills/shared/core/multi-agent-resume/SKILL.md +1 -1
  198. package/pipeline/skills/shared/core/multi-agent-resume-local/SKILL.md +7 -7
  199. package/pipeline/skills/shared/core/multi-agent-route-off/SKILL.md +39 -0
  200. package/pipeline/skills/shared/core/multi-agent-route-on/SKILL.md +76 -0
  201. package/pipeline/skills/shared/core/multi-agent-route-status/SKILL.md +59 -0
  202. package/pipeline/skills/shared/core/multi-agent-setup/SKILL.md +1 -1
  203. package/pipeline/skills/shared/core/multi-agent-status/SKILL.md +5 -5
  204. package/pipeline/skills/shared/core/multi-agent-steer/SKILL.md +2 -2
  205. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +6 -5
  206. package/pipeline/skills/skills-index.md +8 -4
  207. package/pipeline/multi-agent-refs/phases/phase-1-analysis.md +0 -263
  208. package/pipeline/multi-agent-refs/phases/phase-2-planning.md +0 -344
  209. package/pipeline/multi-agent-refs/phases/phase-5-test.md +0 -182
@@ -31,27 +31,27 @@ Autopilot mode skips interactive confirmations and runs the pipeline end-to-end
31
31
 
32
32
  | Phase | Normal (full) | autopilot (full) | local (full) | local autopilot (full) |
33
33
  | ------------------- | ------------------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- |
34
- | Phase 2 (Plan Approval Gate) | Clarification (max 2 rounds) + approval loop - user: approve/abort/free-text edit | **Gate skip** - log the plan, proceed directly to Phase 3 (autopilot contract: zero interaction) | Same as Normal | Same as autopilot |
35
- | Phase 5 (User Test) | Interactive prompt ("Want to test?" -> wait) | Skip (autopilot suppresses interactive prompts) -> proceed directly to Phase 6 | **Not in the phase set** (the gate checks the change out of a worktree; local has none) | Not in the phase set |
36
- | Phase 6 (Commit) | "Want to commit?" -> wait | Auto commit + push | "Want to commit?" -> wait | Auto commit + push |
37
- | Phase 6 (PR) | "Want to open a PR?" -> wait | Auto create PR | "Want to open a PR?" -> wait | Auto create PR |
38
- | **Phase 7 (Channels)** | Multi-select channel + content menu | **STILL PAUSES** - see "Phase 7 autopilot exception" below | Multi-select (same as Normal) | **STILL PAUSES** (same as autopilot) |
34
+ | Phase 1 (Plan Approval Gate) | Clarification (max 2 rounds) + approval loop - user: approve/abort/free-text edit | **Gate skip** - log the plan, proceed directly to Phase 2 (autopilot contract: zero interaction) | Same as Normal | Same as autopilot |
35
+ | Phase 3 (User Test) | Interactive prompt ("Want to test?" -> wait) | Skip (autopilot suppresses interactive prompts) -> proceed directly to Phase 4 | **Not in the phase set** (the gate checks the change out of a worktree; local has none) | Not in the phase set |
36
+ | Phase 4 (Commit) | "Want to commit?" -> wait | Auto commit + push | "Want to commit?" -> wait | Auto commit + push |
37
+ | Phase 4 (PR) | "Want to open a PR?" -> wait | Auto create PR | "Want to open a PR?" -> wait | Auto create PR |
38
+ | **Phase 5 (Channels)** | Multi-select channel + content menu | **STILL PAUSES** - see "Phase 5 autopilot exception" below | Multi-select (same as Normal) | **STILL PAUSES** (same as autopilot) |
39
39
 
40
40
  **What NEVER skips (even in autopilot):**
41
41
 
42
- - Phase 4 Review -> if blocking finding, returns to Phase 3, auto fix + rebuild (safety)
42
+ - Phase 3 Review -> if blocking finding, returns to Phase 2, auto fix + rebuild (safety)
43
43
  - Kill/Purge confirmations -> destructive operations always ask
44
44
  - Build fail -> auto fix + rebuild (max 3 retries). After 3 retries still failing -> pause, ask user
45
45
  - **Circuit-breaker** -> autopilot halts (records reason, waits for `resume`) on a no-progress stall, an identical repeated failure, a rework storm, cost drift past the `costBudget` ceiling, or a merge/rebase conflict. Full wiring: `$HOME/.claude/multi-agent-refs/features/autopilot-circuit-breaker.md`. This is the sanctioned autopilot pause - continuing unattended off the happy path is the less safe choice.
46
- - **Phase 7 channels dispatch** -> always pauses for multi-select. Rationale: Jira/Confluence are externally visible; silently posting wrong-tone content leaks team-visible artifacts. See below.
46
+ - **Phase 5 channels dispatch** -> always pauses for multi-select. Rationale: Jira/Confluence are externally visible; silently posting wrong-tone content leaks team-visible artifacts. See below.
47
47
 
48
48
  **State tracking**: `agent-state.json` gets `"autopilot": true`. Autopilot continues on resume as well.
49
49
 
50
- ### Phase 7 autopilot exception
50
+ ### Phase 5 autopilot exception
51
51
 
52
- The generic "zero-interaction" contract covers Phases 0-6 only. Phase 7 channels dispatch is the **single exception**:
52
+ The generic "zero-interaction" contract covers Phases 0-4 only. Phase 5 channels dispatch is the **single exception**:
53
53
 
54
- - ALL modes (`autopilot`, `--local autopilot`, and a Short run reaching Phase 7) pause at the channels multi-select menu.
54
+ - ALL modes (`autopilot`, `--local autopilot`, and a Short run reaching Phase 5) pause at the channels multi-select menu.
55
55
  - Menu pre-ticks from `prefs.global.reportChannels` + `prefs.global.reportContent` - user can accept with one keypress if prefs are stable.
56
56
  - **30-minute timeout** - if user does not respond, session ends cleanly:
57
57
  - External delivery aborted (no silent apply - prevents accidental Jira comments / Confluence pages).
@@ -60,13 +60,13 @@ The generic "zero-interaction" contract covers Phases 0-6 only. Phase 7 channels
60
60
  - Resume: `/multi-agent:resume <task-id>` re-opens menu with same inputs.
61
61
  - Post-hoc `/multi-agent:channels <task>` never times out - user invoked it explicitly.
62
62
 
63
- Full contract: `$HOME/.claude/multi-agent-refs/phases/phase-7-report.md` (Autopilot pause contract) + `commands/multi-agent/channels/SKILL.md`.
63
+ Full contract: `$HOME/.claude/multi-agent-refs/phases/phase-5-report.md` (Autopilot pause contract) + `commands/multi-agent/channels/SKILL.md`.
64
64
 
65
65
  ---
66
66
 
67
67
  ## Pipeline depth (Full / Short)
68
68
 
69
- Short strips the pipeline to what an already-scoped task needs: no deep analysis, no planning phase. The **Opus** dev agent reads the task scope and implements, and Phase 4 then reviews what it produced. Review is deliberately NOT part of the strip: analysis and planning shape work that has not happened yet, so a task the user has already scoped can skip them, while review judges work that now exists and has no substitute.
69
+ Short strips the pipeline to what an already-scoped task needs: no deep analysis, no planning phase. The **Opus** dev agent reads the task scope and implements, and Phase 3 then reviews what it produced. Review is deliberately NOT part of the strip: analysis and planning shape work that has not happened yet, so a task the user has already scoped can skip them, while review judges work that now exists and has no substitute.
70
70
 
71
71
  **How it is chosen.** Phase 0 Step 7.5, after `taskType` is known:
72
72
 
@@ -85,7 +85,7 @@ Bu is icin hangi pipeline? / Which pipeline for this task?
85
85
  **Pipeline in a Short run:**
86
86
 
87
87
  ```
88
- Phase 0: Init -> Phase 3: Dev (self-contained) -> Phase 4: Review -> Phase 5: Test -> Phase 6: Commit -> Phase 7: Report
88
+ Phase 0: Init -> Phase 2: Dev (self-contained) -> Phase 3: Review -> Phase 3: Review (user test) -> Phase 4: Commit -> Phase 5: Report
89
89
  ```
90
90
 
91
91
  **What changes (Tablo 2 - Short runs):**
@@ -94,14 +94,14 @@ Phase 0: Init -> Phase 3: Dev (self-contained) -> Phase 4: Review -> Phase 5: Te
94
94
  | ------------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------- |
95
95
  | Phase 0 (Init) | Full setup | Same - worktree, branch, state, and the depth question itself | Same - no worktree, branch on `$PROJECT_ROOT` |
96
96
  | Phase 1 (Analysis) | Parallel Explore agents + analysis document | **SKIP** - no tile is ever drawn for it (registration is deferred to Step 7.5) | **SKIP** |
97
- | Phase 2 (Planning) | TaskCreate + architecture review + **Plan Approval Gate** | **SKIP** (no plan means no plan gate) | **SKIP** |
98
- | Phase 3 (Dev) | Follows the Phase 2 plan, TDD cycle (Sonnet) | **Self-contained** (Opus): agent scans relevant files, implements with TDD, builds | Same, on the local branch |
99
- | Phase 4 (Review) | Parallel review + Fable triage (3 reviewers on every host: Claude Code Fable + Opus + Sonnet, Copilot GPT-5.4 + Opus + Sonnet) | **Same** - gates, parallel review, triage; blocking findings return to Phase 3 (cap 3) | **Same**, on the local branch diff |
100
- | Phase 5 (User Test) | Interactive prompt | **Interactive prompt** | Not in the set - no worktree to check out |
101
- | Phase 6 (Commit) | Commit + PR | Same - still asks | Same |
102
- | Phase 7 (Report) | Full report + channels multi-select | Simplified - no analysis section, review section IS present, channels menu still pauses | Same |
97
+ | Phase 1 (Planning) | TaskCreate + architecture review + **Plan Approval Gate** | **SKIP** (no plan means no plan gate) | **SKIP** |
98
+ | Phase 2 (Dev) | Follows the Phase 1 plan, TDD cycle (Sonnet) | **Self-contained** (Opus): agent scans relevant files, implements with TDD, builds | Same, on the local branch |
99
+ | Phase 3 (Review) | Parallel review + Fable triage (3 reviewers on every host: Claude Code Fable + Opus + Sonnet, Copilot GPT-5.4 + Opus + Sonnet) | **Same** - gates, parallel review, triage; blocking findings return to Phase 2 (cap 3) | **Same**, on the local branch diff |
100
+ | Phase 3 (User Test) | Interactive prompt | **Interactive prompt** | Not in the set - no worktree to check out |
101
+ | Phase 4 (Commit) | Commit + PR | Same - still asks | Same |
102
+ | Phase 5 (Report) | Full report + channels multi-select | Simplified - no analysis section, review section IS present, channels menu still pauses | Same |
103
103
 
104
- **Phase 3 in a Short run (self-contained):**
104
+ **Phase 2 in a Short run (self-contained):**
105
105
 
106
106
  The **Opus** agent receives the task description (from Jira, GitHub issue, or free-text) and:
107
107
 
@@ -115,7 +115,7 @@ No separate task breakdown - the agent handles scope autonomously.
115
115
 
116
116
  ### Intake warnings for a Short run
117
117
 
118
- **An analysis document was supplied.** Because Phase 1 and Phase 2 are skipped, no phase turns that document into a task breakdown. The doc becomes raw context for one Dev pass, and work comes out ordered by whatever the model read first: the bottom of the dependency chain lands, the screen wiring does not.
118
+ **An analysis document was supplied.** Because Phase 1 and Phase 1 are skipped, no phase turns that document into a task breakdown. The doc becomes raw context for one Dev pass, and work comes out ordered by whatever the model read first: the bottom of the dependency chain lands, the screen wiring does not.
119
119
 
120
120
  The depth picker is where this is caught. When the intake carried an analysis document or a Figma reference, say so in the question itself rather than after the choice:
121
121
 
@@ -134,10 +134,10 @@ Autopilot never sees this: it runs Full.
134
134
 
135
135
  ## Analysis Mode (`/multi-agent:analysis`)
136
136
 
137
- Not a depth permutation - a different **output kind**. It produces the analysis document and stops; no code, no branch, no PR. The 8-phase contract holds, with four phases reinterpreted the same way a Short run reinterprets Phase 3.
137
+ Not a depth permutation - a different **output kind**. It produces the analysis document and stops; no code, no branch, no PR. The 6-phase contract holds, with four phases reinterpreted the same way a Short run reinterprets Phase 2.
138
138
 
139
139
  ```
140
- Phase 0: Init -> Phase 1: Analysis -> Phase 2: Planning -> Phase 4: Review -> Phase 6: Publish -> Phase 7: Report
140
+ Phase 0: Init -> Phase 1: Plan (analysis) -> Phase 1: Plan -> Phase 3: Review -> Phase 4: Publish -> Phase 5: Report
141
141
  ```
142
142
 
143
143
  | Phase | Analysis mode |
@@ -153,7 +153,7 @@ Phase 0: Init -> Phase 1: Analysis -> Phase 2: Planning -> Phase 4: Review -> Ph
153
153
 
154
154
  **No `local` or `autopilot` variant.** Worktree isolation buys nothing when no code is written, and the intake, the Pass B convention preview and the open-question resolution are interactive by nature; a zero-interaction analysis would be a document nobody agreed to.
155
155
 
156
- **Where the document lands.** Drafts go to `/tmp/analysis-<slug>-<ts>/` first, then the Phase 6 picker decides: Local writes `<repo>/analysis/<feature>-<platform>.md` uncommitted, Confluence posts the page, Jira updates the description. In the full pipeline the same engine writes into the worktree instead and `prefs.global.analysisPhase.commitDoc` decides whether it rides along with the commit.
156
+ **Where the document lands.** Drafts go to `/tmp/analysis-<slug>-<ts>/` first, then the Phase 4 picker decides: Local writes `<repo>/analysis/<feature>-<platform>.md` uncommitted, Confluence posts the page, Jira updates the description. In the full pipeline the same engine writes into the worktree instead and `prefs.global.analysisPhase.commitDoc` decides whether it rides along with the commit.
157
157
 
158
158
  ---
159
159
 
@@ -167,11 +167,11 @@ front so the question resolves without being asked.
167
167
  ```
168
168
  Bu is nerede kossun? / Where should this task run?
169
169
  1. Worktree .worktrees/{id}/ - your current checkout stays untouched
170
- 2. Lokal / Local the project root, on a new branch - no Phase 5
170
+ 2. Lokal / Local the project root, on a new branch - no Phase 3
171
171
  ```
172
172
 
173
173
  Two genuine options, so it meets the two-option floor in `picker-contract.md` on
174
- its own. **Say what local costs inside the question**: Phase 5 is not in a local
174
+ its own. **Say what local costs inside the question**: Phase 3 is not in a local
175
175
  run's set (the user-test gate checks the change out of a worktree, and there is
176
176
  none), and uncommitted work in the project root is in the way of the checkout. A
177
177
  user choosing local should learn both before choosing, not after.
@@ -196,9 +196,9 @@ and doing that in the user's own checkout is what worktrees exist to prevent.
196
196
  | Phase | Normal (worktree) | Local |
197
197
  | -------------- | ------------------------------------------------ | -------------------------------------------------------------- |
198
198
  | Phase 0 Step 8 | Creates worktree at `.worktrees/{id}/` | `git checkout -b {branch}` directly in `$PROJECT_ROOT` |
199
- | Phase 3 | Works in worktree path | Works in `$PROJECT_ROOT` |
200
- | Phase 5 | WIP commit -> remove worktree -> checkout branch | **Not in the phase set** - nothing to check out, nothing to remove |
201
- | Phase 6 | Commit in worktree, push | Commit in project root, push |
199
+ | Phase 2 | Works in worktree path | Works in `$PROJECT_ROOT` |
200
+ | Phase 3 | WIP commit -> remove worktree -> checkout branch | **Not in the phase set** - nothing to check out, nothing to remove |
201
+ | Phase 4 | Commit in worktree, push | Commit in project root, push |
202
202
  | All paths | `{worktreePath}` references | All paths use `$PROJECT_ROOT` directly |
203
203
 
204
204
  **Phase 0 Step 8 in local mode:**
@@ -211,7 +211,7 @@ git -C $PROJECT_ROOT config user.name "{identity.name}"
211
211
  git -C $PROJECT_ROOT config user.email "{identity.email}"
212
212
  ```
213
213
 
214
- **Phase 5 in local mode:** it is not in the phase set. The gate exists to hand the user a change checked out of a worktree, and in local mode the code is already on the branch in `$PROJECT_ROOT` with nothing to check out or remove. `gen-mode-dispatch.mjs --mode=local` is the enforced statement of this; the row above mirrors it.
214
+ **Phase 3 in local mode:** it is not in the phase set. The gate exists to hand the user a change checked out of a worktree, and in local mode the code is already on the branch in `$PROJECT_ROOT` with nothing to check out or remove. `gen-mode-dispatch.mjs --mode=local` is the enforced statement of this; the row above mirrors it.
215
215
 
216
216
  **State tracking**: `agent-state.json` gets `"localMode": true`, `"worktreePath": null`. All path references resolve to `$PROJECT_ROOT`.
217
217
 
@@ -2,7 +2,7 @@
2
2
  >
3
3
  > - **Task IDs** auto-increment from `$HOME/.claude/logs/multi-agent/{project}/.counter` (persistent).
4
4
  > - **Kill/Purge/Clear-logs** require explicit user confirm; destructive ops never chain.
5
- > - **Resume** re-enters at `currentPhase + 1`; always re-runs Phase 7 for knowledge capture.
5
+ > - **Resume** re-enters at `currentPhase + 1`; always re-runs Phase 5 for knowledge capture.
6
6
  > - **3-iteration hard kill**: any retry loop stops after 3 attempts and hands off to the user.
7
7
  > - Subagents return JSON (not prose), get only the diff + relevant files, and must reflect before each retry.
8
8
 
@@ -61,11 +61,11 @@ Every task gets an auto-incremented short ID. Counter stored at `$HOME/.claude/l
61
61
 
62
62
  1. Find state file: `$HOME/.claude/logs/multi-agent/{project}/{task-id}/agent-state.json`
63
63
  2. **Validate before re-entry** (required - a half-written or corrupt state silently resumes at the wrong phase):
64
- - `node $HOME/.claude/scripts/validate-state.mjs <state-file>` (resume-safety check: parseable JSON + `currentPhase` in 0..7 + well-formed `phases`; tolerant of legacy shapes, not a strict schema match). On non-zero exit, do NOT guess a phase: surface the error and stop with `ERR: agent-state.json is unsafe to resume; inspect it or 'kill #N' and restart.`
64
+ - `node $HOME/.claude/scripts/validate-state.mjs <state-file>` (resume-safety check: parseable JSON + `currentPhase` in 0..5 + well-formed `phases`; tolerant of legacy shapes, not a strict schema match). On non-zero exit, do NOT guess a phase: surface the error and stop with `ERR: agent-state.json is unsafe to resume; inspect it or 'kill #N' and restart.`
65
65
  - Confirm the worktree path on `state.worktreePath` / `state.projects[].worktreePath` exists and `git -C <wt> status` is clean-or-known. If the worktree is missing or locked, run the Phase 0 "Worktree stale-lock heal" before continuing.
66
66
  3. Read `agent-log.md` for previous findings
67
67
  4. Resume from `currentPhase + 1`. If `state.phases[currentPhase+1].subStep` is set, re-enter that phase and skip already-recorded sub-steps (see "Sub-step checkpoints").
68
- 5. **Always run Phase 7** on resume completion - ensures knowledge capture even if task was paused mid-pipeline
68
+ 5. **Always run Phase 5** on resume completion - ensures knowledge capture even if task was paused mid-pipeline
69
69
  6. Log: "Resumed {jiraId} from Phase {N}"
70
70
 
71
71
  ---
@@ -138,13 +138,13 @@ lose the update behind it. `WRITE_STATE_LOCK_STALE_MS` now applies only to a
138
138
  lock with no readable PID, and `WRITE_STATE_LOCK_ABANDON_MS` (default ten times
139
139
  that) is the last-resort ceiling for a PID that has been recycled.
140
140
 
141
- **Halt visibility (required, autopilot included).** A halt is never silent. Whenever a phase halts on a hard error (validator failed twice, no subagent returned, dispatch error past fallback, lock irrecoverable), in addition to the `agent-log.md` line: (a) write `state.status = "paused"` and `state.haltReason = "<phase>:<cause>"`; (b) record the cause on the tracker via `phase-tracker.sh meta <phase> halt "<cause>"` and `phase-tracker.sh update <phase> failed`; (c) emit one `>&2` alert line `HALT phase <N>: <cause> - resume with /multi-agent:resume #<id>`; (d) if `prefs.global.usageLog.enabled` is true, emit the end-of-run report so a run that never reaches Phase 7 is still recorded with the phase it stopped at (`state.currentPhase` + `haltReason`) - the emitter no-ops when it is off or unconfigured:
141
+ **Halt visibility (required, autopilot included).** A halt is never silent. Whenever a phase halts on a hard error (validator failed twice, no subagent returned, dispatch error past fallback, lock irrecoverable), in addition to the `agent-log.md` line: (a) write `state.status = "paused"` and `state.haltReason = "<phase>:<cause>"`; (b) record the cause on the tracker via `phase-tracker.sh meta <phase> halt "<cause>"` and `phase-tracker.sh update <phase> failed`; (c) emit one `>&2` alert line `HALT phase <N>: <cause> - resume with /multi-agent:resume #<id>`; (d) if `prefs.global.usageLog.enabled` is true, emit the end-of-run report so a run that never reaches Phase 5 is still recorded with the phase it stopped at (`state.currentPhase` + `haltReason`) - the emitter no-ops when it is off or unconfigured:
142
142
 
143
143
  ```bash
144
144
  node $HOME/.claude/scripts/usage-report.mjs --state "$STATE_FILE" >/dev/null 2>&1 || true
145
145
  ```
146
146
 
147
- Autopilot suppresses *confirmations*, not *halts* - the user must always be able to see why an unattended run stopped without reading the log. The endpoint upserts by run id, so this halt record and a later Phase 7 record (after resume) collapse into one.
147
+ Autopilot suppresses *confirmations*, not *halts* - the user must always be able to see why an unattended run stopped without reading the log. The endpoint upserts by run id, so this halt record and a later Phase 5 record (after resume) collapse into one.
148
148
 
149
149
  ### Pipeline Best Practices
150
150
 
@@ -160,7 +160,7 @@ This keeps orchestrator context lean and enables programmatic routing.
160
160
 
161
161
  **Retry reflection**: Before each retry, force reflection: "What failed? What specific change fixes it? Am I repeating the same approach?" - prevents infinite loops on broken strategies.
162
162
 
163
- **Semantic revert**: Track which files each phase produces in `agent-state.json`. If Phase 5 (testing) fails, revert only Phase 4 (implementation) outputs, not Phase 2 (artifacts):
163
+ **Semantic revert**: Track which files each phase produces in `agent-state.json`. If Phase 3 (testing) fails, revert only Phase 3 (implementation) outputs, not Phase 1 (artifacts):
164
164
 
165
165
  ```json
166
166
  "phases": {
@@ -176,7 +176,7 @@ This keeps orchestrator context lean and enables programmatic routing.
176
176
  bash $HOME/.claude/scripts/capture-flush.sh --state "$STATE_FILE" --quiet
177
177
  ```
178
178
 
179
- The durable stores used to be written only in Phase 7, which is the phase a run is LEAST likely to reach: a run killed in Phase 3 threw away every finding it had established, and the next run on the same repo paid to rediscover it. The flush is idempotent (the second call through writes 0 rows), costs no API tokens, calls no model, and never fails the transition. Phase 7 is now the LAST flush rather than the only one. The trigger is deliberately mechanical - a phase transition, not a model noticing that a moment qualifies.
179
+ The durable stores used to be written only in Phase 5, which is the phase a run is LEAST likely to reach: a run killed in Phase 2 threw away every finding it had established, and the next run on the same repo paid to rediscover it. The flush is idempotent (the second call through writes 0 rows), costs no API tokens, calls no model, and never fails the transition. Phase 5 is now the LAST flush rather than the only one. The trigger is deliberately mechanical - a phase transition, not a model noticing that a moment qualifies.
180
180
  - *Compaction trigger.* If conversation context exceeds ~50%, run `/compact` preserving "modified files, plan, open review findings, current phase + sub-step" before continuing. Don't wait for auto-compaction near the limit - it triggers exactly when context is worst and is lossy. After compaction, re-read `agent-state.json` AND the latest `## Handoff` block in `agent-log.md` to re-ground.
181
181
 
182
182
  **Handoff block (v10.8.0)**: the structured artifact the phase-boundary checkpoint appends to `agent-log.md`. Written by the orchestrator from state it already holds - no agent dispatch, no extra LLM call. Cap at ~15 lines; the latest block is authoritative (earlier ones are history). This is the fresh-context re-entry contract: a resume or post-compaction session rebuilds working context from the latest handoff + `agent-state.json` + git log, never from conversation memory.
@@ -192,6 +192,6 @@ This keeps orchestrator context lean and enables programmatic routing.
192
192
 
193
193
  Full `agent-log.md` shape: `$HOME/.claude/multi-agent-refs/phases/log-format.md`. Resume-side consumption: `resume.md` Step 3 reads the latest handoff FIRST, then falls back to per-phase findings for logs written before v10.8.
194
194
 
195
- **Sub-step checkpoints (long phases)**: Phase 3 (dev/TDD cycles) and Phase 7 (report/channels) can run many minutes; a crash mid-phase loses everything since the last phase boundary and forces a full phase re-run on resume. For these phases, also record `state.phases[<n>].subStep` (a short token: `red`, `green`, `build`, `pr-opened`, `confluence-synced`, ...) and the `files[]` written so far after each meaningful unit of work. On resume, re-enter the phase but skip units whose `subStep` is already recorded and whose `files[]` exist in the worktree - re-do only the unfinished tail, never the whole phase.
195
+ **Sub-step checkpoints (long phases)**: Phase 2 (dev/TDD cycles) and Phase 5 (report/channels) can run many minutes; a crash mid-phase loses everything since the last phase boundary and forces a full phase re-run on resume. For these phases, also record `state.phases[<n>].subStep` (a short token: `red`, `green`, `build`, `pr-opened`, `confluence-synced`, ...) and the `files[]` written so far after each meaningful unit of work. On resume, re-enter the phase but skip units whose `subStep` is already recorded and whose `files[]` exist in the worktree - re-do only the unfinished tail, never the whole phase.
196
196
 
197
197
  **3-iteration hard kill**: Any retry loop (build fix, review fix) MUST stop after 3 attempts. On 4th failure -> pause, ask user. No exceptions.
@@ -46,7 +46,7 @@ OUTPUT_LANG=$(jq -r '.global.outputLanguage // "en"' "$PREFS_FILE" 2>/dev/null |
46
46
 
47
47
  From this point on, everything the user reads renders in `$OUTPUT_LANG`: conversational lines, `AskUserQuestion` `question`/`label`/`description`, and external payload bodies (PR/Jira/Confluence). English stays only on `header`, commit messages, branch names, PR title prefixes, identifiers. Full matrix: `rules.md` "Language Application".
48
48
 
49
- **Model tier resolution** (same step, once per run): read `prefs.global.modelFallback`. If `fableEnabled` is `false`, every `preferredModel: fable` persona resolves to `opus` for this run and the Phase 4 Claude Code panel is 2 reviewers, not 3; print the one-line INFO. Then, if `premiumTierUntil` is set and in the past, apply the date-gate trigger - `preferredModel` personas dispatch on `fallbackModel`, with the one-line WARN. Both lines and the exact ordering: `$HOME/.claude/multi-agent-refs/features/model-fallback.md`. Dispatch-error and budget triggers apply per-dispatch later; nothing else to do here.
49
+ **Model tier resolution** (same step, once per run): read `prefs.global.modelFallback`. If `fableEnabled` is `false`, every `preferredModel: fable` persona resolves to `opus` for this run and the Phase 3 Claude Code panel is 2 reviewers, not 3; print the one-line INFO. Then, if `premiumTierUntil` is set and in the past, apply the date-gate trigger - `preferredModel` personas dispatch on `fallbackModel`, with the one-line WARN. Both lines and the exact ordering: `$HOME/.claude/multi-agent-refs/features/model-fallback.md`. Dispatch-error and budget triggers apply per-dispatch later; nothing else to do here.
50
50
 
51
51
  **First-run guard**: After loading prefs, check if `keychainMapping` has at least one non-null value. If ALL values are null (template defaults - setup never ran), show:
52
52
  ```
@@ -74,7 +74,7 @@ Used for: input parsing, branch naming, commit messages.
74
74
 
75
75
  **UX pattern**: Show `Recent: → {value}` suggestion from history, numbered alternatives, enter to accept. No history → skip suggestion line.
76
76
 
77
- **Save rule**: After EVERY selection, append chosen value to relevant array (dedup, most recent first, max 10). Save prefs after Phase 0 and Phase 7.
77
+ **Save rule**: After EVERY selection, append chosen value to relevant array (dedup, most recent first, max 10). Save prefs after Phase 0 and Phase 5.
78
78
 
79
79
  **v2.1.0+ Recents update map** (which selection writes to which prefs path):
80
80
 
@@ -86,7 +86,7 @@ Used for: input parsing, branch naming, commit messages.
86
86
  | Service ping (any external API call) | `global.serviceStatus[{service}]` | `{ok, checkedAt, reason?}` (TTL `settings.serviceStatusCacheSeconds`, default 300s) | n/a |
87
87
  | Git identity routed (Step 6a) | `projects[{name}].lastIdentity` | int (index into `global.identities`) | n/a |
88
88
 
89
- All updates are O(1) - read-modify-write on the in-memory `prefs` object; single atomic write at the end of Phase 0 (and again at Phase 7).
89
+ All updates are O(1) - read-modify-write on the in-memory `prefs` object; single atomic write at the end of Phase 0 (and again at Phase 5).
90
90
 
91
91
  #### Step 0.5 - Figma access pre-flight (BLOCKING when task carries a Figma reference)
92
92
 
@@ -96,12 +96,12 @@ Probe order:
96
96
 
97
97
  1. **Tier 1 (Figma MCP)**: check the host serves `mcp__claude_ai_Figma__*` before probing. Absent → set `state.figmaAccess.tier1Unavailable = "host"` and fall through to Tier 2 with no probe, no re-auth retry, no MCP-token question. Present → probe `get_metadata(fileKey, nodeId)` on the first frame; on auth failure run `authenticate` + `complete_authentication` and retry once, and only a *second* failure raises the recreate-or-continue question. Success → `state.figmaAccess.tier = 1`.
98
98
  2. **Tier 2 (Figma REST)**: when Tier 1 fails, resolve the PAT via `~/.claude/lib/credential-store.sh get <logical-key>` where `<logical-key>` = `prefs.global.keychainMapping.figma`. Probe `GET https://api.figma.com/v1/files/{fileKey}/nodes?ids={nodeId}` with header `X-Figma-Token: $TOKEN`. HTTP 200 → `state.figmaAccess.tier = 2`. Token missing / 401 / 403 → fall through.
99
- 3. **Tier 3 (User-attached screenshot)**: when Tiers 1 + 2 both fail, scan the task payload for inline screenshots or attachments. Present → `state.figmaAccess.tier = 3` and `state.figmaAccess.reviewBlocking = true` (Phase 4 enforces this).
99
+ 3. **Tier 3 (User-attached screenshot)**: when Tiers 1 + 2 both fail, scan the task payload for inline screenshots or attachments. Present → `state.figmaAccess.tier = 3` and `state.figmaAccess.reviewBlocking = true` (Phase 3 enforces this).
100
100
 
101
101
  Save the issue's image attachments to `$WORKTREE/.pipeline/evidence/` as `state.visualEvidence.before[]`: pre-fix evidence, never re-photographed, and none present is a recorded gap rather than a search. See `$HOME/.claude/multi-agent-refs/features/visual-evidence.md`.
102
102
  4. **Halt**: all three tiers fail → emit a single AskUserQuestion asking the user how to proceed (provide PAT, paste a screenshot, abort). Never proceed with text-derived guesses.
103
103
 
104
- Record the cause, not just the downshift. `tier1Unavailable = "host"` means the tier never existed here - routine on Copilot and Codex, where the installer registers only `multi-agent-toolkit`. `"auth"` means it existed and the credential failed, which on Claude Code points at a dead `figma_mcp` token worth surfacing in Phase 7. Conflating them costs two wasted MCP round trips and a question the user cannot act on. On those two hosts a mapped `figma` PAT is the primary path, not a fallback.
104
+ Record the cause, not just the downshift. `tier1Unavailable = "host"` means the tier never existed here - routine on Copilot and Codex, where the installer registers only `multi-agent-toolkit`. `"auth"` means it existed and the credential failed, which on Claude Code points at a dead `figma_mcp` token worth surfacing in Phase 5. Conflating them costs two wasted MCP round trips and a question the user cannot act on. On those two hosts a mapped `figma` PAT is the primary path, not a fallback.
105
105
 
106
106
  Log the resolved tier in the agent log:
107
107
 
@@ -239,13 +239,13 @@ Sequential prompts (standard UX pattern with Recent suggestion): Project Key →
239
239
 
240
240
  **Token pre-check** (after parsing): Jira input → resolve key via `prefs.global.keychainMapping.jira`, verify token with a lightweight API call (e.g. `GET /myself`). GitHub input → verify `gh auth status`. On failure (missing key, 401, 403) → run the **Token Save Flow** from `setup.md` inline. This is the same clipboard-based flow used during setup - token never appears in terminal. If user skips and the token is critical for the input type (e.g. Jira token for Jira input), halt Phase 0.
241
241
 
242
- **VPN connectivity check**: Test VPN-dependent services (Jira, Bitbucket, Confluence, Fortify, Graylog) with `curl --connect-timeout 3`. If unreachable, warn and offer to continue. Fallback: Jira → manual input, Bitbucket → `git push` only, Confluence → skip Phase 7, Fortify → skip scan, Graylog → skip log fetch (advisory only, never blocks). Cache in `agent-state.json` → `"vpnServices": {"jira": true, ...}`.
242
+ **VPN connectivity check**: Test VPN-dependent services (Jira, Bitbucket, Confluence, Fortify, Graylog) with `curl --connect-timeout 3`. If unreachable, warn and offer to continue. Fallback: Jira → manual input, Bitbucket → `git push` only, Confluence → skip Phase 5, Fortify → skip scan, Graylog → skip log fetch (advisory only, never blocks). Cache in `agent-state.json` → `"vpnServices": {"jira": true, ...}`.
243
243
 
244
244
  #### Step 1b - URL Enrichment (catalogue + targeted deep fetches)
245
245
 
246
246
  **Runs only when Step 1 found at least one URL in the task input** (Jira/Confluence/Figma/Swagger/Crashlytics/Fortify/Graylog links). Otherwise skip straight to Step 2.
247
247
 
248
- When it runs, load `$HOME/.claude/multi-agent-refs/features/url-enrichment.md` and follow it. It covers: 1b.0 extract + catalogue every link into `state.contextLinks[]` (always runs when this step runs), then the deep fetches that are each conditional on their link type being present - 1b.1 Crashlytics -> `state.crashContext`, 1b.2 Fortify SSC -> `state.fortifyFinding`, 1b.3 Graylog, 1b.4 catalogue-only types (fetched at Phase 1). It also owns the two closing log lines and the Phase 1 / Phase 2 prepend contracts.
248
+ When it runs, load `$HOME/.claude/multi-agent-refs/features/url-enrichment.md` and follow it. It covers: 1b.0 extract + catalogue every link into `state.contextLinks[]` (always runs when this step runs), then the deep fetches that are each conditional on their link type being present - 1b.1 Crashlytics -> `state.crashContext`, 1b.2 Fortify SSC -> `state.fortifyFinding`, 1b.3 Graylog, 1b.4 catalogue-only types (fetched at Phase 1). It also owns the two closing log lines and the Phase 1 / Phase 1 prepend contracts.
249
249
 
250
250
  #### Step 2 - Project Selection
251
251
 
@@ -275,7 +275,7 @@ later because a base branch is a property of a repo set (`picker-contract.md`,
275
275
  "Order: project, then repo, then branch").
276
276
 
277
277
  Persist `state.siblings[]` even when empty: the empty array is the record that
278
- the step ran. Absent, Phase 4's parity cross-check cannot tell "no siblings"
278
+ the step ran. Absent, Phase 3's parity cross-check cannot tell "no siblings"
279
279
  from "never asked", and the exit gate below fails.
280
280
 
281
281
  #### Step 3 - Remote Detection + Branch Selection
@@ -351,7 +351,7 @@ options:
351
351
  `{BITBUCKET_HOST}` is almost always the VPN - and make the retry real: it re-runs the
352
352
  fetch and re-enters this picker on a second failure.
353
353
 
354
- Persist the choice in `agent-state.json.baseFetchStatus` ∈ `"fresh" | "cached-stale" | "local-branch" | "aborted"`, and on any non-fresh one log `⚠️ Base ref stale (fetch fail @ {ts}, choice: {status})`. Phase 6 re-attempts `git fetch origin` before push and prompts to rebase if it succeeds.
354
+ Persist the choice in `agent-state.json.baseFetchStatus` ∈ `"fresh" | "cached-stale" | "local-branch" | "aborted"`, and on any non-fresh one log `⚠️ Base ref stale (fetch fail @ {ts}, choice: {status})`. Phase 4 re-attempts `git fetch origin` before push and prompts to rebase if it succeeds.
355
355
 
356
356
  In multi-repo mode the prompt fires per repo, and Abort on any one aborts the whole task (atomic - no partial worktrees).
357
357
 
@@ -382,7 +382,7 @@ Branch name is deterministic - no user confirmation needed.
382
382
  **Collision handling** (automatic - no prompt):
383
383
  - Probe local + remote for existing branch. **Distinguish "no such ref" from "the
384
384
  probe failed"**: with `2>/dev/null` and an empty-output test a failed probe reads
385
- as "no collision", and the duplicate branch surfaces as a rejected push at Phase 6.
385
+ as "no collision", and the duplicate branch surfaces as a rejected push at Phase 4.
386
386
  ```bash
387
387
  LOCAL_HIT=$(git -C "$root" rev-parse --verify --quiet "refs/heads/$branch")
388
388
  REMOTE_ERR=$(git -C "$root" ls-remote --exit-code --heads origin "$branch" 2>&1 >/dev/null)
@@ -393,7 +393,7 @@ Branch name is deterministic - no user confirmation needed.
393
393
  - `REMOTE_RC` is 0 or 2 → treat as authoritative
394
394
  - `REMOTE_RC` is anything else → the remote answer is **unknown**, not "free". Log
395
395
  `Remote collision probe failed: <REMOTE_ERR>`, fall back to the local check only,
396
- and record `"remoteCollisionProbe": "failed"` in `agent-state.json` so Phase 6
396
+ and record `"remoteCollisionProbe": "failed"` in `agent-state.json` so Phase 4
397
397
  expects a possible non-fast-forward and re-checks before pushing.
398
398
  - No collision → use as-is
399
399
  - Collision found → append `-v2`, `-v3`, etc. until unique:
@@ -548,7 +548,7 @@ Single-repo mode (`projects.length === 1` or scalar-only) uses the legacy single
548
548
 
549
549
  **Local-only flow** - when every entry in `state.projects[]` has `provider="local"`:
550
550
  - `taskId` format: `LOCAL-{slug-of-freetext}-{yyyymmdd-HHMMSS}` (e.g. `LOCAL-purchase-flow-20260510-143200`). Slug = lowercase, non-alnum → `-`, trimmed, max 32 chars.
551
- - `state.offlineOnly = true` (Phases 6/7 read this flag).
551
+ - `state.offlineOnly = true` (Phases 4/5 read this flag).
552
552
  - `state.remoteType` per project = `"local"`.
553
553
  - `state.baseBranch` = current branch of the local checkout (no `origin/{base}` fetch).
554
554
  - `state.branch` = local-only feature branch on the same checkout; no upstream tracking is configured (`git checkout -b {branch}` without `-u`).
@@ -577,10 +577,10 @@ Persist: `"taskType": "component" | "bugfix" | "feature" | "refactor" | "chore"`
577
577
 
578
578
  | Phase | Behavior change |
579
579
  | ------- | -------------------------------------------------------------------------------------------------------- |
580
- | Phase 3 | `component` → dispatch to the enabled `ai-<platform>-toolkit` plugin's `create-component` skill (fallback `create-ui-component`); else standard TDD |
581
- | Phase 4 | `bugfix` → test coverage; `component` → accessibility+tokens; `refactor` → behavior preservation |
582
- | Phase 6 | `bugfix`/`hotfix` → `fix(...)` prefix; `feature`/`component` → `feat(...)`; `refactor` → `refactor(...)` |
583
- | Phase 7 | `component` → includes SubPhase breakdown |
580
+ | Phase 2 | `component` → dispatch to the enabled `ai-<platform>-toolkit` plugin's `create-component` skill (fallback `create-ui-component`); else standard TDD |
581
+ | Phase 3 | `bugfix` → test coverage; `component` → accessibility+tokens; `refactor` → behavior preservation |
582
+ | Phase 4 | `bugfix`/`hotfix` → `fix(...)` prefix; `feature`/`component` → `feat(...)`; `refactor` → `refactor(...)` |
583
+ | Phase 5 | `component` → includes SubPhase breakdown |
584
584
 
585
585
  Log: `Phase 0 Step 7: taskType = {component|bugfix|feature|refactor|chore}`
586
586
 
@@ -610,7 +610,7 @@ Log: `Phase 0 Step 7.5: depth = {full|short} (recommended {full|short}, source {
610
610
 
611
611
  #### Step 7.6 - Test baseline (opt-in, `prefs.global.testBaseline.enabled`, default `false`)
612
612
 
613
- Phase 4 Gate 3 cannot tell an inherited red suite from one this run broke, so it blocks on someone else's bug or the agent "fixes" tests it never touched. Runs after Step 6, only when the stack has a test command; skipped in analysis mode.
613
+ Phase 3 Gate 3 cannot tell an inherited red suite from one this run broke, so it blocks on someone else's bug or the agent "fixes" tests it never touched. Runs after Step 6, only when the stack has a test command; skipped in analysis mode.
614
614
 
615
615
  ```bash
616
616
  BASELINE_LOG="$WORKTREE/.baseline-test.log"
@@ -625,7 +625,7 @@ Log: `Phase 0 Step 7.6: test baseline = {green|red|unknown} ({N} pre-existing fa
625
625
 
626
626
  Decide, then probe, then ask, then run. Skipped only when `visualEvidence.enabled` is `false`. Contract: `features/visual-evidence.md` sections 1a, 1b, 4.
627
627
 
628
- **This step is the only writer of `visualEvidence.required`, `requiredBy` and `platform`** (section 1a). No diff exists yet, so the `bugfix` row is provisional and Phase 3 re-decides.
628
+ **This step is the only writer of `visualEvidence.required`, `requiredBy` and `platform`** (section 1a). No diff exists yet, so the `bugfix` row is provisional and Phase 2 re-decides.
629
629
 
630
630
  ```bash
631
631
  eval "$(bash $HOME/.claude/lib/stack-detect.sh "$PROJECT_ROOT")"
@@ -653,7 +653,7 @@ DEPTH_DEFAULT_INDEX=1
653
653
  ASK_CHOICE_DEFAULT="$DEPTH_DEFAULT_INDEX" $HOME/.claude/lib/ask-choice.sh ...
654
654
  ```
655
655
 
656
- Asked by `/multi-agent` and `:local`; autopilot reads `prefs.global.testDepth.default` and degrades to the best open option. Asked here, not Phase 5, which four of the eight modes drop.
656
+ Asked by `/multi-agent` and `:local`; autopilot reads `prefs.global.testDepth.default` and degrades to the best open option. Asked here, not Phase 3, which four of the eight modes drop.
657
657
 
658
658
  Log: `Phase 0 Step 7.7: testDepth = {unit|unit+ui|unit+mcp} (source {user|autopilot|default|forced}), tier1/tier2 = {open|closed}`
659
659
 
@@ -689,7 +689,7 @@ LOG_METRIC_FORWARD_TO_TRACKER=1 $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 0
689
689
  duration_ms=$D tokens_in=$TI tokens_out=$TO
690
690
  ```
691
691
 
692
- Phase 7 cost rollup carries this as a `phase 0` line item so the user sees ambiguity-scoring cost separately from Phase 1 Analysis.
692
+ Phase 5 cost rollup carries this as a `phase 0` line item so the user sees ambiguity-scoring cost separately from Phase 1 Analysis.
693
693
 
694
694
  <!-- progress-contract: applied -->
695
695
 
@@ -710,15 +710,15 @@ node "$HOME/.claude/scripts/usage-register.mjs" --quiet >/dev/null 2>&1 || true
710
710
  node "$HOME/.claude/scripts/usage-report.mjs" --task-id "$TASK_ID" >/dev/null 2>&1 || true
711
711
  ```
712
712
 
713
- The third line reports the run as started: reporting only from Phase 7 reported
714
- only runs that finish, and few do. Phase 7 upserts the same key over it. The
713
+ The third line reports the run as started: reporting only from Phase 5 reported
714
+ only runs that finish, and few do. Phase 5 upserts the same key over it. The
715
715
  second is the backstop for a machine that reached neither setup nor update - it
716
716
  is a no-op once a token resolves, and permanently so under `usageLog.optOut`.
717
717
 
718
718
  It asserts five things, each of which has failed silently in a real run:
719
719
 
720
720
  1. **`agent-state.json` exists.** Every later phase reasons from it.
721
- 2. **`taskType` is set.** Phase 3 branches on it (Step 7).
721
+ 2. **`taskType` is set.** Phase 2 branches on it (Step 7).
722
722
  3. **A Figma reference forces `taskType: "component"`, and `figmaAccess.tier` is
723
723
  recorded**, so a later phase can tell a confirmed design from an unfetched one.
724
724
  4. **`baseBranchSource` is recorded**, and an interactive run recorded `asked` or
@@ -730,4 +730,4 @@ Each failed silently in a real run; the script header names which.
730
730
 
731
731
  A failure is a halt, not a warning: fix the state, re-run the gate, and leave the phase
732
732
  `in_progress` until it passes. Never close Phase 0 on the grounds that its steps ran -
733
- the gate checks the output, which is what Phase 3 consumes.
733
+ the gate checks the output, which is what Phase 2 consumes.