@mmerterden/multi-agent-pipeline 20.36.0 → 20.37.1

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 (222) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/docs/facts.json +2 -2
  3. package/docs/features.md +1 -1
  4. package/docs/recovery-guide.md +1 -1
  5. package/install/catalog-history.json +1 -1
  6. package/manifest.json +225 -148
  7. package/package.json +1 -1
  8. package/pipeline/commands/multi-agent/SKILL.md +33 -154
  9. package/pipeline/commands/multi-agent/analysis/SKILL.md +14 -68
  10. package/pipeline/commands/multi-agent/analysis-jira/SKILL.md +5 -8
  11. package/pipeline/commands/multi-agent/autopilot-on/SKILL.md +38 -109
  12. package/pipeline/commands/multi-agent/channels/SKILL.md +38 -167
  13. package/pipeline/commands/multi-agent/complaint-analysis/SKILL.md +37 -144
  14. package/pipeline/commands/multi-agent/design-check/SKILL.md +27 -131
  15. package/pipeline/commands/multi-agent/garbage-collect/SKILL.md +22 -48
  16. package/pipeline/commands/multi-agent/ios-coding-standard/SKILL.md +37 -180
  17. package/pipeline/commands/multi-agent/jira/SKILL.md +16 -46
  18. package/pipeline/commands/multi-agent/manual-test/SKILL.md +12 -7
  19. package/pipeline/commands/multi-agent/refactor/SKILL.md +23 -184
  20. package/pipeline/commands/multi-agent/resume/SKILL.md +30 -136
  21. package/pipeline/commands/multi-agent/review/SKILL.md +24 -199
  22. package/pipeline/commands/multi-agent/setup/SKILL.md +25 -181
  23. package/pipeline/commands/multi-agent/stack/SKILL.md +9 -53
  24. package/pipeline/commands/multi-agent/status/SKILL.md +13 -2
  25. package/pipeline/commands/multi-agent/store-ready/SKILL.md +27 -226
  26. package/pipeline/commands/multi-agent/sync/SKILL.md +35 -164
  27. package/pipeline/commands/multi-agent/test-gen/SKILL.md +2 -4
  28. package/pipeline/commands/multi-agent/update/SKILL.md +18 -60
  29. package/pipeline/contract/CHANGELOG.md +9 -0
  30. package/pipeline/contract/fixtures/error-invalid-request.json +1 -1
  31. package/pipeline/contract/fixtures/error-unauthorized.json +1 -1
  32. package/pipeline/contract/fixtures/error-unsigned.json +1 -1
  33. package/pipeline/contract/fixtures/runs-awaiting-question.json +1 -1
  34. package/pipeline/contract/fixtures/runs-empty.json +1 -1
  35. package/pipeline/contract/fixtures/runs-failed.json +1 -1
  36. package/pipeline/contract/fixtures/runs-pr-opened-redacted.json +1 -1
  37. package/pipeline/contract/fixtures/runs-pr-opened.json +1 -1
  38. package/pipeline/contract/fixtures/runs-running.json +1 -1
  39. package/pipeline/contract/manifest.json +5 -5
  40. package/pipeline/contract/types/index.d.ts +3 -2
  41. package/pipeline/multi-agent-refs/audit-guide.md +20 -0
  42. package/pipeline/multi-agent-refs/autopilot-on/details.md +148 -0
  43. package/pipeline/multi-agent-refs/channels/generator.md +14 -0
  44. package/pipeline/multi-agent-refs/channels/preview.md +13 -0
  45. package/pipeline/multi-agent-refs/channels/reference.md +46 -0
  46. package/pipeline/multi-agent-refs/complaint-analysis/phases.md +159 -0
  47. package/pipeline/multi-agent-refs/design-check/export.md +1 -0
  48. package/pipeline/multi-agent-refs/design-check/init-inventory.md +1 -1
  49. package/pipeline/multi-agent-refs/design-check/scope-and-ledger.md +64 -0
  50. package/pipeline/multi-agent-refs/features/analysis-command-notes.md +53 -0
  51. package/pipeline/multi-agent-refs/features/commit-multi-repo.md +63 -0
  52. package/pipeline/multi-agent-refs/features/dev-multi-repo.md +51 -0
  53. package/pipeline/multi-agent-refs/features/test-gap.md +40 -0
  54. package/pipeline/multi-agent-refs/features/worktree-finalize.md +1 -1
  55. package/pipeline/multi-agent-refs/garbage-collect/phases.md +60 -0
  56. package/pipeline/multi-agent-refs/ios-coding-standard/plan.md +71 -0
  57. package/pipeline/multi-agent-refs/ios-coding-standard/resolve-and-scan.md +135 -0
  58. package/pipeline/multi-agent-refs/jira/picker-detail.md +71 -0
  59. package/pipeline/multi-agent-refs/orchestrator/copilot-pipeline.md +88 -0
  60. package/pipeline/multi-agent-refs/orchestrator/dispatcher.md +96 -1
  61. package/pipeline/multi-agent-refs/orchestrator/phase-3-user-test.md +12 -9
  62. package/pipeline/multi-agent-refs/phases/phase-1-plan.md +4 -4
  63. package/pipeline/multi-agent-refs/phases/phase-2-dev.md +8 -47
  64. package/pipeline/multi-agent-refs/phases/phase-3-review.md +21 -65
  65. package/pipeline/multi-agent-refs/phases/phase-4-commit.md +9 -59
  66. package/pipeline/multi-agent-refs/phases/phase-5-report.md +0 -31
  67. package/pipeline/multi-agent-refs/refactor/sweep.md +190 -0
  68. package/pipeline/multi-agent-refs/resume/details.md +115 -2
  69. package/pipeline/multi-agent-refs/review/inputs.md +33 -1
  70. package/pipeline/multi-agent-refs/review/module-guides.md +9 -1
  71. package/pipeline/multi-agent-refs/review/panel.md +75 -0
  72. package/pipeline/multi-agent-refs/review/valven.md +5 -1
  73. package/pipeline/multi-agent-refs/rules.md +1 -1
  74. package/pipeline/multi-agent-refs/setup/hooks-and-plugins.md +4 -0
  75. package/pipeline/multi-agent-refs/setup/token-save-flow.md +13 -0
  76. package/pipeline/multi-agent-refs/stack/background.md +72 -0
  77. package/pipeline/multi-agent-refs/store-ready/gates.md +139 -0
  78. package/pipeline/multi-agent-refs/store-ready/report.md +40 -2
  79. package/pipeline/multi-agent-refs/sync/office.md +10 -0
  80. package/pipeline/multi-agent-refs/sync/overview.md +61 -0
  81. package/pipeline/multi-agent-refs/sync/repo.md +91 -0
  82. package/pipeline/multi-agent-refs/update/details.md +83 -0
  83. package/pipeline/office/index.html +6 -3
  84. package/pipeline/office/toolkit.json +1 -1
  85. package/pipeline/rules/figma-pipeline.md +6 -3
  86. package/pipeline/schemas/prefs.schema.json +1 -1
  87. package/pipeline/schemas/runs-index.schema.json +2 -1
  88. package/pipeline/scripts/_memory-policy.mjs +27 -5
  89. package/pipeline/scripts/checkpoint-fold.sh +59 -0
  90. package/pipeline/scripts/contract-server.mjs +1 -1
  91. package/pipeline/scripts/gate-ledger.mjs +1 -1
  92. package/pipeline/scripts/office-control.mjs +41 -15
  93. package/pipeline/scripts/offload-ref.sh +1 -1
  94. package/pipeline/scripts/rework-rulings.mjs +5 -3
  95. package/pipeline/scripts/runs-index.mjs +34 -7
  96. package/pipeline/scripts/scope-check-gate.mjs +15 -2
  97. package/pipeline/scripts/status-overview.mjs +401 -0
  98. package/pipeline/scripts/user-test-handoff.sh +203 -0
  99. package/pipeline/scripts/validate-planning.mjs +5 -3
  100. package/pipeline/scripts/validate-triage.mjs +2 -1
  101. package/pipeline/scripts/write-state.mjs +13 -4
  102. package/pipeline/skills/.skill-manifest.json +64 -64
  103. package/pipeline/skills/shared/core/apple-archive-compliance/SKILL.md +7 -70
  104. package/pipeline/skills/shared/core/apple-archive-compliance/references/examples.md +67 -0
  105. package/pipeline/skills/shared/core/apple-archive-compliance/references/version-history.md +8 -0
  106. package/pipeline/skills/shared/core/google-play-compliance/SKILL.md +10 -72
  107. package/pipeline/skills/shared/core/google-play-compliance/references/examples.md +69 -0
  108. package/pipeline/skills/shared/core/google-play-compliance/references/notes.md +7 -0
  109. package/pipeline/skills/shared/core/google-play-compliance/references/version-history.md +5 -0
  110. package/pipeline/skills/shared/core/multi-agent/SKILL.md +39 -262
  111. package/pipeline/skills/shared/core/multi-agent-autopilot-on/SKILL.md +35 -73
  112. package/pipeline/skills/shared/core/multi-agent-channels/SKILL.md +37 -337
  113. package/pipeline/skills/shared/core/multi-agent-design-check/SKILL.md +27 -122
  114. package/pipeline/skills/shared/core/multi-agent-help/SKILL.md +8 -340
  115. package/pipeline/skills/shared/core/multi-agent-ios-coding-standard/SKILL.md +37 -180
  116. package/pipeline/skills/shared/core/multi-agent-manual-test/SKILL.md +12 -7
  117. package/pipeline/skills/shared/core/multi-agent-refactor/SKILL.md +23 -184
  118. package/pipeline/skills/shared/core/multi-agent-review/SKILL.md +14 -82
  119. package/pipeline/skills/shared/core/multi-agent-setup/SKILL.md +25 -277
  120. package/pipeline/skills/shared/core/multi-agent-status/SKILL.md +13 -2
  121. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +73 -217
  122. package/pipeline/skills/shared/external/alarmkit/SKILL.md +11 -162
  123. package/pipeline/skills/shared/external/alarmkit/references/alarmkit-code.md +257 -0
  124. package/pipeline/skills/shared/external/android-architecture/SKILL.md +7 -58
  125. package/pipeline/skills/shared/external/android-architecture/references/code-examples.md +68 -0
  126. package/pipeline/skills/shared/external/app-intents/SKILL.md +3 -45
  127. package/pipeline/skills/shared/external/app-intents/references/code-examples.md +54 -0
  128. package/pipeline/skills/shared/external/app-store-optimization/SKILL.md +5 -81
  129. package/pipeline/skills/shared/external/app-store-optimization/references/engagement-and-localization.md +96 -0
  130. package/pipeline/skills/shared/external/app-store-review/SKILL.md +6 -112
  131. package/pipeline/skills/shared/external/app-store-review/references/monetization-and-submission.md +138 -0
  132. package/pipeline/skills/shared/external/apple-on-device-ai/SKILL.md +10 -117
  133. package/pipeline/skills/shared/external/apple-on-device-ai/references/foundation-models-code.md +186 -0
  134. package/pipeline/skills/shared/external/authentication/SKILL.md +3 -50
  135. package/pipeline/skills/shared/external/authentication/references/code-examples.md +59 -0
  136. package/pipeline/skills/shared/external/callkit-voip/SKILL.md +3 -84
  137. package/pipeline/skills/shared/external/callkit-voip/references/code-examples.md +93 -0
  138. package/pipeline/skills/shared/external/ci-cd-pipelines/SKILL.md +7 -263
  139. package/pipeline/skills/shared/external/ci-cd-pipelines/references/pipeline-examples.md +281 -0
  140. package/pipeline/skills/shared/external/clean-code/SKILL.md +8 -41
  141. package/pipeline/skills/shared/external/clean-code/references/code-examples.md +56 -0
  142. package/pipeline/skills/shared/external/cloudkit-sync/SKILL.md +8 -146
  143. package/pipeline/skills/shared/external/cloudkit-sync/references/cloudkit-code.md +214 -0
  144. package/pipeline/skills/shared/external/compose-components/SKILL.md +6 -80
  145. package/pipeline/skills/shared/external/compose-components/references/code-examples.md +89 -0
  146. package/pipeline/skills/shared/external/compose-navigation/SKILL.md +5 -64
  147. package/pipeline/skills/shared/external/compose-navigation/references/code-examples.md +70 -0
  148. package/pipeline/skills/shared/external/core-data/SKILL.md +9 -157
  149. package/pipeline/skills/shared/external/core-data/references/core-data-code.md +221 -0
  150. package/pipeline/skills/shared/external/core-nfc/SKILL.md +3 -89
  151. package/pipeline/skills/shared/external/core-nfc/references/code-examples.md +98 -0
  152. package/pipeline/skills/shared/external/coreml/SKILL.md +17 -133
  153. package/pipeline/skills/shared/external/coreml/references/coreml-code.md +208 -0
  154. package/pipeline/skills/shared/external/css-modern/SKILL.md +8 -131
  155. package/pipeline/skills/shared/external/css-modern/references/code-examples.md +142 -0
  156. package/pipeline/skills/shared/external/database-patterns/SKILL.md +6 -103
  157. package/pipeline/skills/shared/external/database-patterns/references/orm-examples.md +112 -0
  158. package/pipeline/skills/shared/external/html-semantic/SKILL.md +7 -48
  159. package/pipeline/skills/shared/external/html-semantic/references/code-examples.md +54 -0
  160. package/pipeline/skills/shared/external/humanizer/SKILL.md +6 -19
  161. package/pipeline/skills/shared/external/humanizer/references/voice.md +24 -0
  162. package/pipeline/skills/shared/external/ios-accessibility/SKILL.md +13 -170
  163. package/pipeline/skills/shared/external/ios-accessibility/references/assistive-tech-review.md +224 -0
  164. package/pipeline/skills/shared/external/ios-localization/SKILL.md +2 -24
  165. package/pipeline/skills/shared/external/ios-localization/references/code-examples.md +30 -0
  166. package/pipeline/skills/shared/external/ios-networking/SKILL.md +3 -58
  167. package/pipeline/skills/shared/external/ios-networking/references/code-examples.md +67 -0
  168. package/pipeline/skills/shared/external/ios-security/SKILL.md +4 -64
  169. package/pipeline/skills/shared/external/ios-security/references/code-examples.md +74 -0
  170. package/pipeline/skills/shared/external/live-activities/SKILL.md +4 -90
  171. package/pipeline/skills/shared/external/live-activities/references/code-examples.md +108 -0
  172. package/pipeline/skills/shared/external/localization-reuse-map/SKILL.md +9 -23
  173. package/pipeline/skills/shared/external/localization-reuse-map/references/project-settings.md +22 -0
  174. package/pipeline/skills/shared/external/mapkit-location/SKILL.md +5 -95
  175. package/pipeline/skills/shared/external/mapkit-location/references/code-examples.md +117 -0
  176. package/pipeline/skills/shared/external/nextjs-app-router/SKILL.md +7 -106
  177. package/pipeline/skills/shared/external/nextjs-app-router/references/app-router-examples.md +124 -0
  178. package/pipeline/skills/shared/external/permissionkit/SKILL.md +2 -31
  179. package/pipeline/skills/shared/external/permissionkit/references/code-examples.md +37 -0
  180. package/pipeline/skills/shared/external/play-store-review/SKILL.md +6 -74
  181. package/pipeline/skills/shared/external/play-store-review/references/signing-and-policies.md +83 -0
  182. package/pipeline/skills/shared/external/push-notifications/SKILL.md +8 -125
  183. package/pipeline/skills/shared/external/push-notifications/references/notification-code.md +176 -0
  184. package/pipeline/skills/shared/external/python-patterns/SKILL.md +7 -158
  185. package/pipeline/skills/shared/external/python-patterns/references/python-examples.md +176 -0
  186. package/pipeline/skills/shared/external/rest-api-design/SKILL.md +7 -157
  187. package/pipeline/skills/shared/external/rest-api-design/references/api-examples.md +175 -0
  188. package/pipeline/skills/shared/external/swift-architecture/SKILL.md +11 -230
  189. package/pipeline/skills/shared/external/swift-architecture/references/pattern-examples.md +295 -0
  190. package/pipeline/skills/shared/external/swift-codable/SKILL.md +17 -149
  191. package/pipeline/skills/shared/external/swift-codable/references/codable-recipes.md +207 -0
  192. package/pipeline/skills/shared/external/swift-concurrency/SKILL.md +12 -99
  193. package/pipeline/skills/shared/external/swift-concurrency/references/code-examples.md +100 -0
  194. package/pipeline/skills/shared/external/swift-concurrency/references/swift-6-2-additions.md +18 -0
  195. package/pipeline/skills/shared/external/swift-formatstyle/SKILL.md +9 -78
  196. package/pipeline/skills/shared/external/swift-formatstyle/references/formatstyle-examples.md +113 -0
  197. package/pipeline/skills/shared/external/swift-language/SKILL.md +3 -56
  198. package/pipeline/skills/shared/external/swift-language/references/code-examples.md +65 -0
  199. package/pipeline/skills/shared/external/swift-testing-pro/SKILL.md +1 -0
  200. package/pipeline/skills/shared/external/swiftdata/SKILL.md +6 -122
  201. package/pipeline/skills/shared/external/swiftdata/references/code-examples.md +140 -0
  202. package/pipeline/skills/shared/external/swiftui-uikit-interop/SKILL.md +12 -139
  203. package/pipeline/skills/shared/external/swiftui-uikit-interop/references/interop-code.md +198 -0
  204. package/pipeline/skills/shared/external/tailwind-css/SKILL.md +9 -81
  205. package/pipeline/skills/shared/external/tailwind-css/references/code-examples.md +91 -0
  206. package/pipeline/skills/shared/external/testing-backend/SKILL.md +7 -207
  207. package/pipeline/skills/shared/external/testing-backend/references/testing-examples.md +225 -0
  208. package/pipeline/skills/shared/external/typescript-patterns/SKILL.md +8 -89
  209. package/pipeline/skills/shared/external/typescript-patterns/references/code-examples.md +100 -0
  210. package/pipeline/skills/shared/external/vision-framework/SKILL.md +2 -20
  211. package/pipeline/skills/shared/external/vision-framework/references/code-examples.md +26 -0
  212. package/pipeline/skills/shared/external/vue-composition/SKILL.md +7 -169
  213. package/pipeline/skills/shared/external/vue-composition/references/vue-examples.md +187 -0
  214. package/pipeline/skills/shared/external/web-accessibility/SKILL.md +7 -174
  215. package/pipeline/skills/shared/external/web-accessibility/references/a11y-examples.md +192 -0
  216. package/pipeline/skills/shared/external/web-performance/SKILL.md +8 -66
  217. package/pipeline/skills/shared/external/web-performance/references/code-examples.md +77 -0
  218. package/pipeline/skills/shared/external/web-testing/SKILL.md +11 -186
  219. package/pipeline/skills/shared/external/web-testing/references/testing-examples.md +213 -0
  220. /package/pipeline/skills/shared/external/localization-reuse-map/{reference → references}/format-and-output.md +0 -0
  221. /package/pipeline/skills/shared/external/localization-reuse-map/{reference → references}/publish-and-snapshot.md +0 -0
  222. /package/pipeline/skills/shared/external/localization-reuse-map/{reference → references}/sources-and-recipes.md +0 -0
