@mmerterden/multi-agent-pipeline 12.5.0 → 12.7.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 (290) hide show
  1. package/CHANGELOG.md +213 -0
  2. package/README.md +19 -19
  3. package/docs/FIGMA_PIPELINE.md +34 -34
  4. package/docs/adr/0001-three-model-triage.md +12 -12
  5. package/docs/adr/0002-instruction-driven-flag.md +5 -5
  6. package/docs/adr/0003-unified-shared-skills.md +5 -5
  7. package/docs/adr/0004-zero-dependency-philosophy.md +5 -5
  8. package/docs/adr/0005-lazy-phase-docs.md +2 -2
  9. package/docs/adr/0006-skills-core-external-split.md +6 -6
  10. package/docs/adr/0007-multi-tool-adapter-framework.md +19 -19
  11. package/docs/adr/0008-installer-modularization-and-secret-leak-defense.md +19 -19
  12. package/docs/adr/README.md +1 -1
  13. package/docs/best-practices.md +3 -3
  14. package/docs/features.md +48 -28
  15. package/docs/performance.md +16 -16
  16. package/docs/recovery-guide.md +39 -39
  17. package/index.js +11 -5
  18. package/install/_common.mjs +5 -11
  19. package/install/_copilot-instructions.mjs +2 -2
  20. package/install/_dev-only-files.mjs +2 -1
  21. package/install/_platform-filter.mjs +1 -1
  22. package/install/_telemetry.mjs +1 -1
  23. package/install/claude.mjs +10 -9
  24. package/install/copilot.mjs +10 -19
  25. package/install/index.mjs +7 -15
  26. package/install/templates/copilot-instructions.md +54 -54
  27. package/install.js +1 -1
  28. package/package.json +15 -11
  29. package/pipeline/agents/security-auditor.md +1 -1
  30. package/pipeline/commands/archive-guard.md +5 -5
  31. package/pipeline/commands/multi-agent/SKILL.md +3 -1
  32. package/pipeline/commands/multi-agent/analysis/SKILL.md +1 -1
  33. package/pipeline/commands/multi-agent/analysis-resolve/SKILL.md +1 -1
  34. package/pipeline/commands/multi-agent/autopilot/SKILL.md +1 -1
  35. package/pipeline/commands/multi-agent/build-optimize/SKILL.md +1 -1
  36. package/pipeline/commands/multi-agent/create-jira/SKILL.md +1 -1
  37. package/pipeline/commands/multi-agent/design-check/SKILL.md +287 -0
  38. package/pipeline/commands/multi-agent/dev/SKILL.md +1 -1
  39. package/pipeline/commands/multi-agent/dev-autopilot/SKILL.md +1 -1
  40. package/pipeline/commands/multi-agent/dev-local/SKILL.md +1 -1
  41. package/pipeline/commands/multi-agent/dev-local-autopilot/SKILL.md +1 -1
  42. package/pipeline/commands/multi-agent/diff-explain/SKILL.md +1 -1
  43. package/pipeline/commands/multi-agent/finish/SKILL.md +6 -6
  44. package/pipeline/commands/multi-agent/forget/SKILL.md +1 -1
  45. package/pipeline/commands/multi-agent/garbage-collect/SKILL.md +1 -1
  46. package/pipeline/commands/multi-agent/help/SKILL.md +46 -6
  47. package/pipeline/commands/multi-agent/issue/SKILL.md +1 -1
  48. package/pipeline/commands/multi-agent/jira/SKILL.md +1 -1
  49. package/pipeline/commands/multi-agent/kill/SKILL.md +1 -1
  50. package/pipeline/commands/multi-agent/language/SKILL.md +1 -1
  51. package/pipeline/commands/multi-agent/local/SKILL.md +1 -1
  52. package/pipeline/commands/multi-agent/local-autopilot/SKILL.md +1 -1
  53. package/pipeline/commands/multi-agent/log/SKILL.md +1 -1
  54. package/pipeline/commands/multi-agent/manual-test/SKILL.md +1 -1
  55. package/pipeline/commands/multi-agent/prune-logs/SKILL.md +1 -1
  56. package/pipeline/commands/multi-agent/purge/SKILL.md +1 -1
  57. package/pipeline/commands/multi-agent/refactor/SKILL.md +107 -19
  58. package/pipeline/commands/multi-agent/resume/SKILL.md +2 -2
  59. package/pipeline/commands/multi-agent/review/SKILL.md +2 -2
  60. package/pipeline/commands/multi-agent/review-issue/SKILL.md +1 -1
  61. package/pipeline/commands/multi-agent/review-jira/SKILL.md +1 -1
  62. package/pipeline/commands/multi-agent/routines/SKILL.md +1 -1
  63. package/pipeline/commands/multi-agent/save/SKILL.md +1 -1
  64. package/pipeline/commands/multi-agent/scan/SKILL.md +1 -1
  65. package/pipeline/commands/multi-agent/search/SKILL.md +1 -1
  66. package/pipeline/commands/multi-agent/setup/SKILL.md +2 -2
  67. package/pipeline/commands/multi-agent/stack/SKILL.md +3 -3
  68. package/pipeline/commands/multi-agent/status/SKILL.md +1 -1
  69. package/pipeline/commands/multi-agent/sync/SKILL.md +123 -16
  70. package/pipeline/commands/multi-agent/test/SKILL.md +2 -2
  71. package/pipeline/commands/multi-agent/uninstall/SKILL.md +1 -1
  72. package/pipeline/commands/multi-agent/update/SKILL.md +3 -3
  73. package/pipeline/commands/sim-test.md +5 -5
  74. package/pipeline/eval/run-metrics-fixture.json +60 -13
  75. package/pipeline/lib/account-resolver.sh +1 -1
  76. package/pipeline/lib/channels-multi-repo.sh +1 -1
  77. package/pipeline/lib/context-link-extractor.sh +1 -1
  78. package/pipeline/lib/credential-store.sh +33 -1
  79. package/pipeline/lib/fetch-confluence.sh +1 -1
  80. package/pipeline/lib/fetch-crashlytics.sh +1 -1
  81. package/pipeline/lib/fetch-fortify.sh +1 -1
  82. package/pipeline/lib/fetch-graylog.sh +1 -1
  83. package/pipeline/lib/fetch-swagger.sh +1 -1
  84. package/pipeline/lib/issue-fetcher.sh +1 -1
  85. package/pipeline/lib/multi-repo-pipeline.sh +1 -1
  86. package/pipeline/lib/repo-cache.sh +1 -1
  87. package/pipeline/lib/submodule-detector.sh +1 -1
  88. package/pipeline/multi-agent-refs/component-dispatch.md +1 -1
  89. package/pipeline/multi-agent-refs/component-generation.md +121 -0
  90. package/pipeline/multi-agent-refs/cross-cli-contract.md +4 -4
  91. package/pipeline/multi-agent-refs/features/model-fallback.md +2 -2
  92. package/pipeline/multi-agent-refs/phases/phase-3-dev.md +2 -2
  93. package/pipeline/multi-agent-refs/phases/phase-4-review.md +1 -1
  94. package/pipeline/multi-agent-refs/phases/phase-5-test.md +4 -4
  95. package/pipeline/preferences-template.json +23 -12
  96. package/pipeline/schemas/agent-state.schema.json +125 -5
  97. package/pipeline/schemas/analysis-output.schema.json +18 -4
  98. package/pipeline/schemas/analysis-spec.schema.json +120 -32
  99. package/pipeline/schemas/clarify-output.schema.json +15 -5
  100. package/pipeline/schemas/design-check-config.schema.json +183 -0
  101. package/pipeline/schemas/dev-critic-output.schema.json +20 -5
  102. package/pipeline/schemas/figma-project-config.schema.json +42 -10
  103. package/pipeline/schemas/learnings-ledger.schema.json +10 -2
  104. package/pipeline/schemas/migrations/figma-config-1.0.0-to-2.0.0.mjs +1 -4
  105. package/pipeline/schemas/migrations/prefs-2.0.0-to-2.1.0.mjs +24 -7
  106. package/pipeline/schemas/migrations/state-2.0.0-to-2.1.0.mjs +30 -12
  107. package/pipeline/schemas/plan-todos.schema.json +6 -3
  108. package/pipeline/schemas/planning-output.schema.json +5 -1
  109. package/pipeline/schemas/prefs.schema.json +215 -197
  110. package/pipeline/schemas/test-gap.schema.json +5 -5
  111. package/pipeline/schemas/token-budget.json +8 -8
  112. package/pipeline/schemas/triage-corpus.schema.json +1 -1
  113. package/pipeline/scripts/README.md +7 -5
  114. package/pipeline/scripts/aggregate-metrics.mjs +18 -6
  115. package/pipeline/scripts/build-skills-index.mjs +6 -2
  116. package/pipeline/scripts/build-stack-plugins.mjs +142 -39
  117. package/pipeline/scripts/check-derived-drift.mjs +196 -0
  118. package/pipeline/scripts/check-md-links.mjs +6 -2
  119. package/pipeline/scripts/classify-plan-safety.mjs +26 -8
  120. package/pipeline/scripts/cost-budget-check.mjs +11 -6
  121. package/pipeline/scripts/cost-table.json +1 -1
  122. package/pipeline/scripts/diff-explain.mjs +7 -3
  123. package/pipeline/scripts/diff-risk-score.mjs +13 -3
  124. package/pipeline/scripts/eval-golden-tasks-live.mjs +8 -3
  125. package/pipeline/scripts/eval-golden-tasks.mjs +21 -9
  126. package/pipeline/scripts/eval-intent.mjs +8 -4
  127. package/pipeline/scripts/eval-mine-corpus.mjs +14 -4
  128. package/pipeline/scripts/evidence-gate.mjs +7 -2
  129. package/pipeline/scripts/fixtures/install-layout.tsv +7 -7
  130. package/pipeline/scripts/gen-mode-dispatch.mjs +38 -21
  131. package/pipeline/scripts/gen-skills-index.mjs +18 -3
  132. package/pipeline/scripts/learning-curve.mjs +13 -3
  133. package/pipeline/scripts/learnings-ledger.mjs +119 -34
  134. package/pipeline/scripts/lint-mcp-refs.mjs +218 -0
  135. package/pipeline/scripts/lint-skills.mjs +20 -9
  136. package/pipeline/scripts/localize-commands.mjs +6 -1
  137. package/pipeline/scripts/match-skills.mjs +15 -4
  138. package/pipeline/scripts/memory-load.sh +5 -1
  139. package/pipeline/scripts/migrate-prefs.mjs +33 -16
  140. package/pipeline/scripts/phase-tracker.sh +3 -1
  141. package/pipeline/scripts/render-work-summary.sh +4 -1
  142. package/pipeline/scripts/repo-map.mjs +110 -64
  143. package/pipeline/scripts/review-scope.mjs +7 -1
  144. package/pipeline/scripts/routine-registry.mjs +4 -9
  145. package/pipeline/scripts/run-aggregator.mjs +11 -5
  146. package/pipeline/scripts/run-metrics.mjs +13 -8
  147. package/pipeline/scripts/run-smokes.mjs +57 -3
  148. package/pipeline/scripts/scorecard.mjs +258 -0
  149. package/pipeline/scripts/smoke-command-inventory.sh +81 -0
  150. package/pipeline/scripts/smoke-commands-skills-parity.sh +1 -1
  151. package/pipeline/scripts/smoke-compliance-skills.sh +4 -4
  152. package/pipeline/scripts/smoke-context-budget.sh +72 -0
  153. package/pipeline/scripts/smoke-cross-cli-behavior.sh +12 -2
  154. package/pipeline/scripts/smoke-generate-issue.sh +6 -5
  155. package/pipeline/scripts/smoke-model-fallback.sh +1 -1
  156. package/pipeline/scripts/smoke-no-mcp-in-dev-phases.sh +86 -7
  157. package/pipeline/scripts/smoke-own-punctuation.sh +103 -0
  158. package/pipeline/scripts/smoke-per-repo-memory.sh +2 -2
  159. package/pipeline/scripts/smoke-review-readiness.sh +3 -2
  160. package/pipeline/scripts/smoke-schema-validation.sh +19 -5
  161. package/pipeline/scripts/smoke-shadow-git.sh +4 -2
  162. package/pipeline/scripts/smoke-workflow-audit.sh +43 -11
  163. package/pipeline/scripts/smoke-write-state.sh +49 -5
  164. package/pipeline/scripts/test-gap-rules/android.json +11 -11
  165. package/pipeline/scripts/test-gap-rules/ios.json +16 -11
  166. package/pipeline/scripts/test-gap-rules/node.json +19 -7
  167. package/pipeline/scripts/test-gap-rules/python.json +10 -4
  168. package/pipeline/scripts/test-gap-scan.mjs +44 -12
  169. package/pipeline/scripts/test-integrity-gate.mjs +5 -1
  170. package/pipeline/scripts/token-budget-report.mjs +44 -21
  171. package/pipeline/scripts/triage-memory.mjs +142 -32
  172. package/pipeline/scripts/uninstall.mjs +75 -31
  173. package/pipeline/scripts/validate-analysis-doc.mjs +15 -5
  174. package/pipeline/scripts/validate-diff-risk.mjs +32 -18
  175. package/pipeline/scripts/validate-test-gap.mjs +17 -7
  176. package/pipeline/scripts/validate-triage.mjs +17 -5
  177. package/pipeline/scripts/write-state.mjs +32 -9
  178. package/pipeline/skills/.skill-manifest.json +24 -8
  179. package/pipeline/skills/.skills-index.json +125 -89
  180. package/pipeline/skills/shared/README.md +65 -61
  181. package/pipeline/skills/shared/core/apple-archive-compliance/SKILL.md +10 -8
  182. package/pipeline/skills/shared/core/google-play-compliance/SKILL.md +1 -1
  183. package/pipeline/skills/shared/core/multi-agent/SKILL.md +26 -279
  184. package/pipeline/skills/shared/core/multi-agent-analysis/SKILL.md +1 -1
  185. package/pipeline/skills/shared/core/multi-agent-analysis-resolve/SKILL.md +1 -1
  186. package/pipeline/skills/shared/core/multi-agent-autopilot/SKILL.md +1 -1
  187. package/pipeline/skills/shared/core/multi-agent-build-optimize/SKILL.md +1 -1
  188. package/pipeline/skills/shared/core/multi-agent-create-jira/SKILL.md +1 -1
  189. package/pipeline/skills/shared/core/multi-agent-design-check/SKILL.md +248 -0
  190. package/pipeline/skills/shared/core/multi-agent-dev/SKILL.md +1 -1
  191. package/pipeline/skills/shared/core/multi-agent-dev-autopilot/SKILL.md +1 -1
  192. package/pipeline/skills/shared/core/multi-agent-dev-local/SKILL.md +1 -1
  193. package/pipeline/skills/shared/core/multi-agent-dev-local-autopilot/SKILL.md +1 -1
  194. package/pipeline/skills/shared/core/multi-agent-diff-explain/SKILL.md +1 -1
  195. package/pipeline/skills/shared/core/multi-agent-finish/SKILL.md +1 -1
  196. package/pipeline/skills/shared/core/multi-agent-forget/SKILL.md +1 -1
  197. package/pipeline/skills/shared/core/multi-agent-garbage-collect/SKILL.md +1 -1
  198. package/pipeline/skills/shared/core/multi-agent-help/SKILL.md +23 -1
  199. package/pipeline/skills/shared/core/multi-agent-issue/SKILL.md +1 -1
  200. package/pipeline/skills/shared/core/multi-agent-jira/SKILL.md +1 -1
  201. package/pipeline/skills/shared/core/multi-agent-kill/SKILL.md +1 -1
  202. package/pipeline/skills/shared/core/multi-agent-language/SKILL.md +1 -1
  203. package/pipeline/skills/shared/core/multi-agent-local/SKILL.md +1 -1
  204. package/pipeline/skills/shared/core/multi-agent-local-autopilot/SKILL.md +1 -1
  205. package/pipeline/skills/shared/core/multi-agent-log/SKILL.md +1 -1
  206. package/pipeline/skills/shared/core/multi-agent-manual-test/SKILL.md +1 -1
  207. package/pipeline/skills/shared/core/multi-agent-prune-logs/SKILL.md +1 -1
  208. package/pipeline/skills/shared/core/multi-agent-purge/SKILL.md +1 -1
  209. package/pipeline/skills/shared/core/multi-agent-refactor/SKILL.md +82 -18
  210. package/pipeline/skills/shared/core/multi-agent-resume/SKILL.md +1 -1
  211. package/pipeline/skills/shared/core/multi-agent-review/SKILL.md +2 -2
  212. package/pipeline/skills/shared/core/multi-agent-review-issue/SKILL.md +1 -1
  213. package/pipeline/skills/shared/core/multi-agent-review-jira/SKILL.md +1 -1
  214. package/pipeline/skills/shared/core/multi-agent-routines/SKILL.md +1 -1
  215. package/pipeline/skills/shared/core/multi-agent-save/SKILL.md +1 -1
  216. package/pipeline/skills/shared/core/multi-agent-scan/SKILL.md +1 -1
  217. package/pipeline/skills/shared/core/multi-agent-search/SKILL.md +1 -1
  218. package/pipeline/skills/shared/core/multi-agent-setup/SKILL.md +1 -1
  219. package/pipeline/skills/shared/core/multi-agent-stack/SKILL.md +3 -3
  220. package/pipeline/skills/shared/core/multi-agent-status/SKILL.md +1 -1
  221. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +51 -9
  222. package/pipeline/skills/shared/core/multi-agent-test/SKILL.md +2 -2
  223. package/pipeline/skills/shared/core/multi-agent-uninstall/SKILL.md +1 -1
  224. package/pipeline/skills/shared/core/multi-agent-update/SKILL.md +1 -1
  225. package/pipeline/skills/shared/external/accessibility-compliance-accessibility-audit/SKILL.md +1 -1
  226. package/pipeline/skills/shared/external/agent-introspection-debugging/SKILL.md +4 -4
  227. package/pipeline/skills/shared/external/agentflow/SKILL.md +1 -1
  228. package/pipeline/skills/shared/external/android-jetpack-compose-expert/SKILL.md +1 -1
  229. package/pipeline/skills/shared/external/android_ui_verification/SKILL.md +1 -1
  230. package/pipeline/skills/shared/external/api-patterns/SKILL.md +1 -1
  231. package/pipeline/skills/shared/external/api-security-best-practices/SKILL.md +1 -1
  232. package/pipeline/skills/shared/external/app-store-changelog/SKILL.md +1 -1
  233. package/pipeline/skills/shared/external/backlog/BACKLOG.md +1 -1
  234. package/pipeline/skills/shared/external/backlog/SKILL.md +12 -12
  235. package/pipeline/skills/shared/external/ci-cd-pipelines/SKILL.md +1 -1
  236. package/pipeline/skills/shared/external/context-compression/SKILL.md +1 -1
  237. package/pipeline/skills/shared/external/council/SKILL.md +3 -3
  238. package/pipeline/skills/shared/external/css-modern/SKILL.md +1 -1
  239. package/pipeline/skills/shared/external/database-patterns/SKILL.md +1 -1
  240. package/pipeline/skills/shared/external/debugging-strategies/SKILL.md +1 -1
  241. package/pipeline/skills/shared/external/docker-expert/SKILL.md +1 -1
  242. package/pipeline/skills/shared/external/fastapi-pro/SKILL.md +1 -1
  243. package/pipeline/skills/shared/external/firebase/SKILL.md +1 -1
  244. package/pipeline/skills/shared/external/github-actions-templates/SKILL.md +1 -1
  245. package/pipeline/skills/shared/external/help-skills/SKILL.md +1 -1
  246. package/pipeline/skills/shared/external/hig-components-content/SKILL.md +1 -1
  247. package/pipeline/skills/shared/external/hig-components-layout/SKILL.md +1 -1
  248. package/pipeline/skills/shared/external/hig-components-status/SKILL.md +1 -1
  249. package/pipeline/skills/shared/external/hig-components-system/SKILL.md +1 -1
  250. package/pipeline/skills/shared/external/hig-foundations/SKILL.md +1 -1
  251. package/pipeline/skills/shared/external/hig-inputs/SKILL.md +1 -1
  252. package/pipeline/skills/shared/external/hig-patterns/SKILL.md +1 -1
  253. package/pipeline/skills/shared/external/hig-platforms/SKILL.md +1 -1
  254. package/pipeline/skills/shared/external/hig-technologies/SKILL.md +1 -1
  255. package/pipeline/skills/shared/external/html-semantic/SKILL.md +1 -1
  256. package/pipeline/skills/shared/external/humanizer/SKILL.md +1 -1
  257. package/pipeline/skills/shared/external/ios-debugger-agent/SKILL.md +1 -1
  258. package/pipeline/skills/shared/external/ios-developer/SKILL.md +1 -1
  259. package/pipeline/skills/shared/external/kotlin-coroutines-expert/SKILL.md +1 -1
  260. package/pipeline/skills/shared/external/macos-menubar-tuist-app/SKILL.md +1 -1
  261. package/pipeline/skills/shared/external/macos-spm-app-packaging/SKILL.md +1 -1
  262. package/pipeline/skills/shared/external/monorepo-architect/SKILL.md +1 -1
  263. package/pipeline/skills/shared/external/nextjs-app-router/SKILL.md +1 -1
  264. package/pipeline/skills/shared/external/nodejs-backend-patterns/SKILL.md +1 -1
  265. package/pipeline/skills/shared/external/observability-engineer/SKILL.md +1 -1
  266. package/pipeline/skills/shared/external/python-patterns/SKILL.md +1 -1
  267. package/pipeline/skills/shared/external/react-best-practices/SKILL.md +1 -1
  268. package/pipeline/skills/shared/external/rest-api-design/SKILL.md +1 -1
  269. package/pipeline/skills/shared/external/search-first/SKILL.md +2 -2
  270. package/pipeline/skills/shared/external/skill-creator/SKILL.md +12 -12
  271. package/pipeline/skills/shared/external/skill-creator/audit.md +21 -21
  272. package/pipeline/skills/shared/external/skill-creator/checklist.md +3 -3
  273. package/pipeline/skills/shared/external/skill-creator/examples.md +10 -10
  274. package/pipeline/skills/shared/external/skill-creator/label-check.md +17 -17
  275. package/pipeline/skills/shared/external/skill-creator/scripts/audit-panel.js +86 -50
  276. package/pipeline/skills/shared/external/skill-creator/template.md +9 -9
  277. package/pipeline/skills/shared/external/swift-concurrency-expert/SKILL.md +1 -1
  278. package/pipeline/skills/shared/external/swiftui-performance-audit/SKILL.md +1 -1
  279. package/pipeline/skills/shared/external/swiftui-ui-patterns/SKILL.md +1 -1
  280. package/pipeline/skills/shared/external/swiftui-view-refactor/SKILL.md +1 -1
  281. package/pipeline/skills/shared/external/tailwind-css/SKILL.md +1 -1
  282. package/pipeline/skills/shared/external/testing-backend/SKILL.md +1 -1
  283. package/pipeline/skills/shared/external/typescript-patterns/SKILL.md +1 -1
  284. package/pipeline/skills/shared/external/vue-composition/SKILL.md +1 -1
  285. package/pipeline/skills/shared/external/web-accessibility/SKILL.md +1 -1
  286. package/pipeline/skills/shared/external/web-performance/SKILL.md +1 -1
  287. package/pipeline/skills/shared/external/web-testing/SKILL.md +1 -1
  288. package/pipeline/skills/shared/external/xcode-build-benchmark/schemas/build-benchmark.schema.json +9 -49
  289. package/pipeline/skills/skills-index.md +63 -59
  290. package/pipeline/scripts/smoke-plugin-validate.sh +0 -64
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: multi-agent
3
3
  language: en
