@mmerterden/multi-agent-pipeline 11.2.0 → 11.3.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 (335) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +2 -2
  3. package/docs/FIGMA_PIPELINE.md +12 -25
  4. package/docs/architecture.md +3 -5
  5. package/docs/features.md +8 -8
  6. package/install/_dev-only-files.mjs +0 -6
  7. package/install/claude.mjs +39 -17
  8. package/install/copilot.mjs +22 -16
  9. package/install/templates/copilot-instructions.md +3 -3
  10. package/package.json +1 -1
  11. package/pipeline/commands/{multi-agent.md → multi-agent/SKILL.md} +39 -39
  12. package/pipeline/commands/multi-agent/{analysis.md → analysis/SKILL.md} +18 -18
  13. package/pipeline/commands/multi-agent/{analysis-resolve.md → analysis-resolve/SKILL.md} +4 -4
  14. package/pipeline/commands/multi-agent/{autopilot.md → autopilot/SKILL.md} +4 -4
  15. package/pipeline/commands/multi-agent/{build-optimize.md → build-optimize/SKILL.md} +1 -1
  16. package/pipeline/commands/multi-agent/{channels.md → channels/SKILL.md} +12 -12
  17. package/pipeline/commands/multi-agent/{dev.md → dev/SKILL.md} +4 -4
  18. package/pipeline/commands/multi-agent/{dev-autopilot.md → dev-autopilot/SKILL.md} +4 -4
  19. package/pipeline/commands/multi-agent/{dev-local.md → dev-local/SKILL.md} +5 -5
  20. package/pipeline/commands/multi-agent/{dev-local-autopilot.md → dev-local-autopilot/SKILL.md} +4 -4
  21. package/pipeline/commands/multi-agent/{finish.md → finish/SKILL.md} +6 -6
  22. package/pipeline/commands/multi-agent/{generate.md → generate/SKILL.md} +3 -3
  23. package/pipeline/commands/multi-agent/{help.md → help/SKILL.md} +4 -4
  24. package/pipeline/commands/multi-agent/{local.md → local/SKILL.md} +5 -5
  25. package/pipeline/commands/multi-agent/{local-autopilot.md → local-autopilot/SKILL.md} +5 -5
  26. package/pipeline/commands/multi-agent/{manual-test.md → manual-test/SKILL.md} +1 -1
  27. package/pipeline/commands/multi-agent/refactor/SKILL.md +257 -0
  28. package/pipeline/commands/multi-agent/{resume.md → resume/SKILL.md} +1 -1
  29. package/pipeline/commands/multi-agent/{review.md → review/SKILL.md} +5 -5
  30. package/pipeline/commands/multi-agent/{setup.md → setup/SKILL.md} +1 -1
  31. package/pipeline/commands/multi-agent/{sync.md → sync/SKILL.md} +20 -58
  32. package/pipeline/lib/credential-store.sh +8 -4
  33. package/pipeline/{commands/multi-agent → multi-agent-refs}/_account-picker.md +2 -2
  34. package/pipeline/{commands/multi-agent → multi-agent-refs}/_dev-context.md +2 -2
  35. package/pipeline/{commands/multi-agent → multi-agent-refs}/_repo-picker.md +2 -2
  36. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/android-guide.md +1 -1
  37. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/channels/jira.md +1 -1
  38. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/channels/wiki.md +7 -7
  39. package/pipeline/multi-agent-refs/component-dispatch.md +92 -0
  40. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/cross-cli-contract.md +10 -77
  41. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/features/verify-by-test.md +1 -1
  42. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/generate-issue.md +2 -2
  43. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/issue-jira-triad.md +1 -1
  44. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/keychain.md +1 -1
  45. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/phases/log-format.md +1 -1
  46. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/phases/modes.md +2 -2
  47. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/phases/operations.md +1 -1
  48. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/phases/phase-0-init.md +10 -10
  49. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/phases/phase-1-analysis.md +6 -6
  50. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/phases/phase-2-planning.md +3 -3
  51. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/phases/phase-3-dev.md +10 -10
  52. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/phases/phase-4-review.md +8 -8
  53. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/phases/phase-5-test.md +3 -3
  54. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/phases/phase-6-commit.md +4 -4
  55. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/phases/phase-7-report.md +6 -6
  56. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/phases.md +12 -12
  57. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/progress-contract.md +4 -4
  58. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/swiftui-guide.md +1 -1
  59. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/tracker-contract.md +3 -3
  60. package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/wiki-capture.md +4 -4
  61. package/pipeline/preferences-template.json +17 -1
  62. package/pipeline/rules/figma-pipeline.md +2 -2
  63. package/pipeline/schemas/prefs.schema.json +0 -34
  64. package/pipeline/scripts/README.md +1 -3
  65. package/pipeline/scripts/build-skills-index.mjs +3 -6
  66. package/pipeline/scripts/eval-mine-corpus.mjs +187 -0
  67. package/pipeline/scripts/fixtures/install-layout.tsv +6 -5
  68. package/pipeline/scripts/gen-mode-dispatch.mjs +3 -3
  69. package/pipeline/scripts/lint-skills.mjs +26 -1
  70. package/pipeline/scripts/phase-banner.sh +2 -2
  71. package/pipeline/scripts/review-scope.mjs +94 -0
  72. package/pipeline/scripts/scan-agent-config.sh +2 -2
  73. package/pipeline/scripts/smoke-agent-log-cost.sh +1 -1
  74. package/pipeline/scripts/smoke-agent-model-routing.sh +4 -4
  75. package/pipeline/scripts/smoke-autopilot-circuit-breaker.sh +2 -2
  76. package/pipeline/scripts/smoke-channels-approval-gate.sh +2 -2
  77. package/pipeline/scripts/smoke-channels-flow.sh +5 -5
  78. package/pipeline/scripts/smoke-clarify.sh +1 -1
  79. package/pipeline/scripts/smoke-commands-skills-parity.sh +3 -3
  80. package/pipeline/scripts/smoke-community-gates.sh +1 -1
  81. package/pipeline/scripts/smoke-compliance-skills.sh +2 -2
  82. package/pipeline/scripts/smoke-cost-summary.sh +1 -1
  83. package/pipeline/scripts/smoke-cross-cli-behavior.sh +17 -43
  84. package/pipeline/scripts/smoke-cross-phase-cohesion.sh +1 -1
  85. package/pipeline/scripts/smoke-dev-critic.sh +1 -1
  86. package/pipeline/scripts/smoke-diff-explain.sh +1 -1
  87. package/pipeline/scripts/smoke-diff-risk.sh +1 -1
  88. package/pipeline/scripts/smoke-evidence-gate.sh +1 -1
  89. package/pipeline/scripts/smoke-figma-dispatch.sh +46 -57
  90. package/pipeline/scripts/smoke-gate-hooks.sh +1 -1
  91. package/pipeline/scripts/smoke-generate-issue.sh +8 -8
  92. package/pipeline/scripts/smoke-handoff-contract.sh +3 -3
  93. package/pipeline/scripts/smoke-identity-isolation.sh +2 -2
  94. package/pipeline/scripts/smoke-intent-guard.sh +1 -1
  95. package/pipeline/scripts/smoke-issue-comment-template.sh +2 -2
  96. package/pipeline/scripts/smoke-issue-jira-triad.sh +4 -4
  97. package/pipeline/scripts/smoke-language-axis.sh +6 -6
  98. package/pipeline/scripts/smoke-learnings-ledger.sh +3 -3
  99. package/pipeline/scripts/smoke-mode-dispatch-drift.sh +16 -16
  100. package/pipeline/scripts/smoke-model-fallback.sh +3 -3
  101. package/pipeline/scripts/smoke-multi-repo-integration.sh +2 -2
  102. package/pipeline/scripts/smoke-multi-repo-worktree.sh +1 -1
  103. package/pipeline/scripts/smoke-no-token-prompt.sh +5 -5
  104. package/pipeline/scripts/smoke-phase-0-multi-repo.sh +1 -1
  105. package/pipeline/scripts/smoke-phase-6-multi.sh +1 -1
  106. package/pipeline/scripts/smoke-phase4-gates.sh +45 -0
  107. package/pipeline/scripts/smoke-plan-approval-gate.sh +5 -5
  108. package/pipeline/scripts/smoke-plan-todos.sh +3 -3
  109. package/pipeline/scripts/smoke-pr-review-actions.sh +3 -3
  110. package/pipeline/scripts/smoke-prefs-language.sh +1 -1
  111. package/pipeline/scripts/smoke-progress-contract.sh +2 -2
  112. package/pipeline/scripts/smoke-push-retry.sh +1 -1
  113. package/pipeline/scripts/smoke-repo-map.sh +2 -2
  114. package/pipeline/scripts/smoke-shadow-git.sh +1 -1
  115. package/pipeline/scripts/smoke-skill-authoring.sh +4 -9
  116. package/pipeline/scripts/smoke-tasklist-ordering.sh +10 -10
  117. package/pipeline/scripts/smoke-test-gap.sh +1 -1
  118. package/pipeline/scripts/smoke-token-budget.sh +1 -1
  119. package/pipeline/scripts/smoke-token-preflight.sh +2 -2
  120. package/pipeline/scripts/smoke-tracker-contract.sh +13 -13
  121. package/pipeline/scripts/smoke-tracker-tokens-invocation.sh +5 -5
  122. package/pipeline/scripts/smoke-triage-memory.sh +2 -2
  123. package/pipeline/scripts/smoke-update-check.sh +1 -1
  124. package/pipeline/scripts/smoke-url-enrichment.sh +2 -2
  125. package/pipeline/scripts/smoke-validator-gates.sh +1 -1
  126. package/pipeline/scripts/smoke-verify-by-test.sh +3 -3
  127. package/pipeline/scripts/smoke-wiki-integration.sh +9 -33
  128. package/pipeline/scripts/smoke-work-summary.sh +1 -1
  129. package/pipeline/scripts/smoke-worktree-path-convention.sh +4 -4
  130. package/pipeline/scripts/test-integrity-gate.mjs +83 -0
  131. package/pipeline/scripts/uninstall.mjs +17 -6
  132. package/pipeline/skills/.skill-manifest.json +40 -160
  133. package/pipeline/skills/.skills-index.json +3 -373
  134. package/pipeline/skills/shared/README.md +1 -1
  135. package/pipeline/skills/shared/core/multi-agent/SKILL.md +1 -1
  136. package/pipeline/skills/shared/core/multi-agent-analysis/SKILL.md +2 -2
  137. package/pipeline/skills/shared/core/multi-agent-analysis-resolve/SKILL.md +3 -3
  138. package/pipeline/skills/shared/core/multi-agent-build-optimize/SKILL.md +1 -1
  139. package/pipeline/skills/shared/core/multi-agent-channels/SKILL.md +1 -1
  140. package/pipeline/skills/shared/core/multi-agent-finish/SKILL.md +1 -1
  141. package/pipeline/skills/shared/core/multi-agent-help/SKILL.md +1 -1
  142. package/pipeline/skills/shared/core/multi-agent-refactor/SKILL.md +116 -51
  143. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +8 -30
  144. package/pipeline/skills/shared/external/compose-components/SKILL.md +14 -14
  145. package/pipeline/skills/skills-index.md +3 -44
  146. package/pipeline/commands/multi-agent/refactor.md +0 -188
  147. package/pipeline/commands/multi-agent/refs/component-dispatch.md +0 -92
  148. package/pipeline/scripts/smoke-existing-discovery-gate.sh +0 -71
  149. package/pipeline/scripts/smoke-figma-android-parity.sh +0 -148
  150. package/pipeline/scripts/smoke-figma-credential-store.sh +0 -105
  151. package/pipeline/scripts/smoke-figma-cross-cli-inventory.sh +0 -177
  152. package/pipeline/scripts/smoke-figma-sync.sh +0 -149
  153. package/pipeline/scripts/smoke-sync-delegation.sh +0 -74
  154. package/pipeline/skills/figma-android/README.md +0 -38
  155. package/pipeline/skills/figma-android/figma-component-code-connect/SKILL.md +0 -62
  156. package/pipeline/skills/figma-android/figma-component-implement/SKILL.md +0 -158
  157. package/pipeline/skills/figma-android/figma-component-test/SKILL.md +0 -120
  158. package/pipeline/skills/figma-android/figma-component-wiki/SKILL.md +0 -35
  159. package/pipeline/skills/figma-android/figma-to-component/SKILL.md +0 -124
  160. package/pipeline/skills/figma-common/README.md +0 -64
  161. package/pipeline/skills/figma-common/figma-bottom-sheets/SKILL.md +0 -152
  162. package/pipeline/skills/figma-common/figma-cli-iterate/SKILL.md +0 -282
  163. package/pipeline/skills/figma-common/figma-cli-iterate-mend/SKILL.md +0 -503
  164. package/pipeline/skills/figma-common/figma-cli-lean-iterate/SKILL.md +0 -288
  165. package/pipeline/skills/figma-common/figma-cli-skip/SKILL.md +0 -362
  166. package/pipeline/skills/figma-common/figma-commit/COMMON_REBASE.md +0 -206
  167. package/pipeline/skills/figma-common/figma-commit/REVIEW.md +0 -337
  168. package/pipeline/skills/figma-common/figma-commit/SKILL.md +0 -216
  169. package/pipeline/skills/figma-common/figma-component-confluence-sync/SKILL.md +0 -223
  170. package/pipeline/skills/figma-common/figma-component-start/SKILL.md +0 -251
  171. package/pipeline/skills/figma-common/figma-component-status-update/SKILL.md +0 -78
  172. package/pipeline/skills/figma-common/figma-evolve-component/SKILL.md +0 -61
  173. package/pipeline/skills/figma-common/figma-fix/SKILL.md +0 -321
  174. package/pipeline/skills/figma-common/figma-form-integration/SKILL.md +0 -542
  175. package/pipeline/skills/figma-common/figma-issue/SKILL.md +0 -750
  176. package/pipeline/skills/figma-common/figma-iterate/SKILL.md +0 -208
  177. package/pipeline/skills/figma-common/figma-iteration-commit/SKILL.md +0 -1020
  178. package/pipeline/skills/figma-common/figma-mend/SKILL.md +0 -331
  179. package/pipeline/skills/figma-common/figma-navigation/SKILL.md +0 -156
  180. package/pipeline/skills/figma-common/figma-overlays/SKILL.md +0 -142
  181. package/pipeline/skills/figma-common/figma-price-integration/SKILL.md +0 -398
  182. package/pipeline/skills/figma-common/figma-remote-mcp-auth/SKILL.md +0 -104
  183. package/pipeline/skills/figma-common/figma-review/SKILL.md +0 -400
  184. package/pipeline/skills/figma-common/figma-setup/SKILL.md +0 -514
  185. package/pipeline/skills/figma-common/figma-setup/scripts/fetch-mcp-token.py +0 -592
  186. package/pipeline/skills/figma-common/figma-skip/SKILL.md +0 -129
  187. package/pipeline/skills/figma-common/figma-ui-patterns/SKILL.md +0 -105
  188. package/pipeline/skills/figma-common/figma-ui-patterns/patterns/animated-gradient-border.md +0 -116
  189. package/pipeline/skills/figma-common/figma-utility/SKILL.md +0 -274
  190. package/pipeline/skills/figma-common/figma-utility/scripts/figma-utility.py +0 -808
  191. package/pipeline/skills/figma-common/figma-validate/SKILL.md +0 -633
  192. package/pipeline/skills/figma-common/performance-iteration-commit-all/SKILL.md +0 -716
  193. package/pipeline/skills/figma-common/performance-review-next/SKILL.md +0 -238
  194. package/pipeline/skills/figma-common/performance-start/SKILL.md +0 -430
  195. package/pipeline/skills/figma-common/performance-swiftui/SKILL.md +0 -706
  196. package/pipeline/skills/figma-common/performance-tour/SKILL.md +0 -423
  197. package/pipeline/skills/figma-ios/REVIEW_CHECKLIST.md +0 -67
  198. package/pipeline/skills/figma-ios/figma-component-code-connect/SKILL.md +0 -178
  199. package/pipeline/skills/figma-ios/figma-component-implement/SKILL.md +0 -184
  200. package/pipeline/skills/figma-ios/figma-component-test/SKILL.md +0 -219
  201. package/pipeline/skills/figma-ios/figma-component-wiki/SKILL.md +0 -274
  202. package/pipeline/skills/figma-ios/figma-to-component/SKILL.md +0 -416
  203. package/pipeline/skills/figma-ios/figma-to-component/halt-return-protocol.md +0 -57
  204. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-0-init.md +0 -307
  205. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-1-gathering.md +0 -119
  206. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-1.5-existing-discovery.md +0 -174
  207. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-2-orchestrator.md +0 -333
  208. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-2a-testing-identifiers.md +0 -368
  209. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-2b-localization.md +0 -393
  210. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-2c-accessibility.md +0 -617
  211. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-2d-analytics.md +0 -352
  212. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-3-orchestrator.md +0 -337
  213. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-3a-location.md +0 -206
  214. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-3b-tokens.md +0 -235
  215. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-3c-nested.md +0 -214
  216. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-3d-patterns.md +0 -902
  217. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-3e-assets.md +0 -156
  218. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-3f-utilities.md +0 -175
  219. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-3g-property-coverage.md +0 -176
  220. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-3h-variant-config.md +0 -333
  221. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-4-orchestrator.md +0 -412
  222. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-4a-configuration.md +0 -336
  223. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-4b-view.md +0 -705
  224. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-4c-documentation.md +0 -332
  225. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-4d-preview.md +0 -380
  226. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-4e-modifiers.md +0 -262
  227. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-5-orchestrator.md +0 -482
  228. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-5a-viewinspector.md +0 -274
  229. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-5b-snapshot.md +0 -636
  230. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-5c-unit.md +0 -142
  231. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-6-code-connect.md +0 -547
  232. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-7-wiki.md +0 -39
  233. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-7a-confluence-generate.md +0 -659
  234. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-7a-wiki-generate.md +0 -580
  235. package/pipeline/skills/figma-ios/figma-to-component/phases/phase-8-cleanup.md +0 -51
  236. package/pipeline/skills/figma-ios/figma-to-component/reference/accessibility.md +0 -183
  237. package/pipeline/skills/figma-ios/figma-to-component/reference/analytics-events.md +0 -64
  238. package/pipeline/skills/figma-ios/figma-to-component/reference/code-connect.md +0 -531
  239. package/pipeline/skills/figma-ios/figma-to-component/reference/confluence-api.md +0 -89
  240. package/pipeline/skills/figma-ios/figma-to-component/reference/confluence-xhtml.md +0 -155
  241. package/pipeline/skills/figma-ios/figma-to-component/reference/figma-to-swiftui-effects.md +0 -196
  242. package/pipeline/skills/figma-ios/figma-to-component/reference/halt-return-protocol.md +0 -57
  243. package/pipeline/skills/figma-ios/figma-to-component/reference/localization-naming.md +0 -89
  244. package/pipeline/skills/figma-ios/figma-to-component/reference/macros.md +0 -227
  245. package/pipeline/skills/figma-ios/figma-to-component/reference/missing-tokens.md +0 -157
  246. package/pipeline/skills/figma-ios/figma-to-component/reference/orchestrator-discipline.md +0 -90
  247. package/pipeline/skills/figma-ios/figma-to-component/reference/registry.md +0 -116
  248. package/pipeline/skills/figma-ios/figma-to-component/reference/remote-mcp-script.md +0 -153
  249. package/pipeline/skills/figma-ios/figma-to-component/reference/rest-api-script.md +0 -130
  250. package/pipeline/skills/figma-ios/figma-to-component/reference/scripts-inventory.md +0 -218
  251. package/pipeline/skills/figma-ios/figma-to-component/reference/snapshot-testing.md +0 -188
  252. package/pipeline/skills/figma-ios/figma-to-component/reference/subcomponent-graph.md +0 -93
  253. package/pipeline/skills/figma-ios/figma-to-component/reference/testing-identifiers-naming.md +0 -98
  254. package/pipeline/skills/figma-ios/figma-to-component/reference/tools.md +0 -261
  255. package/pipeline/skills/figma-ios/figma-to-component/reference/viewinspector.md +0 -147
  256. package/pipeline/skills/figma-ios/figma-to-component/reference/wiki-to-confluence-mapping.md +0 -182
  257. package/pipeline/skills/figma-ios/figma-to-component/scripts/apply-author-login-map.py +0 -185
  258. package/pipeline/skills/figma-ios/figma-to-component/scripts/backfill-status.py +0 -609
  259. package/pipeline/skills/figma-ios/figma-to-component/scripts/build-author-registry.py +0 -332
  260. package/pipeline/skills/figma-ios/figma-to-component/scripts/bulk-sync-issues.py +0 -261
  261. package/pipeline/skills/figma-ios/figma-to-component/scripts/code-connect-data-gather.py +0 -184
  262. package/pipeline/skills/figma-ios/figma-to-component/scripts/code-connect-publish.sh +0 -188
  263. package/pipeline/skills/figma-ios/figma-to-component/scripts/confluence-component-status-upload.py +0 -768
  264. package/pipeline/skills/figma-ios/figma-to-component/scripts/confluence-component-status.py +0 -191
  265. package/pipeline/skills/figma-ios/figma-to-component/scripts/confluence-data-gather.py +0 -420
  266. package/pipeline/skills/figma-ios/figma-to-component/scripts/confluence-page-ids.example.json +0 -9
  267. package/pipeline/skills/figma-ios/figma-to-component/scripts/confluence-publish.py +0 -336
  268. package/pipeline/skills/figma-ios/figma-to-component/scripts/figma-subcomponent-graph.py +0 -391
  269. package/pipeline/skills/figma-ios/figma-to-component/scripts/figma-update.py +0 -292
  270. package/pipeline/skills/figma-ios/figma-to-component/scripts/lib/__init__.py +0 -1
  271. package/pipeline/skills/figma-ios/figma-to-component/scripts/lib/issue_sync_propagate.py +0 -93
  272. package/pipeline/skills/figma-ios/figma-to-component/scripts/lib/registry_writer.py +0 -299
  273. package/pipeline/skills/figma-ios/figma-to-component/scripts/lib/test_backfill_status.py +0 -343
  274. package/pipeline/skills/figma-ios/figma-to-component/scripts/lib/test_figma_update.py +0 -206
  275. package/pipeline/skills/figma-ios/figma-to-component/scripts/lib/test_figma_update_http.py +0 -149
  276. package/pipeline/skills/figma-ios/figma-to-component/scripts/lib/test_phase_clis.py +0 -281
  277. package/pipeline/skills/figma-ios/figma-to-component/scripts/lib/test_registry_writer.py +0 -332
  278. package/pipeline/skills/figma-ios/figma-to-component/scripts/lib/test_skill_figma_issue.py +0 -176
  279. package/pipeline/skills/figma-ios/figma-to-component/scripts/lib/test_skill_figma_review.py +0 -98
  280. package/pipeline/skills/figma-ios/figma-to-component/scripts/lib/test_update_issue.py +0 -298
  281. package/pipeline/skills/figma-ios/figma-to-component/scripts/lib/test_update_issue_gh.py +0 -195
  282. package/pipeline/skills/figma-ios/figma-to-component/scripts/phase1-gather.py +0 -1298
  283. package/pipeline/skills/figma-ios/figma-to-component/scripts/phase2-finalize.py +0 -228
  284. package/pipeline/skills/figma-ios/figma-to-component/scripts/phase3-scripts.py +0 -1089
  285. package/pipeline/skills/figma-ios/figma-to-component/scripts/phase4-finalize.py +0 -141
  286. package/pipeline/skills/figma-ios/figma-to-component/scripts/phase5-finalize.py +0 -106
  287. package/pipeline/skills/figma-ios/figma-to-component/scripts/phase6-finalize.py +0 -162
  288. package/pipeline/skills/figma-ios/figma-to-component/scripts/phase7-finalize.py +0 -105
  289. package/pipeline/skills/figma-ios/figma-to-component/scripts/register-icons-codeconnect.py +0 -179
  290. package/pipeline/skills/figma-ios/figma-to-component/scripts/remote-mcp-fetch.py +0 -260
  291. package/pipeline/skills/figma-ios/figma-to-component/scripts/resolve-author-logins.py +0 -260
  292. package/pipeline/skills/figma-ios/figma-to-component/scripts/run-uicomponents-tests.sh +0 -86
  293. package/pipeline/skills/figma-ios/figma-to-component/scripts/sidebar-generator.py +0 -321
  294. package/pipeline/skills/figma-ios/figma-to-component/scripts/update-issue-from-registry.py +0 -1470
  295. package/pipeline/skills/figma-ios/figma-to-component/scripts/validate-phase4.sh +0 -176
  296. package/pipeline/skills/figma-ios/figma-to-component/scripts/validate-phase6.sh +0 -147
  297. package/pipeline/skills/figma-ios/figma-to-component/scripts/validate-phase7a.py +0 -629
  298. /package/pipeline/commands/multi-agent/{delete.md → delete/SKILL.md} +0 -0
  299. /package/pipeline/commands/multi-agent/{diff-explain.md → diff-explain/SKILL.md} +0 -0
  300. /package/pipeline/commands/multi-agent/{garbage-collect.md → garbage-collect/SKILL.md} +0 -0
  301. /package/pipeline/commands/multi-agent/{issue.md → issue/SKILL.md} +0 -0
  302. /package/pipeline/commands/multi-agent/{jira.md → jira/SKILL.md} +0 -0
  303. /package/pipeline/commands/multi-agent/{kill.md → kill/SKILL.md} +0 -0
  304. /package/pipeline/commands/multi-agent/{language.md → language/SKILL.md} +0 -0
  305. /package/pipeline/commands/multi-agent/{log.md → log/SKILL.md} +0 -0
  306. /package/pipeline/commands/multi-agent/{prune-logs.md → prune-logs/SKILL.md} +0 -0
  307. /package/pipeline/commands/multi-agent/{purge.md → purge/SKILL.md} +0 -0
  308. /package/pipeline/commands/multi-agent/{scan.md → scan/SKILL.md} +0 -0
  309. /package/pipeline/commands/multi-agent/{search.md → search/SKILL.md} +0 -0
  310. /package/pipeline/commands/multi-agent/{stack.md → stack/SKILL.md} +0 -0
  311. /package/pipeline/commands/multi-agent/{status.md → status/SKILL.md} +0 -0
  312. /package/pipeline/commands/multi-agent/{test.md → test/SKILL.md} +0 -0
  313. /package/pipeline/commands/multi-agent/{update.md → update/SKILL.md} +0 -0
  314. /package/pipeline/{commands/multi-agent → multi-agent-refs}/_input-parser.md +0 -0
  315. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/analysis-template.md +0 -0
  316. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/audit-guide.md +0 -0
  317. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/backend-guide.md +0 -0
  318. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/channels/confluence.md +0 -0
  319. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/channels/issue-comment.md +0 -0
  320. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/channels/pr-review-actions.md +0 -0
  321. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/channels/pr.md +0 -0
  322. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/conventions-defaults.md +0 -0
  323. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/features/autopilot-circuit-breaker.md +0 -0
  324. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/features/dev-critic.md +0 -0
  325. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/features/external-context-injection.md +0 -0
  326. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/features/model-fallback.md +0 -0
  327. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/features/plan-todos.md +0 -0
  328. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/features/prior-fix-detection.md +0 -0
  329. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/features/repo-map.md +0 -0
  330. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/features/shadow-git.md +0 -0
  331. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/frontend-guide.md +0 -0
  332. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/knowledge.md +0 -0
  333. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/multi-repo-integration-build.md +0 -0
  334. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/picker-contract.md +0 -0
  335. /package/pipeline/{commands/multi-agent/refs → multi-agent-refs}/rules.md +0 -0
