@mmerterden/multi-agent-pipeline 15.16.0 → 16.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 (90) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/README.md +2 -2
  3. package/README.tr.md +1 -2
  4. package/docs/architecture.md +2 -2
  5. package/docs/ecosystem.md +9 -6
  6. package/docs/features.md +2 -3
  7. package/install/_plugin-skills.mjs +28 -2
  8. package/install/templates/copilot-instructions.md +8 -7
  9. package/package.json +1 -1
  10. package/pipeline/commands/multi-agent/SKILL.md +5 -6
  11. package/pipeline/commands/multi-agent/analysis/SKILL.md +77 -588
  12. package/pipeline/commands/multi-agent/analysis-resolve/SKILL.md +5 -69
  13. package/pipeline/commands/multi-agent/channels/SKILL.md +1 -1
  14. package/pipeline/commands/multi-agent/complaint-analysis/SKILL.md +5 -4
  15. package/pipeline/commands/multi-agent/dev/SKILL.md +8 -280
  16. package/pipeline/commands/multi-agent/dev-autopilot/SKILL.md +12 -124
  17. package/pipeline/commands/multi-agent/dev-local/SKILL.md +8 -111
  18. package/pipeline/commands/multi-agent/dev-local-autopilot/SKILL.md +11 -113
  19. package/pipeline/commands/multi-agent/help/SKILL.md +61 -56
  20. package/pipeline/commands/multi-agent/ios-coding-standard/SKILL.md +4 -2
  21. package/pipeline/commands/multi-agent/local-autopilot/SKILL.md +2 -4
  22. package/pipeline/commands/multi-agent/refactor/SKILL.md +1 -1
  23. package/pipeline/commands/multi-agent/resume-local/SKILL.md +3 -3
  24. package/pipeline/commands/multi-agent/setup/SKILL.md +2 -2
  25. package/pipeline/commands/multi-agent/stack/SKILL.md +10 -9
  26. package/pipeline/commands/multi-agent/store-ready/SKILL.md +1 -1
  27. package/pipeline/commands/multi-agent/sync/SKILL.md +2 -2
  28. package/pipeline/commands/multi-agent/update/SKILL.md +1 -1
  29. package/pipeline/lib/context-link-extractor.sh +38 -0
  30. package/pipeline/lib/fetch-document.sh +190 -0
  31. package/pipeline/multi-agent-refs/_dev-context.md +4 -0
  32. package/pipeline/multi-agent-refs/analysis/evidence.md +213 -0
  33. package/pipeline/multi-agent-refs/analysis/intake.md +167 -0
  34. package/pipeline/multi-agent-refs/analysis/locked.md +53 -0
  35. package/pipeline/multi-agent-refs/analysis/render.md +133 -0
  36. package/pipeline/multi-agent-refs/analysis/resolve.md +76 -0
  37. package/pipeline/multi-agent-refs/analysis/synthesis.md +98 -0
  38. package/pipeline/multi-agent-refs/analysis-template.md +58 -11
  39. package/pipeline/multi-agent-refs/complaint-analysis-template.md +1 -1
  40. package/pipeline/multi-agent-refs/component-dispatch.md +5 -5
  41. package/pipeline/multi-agent-refs/cross-cli-contract.md +9 -7
  42. package/pipeline/multi-agent-refs/features/skill-conformance.md +1 -1
  43. package/pipeline/multi-agent-refs/features/url-enrichment.md +13 -3
  44. package/pipeline/multi-agent-refs/knowledge.md +2 -2
  45. package/pipeline/multi-agent-refs/payload-contracts.md +1 -1
  46. package/pipeline/multi-agent-refs/phases/modes.md +73 -53
  47. package/pipeline/multi-agent-refs/phases/phase-0-init.md +21 -2
  48. package/pipeline/multi-agent-refs/phases/phase-1-analysis.md +26 -0
  49. package/pipeline/multi-agent-refs/phases/phase-2-planning.md +26 -12
  50. package/pipeline/multi-agent-refs/phases/phase-3-dev.md +17 -18
  51. package/pipeline/multi-agent-refs/phases/phase-4-review.md +29 -7
  52. package/pipeline/multi-agent-refs/phases/phase-5-test.md +1 -1
  53. package/pipeline/multi-agent-refs/phases/phase-6-commit.md +8 -0
  54. package/pipeline/multi-agent-refs/phases/phase-7-report.md +1 -1
  55. package/pipeline/multi-agent-refs/phases.md +9 -7
  56. package/pipeline/multi-agent-refs/progress-contract.md +1 -1
  57. package/pipeline/multi-agent-refs/readiness-review.md +2 -0
  58. package/pipeline/multi-agent-refs/rules.md +2 -2
  59. package/pipeline/multi-agent-refs/tracker-contract.md +32 -13
  60. package/pipeline/multi-agent-refs/wiki-capture.md +2 -2
  61. package/pipeline/schemas/agent-state.schema.json +3 -3
  62. package/pipeline/schemas/analysis-output.schema.json +17 -0
  63. package/pipeline/schemas/analysis-spec.schema.json +69 -1
  64. package/pipeline/schemas/complaint-analysis-spec.schema.json +1 -1
  65. package/pipeline/schemas/prefs.schema.json +47 -0
  66. package/pipeline/schemas/token-budget.json +2 -2
  67. package/pipeline/scripts/_stack-routing.mjs +17 -12
  68. package/pipeline/scripts/build-stack-plugins.mjs +16 -6
  69. package/pipeline/scripts/cost-table.json +1 -1
  70. package/pipeline/scripts/gen-mode-dispatch.mjs +20 -30
  71. package/pipeline/scripts/run-aggregator.mjs +1 -1
  72. package/pipeline/scripts/validate-analysis-doc.mjs +36 -3
  73. package/pipeline/skills/.skills-index.json +40 -7
  74. package/pipeline/skills/shared/README.md +12 -9
  75. package/pipeline/skills/shared/core/multi-agent/SKILL.md +9 -5
  76. package/pipeline/skills/shared/core/multi-agent-dev/SKILL.md +7 -61
  77. package/pipeline/skills/shared/core/multi-agent-dev-autopilot/SKILL.md +11 -51
  78. package/pipeline/skills/shared/core/multi-agent-dev-local/SKILL.md +7 -33
  79. package/pipeline/skills/shared/core/multi-agent-dev-local-autopilot/SKILL.md +10 -38
  80. package/pipeline/skills/shared/core/multi-agent-help/SKILL.md +28 -18
  81. package/pipeline/skills/shared/core/multi-agent-ios-coding-standard/SKILL.md +4 -2
  82. package/pipeline/skills/shared/core/multi-agent-local-autopilot/SKILL.md +2 -4
  83. package/pipeline/skills/shared/core/multi-agent-refactor/SKILL.md +1 -1
  84. package/pipeline/skills/shared/core/multi-agent-resume-local/SKILL.md +2 -2
  85. package/pipeline/skills/shared/core/multi-agent-stack/SKILL.md +10 -9
  86. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +2 -2
  87. package/pipeline/skills/shared/external/evidence-github/SKILL.md +45 -0
  88. package/pipeline/skills/shared/external/evidence-registry/SKILL.md +33 -0
  89. package/pipeline/skills/shared/external/signal-community/SKILL.md +44 -0
  90. package/pipeline/skills/skills-index.md +10 -7
@@ -1,6 +1,6 @@
1
1
  ### Phase 2: Planning (Fable)
2
2
 
3
- > **TLDR** - Fable decomposes the analysis (Opus when the fallback ladder engages) into concrete tasks with file-level targets, risk grading, and architecture review. Before Phase 3 a **Plan Approval Gate** runs in normal mode: if the Jira/issue description is ambiguous the orchestrator asks the user structured clarification questions (max 2 rounds) - once scope is clear it renders the plan and loops on free-text edit requests until the user approves or aborts. The gate is **skipped entirely** for `--dev`, `autopilot`, and `--dev autopilot` (their speed/zero-interaction contracts are preserved).
3
+ > **TLDR** - Fable decomposes the analysis (Opus when the fallback ladder engages) into concrete tasks with file-level targets, risk grading, and architecture review. Before Phase 3 a **Plan Approval Gate** runs in normal mode: if the Jira/issue description is ambiguous the orchestrator asks the user structured clarification questions (max 2 rounds) - once scope is clear it renders the plan and loops on free-text edit requests until the user approves or aborts. The gate is **skipped entirely** for a Short run and for `autopilot` (a Short run has no plan to approve; autopilot may not ask).
4
4
 