@@ -12,184 +12,77 @@ confirm: none
12
12
 
13
13
  **Input**: $ARGUMENTS (optional run name, optional `--file <path>`, optional Jira ids / Jira URLs / Confluence URLs; remaining free text is treated as pasted complaints)
14
14
 
15
- Triage of customer-reported errors across the layers the team owns (client apps + BFFs). Per complaint: Graylog log evidence by trx/conversation id, read-only repo correlation, and a verdict. **Core failures get a routing recommendation, never a fix analysis.**
15
+ Triage of customer-reported errors across the layers the team owns (client apps + BFFs): Graylog evidence by trx/conversation id, read-only repo correlation, a verdict per complaint. **Core failures get a routing recommendation, never a fix analysis.**
16
16
 
17
- **Side-effect contract**: may write a local markdown report, post a Confluence page, or add a Jira comment/description - but **never** creates branches, worktrees, commits, or PRs. Stops at the report.
17
+ **Side-effect contract**: may write a local markdown report, post a Confluence page, or add a Jira comment - but **never** creates branches, worktrees, commits, or PRs. Stops at the report.
18
18
 
19
- > **Language**: Per `$HOME/.claude/multi-agent-refs/rules.md` Language Application matrix - instruction prose stays English. `AskUserQuestion.question`, `.options[].label` and `.options[].description` follow `outputLanguage`; only `header` stays English (<=12-char chip). The report body follows `outputLanguage`; Graylog excerpts, verdict tokens, and external payload metadata stay English.
19
+ > **Language**: instruction prose stays English (`$HOME/.claude/multi-agent-refs/rules.md` Language Application). `AskUserQuestion` `question` / `label` / `description` and the report body follow `outputLanguage`; `header` (<=12 chars), verdict tokens, Graylog excerpts and payload metadata stay English.
20
+
21
+ Procedures, tables, the full locked decisions and the reusable refs: `$HOME/.claude/multi-agent-refs/complaint-analysis/phases.md`. Read the section each phase names before running it.
20
22
 