@@ -1,307 +0,0 @@
1
- # PHASE 0 - Component Initialization
2
-
3
- Setup component context and create artifact directory before implementation.
4
- NEXT: Phase 1 (Data Gathering)
5
-
6
- ---
7
-
8
- ## PRE-CHECK: Setup Marker
9
-
10
- ```
11
- Read: {repos.packagesContainer}/{repos.artifactsRepo}/ImplementationArtifacts/Figma/.setup-verified.json
12
- ```
13
-
14
- If file does NOT exist:
15
-
16
- ```
17
- STATUS: HALT
18
- PHASE: phase-0
19
- GATE: PRE_CHECK_SETUP
20
- REASON: Environment setup not completed.
21
- COMPLETED_GATES: []
22
- ARTIFACTS_CREATED: none
23
- USER_ACTION_REQUIRED: Run /figma-setup first to configure your environment.
24
- ```
25
-
26
- If file exists → proceed to REBUILD_DERIVED_ARTIFACTS.
27
-
28
- ---
29
-
30
- ## REBUILD_DERIVED_ARTIFACTS: Rebuild Gitignored Derived Files
31
-
32
- Derived artifacts (component-catalog, ui-token-index, merged translations, etc.) are gitignored. Always rebuild to guarantee fresh data before implementation.
33
-
34
- ```bash
35
- REPO_ROOT=$(git rev-parse --show-toplevel)
36
- bash "${REPO_ROOT}/.instructions/common/scripts/common-rebuild-derived-artifacts.sh"
37
- ```
38
-
39
- If the script exits non-zero:
40
-
41
- ```
42
- STATUS: HALT
43
- PHASE: phase-0
44
- GATE: REBUILD_DERIVED_ARTIFACTS
45
- REASON: Failed to rebuild derived artifacts. Check tool build errors above.
46
- COMPLETED_GATES: [PRE_CHECK_SETUP]
47
- ARTIFACTS_CREATED: none
48
- USER_ACTION_REQUIRED: Fix build errors in {project.slug}-common and retry.
49
- ```
50
-
51
- If exit 0 → proceed to GATE 1.
52
-
53
- ---
54
-
55
- ## GATE 1: EXTRACT_NODE_ID
56
-
57
- INPUT: User provides Figma URL or node ID.
58
-
59
- ```
60
- URL: https://figma.com/design/FILEKEY/Name?node-id=123-456
61
- ↑ ↑
62
- fileKey nodeId=123:456
63
- ```
64
-
65
- Convert `-` to `:` in nodeId.
66
-
67
- PASS → Store `nodeId`, `fileKey`. Proceed to GATE 2.
68
-
69
- FAIL →
70
- ```
71
- STATUS: NEEDS_INPUT
72
- PHASE: phase-0
73
- GATE: EXTRACT_NODE_ID
74
- QUESTION: No node ID found in user input.
75
- OPTIONS:
76
- 1) Provide Figma URL (format: https://figma.com/design/KEY/Name?node-id=X-Y)
77
- 2) Provide node ID directly (format: X:Y)
78
- SUGGESTED: Option 1 - paste the full Figma URL
79
- COMPLETED_GATES: [PRE_CHECK_SETUP]
80
- CONTEXT: A Figma URL or node ID is required to start implementation.
81
- ```
82
-
83
- ---
84
-
85
- ## GATE 2: REGISTRY_LOOKUP
86
-
87
- REF: `reference/registry.md`
88
-
89
- ```bash
90
- REPO_ROOT=$(git rev-parse --show-toplevel)
91
- CONFIG_PATH="${REPO_ROOT}/{repos.common.path}"
92
- cd "$CONFIG_PATH" && .build/debug/FigmaRegistryUtility lookup --node-id '<NODE_ID>'
93
- ```
94
-
95
- **Important:** The utility must run from the config package directory (`cd "$CONFIG_PATH"`) because it resolves `Shared/Figma/Generated/component-registry.json` relative to CWD.
96
-
97
- PASS → Store from JSON output:
98
- - `suggestedComponentName`
99
- - `suggestedComponentLocation`
100
- - `suggestedArtifactPath`
101
- - `fileKey` (verify matches GATE 1)
102
-
103
- Proceed to GATE 3.
104
-
105
- FAIL (binary not found) →
106
- ```bash
107
- swift build --package-path "$CONFIG_PATH" --product FigmaRegistryUtility
108
- ```
109
- Retry GATE 2.
110
-
111
- FAIL (component not found) →
112
- ```
113
- STATUS: NEEDS_INPUT
114
- PHASE: phase-0
115
- GATE: REGISTRY_LOOKUP
116
- QUESTION: Component with node ID <NODE_ID> not found in registry.
117
- OPTIONS:
118
- 1) Update registry first (run registry update command)
119
- 2) Provide component name and location manually
120
- 3) Check if node ID is correct
121
- SUGGESTED: Option 1 - registry may be outdated
122
- COMPLETED_GATES: [PRE_CHECK_SETUP, EXTRACT_NODE_ID]
123
- CONTEXT: The FigmaRegistryUtility lookup returned no results for node ID <NODE_ID>.
124
- ```
125
-
126
- ---
127
-
128
- ## GATE 3: RESOLVE_OVERRIDES
129
-
130
- Resolve `componentName`, `componentLocation`, and `artifactPath` using this priority:
131
-
132
- ### 3.1 Priority order
133
-
134
- | Field | Priority 1 (highest) | Priority 2 | Priority 3 (lowest) |
135
- |-------|---------------------|------------|---------------------|
136
- | `componentName` | User-provided in prompt | Suggested by registry | HALT - ask user |
137
- | `componentLocation` | User-provided in prompt | `suggestedComponentLocation` from registry | HALT - ask user |
138
- | `artifactPath` | Derived from final `componentName` if name changed | `suggestedArtifactPath` from registry | HALT - ask user |
139
-
140
- **How to detect user overrides:** Scan the user's original prompt for explicit name or location mentions:
141
- - `"implement as PackageBadge"` → override componentName
142
- - `"name: FlightCard"` → override componentName
143
- - `"put it in Sources/UIComponents/Booking/"` → override componentLocation
144
- - Any PascalCase word the user associates with the component → override componentName
145
-
146
- If user provided an override in their prompt, use it directly - do NOT ask for confirmation.
147
- If user did NOT provide an override, use the registry suggestion - but check for vague names first.
148
-
149
- ### 3.2 Vague name detection
150
-
151
- Registry names derived from Figma layer hierarchy can be too generic. Check if `suggestedComponentName` is vague:
152
-
153
- **Vague indicators** - single common word that doesn't describe the component's purpose:
154
- - Generic containers: `Package`, `Card`, `Item`, `Cell`, `Row`, `View`, `Container`, `Component`, `Element`, `Block`, `Section`, `Group`, `Box`, `Wrapper`
155
- - Generic actions: `Button`, `Label`, `Icon`, `Badge`, `Tag`, `Chip`, `Indicator`
156
- - Generic layout: `Header`, `Footer`, `Content`, `Body`, `Stack`, `List`
157
-
158
- If `suggestedComponentName` matches a vague indicator (case-insensitive, exact match):
159
-
160
- ```
161
- STATUS: NEEDS_INPUT
162
- PHASE: phase-0
163
- GATE: RESOLVE_OVERRIDES
164
- QUESTION: Registry suggested "{suggestedComponentName}" which is too generic. What should this component be called?
165
- OPTIONS:
166
- 1) Suggest a more descriptive name based on design context (e.g., "Package" → "PackageBadge", "Card" → "FlightCard")
167
- 2) User provides custom name
168
- SUGGESTED: Look at the Figma layer name, parent frame, and page name for context clues.
169
- COMPLETED_GATES: [PRE_CHECK_SETUP, EXTRACT_NODE_ID, REGISTRY_LOOKUP]
170
- CONTEXT:
171
- Registry name: {suggestedComponentName}
172
- Registry location: {suggestedComponentLocation}
173
- Figma node path: {parent names from registry if available}
174
- ```
175
-
176
- If `suggestedComponentName` is NOT vague → use it as-is.
177
-
178
- ### 3.3 Store resolved values
179
-
180
- ```
181
- componentName = <user override OR registry suggestion (after vague check)>
182
- componentLocation = <user override OR suggestedComponentLocation>
183
- artifactPath = {artifactPath} (update path suffix if componentName was overridden)
184
- ```
185
-
186
- If `componentName` was overridden and differs from the registry name, update `artifactPath` by replacing the last path component:
187
- ```
188
- Original: .../Components/StepBar/Package
189
- Overridden: .../Components/StepBar/PackageBadge
190
- ```
191
-
192
- PASS → Store `componentName`, `componentLocation`, `artifactPath`. Proceed to GATE 4.
193
-
194
- FAIL (no name resolvable) →
195
- ```
196
- STATUS: NEEDS_INPUT
197
- PHASE: phase-0
198
- GATE: RESOLVE_OVERRIDES
199
- QUESTION: Component name could not be determined.
200
- OPTIONS:
201
- 1) Use suggested name from registry: <SUGGESTED_NAME>
202
- 2) Provide custom name and location
203
- COMPLETED_GATES: [PRE_CHECK_SETUP, EXTRACT_NODE_ID, REGISTRY_LOOKUP]
204
- CONTEXT: suggestedComponentName: <VALUE_OR_EMPTY>, suggestedComponentLocation: <VALUE_OR_EMPTY>
205
- ```
206
-
207
- ---
208
-
209
- ## GATE 4: CREATE_ARTIFACTS
210
-
211
- Use resolved `artifactPath` from GATE 3.
212
-
213
- ### 4.1 Create directory structure
214
-
215
- ```bash
216
- mkdir -p {artifactPath}/pass1 {artifactPath}/pass2 {artifactPath}/pass3
217
- ```
218
-
219
- ### 4.2 Create IMPLEMENTATION_HISTORY.md
220
-
221
- Write `{artifactPath}/IMPLEMENTATION_HISTORY.md`:
222
-
223
- ```markdown
224
- # <COMPONENT_NAME>
225
-
226
- ## Inputs
227
- - Node ID: <NODE_ID>
228
- - File Key: <FILE_KEY>
229
- - Component Name: <NAME>
230
- - Source Location: {componentLocation}
231
- - Artifact Location: {artifactPath}
232
- - GitHub Issue: #<ISSUE_NUMBER> (https://github.com/{github.componentsRepo}/issues/<ISSUE_NUMBER>)
233
- - Jira: <JIRA_KEY>
234
- - Date: <DATE>
235
-
236
- ## Decisions
237
- <!-- User decisions during implementation -->
238
- ```
239
-
240
- ### 4.3 Create PROMPT_HISTORY.md
241
-
242
- Write `{artifactPath}/PROMPT_HISTORY.md`:
243
-
244
- ```markdown
245
- # <COMPONENT_NAME> Prompt History
246
-
247
- All user prompts verbatim. Sensitive data masked.
248
-
249
- ## Session: <DATE>
250
-
251
- ### Prompt 1
252
- Context: Initial Figma URL provided
253
- <!-- Mask: tokens → <TOKEN>, passwords → <PASSWORD>, keys → <KEY> -->
254
- ```
255
-
256
- PASS → Proceed to GATE 5.
257
-
258
- FAIL →
259
- ```
260
- STATUS: HALT
261
- PHASE: phase-0
262
- GATE: CREATE_ARTIFACTS
263
- REASON: Failed to create artifact directory or files.
264
- COMPLETED_GATES: [PRE_CHECK_SETUP, EXTRACT_NODE_ID, REGISTRY_LOOKUP, RESOLVE_OVERRIDES]
265
- ARTIFACTS_CREATED: none
266
- USER_ACTION_REQUIRED: Check file system permissions for {artifactPath}.
267
- ```
268
-
269
- ---
270
-
271
- ## GATE 5: LOAD_SPECS
272
-
273
- Check if specs were saved by `/figma-to-swift-ui-start`:
274
-
275
- ```bash
276
- ls {artifactPath}/pass0/specs.md 2>/dev/null
277
- ```
278
-
279
- **If specs exist:** read the file and store as `implementationSpecs`. These specs will be passed to subsequent phases as additional context:
280
- - Phase 3 (Analysis) - informs pattern decisions
281
- - Phase 4 (Implementation) - constrains the init signature, defaults, and behavior
282
-
283
- Append to IMPLEMENTATION_HISTORY.md:
284
- ```markdown
285
- ## Specs
286
- - Source: pass0/specs.md
287
- - Loaded: <DATE>
288
- ```
289
-
290
- **If no specs file:** continue without. No error - specs are optional.
291
-
292
- ---
293
-
294
- ## SUCCESS OUTPUT
295
-
296
- ```
297
- STATUS: COMPLETE
298
- PHASE: phase-0
299
- GATES_PASSED: [PRE_CHECK_SETUP, REBUILD_DERIVED_ARTIFACTS, EXTRACT_NODE_ID, REGISTRY_LOOKUP, RESOLVE_OVERRIDES, CREATE_ARTIFACTS, LOAD_SPECS]
300
- ARTIFACTS_CREATED:
301
- - {artifactPath}/IMPLEMENTATION_HISTORY.md
302
- - {artifactPath}/PROMPT_HISTORY.md
303
- - {artifactPath}/pass1/ (empty, ready for Phase 1)
304
- - {artifactPath}/pass2/ (empty, ready for Phase 2)
305
- - {artifactPath}/pass3/ (empty, ready for Phase 3)
306
- SUMMARY: Component <NAME> initialized with artifact directory at {artifactPath}
307
- ```
@@ -1,119 +0,0 @@
1
- # Phase 1 - Data Gathering
2
-
3
- ## Overview
4
-
5
- Runs `phase1-gather.py` to collect all Figma data, then checks if design context was deferred due to sublayer cap.
6
-
7
- ---
8
-
9
- ## Step 1: Run the Script
10
-
11
- ```bash
12
- python3 .instructions/figma/figma-to-swiftui/scripts/phase1-gather.py \
13
- --file-key "{fileKey}" \
14
- --node-id "{nodeId}" \
15
- --artifact-path "{artifactPath}" \
16
- --component-name "{componentName}"
17
- ```
18
-
19
- Parse the JSON output from stdout.
20
-
21
- ---
22
-
23
- ## Step 2: Check Result
24
-
25
- ### If `status` = `COMPLETE`
26
-
27
- Phase 1 is done. All artifacts are in `pass1/`. Proceed to Phase 2.
28
-
29
- ### If `status` = `COMPLETE_WITH_DEFERRED`
30
-
31
- The script completed all data gathering **except** `get_design_context`, which was deferred because the component has too many sublayers (>20). Report status to orchestrator - it will dispatch a Phase 1 subagent for deferred resolution.
32
-
33
- ---
34
-
35
- ## Deferred Resolution
36
-
37
- **When the orchestrator dispatches you for deferred resolution, follow these steps.**
38
-
39
- ### Step 1: Read Context
40
-
41
- ```
42
- Read: {artifactPath}/pass1/component_properties.json
43
- Read: {artifactPath}/pass1/design_context_deferred.json
44
- ```
45
-
46
- From `component_properties.json` extract the variant axes (properties with `type: "VARIANT"`).
47
- From `design_context_deferred.json` extract `sublayerIds` (node IDs) and `sublayerCount`.
48
-
49
- ### Step 2: Smart Representative Selection
50
-
51
- Classify each variant axis:
52
-
53
- | Category | Examples | Action |
54
- |----------|----------|--------|
55
- | **Interaction** | `State` (Default/Hover/Pressed/Disabled), focus/hover variants | Fix to `Default` (only color/opacity changes - no structural difference) |
56
- | **Theme** | `Color`, `Theme`, `Mode` | Fix to first value (e.g., `Brand`) |
57
- | **Structural** | `Size`, `Style`, `IconDirection`, `Type`, `Layout`, everything else | **Vary** - these change layout/structure |
58
-
59
- Calculate structural combinations:
60
- - If <= 20: fetch all structural combinations (with interaction + theme fixed).
61
- - If > 20: also fix the structural axis with the most values to `Default` or its first value. Repeat until <= 20. Target: ~9-12 representatives.
62
-
63
- ### Step 3: Map to Node IDs
64
-
65
- Each sublayer in Figma is a variant named like `Color=Brand, Size=Default, Style=Primary, State=Default, IconDirection=None`.
66
-
67
- The `sublayerIds` list in `design_context_deferred.json` corresponds to the children of the component set. To map selected variant combinations to node IDs:
68
-
69
- 1. Read `{artifactPath}/pass1/screenshots/variants.md` - it has a table of `Variant | Node ID | File`.
70
- 2. Match your selected combinations against the variant names.
71
- 3. Collect the node IDs for matched variants.
72
-
73
- If `variants.md` doesn't have the mapping, use the Figma REST API or MCP `get_metadata` to resolve.
74
-
75
- ### Step 4: Fetch
76
-
77
- Call the script with the selected sublayer IDs:
78
-
79
- ```bash
80
- python3 .instructions/figma/figma-to-swiftui/scripts/phase1-gather.py \
81
- --fetch-deferred \
82
- --file-key "{fileKey}" \
83
- --node-id "{nodeId}" \
84
- --artifact-path "{artifactPath}" \
85
- --component-name "{componentName}" \
86
- --sublayer-ids "id1,id2,id3,..."
87
- ```
88
-
89
- The script:
90
- - Fetches `get_design_context` for each sublayer ID (parallel, using its internal MCP)
91
- - Merges into `pass1/design_context_response.json` in the **same format** as non-deferred components
92
- - Sets `representativeSelection: true` with selection metadata
93
- - Updates `pass1/component_summary.json`
94
-
95
- Parse the JSON output from stdout.
96
-
97
- ### Step 5: Update History
98
-
99
- Append to `{artifactPath}/IMPLEMENTATION_HISTORY.md`:
100
-
101
- ```markdown
102
- - Design context: deferred → smart selection ({N} representatives)
103
- - Fixed: {list fixed axes and values}
104
- - Varied: {list varied axes with cross product notation}
105
- ```
106
-
107
- ### Step 6: Return
108
-
109
- Return COMPLETE with the script's output summary.
110
-
111
- ### If `status` = `HALT`
112
-
113
- Script failed at a specific gate. Report the gate, reason, and user action to the orchestrator for user resolution.
114
-
115
- ---
116
-
117
- ## Return
118
-
119
- Return the script's JSON output as-is to the orchestrator. The orchestrator handles HALT/NEEDS_INPUT flows.
@@ -1,174 +0,0 @@
1
- # PHASE 1.5 - Existing Component Discovery
2
-
3
- Detects whether the target component is already implemented in the codebase OR already mapped via Code Connect, BEFORE Phase 2 starts greenfield generation. Without this gate, the pipeline can silently overwrite existing implementations and re-publish duplicate Code Connect mappings.
4
-
5
- PREV: Phase 1 (Data Gathering)
6
- NEXT: Phase 2 (Utility Integration) - only when status is `GREENFIELD_OK`
7
- REF: `phase-6-code-connect.md` (publish gate honors discovery output)
8
-
9
- ---
10
-
11
- ## ENTRY GATE
12
-
13
- | Condition | Action |
14
- |---|---|
15
- | `pass1/code_connect_map_response.json` missing | HALT - Phase 1 didn't complete cleanly |
16
- | All other cases | EXECUTE |
17
-
18
- ---
19
-
20
- ## STEP 1 - Inspect Code Connect map for self-reference
21
-
22
- INPUT: `{artifactPath}/pass1/code_connect_map_response.json`
23
-
24
- The map is a `{ nodeId: { codeConnectSrc, codeConnectName } }` lookup. The current target's nodeId may or may not appear.
25
-
26
- ```python
27
- # Pseudocode
28
- target_node_id = state.issue.nodeId # e.g. "7528:23317"
29
- target_name = state.issue.componentName # PascalCase, e.g. "MyComponentSettingsLayout"
30
-
31
- cc_map = json.load(open(f"{artifactPath}/pass1/code_connect_map_response.json"))
32
-
33
- if target_node_id in cc_map:
34
- return {
35
- "status": "ALREADY_MAPPED",
36
- "sourcePath": cc_map[target_node_id]["codeConnectSrc"],
37
- "componentName": cc_map[target_node_id]["codeConnectName"]
38
- }
39
- ```
40
-
41
- If `ALREADY_MAPPED`: the target Figma node is already wired to a code component. The pipeline does not generate a new component or republish Code Connect. It runs gap analysis instead (see Step 4).
42
-
43
- ---
44
-
45
- ## STEP 2 - Search the codebase for an existing source file
46
-
47
- If Step 1 returned no match, look for a file that matches the target component name. Use the project's component root (resolved from `figma-config.json` → `componentRoot` if set, else `Sources/UIComponents/Components/`).
48
-
49
- ```bash
50
- find "$COMPONENT_ROOT" -type f -name "${target_name}.swift" 2>/dev/null | head -5
51
- ```
52
-
53
- Three outcomes:
54
-
55
- | Files found | Status |
56
- |---|---|
57
- | 0 | `GREENFIELD_OK` - proceed to Phase 2 normally |
58
- | 1 | `EXISTING_SOURCE_NO_CC` - file exists but Code Connect mapping is missing |
59
- | 2+ | `AMBIGUOUS_SOURCE` - multiple files match; needs user disambiguation |
60
-
61
- For `EXISTING_SOURCE_NO_CC`, also check whether a sibling `.figma.swift` exists:
62
-
63
- ```bash
64
- DIR=$(dirname "<found-file>")
65
- ls "$DIR/${target_name}.figma.swift" 2>/dev/null
66
- ```
67
-
68
- If `.figma.swift` exists → the source has Code Connect locally but it was never published; offer to publish-only.
69
- If `.figma.swift` is absent → the source exists but is fully unconnected.
70
-
71
- ---
72
-
73
- ## STEP 3 - User decision (only on non-greenfield)
74
-
75
- When the orchestrator sees status `ALREADY_MAPPED`, `EXISTING_SOURCE_NO_CC`, or `AMBIGUOUS_SOURCE`, emit a `STATUS: NEEDS_INPUT` block to the parent multi-agent pipeline.
76
-
77
- ### ALREADY_MAPPED
78
-
79
- ```
80
- STATUS: NEEDS_INPUT
81
- PHASE: phase-1.5
82
- GATE: ALREADY_MAPPED
83
- DETECTED: {sourcePath} (already mapped to Figma node {nodeId})
84
- QUESTION: This Figma node is already wired to a code component. What should the pipeline do?
85
- OPTIONS:
86
- 1. Run gap analysis only (FIGMA.md / tests / wiki - fill what's missing, do NOT touch the component source)
87
- 2. Force regenerate (DANGER - overwrites the existing source file; only choose this if the design has materially changed)
88
- 3. Cancel - abort this run, no edits
89
- DEFAULT: 1
90
- ```
91
-
92
- User answer feeds back to the orchestrator as a `USER_DECISION` block; on `1` set `state.discovery.status = "GAP_ANALYSIS"` and proceed to Step 4.
93
-
94
- ### EXISTING_SOURCE_NO_CC
95
-
96
- ```
97
- STATUS: NEEDS_INPUT
98
- PHASE: phase-1.5
99
- GATE: EXISTING_SOURCE_NO_CC
100
- DETECTED: {sourcePath} exists in the codebase but is not connected to the Figma node.
101
- SIBLING_FIGMA_SWIFT: {present | absent}
102
- QUESTION: Found an existing source file matching {target_name}. What should the pipeline do?
103
- OPTIONS:
104
- 1. Add Code Connect only - write {target_name}.figma.swift next to the source, publish it (recommended when sibling absent)
105
- 2. Publish-only - sibling .figma.swift already exists; just run `figma connect publish` (recommended when sibling present)
106
- 3. Force regenerate - overwrite the source file with a fresh greenfield generation
107
- 4. Cancel
108
- DEFAULT: 2 if sibling present, else 1
109
- ```
110
-
111
- ### AMBIGUOUS_SOURCE
112
-
113
- ```
114
- STATUS: NEEDS_INPUT
115
- PHASE: phase-1.5
116
- GATE: AMBIGUOUS_SOURCE
117
- DETECTED: {N} candidates matching {target_name}.swift
118
- CANDIDATES: <bulleted list of paths>
119
- QUESTION: Pick the canonical source for this Figma node, or cancel.
120
- OPTIONS:
121
- <one option per candidate>
122
- N+1. None of the above - treat as greenfield
123
- N+2. Cancel
124
- ```
125
-
126
- ---
127
-
128
- ## STEP 4 - Gap analysis (only on ALREADY_MAPPED + user picked option 1)
129
-
130
- When the existing component is reused, the orchestrator still checks what's missing:
131
-
132
- ```bash
133
- SRC_DIR=$(dirname "$sourcePath")
134
- [ -f "$SRC_DIR/FIGMA.md" ] || gaps+=("FIGMA.md")
135
- [ -f "$SRC_DIR/${target_name}.figma.swift" ] || gaps+=("Code Connect")
136
- # Snapshot tests, ViewInspector tests, wiki MD, ...
137
- ```
138
-
139
- The gap list goes into `state.discovery.gaps[]`. Phases 2/3 are SKIPPED. Phase 4-7 run only the steps that target gaps:
140
-
141
- | Gap | Phase that fills it |
142
- |---|---|
143
- | `FIGMA.md` | Phase 4c (Documentation) |
144
- | `Code Connect` | Phase 6 (Code Connect Publish) |
145
- | `Snapshot test` | Phase 5b |
146
- | `ViewInspector test` | Phase 5a |
147
- | `Wiki page` | Phase 7 |
148
-
149
- Phase 6 ENTRY GATE then sees `discovery.status === "GAP_ANALYSIS"` and `"Code Connect" in discovery.gaps` and runs publish; if Code Connect is NOT in gaps, Phase 6 is silently skipped.
150
-
151
- ---
152
-
153
- ## OUTPUT
154
-
155
- Phase 1.5 always writes the result to `agent-state.json`:
156
-
157
- ```json
158
- {
159
- "discovery": {
160
- "status": "GREENFIELD_OK | ALREADY_MAPPED | EXISTING_SOURCE_NO_CC | AMBIGUOUS_SOURCE | GAP_ANALYSIS | CANCELLED",
161
- "sourcePath": "Sources/.../Component.swift", // when applicable
162
- "siblingFigmaSwift": true | false, // when applicable
163
- "gaps": ["FIGMA.md", "Code Connect", ...] // when applicable
164
- }
165
- }
166
- ```
167
-
168
- Phase 2 ENTRY GATE reads this and halts unless `status === "GREENFIELD_OK"` or the user explicitly picked "Force regenerate".
169
-
170
- ---
171
-
172
- ## CONSERVATIVE FALLBACK
173
-
174
- If anything in this phase fails (missing JSON, missing `find` binary, ambiguous parse), default to `GREENFIELD_OK` and log the anomaly. Better to do harmless duplicate work than to silently skip generation when the user expected it.