5
5
  <!-- progress-contract: applied -->
6
6
  Progress emission per `$HOME/.claude/multi-agent-refs/progress-contract.md` - lines for plan-draft start, clarification-ask, clarification-answer, plan render, plan-edit-request, plan-approved, plan-aborted.
@@ -9,11 +9,12 @@ Progress emission per `$HOME/.claude/multi-agent-refs/progress-contract.md` -
9
9
 
10
10
  Phase 2 Planning consumes the analysis document. MCP forbidden.
11
11
 
12
- 1. **Analysis document presence**: same path resolution as Phase 3.
13
- - Abort with `ERR: analysis doc missing. Run /multi-agent:analysis "<feature>" first.`
12
+ 1. **Analysis document presence**: read `state.analysis.docStatus`, which Phase 1 Step 4 set.
13
+ - `produced` | `reused` -> the file is at `state.analysis.docPath[]`; continue with steps 2-4.
14
+ - `not-applicable` -> no document by design (bugfix/chore, no Figma). Record it, skip steps 2-4, plan from `state.analysis` alone.
15
+ - Unreadable or key missing -> `ERR: Phase 1 reported <status> but no analysis doc is readable. Resume with /multi-agent:resume #N.` Producing it is Phase 1's job; never send the user to another command.
14
16
 
15
- 2. **Parse YAML front-matter**: `feature`, `platform`, `language`, `mode`, `evidence_digest`, `template_version`. Persist into `state.analysis.frontMatter`.
16
- - **`template_version` < `v3` aborts**: `ERR: analysis doc is template v<n>; v3 required. Re-run /multi-agent:analysis to regenerate.` No degraded mode.
17
+ 2. **Parse YAML front-matter** into `state.analysis.frontMatter` and abort below `template_version: v3` - same contract as `phase-3-dev.md` step 2.
17
18
 
18
19
  3. **Section coverage check**: verify these sections are non-empty (template v3 required sections per Locked 2):
19
20
  - Section 1 Summary, Section 2 Goals + Non-Goals, Section 4 User Stories, Section 9 API Contracts, Section 13 Architecture Plan, Section 14 Files to Add, Section 20 Risks, Section 21 References
@@ -27,6 +28,20 @@ Phase 2 Planning consumes the analysis document. MCP forbidden.
27
28
 
28
29
  Phase 2 consumes the Phase 1 output object conforming to `$HOME/.claude/schemas/analysis-output.schema.json`. Read `state.analysis` (the explorer's return value) and treat its `touchedAreas` and `risks` arrays (plus `stack` and `summary`) as authoritative input - do not re-explore the codebase here. (Field names are exactly those in the analysis schema; the planner's own `targetFiles` belongs to `planning-output.schema.json`, not the analysis input.)
29
30
 
31
+ #### Step 0.9 - Post-analysis confirmation (derive first, ask only what cannot be derived)
32
+
33
+ Runs when `state.analysis.docStatus` is `produced` or `reused`, before any planning.
34
+
35
+ **Derived is shown, not asked**: platform set, the seven convention groups, existing components (Code Connect + `uiComponents`), localization keys, analytics events, DI registration, test-method naming. **Only Section 20 rows are asked**, through `$HOME/.claude/multi-agent-refs/analysis/resolve.md` - one row, at most three source-labeled candidates, plus Defer. The engine never invents.
36
+
37
+ ```
38
+ Türetildi (onay için): platform=ios,android · 7 konvansiyon grubu (5 high, 2 medium)
39
+ · 12 mevcut bileşen (9 Code Connect bağlı) · 34 lokalizasyon anahtarı
40
+ Sorulacak: 4 açık soru (Bölüm 20)
41
+ ```
42
+
43
+ A corrected value rewrites its Pass B footnote as `^[user-override: resolved <date>]` (Locked 24). Deferred rows stay in `state.analysis.openQuestions[]` and Phase 4 flags them `review_blocking`. Here and not Phase 4 because Phase 4 runs after development - answered there is answered too late. Autopilot skips the asking and defers every row.
44
+
30
45
  #### Step 1 - Task Decomposition
31
46
 
32
47
  Break the work from Phase 1 analysis into discrete, implementable tasks:
@@ -149,7 +164,7 @@ Phase 3 (Dev) then iterates with `plan-todos.sh next "$TASK_ID"` until empty, ca
149
164
 
150
165
  #### Step 4.8 - Cross-artifact consistency check (required, before presenting the plan)
151
166
 
152
- Before the plan is rendered for approval (Step 5b) or silently accepted (autopilot / `--dev` skip path), verify it against `state.analysis` (drifted plans are the root cause of "PR does not match the ticket"):
167
+ Before the plan is rendered for approval (Step 5b) or silently accepted (the autopilot skip path), verify it against `state.analysis` (drifted plans are the root cause of "PR does not match the ticket"):
153
168
 
154
169
  1. **Requirement coverage** - every analysis requirement (`touchedAreas[]` entry, Section 14 row, acceptance criterion) maps to at least one plan task.
155
170
  2. **Anchor integrity** - No plan task without an analysis anchor (each task cites the `touchedAreas[].path`, Section 6 row, or `risks[]` mitigation it implements).
@@ -170,7 +185,7 @@ Log: "Phase 2: Consistency - requirements:{N/N mapped} anchors:{ok|M unanchore
170
185
 
171
186
  OR:
172
187
 
173
- - `state.onlyDevelop === true` (--dev contract: direct to Phase 3, no plan)
188
+ - `state.onlyDevelop === true` (Short pipeline: direct to Phase 3, no plan)
174
189
 
175
190
  In the skipped case, log `🧠 Phase 2: Plan - gate skipped ({mode}), proceeding to Phase 3` and go to Phase 3.
176
191
 
@@ -293,14 +308,13 @@ No hard cap on edit iterations - the user controls exit via the Approve / Canc
293
308
 
294
309
  #### Step 6 - Mode-specific short-circuit (reference)
295
310
 
296
- The 4 pipeline modes interact with the gate as follows. This table is the source of truth for the gate's mode-awareness - if behavior diverges in code, fix the code, not the table.
311
+ The pipeline shapes interact with the gate as follows. This table is the source of truth for the gate's mode-awareness - if behavior diverges in code, fix the code, not the table.
297
312
 
298
313
  | Mode | Clarification | Approval Loop | Safety Classifier | Notes |
299
314
  |---|---|---|---|---|
300
- | Normal (`multi-agent "task"`) | ✅ (max 2 rounds) | ✅ | - (redundant in normal mode) | Full gate |
301
- | `--dev` | ❌ | ❌ | - | Phase 1-2 already skipped; Phase 3 starts immediately |
302
- | `autopilot` | ❌ | ❌ conditional | ✅ (if `autopilotSafetyGate !== false`) | Safe plans proceed silently; high-risk plans trigger a one-time manual approval. Log records the score. |
303
- | `--dev autopilot` | ❌ | ❌ | - | Phase 3 starts immediately (no plan exists to classify) |
315
+ | Full, interactive (`/multi-agent`, `:local`) | ✅ (max 2 rounds) | ✅ | - (redundant when a human approves) | Full gate |
316
+ | Short (depth picker answered Short) | ❌ | ❌ | - | Phase 1-2 skipped at Step 7.5; Phase 3 starts immediately |
317
+ | `autopilot`, `:local-autopilot` | ❌ | ❌ conditional | ✅ (if `autopilotSafetyGate !== false`) | Always Full, so a plan exists. Safe plans proceed silently; high-risk plans trigger a one-time manual approval. Log records the score. |
304
318
 
305
319
  **Why autopilot now has an escape hatch:** the old "zero interaction - fully trust the scope" contract held well for tightly-scoped batch workflows (figma component iteration over known-safe components) but broke in edge cases - schema migrations auto-merging, security-path drift going silent, delete-without-test sprawls. The safety classifier (Step 5c) is opt-out so the default protects against the edge-case cost; users running known-safe workflows can flip `prefs.global.autopilotSafetyGate = false` to restore pre-v7.0 behavior.
306
320
 
@@ -1,6 +1,6 @@
1
1
  ### Phase 3: Dev (Sonnet)
2
2
 