21
23
  ## Locked decisions (do not re-ask)
22
24
 
23
- 1. **Graylog is primary evidence (deliberate departure).** `features/external-context-injection.md` declares Graylog advisory-only for the dev pipeline; in THIS command Graylog IS the evidence backbone. A per-complaint fetch failure still never halts the run, but that complaint's verdict is capped at `insufficient-evidence` - never fabricated.
24
- 2. **Ids are never guessed.** A complaint with no trxId and no convId enters the Phase 0 Step 5 confirmation loop: the user supplies the id(s) or explicitly marks the complaint `skip-graylog`. Empty submit is not consent (`feedback_no-inferred-defaults-from-empty-answer`); re-ask.
25
- 3. **Read-only ops command.** No worktree, branch, commit, PR, or dev chaining. Report + Stop.
26
- 4. **Redaction before any output.** Complaint text is redacted at intake (`parse-complaints.sh`, default on). Jira / Confluence-sourced complaint text passes through the same redaction (`--stdin` mode) after fetch. Raw PII never enters state, drafts, or any dispatch target.
27
- 5. **Core is a residual classification, not a repo.** Verdict `core` produces a routing recommendation only - no fix analysis, no core-repo grepping, no core code speculation.
28
- 6. **Layer mapping is user-confirmed.** Name-based layer inference (Step 3b) is a proposal; the confirmation table must be approved before Phase 1.
29
- 7. **Output default = Local file.** The Phase 4.5 picker keeps `Local file` pre-selected; Confluence and Jira are never default-selected.
30
- 8. **Humanizer punctuation policy is non-negotiable.** No em-dash, en-dash, ellipsis, curly quotes, or section sign in any emitted text. Turkish diacritics are preserved verbatim - never ASCII-fold the prose.
31
- 9. **Language split.** Report body follows `outputLanguage`; verdict tokens (`client:ios`, `bff:mobile-bff`, `core`, `insufficient-evidence`), Graylog evidence excerpts, and Confluence/Jira payload metadata stay English.
32
- 10. **Verdict citation discipline.** Every `client`/`bff` verdict cites at least one Graylog message (timestamp + source) AND one repo evidence row (`file:line`). Anything less is `insufficient-evidence`. Every `core` verdict cites the Graylog message that names the upstream service.
33
- 11. **One complaint batch per run.** Mixed batches spanning unrelated products are user error: surface it and ask to split.
34
- 12. **No auto-commit.** The local report is written to the working tree; the user commits it themselves if they want.
35
- 13. **Client/bff verdicts carry a development handoff.** Every `client`/`bff` verdict renders a fix plan grounded in the EXISTING architecture (the `repoEvidence[]` files are the reference: name the concrete files/components to touch, reuse-first, no invented structures) plus a ready-to-run dev prompt (English, one fenced block, `/multi-agent`-compatible). The handoff is part of the report - this command still never runs dev itself (Locked 3). Core and insufficient-evidence verdicts never get a fix plan (Locked 5).
25
+ 1. **Graylog is primary evidence.** A fetch failure never halts the run; it caps that complaint at `insufficient-evidence`.
26
+ 2. **Ids are never guessed.** No trxId and no convId: the user supplies one or marks `skip-graylog`. Empty submit is not consent; re-ask.
27
+ 3. **Read-only ops command.** No worktree, branch, commit, PR, or dev chaining.
28
+ 4. **Redaction before any output** (`parse-complaints.sh`, Jira / Confluence text via `--stdin`). Raw PII never enters state, drafts or any target.
29
+ 5. **Core is a residual classification, not a repo**: routing only, no fix analysis, no core-repo grepping.
30
+ 6. **Layer mapping is user-confirmed** before Phase 1.
31
+ 7. **Output default = Local file**; Confluence and Jira are never default-selected.
32
+ 8. **Humanizer punctuation policy is non-negotiable**: no em-dash, en-dash, ellipsis, curly quotes or section sign; Turkish diacritics preserved, never ASCII-folded.
33
+ 9. **Language split** as above.
34
+ 10. **Citations.** `client`/`bff` cites a Graylog message (timestamp + source) AND a `file:line`, else `insufficient-evidence`; `core` cites the message naming the upstream service.
35
+ 11. **One batch per run**; unrelated products: ask to split.
36
+ 12. **No auto-commit.**
37
+ 13. **Client/bff verdicts carry a dev handoff** (fix plan + dev prompt), never run here; other verdicts get none.
36
38
 
37
39
  ## Steps
38
40
 
39
41
  ### Phase 0 - Intake
40
42
 
41
- Sequential `AskUserQuestion` chain, answers land under `state.complaintSpec.*` (schema: `$HOME/.claude/schemas/complaint-analysis-spec.schema.json`). Step narration per `$HOME/.claude/multi-agent-refs/picker-contract.md`: print `<localized: "Step <i>/<n>: <what this step decides>">` before each picker; auto-resolved steps still print their breadcrumb.
42
-
43
- #### Step 0 - Language resolution (BLOCKING)
44
-
45
- Read `prefs.global.outputLanguage` (`tr` or `en`, default `tr`) before the first picker. Every `<localized: "...">` marker in this file is rendered in that language, never emitted literally.
46
-
47
- #### Step 1 - Run name
48
-
49
- From `$ARGUMENTS` quoted string if present, else default `complaints-<YYYYMMDD>` (announce, do not ask). Result: `state.complaintSpec.runName`.
50
-
51
- #### Step 2 - Account picker
52
-
53
- Reuse `$HOME/.claude/multi-agent-refs/_account-picker.md`. Needed for Graylog-adjacent Jira/Confluence fetches and dispatch; skipped only when the run is fully local (no Jira/Confluence input, local output only) - then `account: null`.
54
-
55
- #### Step 3 - Repo multi-select
56
-
57
- Reuse `$HOME/.claude/multi-agent-refs/_repo-picker.md` (multi-select via `~/.claude/lib/repo-cache.sh`). Guidance line in the question: <localized: "Select the client and BFF repos your team owns (e.g. ios / android / web / mobile-bff / web-bff). Core services are NOT selected - core is a triage outcome, not a repo.">
58
-
59
- #### Step 3b - Layer tagging (single confirmation table)
43
+ `AskUserQuestion` chain into `state.complaintSpec.*`, breadcrumbs per `$HOME/.claude/multi-agent-refs/picker-contract.md`. Read `phases.md` "Phase 0" first.
60
44
 