4
- description: "Task orchestrator: runs the full pipeline from a Jira ID or GitHub Issue URL - analysis → plan → TDD development → parallel review (Fable + Sonnet on Claude Code, GPT + Opus + Sonnet on Copilot CLI) → commit → log. Every step is written to agent-log.md."
4
+ description: "Task orchestrator: runs the full pipeline from a Jira ID or GitHub Issue URL - analysis → plan → TDD development → parallel review (Fable + Sonnet on Claude Code, GPT + Opus + Sonnet on Copilot CLI) → commit → log. Every step is written to agent-log.md. Use when given a Jira ID, a GitHub issue or a free-text task and the whole pipeline should run."
5
5
  user-invocable: true
6
6
  argument-hint: '"PROJ-12345" "feature/PROJ-12345-flight-filter" | "https://github.com/.../issues/316" | status | log #1 | resume #1 | kill #1 | clear-logs | purge | review'
7
7
  ---
@@ -281,6 +281,14 @@ When `dynamicSkillLoading=true` AND the target install is index-only, subagent p
281
281
  Run phases sequentially. Log every step to `agent-log.md`.
282
282
  If any phase fails, mark task as `paused` and stop - user can `resume` later.
283
283
 
284
+ **The blocks below are the routing summary, not the specification.** Each phase's
285
+ full contract lives in `$HOME/.claude/multi-agent-refs/phases/phase-{n}-{name}.md`
286
+ (3200 lines across the set) and is read when that phase actually starts. Modes are
287
+ in `phases/modes.md`, operations in `phases/operations.md`, the log shape in
288
+ `phases/log-format.md`. Where a summary here and a ref disagree, the ref wins and
289
+ the summary is the bug: this file used to carry its own copy of the log format,
290
+ and the copy named a path the code had stopped using.
291
+
284
292
  ### Canonical phase labels (TaskCreate + banner)