3
- > **TLDR** - Sonnet executes the plan task-by-task with TDD (red→green→refactor). Required: issue-tracker status moved to "In Progress" before any code, with a post-mutation verify step (re-reads the field, retries once on silent VALIDATION failures). Build verification after each task (up to 3 retries). Build-queue lock serializes concurrent xcodebuild. `--dev` mode uses Opus self-contained (no Phase 2 plan required). `taskType === component` **short-circuits the TDD path** and delegates the whole phase to the enabled `ai-<platform>-toolkit` marketplace plugin's component skill (`create-component`, fallback `create-ui-component`) - see next subsection.
3
+ > **TLDR** - Sonnet executes the plan task-by-task with TDD (red→green→refactor). Required: issue-tracker status moved to "In Progress" before any code, with a post-mutation verify step (re-reads the field, retries once on silent VALIDATION failures). Build verification after each task (up to 3 retries). Build-queue lock serializes concurrent xcodebuild. A Short run (`state.onlyDevelop`) uses Opus self-contained, with no Phase 2 plan. `taskType === component` **short-circuits the TDD path** and delegates the whole phase to the enabled `ai-<platform>-toolkit` marketplace plugin's component skill (`create-component`, fallback `create-ui-component`) - see next subsection.
4
4
 
5
5
  ## Phase 3 Pre-flight (BLOCKING, v9.0.0)
6
6
 
@@ -8,17 +8,14 @@ Per Locked decision 30, Phase 3 Dev consumes the analysis document as the sole d
8
8
 
9
9
  Pre-flight steps (run in order, abort on failure).
10
10
 
11
- **Steps 1, 2, 3, 5 and 6 apply only when Phase 1 ran.** In the `--dev` family (`state.onlyDevelop === true`) there is no analysis doc by design, so they are recorded `not-applicable (no Phase 1 in this mode)` and skipped - an unconditional abort there would make every fast mode impossible. Steps 4, 7, 8 and 9 apply in every mode.
11
+ **Steps 1, 2, 3, 5 and 6 apply only when Phase 1 ran.** In a Short run (`state.onlyDevelop === true`) there is no analysis doc by design, so they are recorded `not-applicable (no Phase 1 in this mode)` and skipped - an unconditional abort there would make every fast mode impossible. Steps 4, 7, 8 and 9 apply in every mode.
12
12
 
13
- 1. **Analysis document presence** (Phase 1 modes only): locate `analysis/<feature-slug>-<platform>.md` for the active platform.
14
- - Path resolution: `state.run.repoPath` + `/analysis/<feature>-<platform>.md`
15
- - Multi-repo runs: each selected repo MUST have the file under its working tree
16
- - **Abort condition**: file missing -> exit with `ERR: analysis doc missing for <platform>. Run /multi-agent:analysis "<feature>" first to generate it.`
13
+ 1. **Analysis document presence** (Phase 1 modes only): read `state.analysis.docStatus` and `state.analysis.docPath[]`, both set by Phase 1 Step 4.
14
+ - `produced` | `reused` -> read the active platform's file; multi-repo runs need one per selected repo.
15
+ - `not-applicable` -> no document by design; record it for steps 1, 2, 3, 5, 6 and skip them, as a Short run does.
16
+ - **Abort**: `produced` but unreadable -> `ERR: analysis doc at <path> unreadable. Resume with /multi-agent:resume #N.` Producing it is Phase 1's job.
17
17
 
18
- 2. **Parse YAML front-matter** (the doc has a `template_version: v3` header):
19
- - `feature`, `platform`, `language`, `mode (full | lite)`, `evidence_digest`
20
- - Persist into `state.analysis.frontMatter`
21
- - **Abort condition**: `template_version` < `v3` -> exit with `ERR: analysis doc is template v<n>; v3 required. Re-run /multi-agent:analysis to regenerate.` No degraded mode.
18
+ 2. **Parse YAML front-matter** into `state.analysis.frontMatter`: `feature`, `platform`, `language`, `mode`, `evidence_digest`, `template_version`. **Abort** when `template_version` < `v3`; there is no degraded mode.
22
19
 
23
20
  3. **Evidence digest match (cache validation)**: if `state.run.lastAnalysisDigest` is present AND matches `frontMatter.evidence_digest`, mark as fresh; otherwise WARN that analysis is stale (continue but flag).
24
21
 
@@ -26,6 +23,8 @@ Pre-flight steps (run in order, abort on failure).
26
23
 
27
24
  5. **Standards binding citations**: read `analysis Section 21 References` table. For each row with `Rol: bağlayıcı / binding`, persist the source path into `state.dev.standardsBindings[]`. Phase 3 Dev tasks MUST cite at least one binding source per architectural decision (pre-existing Locked decision 8).
28
25
 
26
+ 5b. **Test plan handoff (the RED input)**: read `analysis Section 15` into `state.dev.testPlan[]` (15.1 unit rows with name/arrange/act/expected/`BR-` id, 15.2 snapshot variants, 15.6 UI flows, 15.7 manual scenarios). **RED writes these tests, not invented ones** - development is TDD, so the analysis matrix is literally the first thing written. A row too vague to write from is an analysis defect: open a Section 20 question, do not improvise.
27
+
29
28
  6. **Conventions handoff**: read `analysis Section 13.1 Concept Table` (Pass B output with footnotes). Persist concept-to-realization mapping into `state.dev.conventions[<concept>]`. Phase 3 implementation uses these names verbatim, and a non-empty `sharedUtilities` bucket is binding: bind those formatters/rule-facades/tokens, never hand-roll a duplicate (e.g., if Section 13.1 says "State holder: PassengerFlightViewModel", Phase 3 names the class exactly `PassengerFlightViewModel`).
30
29
 
31
30
  7. **MCP forbidden**: calling `mcp__claude_ai_Figma__*` in Phase 3 is a violation. `smoke-no-mcp-in-dev-phases.sh` reads `state.telemetry.mcpCalls[]` after the run and fails if Phase 3 contributed an entry.
@@ -48,7 +47,7 @@ The analysis document is the SOLE design source in Phase 3. Variant choices, pad
48
47
 
49
48
  #### Input contract
50
49
 
51
- Phase 3 consumes the Phase 2 output object conforming to `$HOME/.claude/schemas/planning-output.schema.json` - the task graph (`tasks[]` with `id`, `subject`, `targetFiles`, `complexity`, `blockedBy`) plus the architecture review notes. Tasks execute in dependency order; the schema's `blockedBy` field drives the ready-task picker. In `--dev` mode (no Phase 2), Sonnet/Opus generates the equivalent task list inline before entering the loop below.
50
+ Phase 3 consumes the Phase 2 output object conforming to `$HOME/.claude/schemas/planning-output.schema.json` - the task graph (`tasks[]` with `id`, `subject`, `targetFiles`, `complexity`, `blockedBy`) plus the architecture review notes. Tasks execute in dependency order; the schema's `blockedBy` field drives the ready-task picker. In a Short run (no Phase 2), Opus generates the equivalent task list inline before entering the loop below.
52
51
 
53
52
  **Plan Todo iteration (opt-in)**: gated by `prefs.global.planTodos.enabled` (default: `false`). When enabled and Phase 2 Step 4.5 emitted a `plan.todos[]`, Phase 3 iterates via `$HOME/.claude/lib/plan-todos.sh next/start/complete/fail` instead of walking `tasks[]` directly. When disabled, the loop walks `tasks[]` from `planning-output` - TDD contract is unchanged. Full helper loop + state semantics: `$HOME/.claude/multi-agent-refs/features/plan-todos.md`.
54
53
 