61
- Infer a layer per selected repo from its name (`ios|iphone` -> ios, `android` -> android, `web(?!.*bff)` -> web, `mobile.?bff|bff.?mobile` -> mobile-bff, `web.?bff|bff.?web` -> web-bff, else other). Present ONE AskUserQuestion with the full `repo -> layer` table in the question body: options `Approve mapping` / `Override rows`. On override, one follow-up per rejected row with the 6 layer options. Result: `state.complaintSpec.repos[] = {name, layer, localPath?, provider?}` (Locked 6).
62
-
63
- #### Step 4 - Complaint input (multi-source)
64
-
65
- Classify every `$ARGUMENTS` remainder and any pasted input via `~/.claude/lib/context-link-extractor.sh`, then collect per source type. If nothing was supplied, ask: <localized: "Paste the complaints, or give a file path (csv / xlsx / txt / json), a Jira issue, or a Confluence URL. Mixed input is fine.">
66
-
67
- | Source | Ingestion |
68
- |---|---|
69
- | File path (`--file` or detected) | `~/.claude/lib/parse-complaints.sh --file <path>` (format auto-detected; exit 5 = xlsx degrade -> surface `degradeReason`, ask for a CSV export path, re-run) |
70
- | Pasted free text | `parse-complaints.sh --stdin` (splits blocks, pre-fills ids via the shared label set) |
71
- | Jira id / URL | Fetch issue summary + description + comments via Jira REST (account token); concatenate as text blocks, pipe through `parse-complaints.sh --stdin` (Locked 4) |
72
- | Confluence URL | `~/.claude/lib/fetch-confluence.sh <url>`; page body paragraphs/table rows become text blocks, piped through `parse-complaints.sh --stdin` |
73
-
74
- Merge all outputs into one list, re-numbering ids `C-01..C-NN`. Result: `state.complaintSpec.input` + `state.complaintSpec.complaints[]`.
75
-
76
- #### Step 5 - Id confirmation loop (Locked 2)
77
-
78
- Render the parsed table (id, redacted excerpt <= 80 chars, trxId, convId, platformHint) to the user. For every complaint missing BOTH ids, one AskUserQuestion: <localized: "Complaint <id> has no trx/conversation id. Supply one, or skip Graylog for it?"> with options `Skip Graylog for this complaint` (-> `skipGraylog: true`) and Other for the id (`trx:<value>` / `conv:<value>`). Empty submit re-asks. Set `phase: "fetching_graylog"`.
45
+ 0. **Language (BLOCKING)**: read `prefs.global.outputLanguage` (default `tr`) before the first picker; every `<localized: "...">` marker renders in it, never literally.
46
+ 1. **Run name**: quoted argument, else `complaints-<YYYYMMDD>` (announce, do not ask).
47
+ 2. **Account**: `$HOME/.claude/multi-agent-refs/_account-picker.md`; `null` only for a fully local run.
48
+ 3. **Repos**: `$HOME/.claude/multi-agent-refs/_repo-picker.md`, owned client + BFF repos only.
49
+ 3b. **Layer tagging**: infer a layer per repo, ONE confirmation question with the whole table (`Approve mapping` / `Override rows`) (Locked 6).
50
+ 4. **Complaint input**: every source through `parse-complaints.sh` (Locked 4), merged as `C-01..C-NN`.
51
+ 5. **Id confirmation loop** for every complaint missing both ids (Locked 2). Then `phase: "fetching_graylog"`.
79
52
 
80
53
  ### Phase 1 - Graylog evidence fan-out
81
54
 
82
- For each complaint with at least one id and `skipGraylog: false`:
83
-
84
- ```bash
85
- ~/.claude/lib/fetch-graylog.sh --trx <trxId> --conv <convId> # pass whichever exist
86
- ```
87
-
88
- Environment defaults to `auto`: production first, the test instance (`hosts.graylogTest`) when production returns nothing or is unreachable. A customer complaint is normally a production event, but a tester-minted id only exists on test, and prod-only search reports "no logs" for both cases identically. When the intake itself says which environment a complaint came from, pin it with `--env prod` / `--env test` rather than letting the fallback decide.
89
-
90
- Record per complaint: `graylog: {status: ok|degraded|skipped, environment, totalResults, degradeReason}` plus the top messages (timestamp, source, level, message excerpt) kept in working context for Phase 2/3. Failure handling:
91
-
92
- - Exit 0 with `degraded: true` -> `status: degraded`, keep the reason, continue.
93
- - Exit 2 / 3 / 6 (credential / auth / host) -> per `$HOME/.claude/multi-agent-refs/keychain.md` non-critical rule: warn ONCE (`WARN: Graylog unavailable (<reason>); remaining complaints proceed without log evidence.`), mark this and all remaining fetches `status: degraded`, continue. Never halt (Locked 1).
94
- - `skipGraylog: true` -> `status: skipped`.
95
-
96
- **Always name the environment when citing log evidence.** `source.environment` in the fetcher payload says which instance answered; the same lines mean different things depending on whether a production complaint was corroborated by production logs or only by test ones. A complaint whose only evidence came from test is `insufficient-evidence` for a production claim, not `bff`.
97
-
98
- Set `phase: "correlating_repos"`.
55
+ `~/.claude/lib/fetch-graylog.sh --trx <trxId> --conv <convId>` per complaint with an id and no `skipGraylog`; environment `auto` unless the intake pins it (`--env prod|test`). Exit 2 / 3 / 6: warn ONCE per `$HOME/.claude/multi-agent-refs/keychain.md`, mark the rest `degraded`, continue; never halt (Locked 1). **Always name the environment when citing log evidence**; test-only evidence is `insufficient-evidence` for a production claim. Statuses and recorded fields: `phases.md` "Phase 1". Then `phase: "correlating_repos"`.
99
56
 
100
57
  ### Phase 2 - Repo evidence correlation (read-only)
101
58
 