285
293
 
286
294
  Every user-facing phase title - TaskCreate cards, `phase-banner.sh` headers, and any status line rendered to the terminal - MUST come from this table. Labels are always English (`promptLanguage` is locked to `en`):
@@ -570,206 +578,24 @@ Skip this sub-step if the task is NOT a component implementation (e.g., bug fix,
570
578
 
571
579
  ## Log File Format
572
580
 
573
- Create at `.worktrees/PROJ-{id}/agent-log.md`:
574
-
575
- ```markdown
576
- # PROJ-{id} - {Task Title}
577
- **Branch**: {branch-name}
578
- **Project**: {my-ios-app | my-figma-app}
579
- **Started**: {YYYY-MM-DD HH:mm}
580
- **Finished**: {YYYY-MM-DD HH:mm}
581
- **Total Duration**: {Xm Ys}
582
- **Status**: 🔄 In Progress | ✅ Complete | ⏸️ Paused | ❌ Failed
583
-
584
- ## Timeline
585
-
586
- | # | Phase | Agent | Model | Duration | Tokens (in/out) | Status | Detail |
587
- |---|-------|-------|-------|----------|-----------------|--------|--------|
588
-
589
- > `Tokens (in/out)` is fed per row from the `phase-tracker.sh tokens` accumulator. If there is no token telemetry, the cell is printed as ` - `.
590
-
591
- ## Agent Activity Report
592
-
593
- ### Agent Usage
594
- | Agent | Call Count | Total Duration | Model(s) | Skill Count |
595
- |-------|-------------|-------------|------------|-------------|
596
- | explore | 3 | 12s | haiku | 0 |
597
- | ios-architect | 1 | 8s | opus | 6 |
598
- | code-reviewer | 3 | 37s | opus, gpt-5.4, sonnet | 5 each |
599
- | security-auditor | 1 | 6s | sonnet | 4 |
600
- | task (build) | 4 | 2m 15s | haiku | 0 |
601
- | **TOTAL** | **12** | **3m 18s** | | |
602
-
603
- ### Token Estimate
604
- | Category | Amount |
605
- |----------|--------|
606
- | Main agent (orchestrator) | ~{N}K tokens |
607
- | Sub-agents (total) | ~{N}K tokens |
608
- | **Total estimate** | **~{N}K tokens** |
609
- | Premium request count | ~{N} |
610
-
611
- > Token amounts are estimates. For exact usage, run the `/usage` command.
612
-
613
- ### Per-Phase Time Distribution
614
- ```
615
- Phase 0: Init ████░░░░░░░░░░░░ 5s
616
- Phase 1: Analysis ██████░░░░░░░░░░ 12s
617
- Phase 2: Planning █████░░░░░░░░░░░ 8s
618
- Phase 3: Dev ████████████████ 2m 35s ← longest
619
- Phase 4: Review ████████░░░░░░░░ 37s
620
- Phase 5: Test ██░░░░░░░░░░░░░░ (waiting on user)
621
- Phase 6: Commit ██░░░░░░░░░░░░░░ 3s
622
- Phase 7: Report ███░░░░░░░░░░░░░ 17s ← Jira + Wiki + Confluence + Log + Knowledge
623
- ```
624
-
625
- ### Review Iterations
626
- | Iteration | Blocking | Important | Suggestion | Decision |
627
- |-----------|----------|-----------|------------|-------|
628
- | R1 | 0 | 1 | 2 | 🟡 fix + re-review |
629
- | R2 | 0 | 0 | 1 | 🟢 pass |
630
-
631
- ## Files Changed
632
-
633
- ## Review Consensus
634
-
635
- ## Cost Breakdown
636
-
637
- (Printed in Phase 7 via `pipeline/scripts/render-agent-log-cost.sh <task-id>`. If there is no token data in the tracker, the renderer returns exit 2 and this section is silently skipped.)
638
-
639
- | Phase | Model | Tokens in | Tokens out | Est. USD |
640
- |-------|-------|-----------|------------|----------|
641
-
642
- ## Test Scenarios (Jira)
643
- ```
644
-
645
- ### Cost Breakdown - emit contract
646
-
647
- The Phase 7 agent-log compose step always attempts this render:
648
-
649
- ```bash
650
- COST_BLOCK=$(bash pipeline/scripts/render-agent-log-cost.sh "$TASK_ID" 2>/dev/null) && \
651
- printf '\n%s\n' "$COST_BLOCK" >> "$AGENT_LOG"
652
- ```
653
-
654
- Independent of `reportContent.costSummary` - agent-log always carries it, PR/Jira bodies are opt-in. The renderer uses `cost-table.json`; a price update flows from a single point to both surfaces at once.
655
-
656
- ---
657
-
658
- ## SwiftUI Component Generation Guide (Generic)
659
-
660
- When the task involves creating a SwiftUI component (any project, not just figma), follow this architecture:
661
-
662
- ### Component Architecture: Configuration / View / Modifiers
581
+ Canonical shape, and the path the code actually uses, live in
582
+ `$HOME/.claude/multi-agent-refs/phases/log-format.md`. Read it when writing
583
+ the log; do not re-derive the format here.
663
584
 
664
- Every component produces up to 5 files:
585
+ This section used to carry its own copy of the whole template, and the copy
586
+ had gone stale in a way that mattered: it said the log lives at
587
+ `.worktrees/PROJ-{id}/agent-log.md`, while `prune-logs.sh` and the phase
588
+ tracker both use `$HOME/.claude/logs/multi-agent/{project}/{task-id}/`. Two
589
+ answers for one path, and the wrong one was the one loaded on every run.
665
590
 
666
- | File | When | Content |
667
- |------|------|---------|
668
- | `{Name}Configuration.swift` | Complex (>3 props) | Pure value type, all declarative properties |
669
- | `{Name}View.swift` | Always | SwiftUI view, renders Configuration |
670
- | `{Name}+Modifiers.swift` | Complex | Fluent modifier API chain |
671
- | `{Name}Preview.swift` | Always | All meaningful variant previews |
672
- | `{Name}Tests.swift` | Always | ViewInspector + Unit tests |
591
+ ## Component Generation
673
592
 
674
- ### Configuration Purity Rule
593
+ Generic guide: `$HOME/.claude/multi-agent-refs/component-generation.md`.
594
+ Dispatch (which plugin skill handles it per CLI):
595
+ `$HOME/.claude/multi-agent-refs/component-dispatch.md`.
675
596
 
676
- Configuration structs hold ONLY declarative, value-type properties:
677
-
678
- ```swift
679
- // ✅ CORRECT - pure value type
680
- struct ButtonConfiguration {
681
- var title: String = ""
682
- var style: ButtonStyle = .primary
683
- var isEnabled: Bool = true
684
- var icon: Image? = nil
685
- }
686
-
687
- // ❌ WRONG - these do NOT belong in Configuration
688
- // Closures → View property
689
- // @Binding → View property
690
- // @State → View property
691
- // AnyView / @ViewBuilder → View generic parameter
692
- ```
693
-
694
- ### View Implementation
695
-
696
- ```swift
697
- struct ButtonView: View {
698
- let configuration: ButtonConfiguration
699
- private var action: (() -> Void)? // closure lives in View, not Config
700
-
701
- var body: some View {
702
- Button(action: { action?() }) {
703
- HStack(spacing: .Spacing.spacing8) {
704
- if let icon = configuration.icon { icon }
705
- Text(configuration.title)
706
- .typographyStyle(.body1)
707
- }
708
- }
709
- .disabled(!configuration.isEnabled)
710
- }
711
- }
712
- ```
713
-
714
- ### Modifier Pattern
715
-
716
- ```swift
717
- extension ButtonView {
718
- func title(_ value: String) -> ButtonView {
719
- var config = configuration
720
- config.title = value
721
- return ButtonView(configuration: config)
722
- }
723
- func style(_ value: ButtonStyle) -> ButtonView {
724
- var config = configuration
725
- config.style = value
726
- return ButtonView(configuration: config)
727
- }
728
- func onTap(_ action: @escaping () -> Void) -> ButtonView {
729
- var view = self
730
- view.action = action
731
- return view
732
- }
733
- }
734
- ```
735
-
736
- ### Simple vs Complex Decision
737
-
738
- | Criteria | Simple | Complex |
739
- |----------|--------|---------|
740
- | Properties | ≤3 | >3 |
741
- | Configuration file | No - props in View directly | Yes - separate struct |
742
- | +Modifiers file | No | Yes |
743
- | View file | All-in-one | Renders Configuration |
744
-
745
- ### 3-Layer Test Strategy
746
-
747
- | Layer | Tool | What It Validates |
748
- |-------|------|-------------------|
749
- | Structural | ViewInspector | Hierarchy, subview existence, applied modifiers |
750
- | Visual | Snapshot Tests | Pixel-correct render: light/dark, RTL/LTR |
751
- | Behavioral | Unit Tests | State changes, closures, configuration mutations |
752
-
753
- ### Component Checklist (Before Commit)
754
-
755
- 1. No magic numbers - all values are design tokens or named constants
756
- 2. Configuration purity - no side-effects or view logic in Config
757
- 3. Modifier correctness - fluent API valid, paired modifiers live in the View
758
- 4. Accessibility - accessibility label/trait on every interactive element
759
- 5. Preview - all meaningful variants in the preview
760
- 6. Test - structural + unit tests written
761
- 7. Dark mode - renders correctly in both color schemes
762
- 8. Dynamic Type - text scales at large sizes without breaking the layout
763
-
764
- ### When a Figma URL Is Provided
765
-
766
- If the user provides a Figma URL:
767
- 1. Fetch the design data with Figma MCP tools (get_design_context, get_screenshot)
768
- 2. Map the design's colors, spacing, and typography onto the project's token system
769
- 3. Apply the Configuration/View/Modifiers pattern above
770
- 4. Use the screenshot as a reference, do not copy it - adapt to the project's existing components
771
-
772
- ---
597
+ Loaded only for a task that generates a component from a design, which is
598
+ what it is for. It was previously inline and paid for on every run.
773
599
 
774
600
  ## Rules
775
601
 
@@ -868,85 +694,6 @@ When `multi-agent status` is called, show:
868
694
 
869
695
  ## Help Display
870
696
 
871
- When called with no args or `help`, detect project and show relevant usage with pipeline explanation:
872
-
873
- First show how it works:
874
- ```
875
- 🤖 How it works (8 phases):
876
- 0. Init - Project detection, worktree creation, state file
877
- 1. Analysis - Codebase scan (parallel explore agents, Fable)
878
- 2. Planning - Task breakdown, architecture review, user approval
879
- 3. Dev - TDD loop: write test → write code → build (Sonnet)
880
- 4. Review - Parallel review + Fable triage. Reviewer set by CLI:
881
- • Claude Code → Fable + Sonnet (2 parallel)
882
- • Copilot CLI → GPT-5.4 + Opus + Sonnet (3 parallel)
883
- 5. Test - Optional: switch to the branch, manual test in Xcode
884
- 6. Commit - Commit + push + PR + issue body update (PR links + progress flags)
885
- 7. Report - A single logical phase (5 steps):
886
- 1) Jira comment (humanized analysis + test scenarios)
887
- 2) Component wiki + Figma screenshot + wiki push (for component tasks)
888
- 3) Optional Confluence page update
889
- 4) Detailed report into agent-log.md + Quality & Metrics + telemetry
890
- 5) Knowledge capture (architecture, patterns, gotchas) + memory
891
-
892
- Every step is logged to agent-log.md. An error in any phase → pause.
893
- resume continues from where it left off.
894
- ```
895
-
896
- Then show project-specific usage:
897
-
898
- **my-ios-app:**
899
- ```
900
- 🤖 Multi-Agent Task Orchestrator (my-ios-app)
901
-
902
- Usage:
903
- multi-agent "PROJ-XXX" "branch-name" → Full pipeline → assigns #ID
904
- multi-agent status → All tasks with #ID, phase, status
905
- multi-agent log [#id] → View task log
906
- multi-agent resume [#id] → Resume paused task
907
- multi-agent kill [#id] → Stop + delete worktree/branch/logs
908
- multi-agent clear-logs → Delete all logs, keep worktrees
909
- multi-agent purge → ⚠️ Full reset: delete everything
910
- multi-agent review → Review current diff only
911
-
912
- Example: multi-agent "PROJ-12345" "feature/PROJ-12345-flight-filter"
913
- ```
914
-
915
- **my-figma-app:**
916
- ```
917
- 🤖 Multi-Agent Task Orchestrator (figma)
918
-
919
- Usage:
920
- multi-agent "github-issue-url" → Full pipeline from issue
921
- multi-agent status → All tasks with #ID, phase, status
922
- multi-agent log [#id] → View task log
923
- multi-agent resume [#id] → Resume paused task
924
- multi-agent kill [#id] → Stop + delete worktree/branch/logs
925
- multi-agent clear-logs → Delete all logs, keep worktrees
926
- multi-agent purge → ⚠️ Full reset: delete everything
927
- multi-agent review → Review current diff only
928
-
929
- Example: multi-agent "https://github.com/my-org/my-figma-app/issues/316"
930
- ```
931
-
932
- **generic (any iOS project):**
933
- ```
934
- 🤖 Multi-Agent Task Orchestrator (generic)
935
-
936
- Usage:
937
- multi-agent "bug/feature description" → Full pipeline from free-text
938
- multi-agent "github-issue-url" → Full pipeline from issue
939
- multi-agent "PROJ-XXX" "branch-name" → Full pipeline with Jira
940
- multi-agent status → All tasks with #ID, phase, status
941
- multi-agent log [#id] → View task log
942
- multi-agent resume [#id] → Resume paused task
943
- multi-agent kill [#id] → Stop + delete worktree/branch/logs
944
- multi-agent clear-logs → Delete all logs, keep worktrees
945
- multi-agent purge → ⚠️ Full reset: delete everything
946
- multi-agent review → Review current diff only
947
-
948
- Example: multi-agent "In LoginView the button color is invisible in dark mode"
949
- ```
950
-
951
- Pipeline: Init → Analysis → Planning → Development → Review → User Test → Commit → Wiki → Report
952
- Each step logged to: .worktrees/{task-id}/agent-log.md
697
+ Rendered by the `multi-agent-help` skill (`/multi-agent:help`), which owns
698
+ the full text in both languages. It used to be duplicated here in English
699
+ only, on a path this skill takes for exactly one input.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: multi-agent-analysis
3
3
  language: en
4
- description: "Standalone feature-spec analysis (v3 template). Platform-agnostic concept layer with repo-driven convention extraction and per-platform Pass B render. 23 main sections + 3 footer in Full mode; 7 sections in Lite mode (auto for small features). Collects Figma / Swagger / Confluence / Jira / Standards / Firebase / repo inputs, then stops. Does not chain into dev or create branches."
4
+ description: "Standalone feature-spec analysis (v3 template). Platform-agnostic concept layer with repo-driven convention extraction and per-platform Pass B render. 23 main sections + 3 footer in Full mode; 7 sections in Lite mode (auto for small features). Collects Figma / Swagger / Confluence / Jira / Standards / Firebase / repo inputs, then stops. Does not chain into dev or create branches. Use when a feature needs a written specification before any code, from Figma, Swagger, Confluence, Jira or repo inputs."
5
5
  user-invocable: true
6
6
  argument-hint: "[\"<analysis-name>\"] [--lite | --full] [--no-cache] [--preview-conventions]"
7
7
  ---
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: multi-agent-analysis-resolve
3
3
  language: en
4
- description: "Resolve the Section 20 Risks and Open Questions of an analysis v3 document one row at a time. Proposes up to 3 source-labeled answer candidates per row (from evidence / from repo / AI reasoned), merges the chosen answer into the target body section, and updates the doc in place with a changelog bump. Companion to multi-agent-analysis."
4
+ description: "Resolve the Section 20 Risks and Open Questions of an analysis v3 document one row at a time. Proposes up to 3 source-labeled answer candidates per row (from evidence / from repo / AI reasoned), merges the chosen answer into the target body section, and updates the doc in place with a changelog bump. Companion to multi-agent-analysis. Use when an analysis document's open questions and risks need answering row by row before development starts."
5
5
  user-invocable: true
6
6
  argument-hint: "[path/to/analysis/<feature>-<platform>.md] [--autonomous]"
7
7
  ---
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: multi-agent-autopilot
3
3
  language: en
4
- description: "Launch any task in autopilot mode: skips every confirmation, runs end-to-end autonomously."
4
+ description: "Launch any task in autopilot mode: skips every confirmation, runs end-to-end autonomously. Use when a task should run end to end with no confirmation prompts."
5
5
  user-invocable: true
6
6
  argument-hint: '"task" - issue URL, Jira ID, free-text, or #id (for resume)'
7
7
  ---
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: multi-agent-build-optimize
3
3
  language: en
4
- description: "Wrapper that dispatches to xcode-build-orchestrator on iOS repos. Benchmarks the current Xcode build, runs compilation / project / SPM analyzers, produces a recommend-first optimization plan in .build-benchmark/, and re-benchmarks after the developer approves changes. Fails fast on non-iOS stacks."
4
+ description: "Wrapper that dispatches to xcode-build-orchestrator on iOS repos. Benchmarks the current Xcode build, runs compilation / project / SPM analyzers, produces a recommend-first optimization plan in .build-benchmark/, and re-benchmarks after the developer approves changes. Fails fast on non-iOS stacks. Use when an iOS build is slow and needs measuring before anything is changed."
5
5
  user-invocable: true
6
6
  argument-hint: "(none - operates on current repo)"
7
7
  ---
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: multi-agent-create-jira
3
3
  language: en
4
- description: "Create a standards-compliant Jira issue (Task / Bug / Story): asks the type, mines project conventions, drafts from a standard template with auto-sizing sections, full preview + explicit approval before create."
4
+ description: "Create a standards-compliant Jira issue (Task / Bug / Story): asks the type, mines project conventions, drafts from a standard template with auto-sizing sections, full preview + explicit approval before create. Use when a Jira Task, Bug or Story has to be written to the project's own conventions."
5
5
  user-invocable: true
6
6
  argument-hint: "[\"<free-text description>\"] [figma-url] [swagger-url] - all optional, asked interactively when missing"
7
7
  ---
@@ -0,0 +1,248 @@
1
+ ---
2
+ name: multi-agent-design-check
3
+ language: en
4
+ description: "Mock-mode vs Figma design audit (iOS / Android, local-only). Pick repo + module, gate on mock support, enumerate every state driver into a countable target set, build Debug in a worktree, launch in mock mode, fetch Figma variants, compare each pixel + px-spacing + typography + color, and export a side-by-side annotated report (HTML + PDF + Confluence) to ~/DesignChecks. A coverage gate fails the run when a target is neither audited nor skipped with a reason."
5
+ user-invocable: true
6
+ argument-hint: '[scope] - empty = whole module; screen name; screen@variant; Figma URL(s); --resume'
7
+ ---
8
+
9
+ # multi-agent-design-check - Mock-mode vs Figma design audit
10
+
11
+ 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.
12
+
13
+ **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.
14
+
15
+ > **Language**: `promptLanguage=en` always (this spec stays English). `outputLanguage` applies to conversational lines and the human-readable report - pass it to `design_report` as `report.lang` (engine defaults to English, ships `en` + `tr` packs, per-key `report.labels` overrides). `ask_choice` labels/headers, branch names, paths, code identifiers stay English.
16
+
17
+ ## Scope - `$ARGUMENTS`
18
+
19
+ The scope decides which **inventory targets** (Phase 0 step 5) the run must audit. It never changes how thoroughly each target is audited.
20
+
21
+ | Form | Example | Scope |
22
+ |------|---------|-------|
23
+ | empty / `module` | (no argument) | Every target in the module's inventory |
24
+ | screen name | `boarding-pass` | Every target whose `screen` matches (case/separator-insensitive) |
25
+ | `screen@variant` | `boarding-pass@expired` | One target |
26
+ | target id | `scenario-case:boardingpassoutcome-expired` | One target, exactly |
27
+ | Figma URL(s) | `https://figma.com/design/...?node-id=1-2` | Only the frames those URLs name |
28
+ | `--resume` | `--resume` | The unaudited remainder of the most recent run for this repo + module |
29
+ | combinations | `seat-map summary@semi-success` | Union of the above, space- or newline-separated |
30
+
31
+ A scope matching **no** inventory target is an error, not an empty run: print the closest inventory ids and halt.
32
+
33
+ **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 - a full audit is one sitting, not a project. 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** set, so a deliberate scoped run is never penalised for out-of-scope targets, and `--resume` closes the remainder.
34
+
35
+ ## Pipeline
36
+
37
+ ```
38
+ Phase 0: Init & Gate → repo + module picker, platform detect, MOCK FEASIBILITY GATE, SCENARIO INVENTORY, scope resolve, report dir, worktree
39
+ Phase 1: Build & Launch → Debug build in worktree, boot device, install, launch in mock mode
40
+ Phase 2: Figma → fetch module frame tree, enumerate + map variants (ask when ambiguous)
41
+ Phase 3: Drive & Compare → per plan batch: one launch → capture + flip in-app states → match → batch-ask → compare
42
+ Phase 4: Report → coverage gate + assemble + export HTML + PDF (+ Confluence) to ~/DesignChecks/
43
+ ```
44
+
45
+ ## Requirements
46
+
47
+ - **iOS**: Xcode + Simulator. **Android**: Android SDK + emulator / device.
48
+ - **MCP**: `dev-toolkit` (>= 2.8.0, for `design_scenario_inventory`, the `design_report` coverage gate, and `design_visual_compare` region alignment) + an authenticated Figma MCP (`mcp__claude_ai_Figma__*`).
49
+ - The selected module must support a mock mode (Phase 0 gate). No mock support → halt.
50
+
51
+ ## Phase Tracker (mandatory)
52
+
53
+ ```bash
54
+ bash $HOME/.copilot/scripts/phase-tracker.sh init "$TASK_ID"
55
+ for p in "0:Init & Gate" "1:Build & Launch" "2:Figma" "3:Drive & Compare" "4:Report"; do
56
+ bash $HOME/.copilot/scripts/phase-tracker.sh add "${p%%:*}" "${p#*:}"
57
+ done
58
+ ```
59
+ Copilot / plain shell has no TaskList widget - after every state change call `phase-tracker.sh render` (prints a bordered ANSI card). Do NOT call TaskCreate here.
60
+
61
+ ## STOP-AND-CONFIRM
62
+
63
+ Every Phase 0 / Phase 2 decision uses the `ask_choice` picker (`$HOME/.copilot/lib/ask-choice.sh`). Print a `Step <i>/<n>: <what it decides>` breadcrumb first. Confirmation required even with one option; state inheritance from a previous run is FORBIDDEN.
64
+
65
+ ---
66
+
67
+ ## Phase 0 - Init, Feasibility Gate & Inventory
68
+
69
+ 0. **MCP CURRENCY GATE (first, before anything expensive)** - an MCP stdio server publishes its tool list once at `initialize` and never re-reads the code, so a session bound to a process that started before the last update keeps serving the OLD tool list while still reporting "connected". Finding that out after a Debug build and a device drive wastes the run and yields a report missing the checks this spec depends on.
70
+
71
+ Assert both halves:
72
+
73
+ a. **Session** - `mcp__dev-toolkit__design_scenario_inventory` must be callable and `mcp__dev-toolkit__design_visual_compare` must accept `live_region`. Absent → the session holds a stale process.
74
+
75
+ b. **Disk** - probe the configured server, which reports what a fresh connection WOULD serve:
76
+ ```bash
77
+ printf '%s\n%s\n' \
78
+ '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"probe","version":"1"}}}' \
79
+ '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' \
80
+ | node "<dev-toolkit path>/index.js" 2>/dev/null | python3 -c "
81
+ import sys,json
82
+ for l in sys.stdin:
83
+ try: m=json.loads(l)
84
+ except: continue
85
+ if m.get('id')==1: print('version', m['result']['serverInfo']['version'])
86
+ if m.get('id')==2:
87
+ n=[t['name'] for t in m['result']['tools']]
88
+ print('tools', len(n), 'inventory', 'design_scenario_inventory' in n)"
89
+ ```
90
+
91
+ - **disk OK, session missing the tool** → **HALT**; the user must reconnect the MCP server (a stale build advertises one fewer `design_*` tool, which is the quickest tell). If a reconnect does not take, lingering server processes are the usual cause - compare `ps -o lstart=` start times against the code's mtime.
92
+ - **disk stale** → **HALT**; the checkout needs updating first.
93
+ - **both current** → continue.
94
+
95
+ Never substitute a local `node` call for a missing tool: the run would silently lose the coverage gate and region alignment, which is the exact failure this gate prevents.
96
+
97
+ 1. **Repo picker** - `$HOME/.copilot/multi-agent-refs/_repo-picker.md`. Account picker skipped (Figma token user-supplied) unless Confluence export needs a token.
98
+ 2. **Module picker** - `$HOME/.copilot/multi-agent-refs/_dev-context.md` (auto-suggest `.gitmodules` via `submodule-detector.sh`). Pick the module to audit (multi-module = audit each independently).
99
+ 3. **Platform detect** - `.xcodeproj`/`Package.swift`→iOS, `build.gradle*`→Android. Persist `state.platform`.
100
+ 4. **MOCK FEASIBILITY GATE** on the module path:
101
+ ```
102
+ mcp__dev-toolkit__design_mock_detect({ repo_path, platform, extra_keys })
103
+ ```
104
+ (`extra_keys` from `config mock.keys`.)
105
+ - `false` → **HALT** with `reason`; the module cannot be audited. Never fabricate a comparison.
106
+ - `"debug-only"` → warn via ask_choice (variants can't be toggled at launch; only default Debug state comparable), Continue / Cancel.
107
+ - `true` → persist `state.designCheck.mock` (mechanism, activation, variantsHint, evidence).
108
+ 5. **SCENARIO INVENTORY (this is the audit's target set)**:
109
+ ```
110
+ mcp__dev-toolkit__design_scenario_inventory({ repo_path, platform,
111
+ extra_launch_args: <config inventory.extraLaunchArgs>,
112
+ extra_targets: <config inventory.extraTargets>,
113
+ ignore_targets: <config inventory.ignoreTargets> })
114
+ ```
115
+ Returns `targets[]` - each `{ id, kind, label, screen, driver, cost, evidence }` - plus `plan[]`, `relaunchCount`, `groups[]`, `byKind`, `byCost`, `ignored[]`, `truncated`, `scanStrategy`. Kinds: `launch-arg`, `scenario-case`, **`prefix-code`** (a mock repository branching on the prefix of the reference the user types - usually the LARGEST group, and the one a selector-only search misses entirely), `code-scenario`, `fixture`, `deep-link`.
116
+
117
+ This list, not the agent's reading of the code and not what the UI happens to expose to tapping, is what the run is measured against. Persist verbatim to `state.designCheck.inventory`.
118
+ - `targetCount: 0` → warn that only the default launch state is auditable (a `debug-only` project legitimately lands here).
119
+ - `truncated: true` → the target set is INCOMPLETE. Say so now and pass `coverage.truncatedInventory: true` in Phase 4 so the gate fails instead of reporting a clean percentage of a partial denominator; narrow to a screen and work through the module in `--resume` steps.
120
+ - `ignored[]` non-empty → list what the config dropped, so a stale `ignoreTargets` cannot quietly shrink the audit.
121
+ 6. **Scope resolve** - intersect `$ARGUMENTS` with `inventory.targets`; persist `state.designCheck.scope = { argument, targetIds[] }`.
122
+
123
+ Print the resolved set grouped by screen **with its relaunch cost**: `<n> targets · <relaunchCount> relaunches`. Read the cost from `plan`, not from the target count - one relaunch serves every in-app target on that screen, so a 50-target module is typically a dozen relaunches. **Whole-module is the intended default**; ask_choice only when `relaunchCount` exceeds `config coverage.confirmAbove` (default 25), phrased as a cost estimate rather than an invitation to shrink the audit. Never offer a smaller scope as the easy path.
124
+ 7. **`--resume`** - read the most recent `~/DesignChecks/{repo}__{module}/*/run-state.json`; scope becomes that run's targets minus `covered` minus `skipped`. No previous run → say so and fall back to whole-module scope after confirmation.
125
+ 8. **Report dir** - create `~/DesignChecks/{repo}__{module}/{UTC-timestamp}/` (plus `assets/`) now and persist as `state.designCheck.reportDir`. Phase 3 writes captures, comparison images, and `run-state.json` into it, so it must exist before driving starts.
126
+ 9. **Worktree** - `{projectRoot}/{worktreeBasePath}/{taskId}` (default `.worktrees/DC-<shortId>`), never under $HOME. Prune stale locks + add `.worktrees/` to `.git/info/exclude` first.
127
+
128
+ Persist `agent-state.json` (`mode: "design-check"`, platform, projectRoot, worktreePath, module, designCheck).
129
+
130
+ ## Phase 1 - Build & Launch (mock)
131
+
132
+ 1. **Debug build** in the worktree: iOS `mcp__dev-toolkit__ios_xcodebuild({ scheme, configuration: "Debug", action: "build" })`; Android `./gradlew :<module>:assembleDebug`.
133
+ 2. **Boot + install**: iOS list/boot device + `xcrun simctl install`; Android running emulator + `adb install -r`.
134
+ 3. **Deterministic state**: iOS `ios_status_bar({ preset: "clean" })`; fix appearance + locale.
135
+ 4. **Launch mock**: `mcp__dev-toolkit__design_mock_launch({ platform, bundle_id|package_name, launch_arg|intent_extra })` from Phase 0 activation. `debug-only` → just launch the Debug build. The build is installed once; Phase 3 relaunches it per target rather than rebuilding.
136
+
137
+ ## Phase 2 - Figma fetch & variant mapping (module-scoped)
138
+
139
+ Figma **discovery** happens only here: the frame tree is fetched once and no later phase browses Figma for candidates. Phase 3 may fetch a specific node the user hands over in the 3.3 batch-ask - a targeted fetch of an already-identified frame, and the only Figma call allowed after this phase.
140
+
141
+ 1. Resolve the Figma URL (`$ARGUMENTS` or ask). Parse `fileKey` + `nodeId` (`-`→`:`).
142
+ 2. `mcp__claude_ai_Figma__get_metadata` → frame tree; direct child frames = candidate variants.
143
+ 3. Map each scoped target's `screen` + `label` (and `variantsHint`) → frames by similarity. Ambiguous/unmatched → deferred to the Phase 3.3 batch-ask (where the live capture can be shown); never guess. `debug-only` → single default variant.
144
+ 4. Per variant: `get_screenshot` (design PNG) + `get_design_context` (bbox, itemSpacing, paddings, fontSize/fontFamily, fills, CodeConnect name). Flatten to `figma_spec`; record `figmaFrame` size.
145
+
146
+ Persist `state.designCheck.variants[]`.
147
+
148
+ ## Phase 3 - Drive every scoped target → capture → match → batch-ask → compare
149
+
150
+ **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 needing a different launch argument, scenario case, or typed scenario code - which is exactly how a module's error / edge states go missing.
151
+
152
+ ### 3.1 Drive the inventory's plan, batch by batch
153
+
154
+ **Follow `inventory.plan`, filtered to the scoped ids.** Each batch is one launch: the batch's relaunch target opens a screen, and every in-app target for that screen is flipped while the app is already there. Driving the plan is what makes full coverage affordable - target-by-target relaunching is what made earlier runs give up a third of the way in.
155
+
156
+ Per batch: launch once with the batch's `launch` driver (or the plain mock activation for `(default launch)`) → navigate → capture the relaunch target → for each in-app target, flip its selector, let the screen re-render, capture. **No relaunch between in-app targets.**
157
+
158
+ Per-target activation by `driver.type`:
159
+
160
+ | `driver.type` | Activation |
161
+ |---|---|
162
+ | `launch-arg` | `design_mock_launch({ launch_arg: "<mock activation> <driver.launchArg>" })` - the mock switch AND the target's flag together |
163
+ | `intent-extra` | `design_mock_launch({ intent_extra: "<mock extra> <driver.intentExtra>" })` |
164
+ | `scenario` | Set `driver.enum` to `driver.case` through the build's debug scenario picker, then drive the flow that consumes it |
165
+ | `code` (from `prefix-code`) | Type a reference beginning with `driver.code` at the entry field, then walk to `driver.appliesTo`. The prefix decides which fixture the mock repository returns - this is how most per-screen variants are reached |
166
+ | `code` (from `code-scenario`) | Same entry field, flow-wide code not owned by one screen |
167
+ | `fixture` | Activate the launch arg / scenario that reads `driver.file`; when nothing does → skip with reason "fixture not reachable from any driver" |
168
+ | `deep-link` | `ios_open_url` / `android_open_url` with `driver.url` |
169
+ | `manual` | Config-declared: follow the config's note, or skip with that note as the reason |
170
+
171
+ While a target's state is on screen, also capture the **sub-states reachable from it by tapping** - overlays, bottom sheets, modals, popups, inline errors, QR / share sheets. These cost no relaunch and belong to the target that exposed them (`<id>#<sub-label>`).
172
+
173
+ Per capture: `ios_screenshot`/`android_screenshot` (save PNG into the Phase 0 report dir) + `mcp__dev-toolkit__design_ui_geometry` → append to `state.designCheck.captured[]` with the target id and a human label. **Persist `state` and `run-state.json` after every capture** so a dying run resumes from where it stopped.
174
+
175
+ Unreachable target → record `{ id, reason }` in `state.designCheck.skipped[]` with a concrete reason ("scenario picker not present in this build", "needs a live PNR", "crashes on launch: <symbol>"). "Requires a scenario / prefix / launch-arg" is **not** a reason - that describes the work, and the work is this phase's job.
176
+
177
+ ### 3.2 Match each capture → Figma frame (auto)
178
+
179
+ Resolve each captured screen's frame from the Phase 2 tree; match by structure/content; accept only a **confident** match → `pairs[]`.
180
+
181
+ ### 3.3 Batch-ask the user for EVERYTHING unmatched (ONE prompt, WITH the visual)
182
+
183
+ Collect ALL unmatched captures into a single list and ask ONCE - never guess, never show a wrong frame. **Show each unmatched screen's captured screenshot** (attach the PNG), name the screen, ask for the Figma node-id / URL in `outputLanguage`, optionally list best-guess candidates. Each answer becomes a confirmed pair; a declined screen is a skip with reason "no Figma frame supplied".
184
+
185
+ ### 3.4 Compare ALL pairs in one pass
186
+
187
+ ```
188
+ mcp__dev-toolkit__design_visual_compare({ figma_png, live_png, out_dir, label,
189
+ figma_spec, live_geometry, figma_frame, live_screen,
190
+ crop_top_live, tolerance_px: 2, color_tolerance: 3, max_diff_pct: 1.0 })
191
+ ```
192
+ Collect findings (spacing/size/position px, color ΔE hex, typography), perceptualPct, images.
193
+
194
+ **Bottom sheets, modals, and any partial overlay need region alignment.** Their Figma frame covers only the sheet while the capture is the whole screen; passing that pair as-is stretches a full screen onto a sheet-shaped frame, misplacing every element inside the sheet and burying the real defect in noise. For any capture whose frame is not full-screen add:
195
+
196
+ ```
197
+ live_region: <the sheet container's {x,y,w,h} from design_ui_geometry>,
198
+ expected_region: <where the design puts that sheet, same units>
199
+ ```
200
+ - `live_region` rebases the comparison onto the sheet's own box - read it from the `design_ui_geometry` element that IS the sheet container, never from a guess.
201
+ - `expected_region` comes from the Figma frame's placement inside its parent screen frame; with it the engine emits an `inset` finding per edge.
202
+ - `crop_top_live` is ignored when `live_region` is given (the region crop already excluded chrome).
203
+
204
+ **Edge insets are defects, not tolerances.** A design showing a sheet flush to the screen edges is not satisfied by one floating in from them, and the reverse is equally wrong. Report every `inset` finding as a deviation with its px delta; never absorb a side gap as "close enough" and never raise `tolerance_px` to make one disappear. The sheet's internal content padding is measured by the normal element pairing once the region alignment is right.
205
+
206
+ **Component reference** (best-effort): Code Connect atom → attach matching `*.figma.swift`/`*.figma.kt` component render.
207
+ **Fix prompt**: compose a paste-ready developer prompt from the findings.
208
+
209
+ ### 3.5 Close the ledger
210
+
211
+ Every scoped target id ends in exactly one bucket: **covered** (captured AND compared) or **skipped** (with a concrete reason from 3.1 / 3.3). Write `run-state.json` into the Phase 0 report dir with `{ targetIds, covered, skipped }` so `--resume` can pick up the remainder.
212
+
213
+ 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.
214
+
215
+ ## Phase 4 - Report, coverage gate & export
216
+
217
+ 1. Output dir: `state.designCheck.reportDir`, already created in Phase 0, holding Phase 3's captures and comparison images. Do not mint a second timestamped dir.
218
+ 2. Assemble the report object:
219
+ ```
220
+ { project, module, platform, figmaUrl, figmaFileKey, timestamp, lang: <outputLanguage>,
221
+ coverage: { targets: <scoped target ids/objects>, covered: <audited ids>,
222
+ skipped: [{ id, group, reason }],
223
+ truncatedInventory: <inventory.truncated>,
224
+ floor: <config coverage.floor, optional> },
225
+ variants: [{ name, figmaNodeId, perceptualPct, passed, compareSize, liveSize,
226
+ images, findings, fixPrompt, componentRefs }] }
227
+ ```
228
+ Pass **ids**, not counts: the engine then names each unaccounted target instead of printing an anonymous tally. `compareSize` / `liveSize` come straight from the `design_visual_compare` result.
229
+ 3. Export:
230
+ ```
231
+ mcp__dev-toolkit__design_report({ report, out_dir: state.designCheck.reportDir,
232
+ formats: ["html","pdf"] (+ "confluence" if enabled) })
233
+ ```
234
+ HTML self-contained with the gate banner on top; PDF via Playwright (reports `pdfError` if unavailable); Confluence only if enabled (reuse `multi-agent-channels` adapter), else graceful skip.
235
+ 4. **COVERAGE GATE (blocking, not advisory)** - read `coverage` from the tool result and persist to `state.designCheck.coverage`:
236
+ - `gate: "pass"` → print per-variant PASS/FAIL + findings + report paths.
237
+ - `gate: "fail"` → the run is **INCOMPLETE**. Print `coverageError`, the `unaccountedIds`, and the command that closes the gap (`--resume`). Do not present an incomplete audit as finished, and never pad the covered list to make the gate pass.
238
+
239
+ The gate is a last line of defence, not the plan. If it fires, Phase 3 left work undone - drive the missing targets, then report.
240
+ 5. Remove the worktree unless asked to keep it. The report dir is never removed.
241
+
242
+ ## Notes
243
+
244
+ - Feasibility is real - report honestly and stop when a module has no mock support; never fabricate a partial comparison.
245
+ - **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.
246
+ - **Chunk with scope, not with silence**: a 50-target module is a legitimate multi-run job. Scope it, close each run's gate, let `--resume` carry the remainder.
247
+ - "Pixel perfect" is perceptual + geometric (scale normalized, chrome cropped); deltas reported in px/pt/hex with a tolerance.
248
+ - The `design_*` engine is generic; project specifics (mock keys, extra launch args / targets, node overrides, status-bar crop, coverage floor, Confluence toggle) come from `design-check-config.json` / prefs, never hardcoded.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: multi-agent-dev
3
3
  language: en
4
- description: "Fast development mode: Init → Dev (Opus) → Test → Commit → Report. Analysis, planning, and review phases are skipped."
4
+ description: "Fast development mode: Init → Dev (Opus) → Test → Commit → Report. Analysis, planning, and review phases are skipped. Use when the work is already scoped and only development, test and commit are needed."
5
5
  user-invocable: true
6
6
  argument-hint: '"task" [autopilot] - issue URL, Jira ID, or free-text + optional autopilot'
7
7
  ---