@@ -56,7 +55,7 @@ Phase 3 consumes the Phase 2 output object conforming to `$HOME/.claude/schemas/
56
55
 
57
56
  #### Component tasks - delegated dispatch (taskType === "component")
58
57
 
59
- When Phase 0 Step 7 classified the task as `component`, Phase 3 delegates the entire phase to the enabled `ai-<platform>-toolkit` marketplace plugin's component skill (`create-component`, fallback `create-ui-component`) via the Skill tool and does NOT run the TDD loop below. The dispatch layer passes the plugin skill the analysis Section 6 (Bileşen Envanteri) entry + Section 13.1 conventions for the named component as context. Because plugin skills do not write pipeline state, the **dispatch layer** (not the skill) owns `state.phases["3"].subphases[]`, recording a coarse component-build row - multi-agent's `phase-tracker` reads that array with no special case. Plugin resolution (dual-name), dispatch call, failure/resume, multi-repo, `--dev` elisions, and the intentional cross-CLI divergence live in `$HOME/.claude/multi-agent-refs/component-dispatch.md` - read it before editing component-task behaviour here. Phase 3 still owns: progress line `-> dispatching create-component <name>`, `retryCount` cap at 3, and fallthrough to the TDD path when dispatch prerequisites are missing (`taskType` absent OR the plugin is not enabled in this repo -> log anomaly, halt or run TDD per component-dispatch.md).
58
+ When Phase 0 Step 7 classified the task as `component`, Phase 3 delegates the entire phase to the enabled `ai-<platform>-toolkit` marketplace plugin's component skill (`create-component`, fallback `create-ui-component`) via the Skill tool and does NOT run the TDD loop below. The dispatch layer passes the plugin skill the analysis Section 6 (Bileşen Envanteri) entry + Section 13.1 conventions for the named component as context. Because plugin skills do not write pipeline state, the **dispatch layer** (not the skill) owns `state.phases["3"].subphases[]`, recording a coarse component-build row - multi-agent's `phase-tracker` reads that array with no special case. Plugin resolution (dual-name), dispatch call, failure/resume, multi-repo, Short-run elisions, and the intentional cross-CLI divergence live in `$HOME/.claude/multi-agent-refs/component-dispatch.md` - read it before editing component-task behaviour here. Phase 3 still owns: progress line `-> dispatching create-component <name>`, `retryCount` cap at 3, and fallthrough to the TDD path when dispatch prerequisites are missing (`taskType` absent OR the plugin is not enabled in this repo -> log anomaly, halt or run TDD per component-dispatch.md).
60
59
 
61
60
  For non-component taskTypes (`bugfix`, `feature`, `refactor`, `chore`), continue with the standard TDD section below.
62
61
 
@@ -253,13 +252,13 @@ LOG_METRIC_FORWARD_TO_TRACKER=1 $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 3
253
252
  edits_returned=$RET edits_applied=$APPLIED edits_skipped=$SKIPPED
254
253
  ```
255
254
 
256
- Scope guard: a single pass, never looped. Runs in `--dev` mode too; component tasks (`taskType === "component"`) skip it (the figma skill owns its own checklist).
255
+ Scope guard: a single pass, never looped. Runs in a Short run too; component tasks (`taskType === "component"`) skip it (the figma skill owns its own checklist).
257
256
 
258
257
  ---
259
258
 
260
- #### Dev-Only Mode (`--dev`)
259
+ #### Short pipeline (`state.onlyDevelop === true`)
261
260
 
262
- When `agent-state.json.onlyDevelop === true`, Phase 3 runs self-contained with **Opus** (not Sonnet). No Phase 2 plan exists - the agent creates its own scope.
261
+ Set by the Phase 0 Step 7.5 depth picker, or by autopilot never (autopilot always runs Full). When it is true, Phase 3 runs self-contained with **Opus** (not Sonnet). No Phase 2 plan exists - the agent creates its own scope.
263
262
 
264
263
  **Flow:**
265
264
  1. Read task description (from Jira, GitHub issue, or free-text)
@@ -271,7 +270,7 @@ When `agent-state.json.onlyDevelop === true`, Phase 3 runs self-contained with *
271
270
 
272
271
  **Key differences from normal mode:**
273
272
 
274
- | Aspect | Normal | Dev-Only |
273
+ | Aspect | Full | Short |
275
274
  |--------|--------|----------|
276
275
  | Model | Sonnet | **Opus** |
277
276
  | Plan source | Phase 2 task list | Self-determined |
@@ -282,7 +281,7 @@ When `agent-state.json.onlyDevelop === true`, Phase 3 runs self-contained with *
282
281
 
283
282
  Because the agent determines its own scope here, Phase 4 is the only place that checks the result against anything external. Record every skill, plugin skill and guide consulted during this phase into `state.telemetry.skillCalls[]` with the files it was applied to - Phase 4 resolves the criteria set independently, and this record is what lets it tell "applied and honoured" from "never opened".
284
283
 
285
- **Combinable with autopilot**: `--dev autopilot` = zero interaction. Init → Dev → Review (auto-fix) → auto-commit → auto-PR → Report.
284
+ **Never combined with autopilot.** Autopilot skips the depth question and runs Full, so `onlyDevelop` is false in every unattended run. "Fast plus unattended" was `--dev autopilot` until v16.0.0 and no longer exists: something has to choose when nobody is asked, and unattended is the worst place to drop analysis and planning.
286
285
 
287
286
  **Tracker visibility during Opus dispatch**: on Claude Code the model switch to Opus happens via subagent dispatch, and the parent widget cannot move while an Agent call is in flight. Dispatch per task from the self-generated task list (never one monolithic call for the whole phase), set the pre-dispatch `activeForm` marker, and record tokens between chunks - full rules in `$HOME/.claude/multi-agent-refs/tracker-contract.md` section "Delegated phases".
288
287
 
@@ -344,7 +343,7 @@ LOG_METRIC_FORWARD_TO_TRACKER=1 $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 3
344
343
  tokens_in=$IN tokens_out=$OUT duration_ms=$DUR
345
344
  ```
346
345
 
347
- Model resolves from the active mode: full pipeline runs Sonnet, `--dev` modes run Opus. Best-effort. See `$HOME/.claude/multi-agent-refs/progress-contract.md#token-telemetry-forwarding-v83`.
346
+ Model resolves from the active mode: a Full run uses Sonnet, a Short run uses Opus. Best-effort. See `$HOME/.claude/multi-agent-refs/progress-contract.md#token-telemetry-forwarding-v83`.
348
347
 
349
348
  ---
350
349
 
@@ -5,6 +5,12 @@
5
5
  <!-- progress-contract: applied -->
6
6
  Progress emission per `$HOME/.claude/multi-agent-refs/progress-contract.md` - lines for each gate, each reviewer dispatch + finish, triage start, triage verdict, fix dispatch.
7
7
 
8
+ #### Step 0 - Analysis mode branch
9
+
10
+ `state.mode === "analysis"` has no diff: the artefact is the document. Replace Steps 1-3 with (1) `validate-analysis-doc.mjs <file> --strict` per platform, (2) the same CLI-aware reviewer set reading the document against one question - **could an implementer build the right thing from this alone?** a finding is anything that would force a guess - and (3) `$HOME/.claude/multi-agent-refs/analysis/resolve.md` over the Section 20 rows still `Acik / Open`; deferred rows report `review_blocking`. Then go to Phase 6.
11
+
12
+ Log: `Phase 4: Document review - validator:{pass/fail} | {N} findings | {M} resolved, {K} deferred`
13
+
8
14
  #### Step 1 - Deterministic Gates (run BEFORE AI review)
9
15
 
10
16
  If any gate fails → fix first, don't waste AI tokens reviewing broken code.
@@ -65,6 +71,12 @@ Gate semantics:
65
71
 
66
72
  When `state.fortifyFinding.status === "skipped"` (token missing, VPN unreachable, or host mismatch) the gate logs `→ fortify gate: skipped (<reason>)` and never blocks - the user already saw the structured Save Flow signal at Phase 0 and chose to proceed.
67
73
 
74
+ #### Step 1.45 - Test plan coverage cross-check (Phase 1 modes with a test plan)
75
+
76
+ Every `state.dev.testPlan[]` row must map to a real test in the diff, matched on the planned name. Missing -> `important` ("planned test <name> (BR-<id>) has no implementation"); present but asserting something else -> `blocking`, plan and code disagree about the rule. This is what makes "analysis quality is output quality" measurable. Skipped when `docStatus === "not-applicable"` or the mode has no Phase 1.
77
+
78
+ Log: `→ test plan coverage: <N>/<M> planned rows implemented`
79
+
68
80
  #### Step 1.5 - Platform Compliance Review (skill-based, no device needed)
69
81
 
70
82
  If changes include UI files (iOS: `*View.swift`, `*Screen.swift`, `*Cell.swift`; Android: `*Screen.kt`, `*Content.kt`, `*Composable.kt`), run platform-specific checks:
@@ -206,7 +218,7 @@ Output conforms to `$HOME/.claude/schemas/criteria-manifest.schema.json`. The fo
206
218
 