102
- From each complaint's Graylog messages extract candidate signals: endpoint paths, error codes, exception class names, distinctive message templates, and the `source` service name. Then grep the selected repos (skip dirs: `.build`, `DerivedData`, `Pods`, `node_modules`, `.next`, `build/`, `.gradle`, `vendor/`):
103
-
104
- ```bash
105
- grep -rn --include='*.swift' --include='*.kt' --include='*.ts' --include='*.tsx' --include='*.js' --include='*.java' -E "<signal>" "$REPO_PATH"
106
- ```
107
-
108
- Bucket hits per complaint as `repoEvidence[] = {repo, layer, file, line, signal, matchKind: direct|partial}` (`direct` = exact endpoint/error-code/template match; `partial` = fuzzy/name-only). Grep only - no convention extraction, no Figma, no Swagger. Complaints with `status: degraded|skipped` still get a text-similarity pass (grep the complaint's distinctive nouns/error phrases), tagged `partial`. Set `phase: "triaging"`.
59
+ Grep the selected repos for Graylog-derived signals only; degraded or skipped complaints get a `partial` text-similarity pass. Details: `phases.md` "Phase 2". Then `phase: "triaging"`.
109
60
 
110
61
  ### Phase 3 - Triage classification
111
62
 
112
- Per complaint, in order:
113
-
114
- | Condition | Verdict |
115
- |---|---|
116
- | Graylog error originates in an owned layer: signal matched `direct` in a selected repo, OR the failing `source` maps to an owned BFF | `client:<ios|android|web>` or `bff:<mobile-bff|web-bff>` + root-cause rationale + citations (Locked 10) |
117
- | Graylog shows the failure downstream of owned layers: `source` is an unowned core service, 5xx from an upstream nobody selected owns, no repo match | `core` + routing recommendation (below) |
118
- | No/degraded Graylog AND no direct repo signal | `insufficient-evidence` + open question row |
119
-
120
- **Routing recommendation** (core only, Locked 5): `{suspectedService: <Graylog source>, endpoint, errorCode, evidenceExcerpt (EN, redacted), suggestedQueue: prefs.projects[<project>].routing.coreTeamLabel ?? null, confidence}`.
121
-
122
- Verdict shape: `verdict: {category, layer, confidence: high|medium|low, rationale}`. Ambiguous client-vs-bff attribution lowers `confidence`, never invents evidence.
123
-
124
- **Development handoff (client/bff only, Locked 13)**: for each `client`/`bff` verdict, derive from the `repoEvidence[]` rows:
125
-
126
- - **Fix plan**: 2-5 numbered steps referencing the existing architecture by `file:line` - which service/view/handler to change, what to reuse (reuse-first: prefer extending the cited components over adding new ones), which tests to add. No speculative rewrites.
127
- - **Dev prompt**: one fenced English block the user can paste into `/multi-agent` (or a Jira description): complaint summary, root cause, the cited files, the fix plan steps, and the acceptance check. Include the complaint id (`[C-NN]`) for traceability.
128
-
129
- Set `phase: "drafting"`.
63
+ Owned-layer origin -> `client:<ios|android|web>` / `bff:<mobile-bff|web-bff>`; downstream unowned failure -> `core` + routing recommendation; no evidence -> `insufficient-evidence`. Ambiguity lowers `confidence`, never invents evidence. Condition table, routing shape and the client/bff fix plan + dev prompt (Locked 13): `phases.md` "Phase 3". Then `phase: "drafting"`.
130
64
 
131
65
  ### Phase 4 - Draft, humanize, buffer
132
66
 
133
- 1. Render the report per `$HOME/.claude/multi-agent-refs/complaint-analysis-template.md` (8 fixed sections; single-language body in `outputLanguage`; verdict tokens English per Locked 9) to `/tmp/complaint-analysis-<run-slug>-<UTC-iso8601>/report.md`. Store `outputs.draftDir`.
134
- 2. **Humanizer pass (required: actually invoke the `ai-common-toolkit:humanizer` skill; the punctuation grep alone does NOT satisfy this)** with `language: <tr|en>`, `tone: technical-explanatory`, `stripFancyPunctuation: true`. Diacritics preserved (Locked 8).
135
- 3. Punctuation gate: `node $HOME/.claude/scripts/validate-complaint-doc.mjs <draft>` reports no banned-punctuation error. It checks the policy in Node; `grep -P` is absent from BSD grep and would never run.
136
- 4. Show the draft path + size to the user. Set `phase: "awaiting_output_decision"`.
67
+ 1. Render per `$HOME/.claude/multi-agent-refs/complaint-analysis-template.md` to `/tmp/complaint-analysis-<run-slug>-<UTC-iso8601>/report.md` (`outputs.draftDir`).
68
+ 2. **Humanizer pass (required: actually invoke the `ai-common-toolkit:humanizer` skill; the punctuation grep alone does NOT satisfy this)**: `language: <tr|en>`, `tone: technical-explanatory`, `stripFancyPunctuation: true` (Locked 8).
69
+ 3. `node $HOME/.claude/scripts/validate-complaint-doc.mjs <draft>` reports no banned punctuation (never `grep -P`).
70
+ 4. Show path + size; `phase: "awaiting_output_decision"`.
137
71
 
138
72
  ### Phase 4.5 - Output destination picker
139
73
 
140
- AskUserQuestion (multiSelect=true), `Local file` pre-selected (Locked 7):
141
-
142
- ```
143
- header: "Output"
144
- question: <localized: "Where should the triage report be written?">
145
- options:
146
- - label: "Local file" (description: complaints/<run-name>.md in the primary repo's working tree)
147
- - label: "Confluence page"
148
- - label: "Jira"
149
- ```
150
-
151
- Follow-ups: Confluence -> ask parent page (Other, LRU recents from `prefs.projects[<project>].confluenceUrls`); Jira -> pick from Step 4 Jira ids if any, else ask via Other. Result: `outputs.destinations[]`. Set `phase: "dispatching"`.
74
+ `AskUserQuestion` multiSelect, `header` `Output`, options `Local file` (pre-selected, Locked 7) / `Confluence page` / `Jira`; follow-ups in `phases.md` "Phase 4.5". Then `phase: "dispatching"`.
152
75
 
153
76
  ### Phase 5 - Validate, dispatch, report. Stop.
154
77
 
155
- **Pre-dispatch gate (BLOCKING)**: `node $HOME/.claude/scripts/validate-complaint-doc.mjs <draft>` - front-matter, required sections, verdict tokens per triage row, routing entry per core verdict, punctuation, redaction-leak scan. Any ERROR blocks dispatch: fix the draft, re-validate.
156
-
157
- | Target | Action |
158
- |---|---|
159
- | Local | `cp` the draft to `complaints/<run-name>.md` in the primary repo's working tree. **No commit** (Locked 12). |
160
- | Confluence | Re-humanize with `formal-stakeholder` tone; post one page under the chosen parent via `$HOME/.claude/multi-agent-refs/channels/confluence.md` + `~/.claude/lib/md2confluence-v3.py`. |
161
- | Jira | Re-humanize with `informal-technical` tone; markdown -> wiki markup per `$HOME/.claude/multi-agent-refs/channels/jira.md`; post as a comment on the chosen issue (never close/transition the issue). |
162
-
163
- Then print the summary in `outputLanguage`: complaint count, verdict counts (`X client / Y bff / Z core / W insufficient-evidence`), degraded services, output paths/URLs. When any `core` verdict exists, add: <localized: "N complaint(s) route to the core team - see the routing section before forwarding.">
78
+ **Pre-dispatch gate (BLOCKING)**: `validate-complaint-doc.mjs <draft>`; any ERROR blocks dispatch until fixed and re-validated. Local copies to `complaints/<run-name>.md` with **no commit** (Locked 12); Confluence and Jira re-humanize and post per `phases.md` "Phase 5" (a Jira issue gets a comment, never a close or transition). 401 / 403: surface it and offer Local. Print the `outputLanguage` summary (`phases.md` "Phase 5").
164
79
 
165
80
  **Stop. Do not chain into a dev run. Do not open a worktree. Do not create a branch.** Set `phase: "done"`.
166
81
 
167
82
  ### Resume contract
168
83
 
169
- `state.complaintSpec.phase`: `intake | fetching_graylog | correlating_repos | triaging | drafting | awaiting_output_decision | dispatching | reporting | done`.
170
-
171
- `/multi-agent:resume` at `awaiting_output_decision`: if `outputs.draftDir` still holds `report.md`, jump to Phase 4.5; if gone, re-render Phase 4 from state (evidence is retained). Earlier phases resume at their own boundary; Graylog results already in state are never re-fetched.
172
-
173
- ## Reusable refs
174
-
175
- | Path | Reason |
176
- |---|---|
177
- | `~/.claude/lib/parse-complaints.sh` | Phase 0 Step 4 normalization + redaction (all formats + stdin) |
178
- | `~/.claude/lib/context-link-extractor.sh` | Phase 0 Step 4 input classifier (jira / confluence / graylog id labels) |
179
- | `~/.claude/lib/fetch-graylog.sh` | Phase 1 log evidence (`--trx` / `--conv`) |
180
- | `~/.claude/lib/fetch-confluence.sh` | Phase 0 Step 4 Confluence-sourced complaints |
181
- | `$HOME/.claude/multi-agent-refs/_account-picker.md`, `_repo-picker.md`, `picker-contract.md` | Phase 0 pickers |
182
- | `$HOME/.claude/multi-agent-refs/keychain.md` | Phase 1 non-critical credential handling |
183
- | `$HOME/.claude/multi-agent-refs/complaint-analysis-template.md` | Phase 4 report template (8 sections) |
184
- | `ai-common-toolkit:humanizer` | Phase 4 tone pass |
185
- | `ai-analyst-toolkit:signal-community` | Phase 1 corroboration, optional. Advisory only: a matching report outside the company shows the complaint is not one user's device, and lands in the risks section with its link, never as a root cause. |
186
- | `$HOME/.claude/scripts/validate-complaint-doc.mjs` | Phase 5 pre-dispatch gate |
187
- | `$HOME/.claude/multi-agent-refs/channels/confluence.md`, `channels/jira.md`, `~/.claude/lib/md2confluence-v3.py` | Phase 5 dispatch |
188
- | `$HOME/.claude/schemas/complaint-analysis-spec.schema.json` | State contract |
84
+ `state.complaintSpec.phase`: `intake | fetching_graylog | correlating_repos | triaging | drafting | awaiting_output_decision | dispatching | reporting | done`. At `awaiting_output_decision`, jump to Phase 4.5 when `report.md` is still in `outputs.draftDir`, else re-render Phase 4 from state. Earlier phases resume at their own boundary. Graylog results in state are never re-fetched.
189
85
 
190
86
  ## Notes
191
87
 
192
- - Fully generic: hosts come from `prefs.global.hosts.*`, tokens from `prefs.global.keychainMapping.*`; no company name, host, or real repo name in this file.
193
- - `prefs.projects[<project>].routing.coreTeamLabel` is optional; when unset, `suggestedQueue` renders as `-` and the routing entry still stands.
194
- - If Confluence / Jira dispatch returns 401 / 403, surface the error and offer the Local fallback (the draft stays on disk).
195
- - The `complaints/` directory is not gitignored; the user commits manually if desired.
88
+ - Fully generic: hosts from `prefs.global.hosts.*`, tokens from `prefs.global.keychainMapping.*`; no company name, host, or real repo name in this file.
@@ -9,13 +9,11 @@ confirm: none
9
9
  allowed-tools: Agent, Bash, Read, Write, Edit, Glob, Grep, TaskCreate, TaskUpdate, AskUserQuestion, Skill, mcp__claude_ai_Figma__get_metadata, mcp__claude_ai_Figma__get_design_context, mcp__claude_ai_Figma__get_screenshot, mcp__multi-agent-toolkit__design_mock_detect, mcp__multi-agent-toolkit__design_scenario_inventory, mcp__multi-agent-toolkit__design_mock_launch, mcp__multi-agent-toolkit__design_ui_geometry, mcp__multi-agent-toolkit__design_visual_compare, mcp__multi-agent-toolkit__design_report, mcp__multi-agent-toolkit__ios_list_devices, mcp__multi-agent-toolkit__ios_boot_device, mcp__multi-agent-toolkit__ios_launch_app, mcp__multi-agent-toolkit__ios_terminate_app, mcp__multi-agent-toolkit__ios_screenshot, mcp__multi-agent-toolkit__ios_tap, mcp__multi-agent-toolkit__ios_swipe, mcp__multi-agent-toolkit__ios_type_text, mcp__multi-agent-toolkit__ios_open_url, mcp__multi-agent-toolkit__ios_get_ui_tree, mcp__multi-agent-toolkit__ios_status_bar, mcp__multi-agent-toolkit__ios_set_appearance, mcp__multi-agent-toolkit__ios_set_locale, mcp__multi-agent-toolkit__ios_xcodebuild, mcp__multi-agent-toolkit__ios_xcresult, mcp__multi-agent-toolkit__android_list_devices, mcp__multi-agent-toolkit__android_screenshot, mcp__multi-agent-toolkit__android_tap, mcp__multi-agent-toolkit__android_swipe, mcp__multi-agent-toolkit__android_type_text, mcp__multi-agent-toolkit__android_open_url, mcp__multi-agent-toolkit__android_launch_app, mcp__multi-agent-toolkit__android_stop_app
10
10
  ---
11
11
 
12
- # /multi-agent:design-check - Mock-mode vs Figma design audit
12
+ # /multi-agent:design-check - Mock-mode vs Figma design audit
13
13
 
14
- Local, on-device design-conformance auditor. Runs the app in a **mock mode** on a simulator / emulator and compares each screen (and every mock variant the build exposes) against its Figma design at the **pixel + geometry + typography + color** level, then produces a detailed report.
14
+ Runs the app in **mock mode** on a simulator / emulator and compares each screen and mock variant against Figma at the **pixel + geometry + typography + color** level. **Local-only**: no CI, no commits, no PR; the report goes to `~/DesignChecks/`, the worktree only isolates the Debug build.
15
15
 
16
- **Local-only**: no CI/CD, no cron, no commits, no PR. Read-only audit; writes a report to `~/DesignChecks/`. The worktree only isolates the Debug build from the user's working tree.
17
-
18
- > **Language (read FIRST)**: `prefs.global.promptLanguage` is always `en` - this spec and every instruction to the LLM stay English. `prefs.global.outputLanguage` applies to conversational lines and the human-readable parts of the report; pass it to `design_report` as `report.lang` (engine defaults to English, ships `en` + `tr` label packs, per-key `report.labels` overrides). `AskUserQuestion` `header` chips, branch names, file paths, code identifiers and log lines stay English; option `label`s follow `outputLanguage`. Full contract: `$HOME/.claude/multi-agent-refs/rules.md` "Language Application".
16
+ > **Language**: this spec stays English. `outputLanguage` covers conversational lines and the report (`design_report` `report.lang`); `header` chips, paths, identifiers and logs stay English. Contract: `$HOME/.claude/multi-agent-refs/rules.md` "Language Application".
19
17
 
20
18
  ## Gotchas
21
19
 
@@ -23,145 +21,43 @@ Local, on-device design-conformance auditor. Runs the app in a **mock mode** on
23
21
  - The coverage gate fails the run when a target was neither audited nor skipped with a reason. "Not reached" is not "passed".
24
22
  - A Figma variant with no matching mock state is a finding about the mock, not a pass for the screen.
25
23
 
26
- ## Scope - `$ARGUMENTS`
27
-
28
- The scope decides which **inventory targets** (Phase 0 step 5) the run must audit. It never changes how thoroughly each target is audited.
29
-
30
- | Form | Example | Scope |
31
- |------|---------|-------|
32
- | empty / `module` | `/multi-agent:design-check` | Every target in the module's inventory |
33
- | screen name | `order-status` | Every target whose `screen` matches (case/separator-insensitive) |
34
- | `screen@variant` | `order-status@expired` | One target |
35
- | target id | `scenario-case:orderstatusoutcome-expired` | One target, exactly |
36
- | Figma URL(s) | `https://figma.com/design/...?node-id=1-2` | Only the frames those URLs name |
37
- | `--resume` | `--resume` | The unaudited remainder of the most recent run for this repo + module |
38
- | combinations | `seat-map summary@semi-success` | Union of the above, space- or newline-separated |
39
-
40
- A scope that matches **no** inventory target is an error, not an empty run: print the closest inventory ids and halt.
41
-
42
- **Whole-module is the default, and it is meant to finish.** The inventory prices each target (`cost: relaunch | in-app`) and batches them into a run `plan`, so a 50-target module is typically about a dozen relaunches rather than fifty. Scope exists for resuming an interrupted run and for re-checking one screen after a fix, **not** for trimming an audit down to what feels affordable. The coverage gate applies to the **scoped** target set, so a deliberate scoped run is never penalised for out-of-scope targets, and `--resume` closes the remainder.
43
-
44
- ## Pipeline
45
-
46
- ```
47
- Phase 0: Init & Gate → repo + module picker, platform detect, MOCK FEASIBILITY GATE, SCENARIO INVENTORY, scope resolve, report dir, worktree
48
- Phase 1: Build & Launch → Debug build in worktree, boot device, install, launch in mock mode
49
- Phase 2: Figma → fetch module frame tree, enumerate + map variants (ask when ambiguous)
50
- Phase 3: Drive & Compare → per plan batch: one launch → capture + flip in-app states → match → batch-ask → compare
51
- Phase 4: Report → coverage gate + assemble + export HTML + PDF (+ Confluence) to ~/DesignChecks/
52
- ```
53
-
54
- ## Requirements
55
-
56
- - **iOS**: Xcode + an available Simulator. **Android**: Android SDK + a running emulator / device.
57
- - **MCP**: the `multi-agent-toolkit` MCP server (>= 2.8.0, for `design_scenario_inventory`, the `design_report` coverage gate, and `design_visual_compare` region alignment). The Figma MCP (`mcp__claude_ai_Figma__*`) must be authenticated - the user supplies the Figma URL.
58
- - The selected module must be auditable: a **mock mode** (preferred - it can toggle variants) or a **snapshot capture** of the screen's view model. Phase 0 decides which. Neither → the command halts.
59
-
60
- ## Phase Tracker Contract (mandatory)
61
-
62
- Register one tile per phase in strict order BEFORE any update, on both channels. Full spec: `$HOME/.claude/multi-agent-refs/tracker-contract.md`.
63
-
64
- ```bash
65
- bash $HOME/.claude/scripts/phase-tracker.sh init "$TASK_ID"
66
- for p in "0:Init & Gate" "1:Build & Launch" "2:Figma" "3:Drive & Compare" "4:Report"; do
67
- bash $HOME/.claude/scripts/phase-tracker.sh add "${p%%:*}" "${p#*:}"
68
- done
69
- ```
70
-
71
- In Claude Code also drive the native TaskList widget: fire all `TaskCreate` calls in phase order (0→1→2→3→4) first, persist each `taskId` via `phase-tracker.sh meta <N> tasklist_id`, then flip status with `TaskUpdate` + `phase-tracker.sh update` at every boundary. On Copilot / plain shell call `phase-tracker.sh render` instead (no TaskCreate).
72
-
73
- ## STOP-AND-CONFIRM format
74
-
75
- Every Phase 0 / Phase 2 decision uses a native `AskUserQuestion` picker per `picker-contract.md` (numbered text menus are forbidden). Print a `Step <i>/<n>: <what it decides>` breadcrumb before each picker. Confirmation is required even with a single option; state inheritance from a previous run is FORBIDDEN.
76
-
77
- ---
78
-
79
- ## Phase 0 - Init, Feasibility Gate & Inventory
80
-
81
- 0. **MCP CURRENCY GATE (first, before anything expensive)** - a session started before the last update serves the OLD tool list while reporting "connected". Check both halves before the Debug build: (a) **session** - `design_scenario_inventory` is available and `design_visual_compare` accepts `live_region`; (b) **disk** - probe what a fresh connection would serve. Disk OK but session stale → **HALT**, tell the user to reconnect (`/mcp` → `multi-agent-toolkit` → Reconnect). Disk stale → **HALT**, the checkout needs updating. Both current → continue. Never substitute a local `node` call for a missing tool: the run would silently lose the coverage gate and region alignment. Full procedure: `$HOME/.claude/multi-agent-refs/design-check/mcp-currency-gate.md`. Read it for Phase 0 step 0.
82
- 1. **Repo picker** - `$HOME/.claude/multi-agent-refs/_repo-picker.md`. Account picker skipped unless Confluence export is enabled.
83
- 2. **Module / dev-context picker** - `$HOME/.claude/multi-agent-refs/_dev-context.md`; multi-module allowed, each audited independently.
84
- 3. **Platform detect** - persist `state.designCheck.platform`.
85
- 4. **MOCK FEASIBILITY GATE** - `mcp__multi-agent-toolkit__design_mock_detect` on the selected module path. Branch on `supported`:
86
- - **`false`** → try the **snapshot lane** before halting: a screen renderable from its own view model is auditable without a runtime mock switch. Ask via `AskUserQuestion`, persist `state.designCheck.captureLane = "snapshot"`, and state the trade (no in-app variant flips). Declined or not renderable → **HALT** with `reason`. Never fabricate a comparison.
87
- - **`"debug-only"`** → `AskUserQuestion` warning: variants cannot be toggled at launch, only the default Debug state is comparable. Continue / Cancel.
88
- - **`true`** → continue; persist `state.designCheck.mock`.
89
- 5. **SCENARIO INVENTORY (this is the audit's target set)** - `mcp__multi-agent-toolkit__design_scenario_inventory` with the config's inventory overrides. This list, not the agent's reading of the code or what the UI exposes to tapping, is what the run is measured against. Persist verbatim to `state.designCheck.inventory`.
90
- - `targetCount: 0` → warn that no state driver was found and only the default launch state can be audited; a `debug-only` project lands here.
91
- - `truncated: true` → the target set is INCOMPLETE. Say so now, and pass `coverage.truncatedInventory: true` in Phase 4 so the gate fails rather than reporting a clean percentage of a partial denominator. Narrow the scope to a screen and work through the module in `--resume` steps.
92
- - `ignored[]` non-empty → list what the config dropped, so a stale `ignoreTargets` cannot quietly shrink the audit.
93
- 6. **Scope resolve** - intersect `$ARGUMENTS` with `inventory.targets`; persist `state.designCheck.scope = { argument, targetIds[] }`. Print the set grouped by screen as `<n> targets · <relaunchCount> relaunches` (cost from `plan`, not the target count). Ask for confirmation only when `relaunchCount` exceeds `config coverage.confirmAbove` (default 25), as a cost estimate; never propose a smaller scope as the easy path.
94
- 7. **`--resume`** - scope = the latest `run-state.json` targets minus `covered` minus `skipped`. No previous run → tell the user and fall back to whole-module scope after confirmation.
95
- 8. **Report dir** - create `~/DesignChecks/{repo}__{module}/{UTC-timestamp}/` (+ `assets/`) now, persist `state.designCheck.reportDir`; it exists before driving starts.
96
- 9. **Worktree** - `{projectRoot}/.worktrees/{taskId}`, `taskId` = `DC-<shortId>`, **never under $HOME**; prune stale locks and add the residue guard first. Local mode is not offered.
97
-
98
- Then persist `agent-state.json`. Full procedure: `$HOME/.claude/multi-agent-refs/design-check/init-inventory.md`. Read it for Phase 0 steps 1-9.
99
-
100
- ## Phase 1 - Build & Launch (mock)
101
-
102
- Debug build in the worktree (mocks need Debug), boot, install once, fix status bar / appearance / locale, launch via `design_mock_launch` with the Phase 0 activation (`debug-only`: plain launch). Phase 3 relaunches, never rebuilds. Full procedure: `$HOME/.claude/multi-agent-refs/design-check/build-launch.md`. Read it for Phase 1.
103
-
104
- ## Phase 2 - Figma fetch & variant mapping (module-scoped)
105
-
106
- Figma **discovery** happens only here: the frame tree is fetched once and no later phase browses Figma looking for candidates. Phase 3 may still fetch a specific node the user hands over in the 3.3 batch-ask - that is a targeted fetch of an already-identified frame, not discovery, and it is the only Figma call allowed after this phase.
107
-
108
- Fetch the frame tree, map each scoped target to a frame, fetch screenshot + design context per variant, persist `state.designCheck.variants[]`. **Ambiguous or unmatched → defer to the Phase 3.3 batch-ask. Never guess silently.** Full procedure: `$HOME/.claude/multi-agent-refs/design-check/figma-mapping.md`. Read it for Phase 2.
109
-
110
- ## Phase 3 - Drive every scoped target → capture → match → batch-ask → compare
111
-
112
- **This phase iterates `state.designCheck.scope.targetIds` - a finite list decided in Phase 0. It ends when every id is resolved, not when the UI stops offering new taps.** Tap-walking alone cannot reach a state that needs a different launch argument, scenario case, or typed scenario code - which is how a module's error / edge states go missing.
113
-
114
- ### 3.0 What every capture is compared against
115
-
116
- **Read `$HOME/.claude/multi-agent-refs/features/design-conformance.md` before the first compare.** It owns the per-component catalog (30 groups), the scope tags, and the three rules that decide whether this phase produced a result or an impression: enumerate first (a blank cell is a fail-to-verify), measure never the token, and converge per component (two consecutive clean attempts, cap 8). The screen is done when every component converged - not when the walk reached the bottom.
117
-
118
- ### 3.1 Drive the inventory's plan, batch by batch
119
-
120
- **Follow `inventory.plan`, filtered to the scoped ids.** Each batch is one launch: the relaunch target opens a screen, then every in-app target for that screen is flipped while the app sits there - **no relaunch between them**. Driving the plan is what makes full coverage affordable. Activate each target by its `driver.type`, and capture the tap-reachable sub-states (sheets, modals, inline errors) under `<id>#<sub-label>`. Each capture (screenshot + `design_ui_geometry`) goes to `state.designCheck.captured[]`. **Persist `state` and `run-state.json` after every capture**, so a run that dies mid-way resumes from where it stopped. Full procedure (driver table, capture mechanics): `$HOME/.claude/multi-agent-refs/design-check/drive-capture.md`. Read it for Phase 3.1.
121
-
122
- An unreachable target is recorded immediately as `{ id, reason }` in `state.designCheck.skipped[]` with a concrete reason. "Requires a scenario / prefix / launch-arg" is **not** a reason - it describes the work, which is this phase's job.
123
-
124
- ### 3.2 Match each capture → Figma frame (auto)
24
+ ## Scope, requirements, tracker
125
25
 
126
- Accept only a **confident** match against the Phase 2 tree; matched → `pairs[]`.
26
+ Before Phase 0, read `$HOME/.claude/multi-agent-refs/design-check/scope-and-ledger.md`: the scope grammar (empty, screen, `screen@variant`, target id, Figma URL, `--resume`), the requirements, the tracker detail and the ledger rules. Whole-module is the default and is meant to finish; scope is for resuming or re-checking, never for trimming. No mock mode and no snapshot capture: halt.
127
27
 
128
- ### 3.3 Batch-ask the user for EVERYTHING unmatched (ONE prompt, WITH the visual)
28
+ Tracker: `phase-tracker.sh init` + `add` for `0:Init & Gate`, `1:Build & Launch`, `2:Figma`, `3:Drive & Compare`, `4:Report`, plus `TaskCreate` in phase order first (`$HOME/.claude/multi-agent-refs/tracker-contract.md`).
129
29
 
130
- Collect ALL captures with no confident Figma match into a single list and ask the user ONCE - never guess, never show a wrong frame. **For each unmatched screen you MUST SHOW its captured live screenshot**, name the screen, and ask for the Figma node-id / URL (in `outputLanguage`). Each answer becomes a confirmed pair. A screen the user declines to map is a skip with reason "no Figma frame supplied".
30
+ Every Phase 0 / Phase 2 decision is a native `AskUserQuestion` per `picker-contract.md` with a `Step <i>/<n>` breadcrumb; confirm even a single option; never inherit state from a previous run.
131
31
 
132
- ### 3.4 Compare ALL pairs in one pass
32
+ ## Phase 0 - Init, feasibility gate, inventory
133
33
 
134
- `design_visual_compare` per pair (matched + user-supplied) with `tolerance_px: 2, color_tolerance: 3, max_diff_pct: 1.0`. **Bottom sheets, modals, and any partial overlay need region alignment** (`live_region` from the sheet container in `design_ui_geometry`, never a guess, plus `expected_region` from the Figma placement). Attach Code Connect refs (best-effort); compose a paste-ready fix prompt. Full procedure (match, batch-ask mechanics, compare call, region alignment): `$HOME/.claude/multi-agent-refs/design-check/compare.md`. Read it for Phase 3.2-3.4.
34
+ Read `$HOME/.claude/multi-agent-refs/design-check/mcp-currency-gate.md` for step 0 and `$HOME/.claude/multi-agent-refs/design-check/init-inventory.md` for steps 1-9.
135
35
 
136
- **Edge insets are defects, not tolerances.** Report every `inset` finding as a deviation with its px delta; never absorb a side gap as "close enough", never raise `tolerance_px` to make one disappear.
36
+ 0. **MCP currency gate** before anything expensive: session stale or disk stale: **HALT** (reconnect, or update the checkout). Never substitute a local `node` call for a missing tool.
37
+ 1-3. Repo picker, module picker, platform detect.
38
+ 4. **Mock feasibility** (`design_mock_detect`): `false`: offer the **snapshot lane** (`captureLane = "snapshot"`, no in-app flips), declined or not renderable: **HALT** with `reason`, never fabricate a comparison. `"debug-only"`: warn, Continue / Cancel. `true`: persist `state.designCheck.mock`.
39
+ 5. **Scenario inventory** (`design_scenario_inventory`) is the target set; persist verbatim. `truncated: true`: say so and pass `coverage.truncatedInventory: true` in Phase 4. `targetCount: 0`: only the default launch state is auditable. List `ignored[]`.
40
+ 6-7. Scope resolve, `--resume`; confirm only above `coverage.confirmAbove` relaunches, as a cost estimate, never offering a smaller scope.
41
+ 8-9. Report dir now; worktree `{projectRoot}/.worktrees/DC-<shortId>`, never under $HOME.
137
42
 
138
- ### 3.5 Close the ledger
43
+ ## Phase 1 - Build & launch
139
44
 
140
- Every scoped target id must end in exactly one bucket:
45
+ Debug build in the worktree, launch via `design_mock_launch`; Phase 3 relaunches, never rebuilds. Read `$HOME/.claude/multi-agent-refs/design-check/build-launch.md` for Phase 1.
141
46
 
142
- - **covered** - captured AND compared (or captured and explicitly awaiting a Figma frame the user declined to supply, which is a skip)
143
- - **skipped** - with a concrete reason recorded in 3.1 / 3.3
47
+ ## Phase 2 - Figma mapping
144
48
 
145
- Write `run-state.json` into the Phase 0 report dir with `{ targetIds, covered, skipped }` so `--resume` can pick up the remainder. An id in neither bucket is a bug in this phase, and Phase 4's gate will fail the run for it.
49
+ The only Figma discovery; later only a node the user hands over in 3.3. **Ambiguous or unmatched: defer to 3.3, never guess.** Read `$HOME/.claude/multi-agent-refs/design-check/figma-mapping.md` for Phase 2.
146
50
 
147
- Before leaving this phase, compare `covered.length + skipped.length` against `scope.targetIds.length`. A mismatch is a set of targets nobody decided about - go back and drive them, or record why they cannot be driven. Reaching Phase 4 with a mismatch is the worst of both worlds: the work is undone AND the run is marked incomplete.
51
+ ## Phase 3 - Drive, capture, match, compare
148
52
 
149
- ## Phase 4 - Report, coverage gate & export
53
+ Iterate `scope.targetIds`; done when every id is resolved, not when taps run out. Before the first compare, read `$HOME/.claude/multi-agent-refs/features/design-conformance.md`.
150
54
 
151
- 1. **Output dir**: `state.designCheck.reportDir` from Phase 0; never a second timestamped dir.
152
- 2. **Assemble** the report object: `coverage` (scoped `targets`, `covered`, `skipped` with reasons, `truncatedInventory`, optional `floor`) and per-variant results with a `walk` block (`components`, `converged`, `didNotConverge`, `notVerified`). `walk` separates a checked screen from a viewed one: an empty `notVerified` on a run that never captured a dark or mirrored pass is a false clean - list the skip. Pass **ids**, not counts.
153
- 3. **Render + export** with `design_report` (`html` + `pdf`, + `confluence` only when enabled; disabled → graceful skip). Full procedure (report object, export formats, cleanup): `$HOME/.claude/multi-agent-refs/design-check/export.md`. Read it for Phase 4.
154
- 4. **COVERAGE GATE (blocking, not advisory)** - read `coverage` from the tool result and persist it to `state.designCheck.coverage`:
155
- - `gate: "pass"` → report per-variant PASS/FAIL + findings count + report paths.
156
- - `gate: "fail"` → the run is **INCOMPLETE**. Print `coverageError`, the `unaccountedIds`, and the exact command that closes the gap: `/multi-agent:design-check --resume`. Do not present an incomplete audit as a finished one, do not bury the miss in a footnote, and never pad the covered list to make the gate pass.
55
+ - **3.1** Drive `inventory.plan` batch by batch; persist `state` and `run-state.json` after every capture. Unreachable: skip with a concrete reason. Read `$HOME/.claude/multi-agent-refs/design-check/drive-capture.md`.
56
+ - **3.2-3.4** Confident matches only; batch-ask everything unmatched ONCE, showing each live screenshot; compare all pairs (`tolerance_px: 2, color_tolerance: 3, max_diff_pct: 1.0`), sheets and modals with region alignment. **Edge insets are defects**: never raise `tolerance_px` to hide one. Read `$HOME/.claude/multi-agent-refs/design-check/compare.md`.
57
+ - **3.5** Every id ends covered or skipped; `covered + skipped` must equal `targetIds` before Phase 4.
157
58
 
158
- The gate is a last line of defence, not the plan. If it fires, Phase 3 left work undone - the correct response is to drive the missing targets, and only then to report.
159
- 5. Remove the worktree unless the user asked to keep the built app. The report dir is never removed.
59
+ ## Phase 4 - Report and coverage gate
160
60
 
161
- ## Notes
61
+ Use `state.designCheck.reportDir`. Pass ids, not counts; each variant carries `walk` with `didNotConverge` and `notVerified`. Export with `design_report` (Confluence only when enabled). Read `$HOME/.claude/multi-agent-refs/design-check/export.md` for Phase 4.
162
62
 
163
- - **Feasibility is real**: a project with no launchable app or no runtime switch cannot be audited. Report that honestly and stop - never substitute a fabricated or partial comparison.
164
- - **The inventory is the contract**: Phase 0 step 5 decides what "done" means. An audit that visits the linear happy path and lists the rest as "not visited" is the failure mode this pipeline exists to prevent; the gate makes it visible instead of polite.
165
- - **Chunk with scope, not with silence**: a 50-target module is a legitimate multi-run job. Scope it, finish each run's gate cleanly, and let `--resume` carry the remainder.
166
- - **"Pixel perfect" is perceptual + geometric**: scale normalized, chrome cropped; findings carry px / pt / hex deltas and a tolerance.
167
- - The `design_*` engine is project-agnostic; project specifics (mock keys, launch args / targets, node overrides, status-bar crop, coverage floor, Confluence toggle) come from `design-check-config.json` / prefs, never hardcoded.
63
+ **Coverage gate (blocking)**: `pass`: report results and paths. `fail`: the run is **INCOMPLETE**; print `coverageError`, `unaccountedIds` and `/multi-agent:design-check --resume`. Never pad the covered list. Remove the worktree unless asked to keep it; never the report dir.
@@ -13,15 +13,14 @@ confirm: required
13
13
 
14
14
  > **Pickers follow** `$HOME/.claude/multi-agent-refs/picker-contract.md`: never a one-option call, and branch on the option selected, not on its text.
15
15
 
16
- Each run writes ephemeral scratch under `/tmp`: picker state
17
- (`multi-agent-picker-*`), PR/review diffs (`multi-agent-review-*`), issue
18
- progress bodies (`issue-progress-*`), channel payloads (`channels-*`),
19
- external-context bundles (`context-links-*` / `context-by-type-*`), and analysis
20
- drafts (`analysis-*`). Most are never cleaned up, so a long-lived machine
21
- accumulates them. This sweeps the known prefixes only.
16
+ Sweeps run scratch under `/tmp` (known prefixes only), worktree residue,
17
+ offloaded payloads and, with `--abandoned`, stopped runs. Backed by
18
+ `$HOME/.claude/scripts/gc-tmp.sh` and its siblings. Safe by default: it previews
19
+ and deletes nothing until you confirm.
22
20
 
23
- Backed by `$HOME/.claude/scripts/gc-tmp.sh`. Safe by default: it previews and
24
- deletes nothing until you confirm.
21
+ What each phase covers, the abandoned-run line kinds and the scope of each
22
+ phase: `$HOME/.claude/multi-agent-refs/garbage-collect/phases.md`. Read it when
23
+ explaining a phase's output.
25
24
 
26
25
  ## Steps
27
26
 
@@ -63,13 +62,8 @@ deletes nothing until you confirm.
63
62
  bash $HOME/.claude/scripts/gc-worktrees.sh ${ARGUMENTS}
64
63
  ```
65
64
 
66
- This covers: stale worktree admin entries (`git worktree prune`, applied
67
- immediately - it only drops bookkeeping for dirs that are already gone),
68
- orphan `.worktrees/*` dirs no longer registered as worktrees, gitlink
69
- residue in the index (`.worktrees/{id}` recorded as a "Subproject commit"
70
- entry by a pre-guard `git add -A`), and a missing `.worktrees/` line in
71
- `.git/info/exclude`. Registered, healthy worktrees are NEVER touched -
72
- those belong to `/multi-agent:resume` / `/multi-agent:kill`.
65
+ Registered, healthy worktrees are NEVER touched - those belong to
66
+ `/multi-agent:resume` / `/multi-agent:kill`.
73
67
 
74
68
  - Output says `nothing to do` -> skip silently, no question.
75
69
  - Otherwise surface a second `AskUserQuestion` (in `outputLanguage`):
@@ -86,13 +80,8 @@ deletes nothing until you confirm.
86
80
  bash $HOME/.claude/scripts/gc-refs.sh ${ARGUMENTS}
87
81
  ```
88
82
 
89
- `offload-ref.sh` parks build logs, diffs and test output under
90
- `.multi-agent/refs/<node_id>.md`. In worktree modes that directory dies with
91
- the worktree; when the run chose a local workspace it lands in the real checkout, and
92
- because it is gitignored it never shows up in `git status`. Only files
93
- matching the node-id shape are touched - anything else in that directory is
94
- left alone, and files inside the grace window are spared so a sweep cannot
95
- pull a ref out from under a running phase.
83
+ Only node-id-shaped files under `.multi-agent/refs/` are touched, and files
84
+ inside the grace window are spared.
96
85
 
97
86
  - Output says `nothing to do` -> skip silently, no question.
98
87
  - Otherwise surface a third `AskUserQuestion` (in `outputLanguage`):
@@ -112,25 +101,15 @@ deletes nothing until you confirm.
112
101
  bash $HOME/.claude/scripts/gc-abandoned.sh ${ARGUMENTS}
113
102
  ```
114
103
 
115
- Nothing else collects these. `gc-worktrees.sh` skips registered worktrees on
116
- purpose, because a registered worktree belongs to a live run - and a run that
117
- stopped never stops being "live". Measured on one machine: 20 runs reading
118
- `in_progress`, every one over a day old, one of them 157 days.
104
+ The four line kinds (`would remove`, `would stash`, `would mark abandoned`,
105
+ `unattributed`) are not interchangeable; their table is in `phases.md`. An
106
+ `unattributed` worktree is **never removed, whatever the flags**: report the
107
+ list and its size; the user decides.
119
108
 
120
- The output has four kinds of line and they are not interchangeable:
121
-
122
- | Line | Meaning |
123
- |---|---|
124
- | `would remove` / `would remove worktree` | reapable: stopped past its age limit, or finished with its worktree left behind |
125
- | `would stash` | uncommitted work found - it goes into a stash entry labelled `autopilot/abandoned/<task-id>` (`git stash list`) and the worktree is **kept** |
126
- | `would mark abandoned` | the state is stale but there is no worktree left to remove |
127
- | `unattributed` | a worktree with no run state. **Never removed, whatever the flags.** `.worktrees/` is not exclusively ours, and nothing distinguishes a hand-made worktree from a pipeline one whose log was pruned. Report the list and its size; the user decides |
128
-
129
- Three rules hold with or without `--yes`, and they are why this is safe to
130
- offer: a run waiting on you (open PR, Phase 4/5, `awaiting_input`) is never
131
- touched; a path outside `<repo>/.worktrees/` is never removed, which matters
132
- because four state files on the measured machine record the REPO ROOT as
133
- their `worktreePath`; and uncommitted work is stashed rather than lost.
109
+ Three rules hold with or without `--yes`: a run waiting on you (open PR,
110
+ Phase 4/5, `awaiting_input`) is never touched; a path outside
111
+ `<repo>/.worktrees/` is never removed; and uncommitted work is stashed rather
112
+ than lost.
134
113
 
135
114
  - Output says `nothing to do` -> skip silently, no question.
136
115
  - Otherwise surface a fourth `AskUserQuestion` (in `outputLanguage`):
@@ -147,11 +126,6 @@ deletes nothing until you confirm.
147
126
  and `/multi-agent:resume` re-uses them. If a run is paused at
148
127
  `awaiting_output_decision`, pass `--older-than=<minutes>` so fresh drafts are
149
128
  spared, or finish the run first.
150
- - The /tmp phase only touches `/tmp` scratch; the worktree phase only touches
151
- the current repo's `.worktrees/` residue and index; the payload phase only
152
- touches node-id files under `.multi-agent/refs/`. Persistent per-task logs
153
- live under `~/.claude/logs/multi-agent/` and are cleaned by
154
- `/multi-agent:prune-logs`. The per-repo memory stores under
155
- `~/.claude/memory/multi-agent/` are durable knowledge, not scratch: they are
156
- removed only by `/multi-agent:uninstall --all-data`, or one entry at a time
157
- with `learnings-ledger.mjs forget`.
129
+ - Per-task logs (`/multi-agent:prune-logs`) and the per-repo memory stores
130
+ (`/multi-agent:uninstall --all-data`) are never swept here; see `phases.md`,
131
+ "Scope of each phase".