207
219
  #### Step 1.8 - Figma visual-fidelity context (when task carries a Figma reference)
208
220
 
209
- **Dev-mode inputs.** Phases 1 and 2 never run in the `--dev` family, so three inputs this phase was written around are absent. Substitute them and RECORD the substitution - a step that could not run and a step that passed must not read the same, or the completeness claim cannot be checked:
221
+ **Short-run inputs.** Phases 1 and 2 do not run in a Short run, so three inputs this phase was written around are absent. Substitute them and RECORD the substitution - a step that could not run and a step that passed must not read the same, or the completeness claim cannot be checked:
210
222
 
211
223
  | Absent input | Substitute |
212
224
  |---|---|
@@ -377,6 +389,8 @@ Exit 0 = valid. Exit 2 = contradiction (approved=true with blocking findings) -
377
389
 
378
390
  **CRITICAL**: Reviewer findings are **raw signals**, not commands. Never auto-loop on every "blocking" tag - reviewers hallucinate, misread scope, or repeat each other. Run Fable triage (Opus on Copilot CLI) to evaluate merged findings against task scope.
379
391
 
392
+ Optional: when `ai-analyst-toolkit` is enabled and a finding blames a third-party library rather than this diff, ask `evidence-github` whether it is already open upstream. A confirmed one is `deferred` with its `GitHub:<owner>/<repo>#<n>` citation, not `accepted` and handed to Phase 3 to fix code that is not ours.
393
+
380
394
  Opt-in empirical layer: when `prefs.global.verifyByTest.enabled` is `true`, accepted blocking findings additionally go through Step 3.7 (verify-by-test), which tries to reproduce each one with a minimal failing test before the Phase 3 rework loop fires. Full wiring: `$HOME/.claude/multi-agent-refs/features/verify-by-test.md`.
381
395
 
382
396
  ##### 3.0 Merge the deterministic findings in
@@ -510,14 +524,22 @@ Failure fallback (timeout >120s, or agent crash before any JSON is produced): re
510
524
 
511
525
  Emit metrics per review pass for Phase 7 cost rollup:
512
526
 
527
+ One `review.reviewer_call` per dispatched reviewer, one `review.triage_call`, one `review.completed` to close the pass:
528
+
513
529
  ```bash
514
- LOG_METRIC_FORWARD_TO_TRACKER=1 $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 4 review.reviewer_call model=fable duration_ms=$R1_DURATION tokens_in=$R1_IN tokens_out=$R1_OUT # model=opus on Copilot CLI
515
- # GPT-5.4 metric emitted only on Copilot CLI (skip on Claude Code):
530
+ M=$HOME/.claude/scripts/log-metric.sh
531
+ emit() { # $1=event $2=model $3=duration $4=tokens_in $5=tokens_out
532
+ LOG_METRIC_FORWARD_TO_TRACKER=1 bash "$M" "$TASK_ID" 4 "$1" \
533
+ model="$2" duration_ms="$3" tokens_in="$4" tokens_out="$5"
534
+ }
535
+ emit review.reviewer_call fable "$R1_DURATION" "$R1_IN" "$R1_OUT" # opus on Copilot CLI
536
+ emit review.reviewer_call sonnet "$SONNET_DURATION" "$SONNET_IN" "$SONNET_OUT"
537
+ # Reviewer 2 is GPT-5.4 and exists only on Copilot CLI:
516
538
  [ "${CLI_HOST:-claude}" = "copilot" ] && \
517
- LOG_METRIC_FORWARD_TO_TRACKER=1 $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 4 review.reviewer_call model=gpt-5.4 duration_ms=$GPT_DURATION tokens_in=$GPT_IN tokens_out=$GPT_OUT
518
- LOG_METRIC_FORWARD_TO_TRACKER=1 $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 4 review.reviewer_call model=sonnet duration_ms=$SONNET_DURATION tokens_in=$SONNET_IN tokens_out=$SONNET_OUT
519
- LOG_METRIC_FORWARD_TO_TRACKER=1 $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 4 review.triage_call model=fable duration_ms=$TRIAGE_DURATION tokens_in=$TRIAGE_IN tokens_out=$TRIAGE_OUT
520
- $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 4 review.completed raw_count=$RAW accepted=$ACC deferred=$DEF rejected=$REJ approved=$APPROVED duration_ms=$DURATION
539
+ emit review.reviewer_call gpt-5.4 "$GPT_DURATION" "$GPT_IN" "$GPT_OUT"
540
+ emit review.triage_call fable "$TRIAGE_DURATION" "$TRIAGE_IN" "$TRIAGE_OUT"
541
+ bash "$M" "$TASK_ID" 4 review.completed raw_count=$RAW accepted=$ACC \
542
+ deferred=$DEF rejected=$REJ approved=$APPROVED duration_ms=$DURATION
521
543
  ```
522
544
 
523
545
  `LOG_METRIC_FORWARD_TO_TRACKER=1` mirrors `tokens_in`/`tokens_out`/`model` into `phase-tracker.sh` (see `$HOME/.claude/multi-agent-refs/progress-contract.md#token-telemetry-forwarding-v83`). On non-zero validator exit (1/2/3), also emit `triage.edge_case` with cause. Omit `tokens_in`/`tokens_out` if unavailable. Best-effort - never fails the pipeline.
@@ -1,6 +1,6 @@
1
1
  ### Phase 5: Test
2
2
 
3
- > **TLDR** - Optional test gate. Offers to boot the simulator/emulator (UI Bug Hunter) or hand off to the user for manual QA. Needs an interactive prompt AND a worktree checkout, so it runs in `--dev` and the full pipeline but is dropped by every `autopilot` or `--local` variant. If issues found, loops back to Phase 3.
3
+ > **TLDR** - Optional test gate. Offers to boot the simulator/emulator (UI Bug Hunter) or hand off to the user for manual QA. Needs an interactive prompt AND a worktree checkout, so it is in the phase set of `/multi-agent` alone and dropped by every `autopilot` or `--local` entry. Depth does not affect it: a Short run still reaches Phase 5. If issues found, loops back to Phase 3.
4
4
 
5
5
  <!-- progress-contract: applied -->
6
6
  Progress emission per `$HOME/.claude/multi-agent-refs/progress-contract.md` - lines for local-test prompt render, user-answer capture, repo checkout (if selected).
@@ -2,6 +2,14 @@
2
2
 
3
3
  > **TLDR** - Commit with conventional message + ticket ID, push, open PR. Order: (1) identity confirm → (2) commit → (3) push → (4) fetch default reviewers → (5) ask DRAFT-or-READY → (6) build payload with heredoc+rawfile → (7) POST with `reviewers`+`fromRef`+`toRef`+`draft` required on Bitbucket (missing fields wipe defaults).
4
4
 
5
+ #### Analysis mode: publish, do not commit
6
+
7
+ When `state.mode === "analysis"` this phase publishes the document and skips everything below. Locked 6 forbids `git add` and `git commit` here, so nothing in the repo is staged.
8
+
9
+ Destination picker and dispatch: `$HOME/.claude/multi-agent-refs/analysis/render.md`. Local file is pre-selected (Locked 5), multiple destinations allowed.
10
+
11
+ Full pipeline is the opposite: Phase 1 already wrote the document into the worktree, and `prefs.global.analysisPhase.commitDoc` (default `true`) decides whether it rides along with the commit below.
12
+
5
13
  <!-- progress-contract: applied -->
6
14
  Progress emission per `$HOME/.claude/multi-agent-refs/progress-contract.md` - lines for each per-repo squash, commit, push attempt (including retries), PR body generate, PR create, Jira comment post.
7
15
  >
@@ -24,7 +24,7 @@ On entry: `phase-tracker.sh sub 7 <N> "<name>" in_progress`. On exit: `completed
24
24
 
25
25
  Phase 7 is the single exception to the autopilot zero-interaction rule. Full contract in `$HOME/.claude/multi-agent-refs/phases/modes.md`:
26
26
 
27
- - **Normal / `--dev` / `autopilot`** - ALL modes pause at the channels multi-select menu.
27
+ - **Every mode, Full or Short, attended or autopilot** - ALL pause at the channels multi-select menu.
28
28
  - **30-min timeout** - if user does not respond, session ends cleanly. External delivery is aborted (no silent apply of defaults - prevents accidental Jira comments / Confluence pages). Internal capture (Steps 2 + 3 below) STILL runs so `agent-log.md` + knowledge base are persisted.
29
29
  - **Resumable** - state written as `{phase: 7, waitingFor: "user-channels-choice", channelsInput: <state-bundle>}`. User can `/multi-agent:resume <task-id>` any time later; channels menu re-opens with same inputs.
30
30
  - **Timeout log line:** `Phase 7: channels menu timeout (30 min) - session ended, resume with /multi-agent:resume {taskId}`.
@@ -4,7 +4,7 @@
4
4
 
5
5
  | Phase | File |
6
6
  | --------------------------------- | -------------------------------------------------------------------- |
7
- | Modes (autopilot, --dev, --local) | `$HOME/.claude/multi-agent-refs/phases/modes.md` |
7
+ | Modes (depth picker, autopilot, --local) | `$HOME/.claude/multi-agent-refs/phases/modes.md` |
8
8
  | Operations (kill, purge, resume) | `$HOME/.claude/multi-agent-refs/phases/operations.md` |
9
9
  | Phase 0: Init | `$HOME/.claude/multi-agent-refs/phases/phase-0-init.md` |
10
10
  | Phase 1: Analysis | `$HOME/.claude/multi-agent-refs/phases/phase-1-analysis.md` |
@@ -19,9 +19,11 @@
19
19
  ## Pipeline Flow
20
20
 
21
21
  ```
22
- Normal: 0-Init -> 1-Analysis -> 2-Planning -> 3-Dev -> 4-Review -> 5-Test -> 6-Commit -> 7-Report
23
- --dev: 0-Init ------------------------------------------> 3-Dev -> 4-Review -> 5-Test -> 6-Commit -> 7-Report
24
- --local: Same as above but no worktree - works directly on local branch
22
+ Full: 0-Init -> 1-Analysis -> 2-Planning -> 3-Dev -> 4-Review -> 5-Test -> 6-Commit -> 7-Report
23
+ Short: 0-Init -> (1,2 skipped) --------------> 3-Dev -> 4-Review -> 5-Test -> 6-Commit -> 7-Report
24
+ --local: Either of the above with no worktree - works directly on a local branch
25
+
26
+ Full or Short is the Phase 0 Step 7.5 question, not a command name. Autopilot never asks and always runs Full.
25
27
  ```
26
28
 
27
29
  ## Visual Phase Tracker
@@ -60,7 +62,7 @@ $HOME/.claude/scripts/phase-tracker.sh update <N> in_progress # phase starts
60
62
  $HOME/.claude/scripts/phase-tracker.sh update <N> completed # phase ends OK
61
63
  # or:
62
64
  $HOME/.claude/scripts/phase-tracker.sh update <N> failed # phase failed
63
- $HOME/.claude/scripts/phase-tracker.sh update <N> skipped # --dev mode etc.
65
+ $HOME/.claude/scripts/phase-tracker.sh update <N> skipped # e.g. 1 and 2 in a Short run
64
66
  ```
65
67
 
66
68
  After every LLM call (counts are additive; skipping this is why runs end with durations but no cost - nothing reconstructs spend afterwards):
@@ -93,7 +95,7 @@ Banner status enum on `end`: `done` | `failed` | `skipped`. Anything else exits
93
95
 
94
96
  ### TaskCreate registration (Claude Code - required)
95
97
 
96
- In Claude Code the agent MUST register one TaskCreate tile per phase at Phase 0 startup (one per phase that the current mode runs - full pipeline = 0..7, `--dev` = 0/3/6/7). Capture the returned `taskId`, persist it via `phase-tracker.sh meta <N> tasklist_id "<taskId>"` so `:resume` can rebuild the widget.
98
+ In Claude Code the agent MUST register one TaskCreate tile per phase at Phase 0 startup (one per phase the current COMMAND runs - `/multi-agent` = 0..7, `:local` and the autopilot entries = 0/1/2/3/4/6/7, `:analysis` = 0/1/2/4/6/7). Capture the returned `taskId`, persist it via `phase-tracker.sh meta <N> tasklist_id "<taskId>"` so `:resume` can rebuild the widget.
97
99
 
98
100
  Per phase boundary:
99
101
 
@@ -111,7 +113,7 @@ TaskUpdate({ taskId: <saved>, status: "completed" })
111
113
  bash phase-tracker.sh update <N> completed
112
114
  ```
113
115
 
114
- `--dev` mode does NOT TaskCreate phases 1/2/4 at all - those phases are not part of the `--dev` set (`0:Init 3:Dev 5:Test 6:Commit 7:Report`). Only register tiles for the active mode's phase set. (Earlier guidance suggested pre-marking 1/2/4 with `[SKIPPED]` activeForm; that produces visually scrambled tile stacks - see the v8.3.1 ordering rule below.)
116
+ A phase outside the command's set gets no TaskCreate at all. Depth is different: it is not known at registration time, because the tracker boots at Step -1 and the depth question runs at Step 7.5, so a Short run registers Phases 1 and 2 like any other and flips them to `skipped` when the answer lands. Pre-marking them before Phase 0 produces visually scrambled tile stacks - see the ordering rule below.
115
117
 
116
118
  **(strict) TaskCreate ordering**: All TaskCreate calls MUST fire in strict phase-number order BEFORE any TaskUpdate is applied. 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 with default `pending` status, 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)".
117
119
 
@@ -59,7 +59,7 @@ Emit a progress line **at least** at every one of these moments:
59
59
 
60
60
  ### Phase 2 (Planning)
61
61
  - plan draft start, plan render, user-approval prompt.
62
- - **v5.3.0 Plan Approval Gate (normal mode only - skipped for `--dev`, `autopilot`, `--dev autopilot`):**
62
+ - **v5.3.0 Plan Approval Gate (Full + interactive only - a Short run has no plan, autopilot may not ask):**
63
63
  - `clarification-ask` per round - orchestrator writes structured questions when Phase 1 flagged ambiguity (missing acceptance criteria, no Figma/endpoint link, vague language, parent-story scope drift)
64
64
  - `clarification-answer` per round - user reply captured into `state.phases["2"].clarificationAnswers`
65
65
  - `plan-edit-request` per free-text edit - user-supplied revision instruction captured into `state.phases["2"].planEditRequests`
@@ -29,6 +29,8 @@ Maturity is generic; add these pipeline-readiness dimensions by reading the fetc
29
29
 
30
30
  Only emit a dimension as a gap when its trigger applies (do not demand an API contract on a copy-change task). Merge: `gaps = maturity.blockers + maturity.warnings + rubric gaps`.
31
31
 
32
+ **Known upstream (optional).** When `ai-analyst-toolkit` is enabled and the item names a library, framework or SDK, ask `evidence-github` whether the reported behaviour is already an open issue there. A hit does not change the score - it changes the comment, which then says "this looks like `GitHub:<owner>/<repo>#<n>`, upstream" instead of asking the reporter for more detail about a bug that is not theirs. Not enabled, or nothing found, is a silent no-op.
33
+
32
34
  ## Step 4 - verdict (chat, always)
33
35
  Print a compact verdict; reuse the maturity blocker-vs-warning severity contract (same as the Phase 0 maturity check):
34
36
 
@@ -44,7 +44,7 @@ This is the single source of truth. When a contributor or model is unsure where
44
44
  3. `AskUserQuestion` `label` and `header` stay English regardless of `OUTPUT_LANG` (UI contract). `question` and `description` follow `OUTPUT_LANG` - the user reads them as conversational copy, not as button affordances.
45
45
  4. Always English regardless of either axis: commit messages, PR titles, branch names, code identifiers, agent-state.json values, agent-log.md, reviewer/triage system prompts.
46
46
 
47
- **Failure mode this prevents.** Entering `/multi-agent:dev`, `/multi-agent:autopilot`, `/multi-agent:local`, etc. and switching the assistant's conversational text or picker question copy to English while `outputLanguage="tr"` is set. The user sees a half-English half-Turkish dialogue, flagged as a pipeline bug, not a stylistic choice.
47
+ **Failure mode this prevents.** Entering `/multi-agent`, `/multi-agent:autopilot`, `/multi-agent:local`, etc. and switching the assistant's conversational text or picker question copy to English while `outputLanguage="tr"` is set. The user sees a half-English half-Turkish dialogue, flagged as a pipeline bug, not a stylistic choice.
48
48
 
49
49
  ## Code & Commit Rules
50
50
 
@@ -212,7 +212,7 @@ Full chain definition, REST endpoints, URL parsing, Code Connect snippet rules,
212
212
 
213
213
  ### Figma Access by Phase (pipeline-wide BLOCKING, v9.0.0)
214
214
 
215
- Per Locked decision 30 of `/multi-agent:analysis` and the parallel rule in `$HOME/.claude/rules/figma-pipeline.md`, Figma MCP / REST is allowed only in the analysis phase. Phase 2 through Phase 7 in every orchestrator mode (including `--dev`, `--local`, `--autopilot` combinations) consume the analysis document + repo Code Connect mappings.
215
+ Per Locked decision 30 of `/multi-agent:analysis` and the parallel rule in `$HOME/.claude/rules/figma-pipeline.md`, Figma MCP / REST is allowed only in the analysis phase. Phase 2 through Phase 7 in every orchestrator mode (Full or Short, `--local`, autopilot) consume the analysis document + repo Code Connect mappings.
216
216
 
217
217
  | Phase | MCP | REST | Sole design source |
218
218
  |---|---|---|---|
@@ -73,10 +73,12 @@ Phases by mode:
73
73
 
74
74
  | Mode | Phases |
75
75
  |---|---|
76
- | Full pipeline | 0,1,2,3,4,5,6,7 |
77
- | `--dev` | 0,3,4,5,6,7 |
78
- | `--dev autopilot`, `--dev local`, `--dev local autopilot` | 0,3,4,6,7 (Phase 5 interactive test gate dropped) |
79
- | `--autopilot` | same as full pipeline, with confirmations skipped |
76
+ | `/multi-agent` | 0,1,2,3,4,5,6,7 |
77
+ | `/multi-agent:local` | 0,1,2,3,4,6,7 (Phase 5 User Test needs a worktree checkout; local has none) |
78
+ | `/multi-agent:autopilot`, `/multi-agent:local-autopilot` | 0,1,2,3,4,6,7 (always Full; autopilot drops the interactive Phase 5 gate) |
79
+ | `/multi-agent:analysis` | 0,1,2,4,6,7 (no code is written, so no Dev and no Test) |
80
+
81
+ What changed in v16.0.0: the two picker entries (`/multi-agent`, `:local`) register their FULL set even when the run turns out to be Short, and there is a timing reason. The tracker boots at Step -1, the first thing in every run, while the depth picker cannot run before Step 7.5 - its recommendation needs `taskType`, which needs the fetched issue and the branch. So Phases 1 and 2 are registered `pending` like any other and flipped to `skipped` at 7.5 if Short is chosen. See "Late skip" below.
80
82
 
81
83
  Register each phase:
82
84
 
@@ -107,7 +109,7 @@ The `tasklist_id` meta field is persisted so that `:resume` can rebuild the Task
107
109
 
108
110
  > **All TaskCreate calls for the active mode's phase set MUST fire in strict phase-number order BEFORE any TaskUpdate is applied. No "pre-mark skipped phases as completed before Phase 0" reasoning is permitted - even when the agent knows in advance that a phase will be skipped.**
109
111
 
110
- Why: an agent reasoning "this is a `--dev` task, so phases 1/2/4 will be skipped - let me TaskCreate them as completed first" produces tile IDs `1, 2, 3, ...` for phases 1/2/4, then the Phase 0 tile gets ID `4` and visually drops below them. The user sees `1, 2, 4 ✓ · 0 ▶ · 3 ☐ · ...` instead of `0 ▶ · 1 ✓ · 2 ✓ · 3 ☐ · 4 ✓ · ...`.
112
+ Why: an agent reasoning "the user picked Short, so phases 1/2 will be skipped - let me TaskCreate them as completed first" produces tile IDs `1, 2, 3, ...` for phases 1/2/4, then the Phase 0 tile gets ID `4` and visually drops below them. The user sees `1, 2, 4 ✓ · 0 ▶ · 3 ☐ · ...` instead of `0 ▶ · 1 ✓ · 2 ✓ · 3 ☐ · 4 ✓ · ...`.
111
113
 
112
114
  The correct sequence is **always**:
113
115
 
@@ -135,14 +137,31 @@ Mode-specific phase sets:
135
137
 
136
138
  | Mode | TaskCreate set (in order) |
137
139
  |---|---|
138
- | Full interactive (`/multi-agent`) | 0 → 1 → 2 → 3 → 4 → 5 → 6 → 7 (all 8) |
139
- | `:autopilot`, `:local`, `:local-autopilot` | 0 → 1 → 2 → 3 → 4 → 6 → 7 (7 phases - the interactive Phase 5 test gate is dropped in every autopilot/local variant) |
140
- | `:dev` | 0 → 3 → 4 → 5 → 6 → 7 (6 phases - 1/2 omitted entirely) |
141
- | `:dev-autopilot`, `:dev-local`, `:dev-local-autopilot` | 0 → 3 → 4 → 6 → 7 (5 phases - 1/2/5 omitted entirely; the autopilot/local variants drop the interactive Phase 5 test gate) |
140
+ | `/multi-agent` | 0 → 1 → 2 → 3 → 4 → 5 → 6 → 7 (all 8; 1 and 2 flip to skipped at Step 7.5 if the user picks Short) |
141
+ | `:local` | 0 → 1 → 2 → 3 → 4 → 6 → 7 (same late skip; Phase 5 is not in the set at all) |
142
+ | `:autopilot`, `:local-autopilot` | 0 → 1 → 2 → 3 → 4 → 6 → 7 (7 phases - always Full, and the interactive Phase 5 gate is dropped) |
143
+ | `:analysis` | 0 → 1 → 2 → 4 → 6 → 7 (6 phases - no code is written, so 3 and 5 are not in the set) |
144
+
145
+ A phase outside the mode's set gets no TaskCreate at all; the `[SKIPPED]` pattern applies only to a phase that IS in the set and short-circuits at runtime. Phase 4 is in every mode's set as of v14.0.0. The authoritative per-mode set is the `for p in ...` init block in each mode's own entry doc, generated by `gen-mode-dispatch.mjs`; this table mirrors those blocks.
146
+
147
+ #### Late skip - the depth picker
148
+
149
+ The two picker entries cannot know their phase set at Step -1, and the ordering rule above forbids pre-marking. The contract already has the answer, and it is the only permitted one: register the tile in order with the default `pending` status, then flip it when the phase actually short-circuits.
150
+
151
+ ```text
152
+ # Step -1, before anything else: all eight, in order, all pending
153
+ TaskCreate(Phase 0) ... TaskCreate(Phase 7)
154
+
155
+ # Step 7.5, after the depth answer. Short only:
156
+ TaskUpdate(taskId₁, status="completed", activeForm="[SKIPPED]")
157
+ TaskUpdate(taskId₂, status="completed", activeForm="[SKIPPED]")
158
+ bash $HOME/.claude/scripts/phase-tracker.sh update 1 skipped
159
+ bash $HOME/.claude/scripts/phase-tracker.sh update 2 skipped
160
+ ```
142
161
 
143
- Note: in `--dev` modes the omitted phases (1, 2 - plus 5 in the autopilot/local variants) **do not get TaskCreate calls at all** - they're not part of the mode's phase set. Phase 4 is in every mode's set as of v14.0.0, so it is always registered. The "[SKIPPED]" pattern above only applies if a phase that IS in the set is conditionally skipped at runtime. The authoritative per-mode set is the `for p in ...` init block in each mode's own entry doc, generated by `gen-mode-dispatch.mjs`; this table mirrors those blocks.
162
+ Order holds because every tile was created before any update. Nothing is pre-marked: at creation time the run genuinely does not know, and the flip happens at the moment it learns.
144
163
 
145
- **Enforcement**: `smoke-tasklist-ordering.sh` scans the dispatcher (`commands/multi-agent/SKILL.md`) and every mode entry point doc (`commands/multi-agent/{dev,autopilot,local,local-autopilot,dev-autopilot,dev-local,dev-local-autopilot,resume-local}/SKILL.md` + the Copilot full-inline orchestrator mirror) for the explicit "in phase-number order" rule. Inventory drift fails the smoke.
164
+ **Enforcement**: `smoke-tasklist-ordering.sh` scans the dispatcher (`commands/multi-agent/SKILL.md`) and every mode entry point doc (`commands/multi-agent/{autopilot,local,local-autopilot,analysis,resume-local}/SKILL.md` + the Copilot full-inline orchestrator mirror) for the explicit "in phase-number order" rule. Inventory drift fails the smoke.
146
165
 
147
166
  ### Other CLIs - call render after every state change
148
167
 
@@ -208,12 +227,12 @@ Throttling rules: mirror only canonical-set lines (`verbose`-tier internals are
208
227
 
209
228
  ### Delegated phases - mirror limitation + chunked dispatch (required)
210
229
 
211
- When a phase's work is delegated to a subagent (Phase 3 Dev on Opus in `--dev` modes, `create-component` plugin dispatch, Phase 1 explorers, Phase 4 reviewers), the visual channel freezes for the duration of the Agent call: the orchestrator is blocked while the call is in flight, so it cannot fire `TaskUpdate` / `now` / `tokens`, and a subagent cannot drive the parent session's TaskList (its own TaskCreate/TaskUpdate calls land on an invisible child list). The progress-line mirror above can therefore only fire while the orchestrator holds control. Rules:
230
+ When a phase's work is delegated to a subagent (Phase 3 Dev on Opus in a Short run, `create-component` plugin dispatch, Phase 1 explorers, Phase 4 reviewers), the visual channel freezes for the duration of the Agent call: the orchestrator is blocked while the call is in flight, so it cannot fire `TaskUpdate` / `now` / `tokens`, and a subagent cannot drive the parent session's TaskList (its own TaskCreate/TaskUpdate calls land on an invisible child list). The progress-line mirror above can therefore only fire while the orchestrator holds control. Rules:
212
231
 
213
232
  1. **Pre-dispatch marker.** Immediately before every Agent call, set the active-phase line to the delegation itself, so the frozen interval at least states what is running and on which model:
214
233
  - Claude Code: `TaskUpdate({activeForm: "Dev subagent (opus): <task subject>"})`
215
234
  - Other CLIs: `phase-tracker.sh now <N> "dev subagent (opus): <task subject>"`
216
- 2. **Chunk long delegations.** A phase whose delegated work spans multiple tasks MUST NOT go out as one monolithic Agent call. Dispatch per task (the Phase 2 task graph, or in `--dev` mode the self-generated task list, is the natural chunk boundary) so the orchestrator regains control at each boundary and refreshes `activeForm`, `tokens`, and `now` between chunks. Single-task phases and inherently atomic dispatches (one reviewer, one explorer) are exempt.
235
+ 2. **Chunk long delegations.** A phase whose delegated work spans multiple tasks MUST NOT go out as one monolithic Agent call. Dispatch per task (the Phase 2 task graph, or in a Short run the self-generated task list, is the natural chunk boundary) so the orchestrator regains control at each boundary and refreshes `activeForm`, `tokens`, and `now` between chunks. Single-task phases and inherently atomic dispatches (one reviewer, one explorer) are exempt.
217
236
  3. **Post-chunk accounting.** When each chunk returns, record its token estimate (`phase-tracker.sh tokens <N> <in> <out>`) before dispatching the next chunk - not accumulated once at phase end.
218
237
 
219
238
  ### 5. Token accounting - automatic (manual top-up optional)
@@ -64,7 +64,7 @@ Autopilot in Phase 7 pauses at the channels menu (per modes.md contract) - if
64
64
 
65
65
  ## Legacy prompt + preference flow (pre-v5.7, still supported for backward compat)
66
66
 
67
- Interactive path (normal / `--dev`), ONLY when the schema lacks `wikiScope` - ask with a native `AskUserQuestion` picker (never a typed y/n):
67
+ Interactive path (any interactive run, Full or Short), ONLY when the schema lacks `wikiScope` - ask with a native `AskUserQuestion` picker (never a typed y/n):
68
68
 
69
69
  - `question`: "Generate component wiki docs?" (rendered in `outputLanguage`)
70
70
  - `header`: "Wiki" (English, <=12 chars)
@@ -92,7 +92,7 @@ Explicit logs help the developer understand why wiki did or did not run:
92
92
  - `figmaConfig` missing entirely → log `Phase 7: wiki skipped (no figma-config for this project)`.
93
93
  - User declined at prompt → log `Phase 7: wiki skipped by user`.
94
94
  - Autopilot with `wikiDefault=false` → log `Phase 7: wiki skipped (autopilot + wikiDefault=false)`.
95
- - `--dev` mode: DO prompt - wiki is cheap and keeps docs fresh on fast paths; skip only if user says no.
95
+ - Short run: DO prompt - wiki is cheap and keeps docs fresh on the fast path; skip only if the user says no.
96
96
 
97
97
  ## Success log
98
98
 
@@ -179,7 +179,7 @@
179
179
  "onlyDevelop": {
180
180
  "type": "boolean",
181
181
  "default": false,
182
- "description": "--dev flag - phases 1 and 2 are skipped. Phase 4 Review runs (v14.0.0+); Phase 5 is skipped only in the autopilot/local variants, which drop the interactive test gate."
182
+ "description": "Short pipeline - phases 1 and 2 are skipped. Set by the Phase 0 Step 7.5 depth picker as of v16.0.0 (it was the --dev flag before); the key and every reader of it are unchanged. Phase 4 Review still runs (v14.0.0+). Always false in an autopilot run, which never asks the depth question."
183
183
  },
184
184
  "localMode": {
185
185
  "type": "boolean",
@@ -448,7 +448,7 @@
448
448
  "type": "integer",
449
449
  "minimum": 0,
450
450
  "maximum": 2,
451
- "description": "v5.3.0 Phase 2 Plan Approval Gate - number of clarification question/answer rounds the orchestrator ran before producing the first plan. Cap 2; hitting the cap produces a 'best-effort' plan instead of asking more questions. Only emitted in normal mode (skipped for --dev, autopilot, --dev autopilot)."
451
+ "description": "v5.3.0 Phase 2 Plan Approval Gate - number of clarification question/answer rounds the orchestrator ran before producing the first plan. Cap 2; hitting the cap produces a 'best-effort' plan instead of asking more questions. Only emitted on a Full interactive run (a Short run has no plan, autopilot may not ask)."
452
452
  },
453
453
  "clarificationQuestions": {
454
454
  "type": "array",
@@ -472,7 +472,7 @@
472
472
  "planApprovedAt": {
473
473
  "type": ["string", "null"],
474
474
  "format": "date-time",
475
- "description": "v5.3.0 Phase 2 Plan Approval Gate - timestamp when the user approved the plan. Null when the gate is not applicable (--dev, autopilot, --dev autopilot) or the task was aborted at the gate."
475
+ "description": "v5.3.0 Phase 2 Plan Approval Gate - timestamp when the user approved the plan. Null when the gate is not applicable (Short run, or autopilot) or the task was aborted at the gate."
476
476
  },
477
477
  "planEditRequests": {
478
478
  "type": "array",
@@ -69,6 +69,23 @@
69
69
  "minLength": 20,
70
70
  "description": "≤200 word plain-language summary for Phase 2 planning + user approval."
71
71
  },
72
+ "docStatus": {
73
+ "type": "string",
74
+ "enum": ["produced", "reused", "not-applicable"],
75
+ "description": "v15.17+ - what Phase 1 Step 4 did about the analysis document. `produced` wrote it, `reused` matched an existing evidence_digest (Locked 27), `not-applicable` means the task needs none (bugfix/chore with no Figma reference). Phase 2 and Phase 3 pre-flights branch on this instead of guessing from the filesystem, and `not-applicable` is a legitimate skip rather than an abort."
76
+ },
77
+ "docPath": {
78
+ "type": "array",
79
+ "items": { "type": "string" },
80
+ "description": "v15.17+ - paths of the produced or reused per-platform documents, one per platform. Empty when docStatus is not-applicable.",
81
+ "default": []
82
+ },
83
+ "openQuestions": {
84
+ "type": "array",
85
+ "items": { "type": "object" },
86
+ "description": "v15.17+ - Section 20 rows still open after the post-analysis confirmation pass. Phase 4 flags any remaining row as review_blocking.",
87
+ "default": []
88
+ },
72
89
  "priorArt": {
73
90
  "type": "array",
74
91
  "description": "Advisory only. Up to 3 similar past-task triage matches injected AFTER the explorer returns (priorArtEnrichment). Not produced by the explorer and never required; present so the enriched object still validates under additionalProperties:false.",