@sarjallab09/figma-intelligence 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/LICENSE +26 -0
  2. package/README.md +327 -0
  3. package/bin/cli.js +859 -0
  4. package/design-bridge/.env.example +5 -0
  5. package/design-bridge/bridge.js +196 -0
  6. package/design-bridge/lib/assets.js +367 -0
  7. package/design-bridge/lib/prompt.js +85 -0
  8. package/design-bridge/lib/server.js +66 -0
  9. package/design-bridge/lib/stitch.js +37 -0
  10. package/design-bridge/lib/tokens.js +82 -0
  11. package/design-bridge/package-lock.json +579 -0
  12. package/design-bridge/package.json +19 -0
  13. package/figma-bridge-plugin/README.md +97 -0
  14. package/figma-bridge-plugin/anthropic-chat-runner.js +192 -0
  15. package/figma-bridge-plugin/bridge-relay.js +2363 -0
  16. package/figma-bridge-plugin/chat-runner.js +459 -0
  17. package/figma-bridge-plugin/code.js +1528 -0
  18. package/figma-bridge-plugin/codex-runner.js +505 -0
  19. package/figma-bridge-plugin/component-schemas.js +110 -0
  20. package/figma-bridge-plugin/content-context.js +869 -0
  21. package/figma-bridge-plugin/create-button.js +216 -0
  22. package/figma-bridge-plugin/gemini-cli-runner.js +291 -0
  23. package/figma-bridge-plugin/gemini-runner.js +187 -0
  24. package/figma-bridge-plugin/html-to-figma.js +927 -0
  25. package/figma-bridge-plugin/knowledge-hub/.gitkeep +0 -0
  26. package/figma-bridge-plugin/knowledge-hub/uspec-references/anatomy-spec.md +159 -0
  27. package/figma-bridge-plugin/knowledge-hub/uspec-references/api-spec.md +162 -0
  28. package/figma-bridge-plugin/knowledge-hub/uspec-references/color-spec.md +148 -0
  29. package/figma-bridge-plugin/knowledge-hub/uspec-references/full-spec-template.md +314 -0
  30. package/figma-bridge-plugin/knowledge-hub/uspec-references/property-spec.md +175 -0
  31. package/figma-bridge-plugin/knowledge-hub/uspec-references/screen-reader-spec.md +180 -0
  32. package/figma-bridge-plugin/knowledge-hub/uspec-references/structure-spec.md +165 -0
  33. package/figma-bridge-plugin/manifest.json +21 -0
  34. package/figma-bridge-plugin/package-lock.json +1936 -0
  35. package/figma-bridge-plugin/package.json +20 -0
  36. package/figma-bridge-plugin/perplexity-runner.js +188 -0
  37. package/figma-bridge-plugin/references/SKILL.md +178 -0
  38. package/figma-bridge-plugin/references/anatomy-spec.md +159 -0
  39. package/figma-bridge-plugin/references/api-spec.md +162 -0
  40. package/figma-bridge-plugin/references/color-spec.md +148 -0
  41. package/figma-bridge-plugin/references/full-spec-template.md +314 -0
  42. package/figma-bridge-plugin/references/property-spec.md +175 -0
  43. package/figma-bridge-plugin/references/screen-reader-spec.md +180 -0
  44. package/figma-bridge-plugin/references/structure-spec.md +165 -0
  45. package/figma-bridge-plugin/shared-prompt-config.js +604 -0
  46. package/figma-bridge-plugin/spec-helpers/build-table.js +269 -0
  47. package/figma-bridge-plugin/spec-helpers/classify-elements.js +189 -0
  48. package/figma-bridge-plugin/spec-helpers/index.js +35 -0
  49. package/figma-bridge-plugin/spec-helpers/parse-figma-link.js +49 -0
  50. package/figma-bridge-plugin/spec-helpers/position-markers.js +158 -0
  51. package/figma-bridge-plugin/stitch-auth.js +322 -0
  52. package/figma-bridge-plugin/stitch-runner.js +1427 -0
  53. package/figma-bridge-plugin/token-resolver.js +107 -0
  54. package/figma-bridge-plugin/ui.html +4467 -0
  55. package/figma-intelligence-layer/.env.example +39 -0
  56. package/figma-intelligence-layer/docs/local-image-generation.md +60 -0
  57. package/figma-intelligence-layer/examples/comfyui-workflow-template.example.json +101 -0
  58. package/figma-intelligence-layer/jest.config.js +14 -0
  59. package/figma-intelligence-layer/mcp-config.json +19 -0
  60. package/figma-intelligence-layer/package-lock.json +5892 -0
  61. package/figma-intelligence-layer/package.json +48 -0
  62. package/figma-intelligence-layer/scripts/setup-comfyui-local.sh +67 -0
  63. package/figma-intelligence-layer/scripts/start-comfyui.sh +33 -0
  64. package/figma-intelligence-layer/src/index.ts +2233 -0
  65. package/figma-intelligence-layer/src/shared/auto-layout-validator.ts +404 -0
  66. package/figma-intelligence-layer/src/shared/cache.ts +187 -0
  67. package/figma-intelligence-layer/src/shared/color-operations.ts +533 -0
  68. package/figma-intelligence-layer/src/shared/color-utils.ts +138 -0
  69. package/figma-intelligence-layer/src/shared/component-script-builder.ts +413 -0
  70. package/figma-intelligence-layer/src/shared/component-templates.ts +2767 -0
  71. package/figma-intelligence-layer/src/shared/concept-taxonomy.ts +694 -0
  72. package/figma-intelligence-layer/src/shared/decision-log.ts +128 -0
  73. package/figma-intelligence-layer/src/shared/design-system-context.ts +568 -0
  74. package/figma-intelligence-layer/src/shared/design-system-intelligence.ts +131 -0
  75. package/figma-intelligence-layer/src/shared/design-system-matcher.ts +184 -0
  76. package/figma-intelligence-layer/src/shared/design-system-normalizers.ts +196 -0
  77. package/figma-intelligence-layer/src/shared/design-system-tokens.ts +295 -0
  78. package/figma-intelligence-layer/src/shared/dtcg-validator.ts +530 -0
  79. package/figma-intelligence-layer/src/shared/enrichment-pipeline.ts +671 -0
  80. package/figma-intelligence-layer/src/shared/figma-bridge.ts +1408 -0
  81. package/figma-intelligence-layer/src/shared/font-config.ts +126 -0
  82. package/figma-intelligence-layer/src/shared/icon-catalog.ts +360 -0
  83. package/figma-intelligence-layer/src/shared/icon-fetch.ts +80 -0
  84. package/figma-intelligence-layer/src/shared/prototype-script-builder.ts +162 -0
  85. package/figma-intelligence-layer/src/shared/response-compression.ts +440 -0
  86. package/figma-intelligence-layer/src/shared/semantic-token-catalog.ts +324 -0
  87. package/figma-intelligence-layer/src/shared/token-binder.ts +505 -0
  88. package/figma-intelligence-layer/src/shared/token-math.ts +427 -0
  89. package/figma-intelligence-layer/src/shared/token-naming.ts +468 -0
  90. package/figma-intelligence-layer/src/shared/token-utils.ts +420 -0
  91. package/figma-intelligence-layer/src/shared/types.ts +346 -0
  92. package/figma-intelligence-layer/src/shared/typography-presets.ts +94 -0
  93. package/figma-intelligence-layer/src/shared/unsplash.ts +165 -0
  94. package/figma-intelligence-layer/src/shared/vision-client.ts +607 -0
  95. package/figma-intelligence-layer/src/shared/vision-provider-anthropic.ts +334 -0
  96. package/figma-intelligence-layer/src/shared/vision-provider-openai.ts +446 -0
  97. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotate-handler.ts +782 -0
  98. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotate-renderer.ts +496 -0
  99. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotation-kit.ts +230 -0
  100. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/colorblind-sim.ts +66 -0
  101. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/index.ts +810 -0
  102. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-analyzer.ts +1191 -0
  103. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-figma-page.ts +1346 -0
  104. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-handler.ts +148 -0
  105. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/vpat-figma-page.ts +499 -0
  106. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/vpat-report.ts +910 -0
  107. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/wcag-checker.ts +989 -0
  108. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/wcag-criteria.ts +1160 -0
  109. package/figma-intelligence-layer/src/tools/phase1-vision/design-from-ref/index.ts +424 -0
  110. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/component-recognizer.ts +38 -0
  111. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/ds-matcher.ts +111 -0
  112. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/font-matcher.ts +114 -0
  113. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/icon-resolver.ts +103 -0
  114. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/index.ts +1060 -0
  115. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/layout-segmenter.ts +18 -0
  116. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/token-inferencer.ts +39 -0
  117. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/vision-pipeline.ts +58 -0
  118. package/figma-intelligence-layer/src/tools/phase1-vision/sketch-to-design/index.ts +298 -0
  119. package/figma-intelligence-layer/src/tools/phase1-vision/visual-audit/index.ts +197 -0
  120. package/figma-intelligence-layer/src/tools/phase2-accuracy/component-audit/index.ts +494 -0
  121. package/figma-intelligence-layer/src/tools/phase2-accuracy/intent-translator/index.ts +356 -0
  122. package/figma-intelligence-layer/src/tools/phase2-accuracy/layout-intelligence/container-patterns.ts +123 -0
  123. package/figma-intelligence-layer/src/tools/phase2-accuracy/layout-intelligence/index.ts +663 -0
  124. package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/built-in-rules.yaml +56 -0
  125. package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/index.ts +614 -0
  126. package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/rule-engine.ts +113 -0
  127. package/figma-intelligence-layer/src/tools/phase2-accuracy/theme-generator/color-theory.ts +178 -0
  128. package/figma-intelligence-layer/src/tools/phase2-accuracy/theme-generator/index.ts +470 -0
  129. package/figma-intelligence-layer/src/tools/phase2-accuracy/variant-expander/index.ts +429 -0
  130. package/figma-intelligence-layer/src/tools/phase2-accuracy/variant-expander/token-override-maps.ts +226 -0
  131. package/figma-intelligence-layer/src/tools/phase3-generation/ai-image-insert/index.ts +535 -0
  132. package/figma-intelligence-layer/src/tools/phase3-generation/component-archaeologist/index.ts +660 -0
  133. package/figma-intelligence-layer/src/tools/phase3-generation/component-archaeologist/pattern-fingerprints.ts +209 -0
  134. package/figma-intelligence-layer/src/tools/phase3-generation/composition-builder/index.ts +540 -0
  135. package/figma-intelligence-layer/src/tools/phase3-generation/figma-animated-build.ts +391 -0
  136. package/figma-intelligence-layer/src/tools/phase3-generation/page-architect/index.ts +2019 -0
  137. package/figma-intelligence-layer/src/tools/phase3-generation/page-architect/screen-templates.ts +131 -0
  138. package/figma-intelligence-layer/src/tools/phase3-generation/prototype-map/index.ts +381 -0
  139. package/figma-intelligence-layer/src/tools/phase3-generation/prototype-wire/index.ts +565 -0
  140. package/figma-intelligence-layer/src/tools/phase3-generation/swarm-build/index.ts +764 -0
  141. package/figma-intelligence-layer/src/tools/phase3-generation/system-drift/index.ts +535 -0
  142. package/figma-intelligence-layer/src/tools/phase3-generation/unsplash-search/index.ts +84 -0
  143. package/figma-intelligence-layer/src/tools/phase3-generation/url-to-frame/index.ts +401 -0
  144. package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/css-animations.ts +68 -0
  145. package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/framer-motion.ts +78 -0
  146. package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/swift-animations.ts +93 -0
  147. package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/index.ts +596 -0
  148. package/figma-intelligence-layer/src/tools/phase4-sync/ci-check/index.ts +462 -0
  149. package/figma-intelligence-layer/src/tools/phase4-sync/export-tokens/index.ts +1470 -0
  150. package/figma-intelligence-layer/src/tools/phase4-sync/generate-component-code/index.ts +829 -0
  151. package/figma-intelligence-layer/src/tools/phase4-sync/handoff-spec/index.ts +702 -0
  152. package/figma-intelligence-layer/src/tools/phase4-sync/icon-library-sync/index.ts +483 -0
  153. package/figma-intelligence-layer/src/tools/phase4-sync/sync-from-code/index.ts +501 -0
  154. package/figma-intelligence-layer/src/tools/phase4-sync/sync-from-code/storybook-parser.ts +106 -0
  155. package/figma-intelligence-layer/src/tools/phase4-sync/watch-docs/index.ts +676 -0
  156. package/figma-intelligence-layer/src/tools/phase4-sync/webhook-listener/index.ts +560 -0
  157. package/figma-intelligence-layer/src/tools/phase5-governance/apg-doc/index.ts +1043 -0
  158. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/component-detection.ts +620 -0
  159. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/anatomy.ts +331 -0
  160. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/color-tokens.ts +77 -0
  161. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/properties.ts +54 -0
  162. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/snapshot.ts +287 -0
  163. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/spacing.ts +71 -0
  164. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/states.ts +43 -0
  165. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/typography.ts +71 -0
  166. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/index.ts +221 -0
  167. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/_default.ts +166 -0
  168. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/accordion.ts +232 -0
  169. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/alert.ts +234 -0
  170. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/avatar-group.ts +270 -0
  171. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/avatar.ts +249 -0
  172. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/badge.ts +231 -0
  173. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/banner.ts +293 -0
  174. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/breadcrumb.ts +240 -0
  175. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/button.ts +243 -0
  176. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/calendar.ts +307 -0
  177. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/card.ts +143 -0
  178. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/checkbox.ts +227 -0
  179. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/chip.ts +233 -0
  180. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/combobox.ts +282 -0
  181. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/datepicker.ts +276 -0
  182. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/divider.ts +223 -0
  183. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/drawer.ts +255 -0
  184. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/dropdown-menu.ts +289 -0
  185. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/empty-state.ts +261 -0
  186. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/file-uploader.ts +290 -0
  187. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/form.ts +265 -0
  188. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/grid.ts +238 -0
  189. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/icon.ts +255 -0
  190. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/index.ts +128 -0
  191. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/inline-edit.ts +286 -0
  192. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/inline-message.ts +255 -0
  193. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/input.ts +330 -0
  194. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/link.ts +247 -0
  195. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/list.ts +250 -0
  196. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/menu.ts +247 -0
  197. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/modal.ts +144 -0
  198. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/navbar.ts +264 -0
  199. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/navigation.ts +251 -0
  200. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/number-input.ts +261 -0
  201. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/pagination.ts +248 -0
  202. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/popover.ts +270 -0
  203. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/progress.ts +251 -0
  204. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/radio.ts +142 -0
  205. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/range-slider.ts +282 -0
  206. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/rating.ts +250 -0
  207. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/search.ts +258 -0
  208. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/segmented-control.ts +265 -0
  209. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/select.ts +319 -0
  210. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/skeleton.ts +256 -0
  211. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/slider.ts +232 -0
  212. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/spinner.ts +239 -0
  213. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/status-dot.ts +252 -0
  214. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/stepper.ts +270 -0
  215. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/table.ts +244 -0
  216. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tabs.ts +143 -0
  217. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tag.ts +243 -0
  218. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/textarea.ts +259 -0
  219. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/time-picker.ts +293 -0
  220. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toast.ts +144 -0
  221. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toggle.ts +289 -0
  222. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toolbar.ts +267 -0
  223. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tooltip.ts +232 -0
  224. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/treeview.ts +257 -0
  225. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/typography.ts +319 -0
  226. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/legacy-compat.ts +121 -0
  227. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/anatomy-diagram.ts +430 -0
  228. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/figma-page.ts +312 -0
  229. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/json.ts +129 -0
  230. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/markdown.ts +78 -0
  231. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/visual-doc.ts +2333 -0
  232. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/accessibility.ts +100 -0
  233. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/anatomy.ts +32 -0
  234. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/color-tokens.ts +59 -0
  235. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/content-guidance.ts +18 -0
  236. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/design-tokens.ts +53 -0
  237. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/interaction-rules.ts +19 -0
  238. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/overview.ts +91 -0
  239. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/properties-api.ts +71 -0
  240. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/qa-criteria.ts +19 -0
  241. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/related-components.ts +110 -0
  242. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/responsive.ts +19 -0
  243. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/size-specs.ts +67 -0
  244. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/spacing-structure.ts +58 -0
  245. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/state-specs.ts +79 -0
  246. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/states.ts +50 -0
  247. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/type-hierarchy.ts +33 -0
  248. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/typography.ts +55 -0
  249. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/usage-guidelines.ts +73 -0
  250. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/variants.ts +81 -0
  251. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/types.ts +409 -0
  252. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/index.ts +198 -0
  253. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/renderer.ts +701 -0
  254. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/types.ts +88 -0
  255. package/figma-intelligence-layer/src/tools/phase5-governance/decision-log/index.ts +135 -0
  256. package/figma-intelligence-layer/src/tools/phase5-governance/design-decision-log/index.ts +491 -0
  257. package/figma-intelligence-layer/src/tools/phase5-governance/ds-primitives/index.ts +416 -0
  258. package/figma-intelligence-layer/src/tools/phase5-governance/ds-scaffolder/index.ts +722 -0
  259. package/figma-intelligence-layer/src/tools/phase5-governance/ds-variables/index.ts +449 -0
  260. package/figma-intelligence-layer/src/tools/phase5-governance/health-report/index.ts +393 -0
  261. package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/index.ts +406 -0
  262. package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/figma-page.ts +292 -0
  263. package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/json.ts +24 -0
  264. package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/markdown.ts +172 -0
  265. package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/naming-guide.ts +409 -0
  266. package/figma-intelligence-layer/src/tools/phase5-governance/token-analytics/index.ts +594 -0
  267. package/figma-intelligence-layer/src/tools/phase5-governance/token-docs/index.ts +710 -0
  268. package/figma-intelligence-layer/src/tools/phase5-governance/token-migrate/index.ts +458 -0
  269. package/figma-intelligence-layer/src/tools/phase5-governance/token-naming/index.ts +134 -0
  270. package/figma-intelligence-layer/tests/apg-doc.test.ts +101 -0
  271. package/figma-intelligence-layer/tests/design-system-context.test.ts +152 -0
  272. package/figma-intelligence-layer/tests/design-system-matcher.test.ts +144 -0
  273. package/figma-intelligence-layer/tests/figma-bridge.test.ts +83 -0
  274. package/figma-intelligence-layer/tests/generate-image-and-insert.test.ts +56 -0
  275. package/figma-intelligence-layer/tests/screen-cloner-regression.test.ts +69 -0
  276. package/figma-intelligence-layer/tests/smoke.test.ts +174 -0
  277. package/figma-intelligence-layer/tests/spec-generator.test.ts +127 -0
  278. package/figma-intelligence-layer/tests/token-migrate.test.ts +21 -0
  279. package/figma-intelligence-layer/tests/token-naming.test.ts +30 -0
  280. package/figma-intelligence-layer/tsconfig.json +19 -0
  281. package/package.json +35 -0
  282. package/scripts/clean-existing-chunks.js +179 -0
  283. package/scripts/connect-ai-tool.js +490 -0
  284. package/scripts/convert-hub-pdfs.js +425 -0
  285. package/scripts/figma-mcp-status.js +349 -0
  286. package/scripts/register-codex-mcp.js +96 -0
@@ -0,0 +1,604 @@
1
+ /**
2
+ * shared-prompt-config.js — Shared prompt configuration used by all runner
3
+ * files (chat-runner, codex-runner, gemini-cli-runner).
4
+ *
5
+ * OPTIMIZED: System prompt reduced to ~500 chars. Claude reasons from MCP tool
6
+ * schemas — no routing tables, no task guidance regex, no quality constants.
7
+ */
8
+
9
+ const { resolve, join } = require("path");
10
+ const fs = require("fs");
11
+
12
+ const REPO_DIR = resolve(__dirname, "..");
13
+
14
+ // ── Spec Reference Loader (cached) ─────────────────────────────────────────
15
+
16
+ const _specCache = new Map();
17
+
18
+ function loadSpecReference(specType) {
19
+ if (_specCache.has(specType)) return _specCache.get(specType);
20
+ const filenames = {
21
+ 'anatomy': 'anatomy-spec.md',
22
+ 'api': 'api-spec.md',
23
+ 'property': 'property-spec.md',
24
+ 'color': 'color-spec.md',
25
+ 'structure': 'structure-spec.md',
26
+ 'screen-reader': 'screen-reader-spec.md',
27
+ 'all': 'SKILL.md',
28
+ 'full-template': 'full-spec-template.md',
29
+ };
30
+ const file = filenames[specType];
31
+ if (!file) return '';
32
+ try {
33
+ const content = fs.readFileSync(join(__dirname, 'references', file), 'utf8');
34
+ _specCache.set(specType, content);
35
+ return content;
36
+ } catch { return ''; }
37
+ }
38
+
39
+ // ── System Prompt (~500 chars) ───────────────────────────────────────────────
40
+
41
+ const SYSTEM_PROMPT = `You are an AI design assistant operating inside a Figma plugin via MCP tools. Execute designs directly in Figma — never describe what you would do. Produce production-quality UI matching senior designer polish.
42
+
43
+ === MANDATORY WORKFLOW ===
44
+
45
+ STEP 0 — FIND EMPTY SPACE (NEVER SKIP):
46
+ Scan existing top-level frames, position new work at rightmost edge + 200px gap. Never place at (0,0) when frames exist. If >10 frames on page, create a new page instead.
47
+
48
+ STEP 1 — GATHER CONTEXT (NEVER SKIP ANY SUB-STEP):
49
+ 1. figma_get_status to verify connection.
50
+ 2. figma_get_variables(verbosity:"inventory") — reuse existing tokens, never hardcode hex.
51
+ 3. figma_get_pages — list ALL pages in file. Check for pages dedicated to the requested component/topic. If found, navigate there and screenshot to study existing patterns.
52
+ 4. figma_search_components — find existing components. If a relevant component exists, use figma_get_node or figma_component_archaeologist to study its structure, variants, and properties BEFORE building.
53
+
54
+ STEP 2 — BUILD WITH LAYOUT:
55
+ Use figma_execute. Layout rules:
56
+ - ONE SCREEN: Create exactly 1 root frame per task (unless user asks for multiple).
57
+ - Root frame: resize(W,H) FIRST, then layoutMode="VERTICAL", layoutSizingHorizontal="FIXED", layoutSizingVertical="FIXED". Target: 390×844 mobile, 1440×900 desktop.
58
+ - EVERY frame/child MUST set BOTH layoutSizingHorizontal AND layoutSizingVertical explicitly.
59
+ - Children of VERTICAL parent: layoutSizingHorizontal="FILL", layoutSizingVertical="HUG" (or "FIXED" for known heights).
60
+ - Children of HORIZONTAL parent: layoutSizingVertical="FILL", layoutSizingHorizontal="HUG" (or "FILL" if flex-1).
61
+ - Text nodes: layoutSizingHorizontal="FILL", layoutSizingVertical="HUG" (in vertical parent). Load font via figma.loadFontAsync() BEFORE setting characters.
62
+ - Buttons: layoutSizingHorizontal="HUG", layoutSizingVertical="HUG" (or "FILL" horizontal for full-width).
63
+ - Inputs/cards: layoutSizingHorizontal="FILL", layoutSizingVertical="HUG".
64
+ - Icons/avatars: layoutSizingHorizontal="FIXED", layoutSizingVertical="FIXED".
65
+ - Structural wrappers (no visual styling): fills=[] (transparent, no white bg).
66
+ - PROPERTY ORDER: layoutMode FIRST → sizing → padding → spacing → alignment → fills/strokes. Children: appendChild() BEFORE setting layoutSizingHorizontal="FILL".
67
+ - Padding: spacing tokens (8,12,16,24,32). itemSpacing: (4,8,12,16,24).
68
+ - Text: explicit fontSize, load fontName via figma.loadFontAsync(), fills = text color token.
69
+ - Components: build ONE base state, then figma_variant_expander for variant matrix.
70
+ - NEVER: FILL on root (no parent), HUG parent + FILL child (circular), resize() after HUG (overrides to FIXED).
71
+
72
+ STEP 3 — LAYOUT INTELLIGENCE:
73
+ Call figma_layout_intelligence with recursive:true on EVERY container frame. MANDATORY.
74
+
75
+ STEP 4 — VERIFY (MANDATORY):
76
+ figma_navigate → figma_take_screenshot → inspect for: unfilled widths, clipped text, missing padding, overlaps, emoji icons, poor hierarchy. Fix + re-screenshot up to 3x.
77
+
78
+ === RULES ===
79
+ ICONS: Never use emoji. Use SVG-based Icon components from the design system. Specify icons using icon/{category}/{name} taxonomy (e.g. "icon/action/search", "icon/navigation/menu", "icon/action/close"). Categories: action, navigation, content, communication, status, media, file, social, editor, toggle, device. No text-node icons. No fallback to emoji.
80
+ LAYOUT: Every frame needs Auto Layout + explicit layoutSizingHorizontal + layoutSizingVertical. No frames without both sizing properties set. No clipped text. Consistent spacing tokens.
81
+ QUALITY: Production-ready, not wireframe. Headings 24-32px, body 14-16px, captions 12px. Proper contrast and hierarchy.
82
+
83
+ Execute first, explain briefly after.`;
84
+
85
+ // ── Design Systems (full token data) ─────────────────────────────────────
86
+
87
+ const DESIGN_SYSTEMS = [
88
+ {
89
+ id: "mui",
90
+ name: "Material UI",
91
+ org: "Google",
92
+ tokens: {
93
+ colors: { primary: "#1976D2", secondary: "#9C27B0", error: "#D32F2F", success: "#2E7D32", warning: "#ED6C02", info: "#0288D1", bg: "#ffffff", surface: "#F5F5F5", text: "#212121" },
94
+ typography: { fontFamily: "Roboto", scale: { xs: 12, sm: 14, md: 16, lg: 20, xl: 24, "2xl": 34 } },
95
+ spacing: [0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64],
96
+ radius: { sm: 4, md: 8, lg: 16 },
97
+ },
98
+ components: ["Button", "TextField", "Select", "Card", "Dialog", "Snackbar", "Chip", "Avatar", "AppBar", "Drawer", "Tabs", "DataGrid"],
99
+ promptContext: "Material Design 3 (MUI). 8px grid. Elevation via shadows (0dp–24dp). Rounded corners (4–16px). Typography: Roboto. Use Material component names exactly. Surfaces use tonal color mapping.",
100
+ },
101
+ {
102
+ id: "carbon",
103
+ name: "IBM Carbon",
104
+ org: "IBM",
105
+ tokens: {
106
+ colors: { primary: "#0F62FE", danger: "#DA1E28", success: "#24A148", warning: "#F1C21B", info: "#4589FF", bg: "#ffffff", surface: "#F4F4F4", text: "#161616" },
107
+ typography: { fontFamily: "IBM Plex Sans", scale: { xs: 12, sm: 14, md: 16, lg: 20, xl: 28, "2xl": 32 } },
108
+ spacing: [0, 2, 4, 8, 12, 16, 24, 32, 48, 64, 96],
109
+ radius: { sm: 0, md: 0, lg: 0 },
110
+ },
111
+ components: ["Button", "TextInput", "Dropdown", "Modal", "DataTable", "Notification", "Tag", "Tile", "Accordion", "Breadcrumb", "Toggle", "NumberInput"],
112
+ promptContext: "IBM Carbon Design System. 2x grid (mini-unit: 8px). Sharp corners (0px radius). Dense information layouts. Typography: IBM Plex Sans. Always include focus states. Use Carbon component names exactly.",
113
+ },
114
+ {
115
+ id: "atlassian",
116
+ name: "Atlassian DS",
117
+ org: "Atlassian",
118
+ tokens: {
119
+ colors: { primary: "#0052CC", danger: "#DE350B", success: "#00875A", warning: "#FF991F", info: "#0065FF", bg: "#ffffff", surface: "#FAFBFC", text: "#172B4D" },
120
+ typography: { fontFamily: "Inter", scale: { xs: 11, sm: 14, md: 16, lg: 20, xl: 24, "2xl": 29 } },
121
+ spacing: [0, 2, 4, 8, 12, 16, 20, 24, 32, 40, 48],
122
+ radius: { sm: 3, md: 3, lg: 3 },
123
+ },
124
+ components: ["Button", "Textfield", "Select", "Modal", "DynamicTable", "Flag", "Lozenge", "Banner", "Tabs", "Breadcrumbs", "Toggle", "Checkbox"],
125
+ promptContext: "Atlassian Design System. 8px grid. Consistent 3px border radius. Typography: Inter (previously -apple-system). Lozenges for status, Flags for notifications. Use Atlassian component names exactly.",
126
+ },
127
+ {
128
+ id: "polaris",
129
+ name: "Polaris",
130
+ org: "Shopify",
131
+ tokens: {
132
+ colors: { primary: "#008060", critical: "#D72C0D", success: "#008060", warning: "#FFC453", highlight: "#5C6AC4", bg: "#FFFFFF", surface: "#F6F6F7", text: "#202223" },
133
+ typography: { fontFamily: "Inter", scale: { xs: 12, sm: 13, md: 14, lg: 16, xl: 20, "2xl": 26 } },
134
+ spacing: [0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64],
135
+ radius: { sm: 4, md: 8, lg: 12 },
136
+ },
137
+ components: ["Button", "TextField", "Select", "Modal", "DataTable", "Banner", "Badge", "Card", "Tabs", "Navigation", "ResourceList", "IndexTable"],
138
+ promptContext: "Shopify Polaris Design System. 4px base unit. Commerce-focused patterns. Typography: Inter. Cards are primary containers. Use Polaris component names exactly. Resource-oriented layouts.",
139
+ },
140
+ {
141
+ id: "fluent",
142
+ name: "Fluent UI",
143
+ org: "Microsoft",
144
+ tokens: {
145
+ colors: { primary: "#0078D4", danger: "#D13438", success: "#107C10", warning: "#FFB900", info: "#0078D4", bg: "#FFFFFF", surface: "#F5F5F5", text: "#242424" },
146
+ typography: { fontFamily: "Segoe UI", scale: { xs: 10, sm: 12, md: 14, lg: 16, xl: 20, "2xl": 28 } },
147
+ spacing: [0, 2, 4, 6, 8, 10, 12, 16, 20, 24, 32],
148
+ radius: { sm: 2, md: 4, lg: 8 },
149
+ },
150
+ components: ["Button", "Input", "Dropdown", "Dialog", "DataGrid", "MessageBar", "Badge", "Card", "Pivot", "Breadcrumb", "Toggle", "SpinButton"],
151
+ promptContext: "Microsoft Fluent UI 2. 4px grid. Subtle rounded corners (2–8px). Typography: Segoe UI. Layered depth via shadow tokens. Use Fluent UI component names exactly. Follow Windows/Office visual patterns.",
152
+ },
153
+ {
154
+ id: "antd",
155
+ name: "Ant Design",
156
+ org: "Ant Group",
157
+ tokens: {
158
+ colors: { primary: "#1677FF", error: "#FF4D4F", success: "#52C41A", warning: "#FAAD14", info: "#1677FF", bg: "#FFFFFF", surface: "#F5F5F5", text: "#000000E0" },
159
+ typography: { fontFamily: "system-ui", scale: { xs: 12, sm: 14, md: 16, lg: 20, xl: 24, "2xl": 30 } },
160
+ spacing: [0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64],
161
+ radius: { sm: 4, md: 6, lg: 8 },
162
+ },
163
+ components: ["Button", "Input", "Select", "Modal", "Table", "Notification", "Tag", "Card", "Tabs", "Breadcrumb", "Switch", "InputNumber"],
164
+ promptContext: "Ant Design 5. 4px grid. Enterprise-grade data-heavy interfaces. Typography: system-ui stack. Dense forms and tables. Use Ant Design component names exactly. Token-based theming with CSS variables.",
165
+ },
166
+ {
167
+ id: "shadcn",
168
+ name: "shadcn/ui",
169
+ org: "Community",
170
+ tokens: {
171
+ colors: { primary: "#18181B", secondary: "#F4F4F5", accent: "#F4F4F5", destructive: "#EF4444", muted: "#F4F4F5", bg: "#FFFFFF", surface: "#FAFAFA", text: "#09090B", border: "#E4E4E7" },
172
+ typography: { fontFamily: "Inter", scale: { xs: 12, sm: 14, md: 16, lg: 18, xl: 24, "2xl": 30 } },
173
+ spacing: [0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64],
174
+ radius: { sm: 6, md: 8, lg: 12 },
175
+ },
176
+ components: ["Button", "Input", "Select", "Dialog", "DataTable", "Toast", "Badge", "Card", "Tabs", "Breadcrumb", "Switch", "Separator"],
177
+ promptContext: "shadcn/ui (Radix primitives + Tailwind CSS). CSS custom properties for theming. Copy-paste component model. Typography: Inter or Geist Sans. Use shadcn/ui component names exactly. Minimalist, developer-focused aesthetic.",
178
+ },
179
+ {
180
+ id: "primer",
181
+ name: "Primer",
182
+ org: "GitHub",
183
+ tokens: {
184
+ colors: { primary: "#0969DA", danger: "#CF222E", success: "#1A7F37", attention: "#BF8700", accent: "#8250DF", bg: "#FFFFFF", surface: "#F6F8FA", text: "#1F2328", border: "#D0D7DE" },
185
+ typography: { fontFamily: "system-ui", scale: { xs: 12, sm: 14, md: 16, lg: 20, xl: 26, "2xl": 32 } },
186
+ spacing: [0, 4, 8, 16, 24, 32, 40, 48, 64, 80, 96],
187
+ radius: { sm: 3, md: 6, lg: 12 },
188
+ },
189
+ components: ["Button", "TextInput", "Select", "Dialog", "DataTable", "Flash", "Label", "Box", "UnderlineNav", "Breadcrumbs", "ToggleSwitch", "ActionMenu"],
190
+ promptContext: "GitHub Primer Design System. 8px grid. Functional, developer-tool aesthetic. Typography: system-ui (-apple-system). Use Primer component names exactly. Flash for alerts, Labels for status. Subtle borders over shadows.",
191
+ },
192
+ ];
193
+
194
+ function getDesignSystemById(id) {
195
+ if (!id) return null;
196
+ return DESIGN_SYSTEMS.find((ds) => ds.id === id) || null;
197
+ }
198
+
199
+ function buildDesignSystemAddendum(dsId) {
200
+ const ds = getDesignSystemById(dsId);
201
+ if (!ds) return "";
202
+
203
+ const colorNames = Object.keys(ds.tokens.colors).join(",");
204
+ const scaleNames = Object.keys(ds.tokens.typography.scale).join(",");
205
+ const r = ds.tokens.radius;
206
+
207
+ return `
208
+ === DESIGN SYSTEM: ${ds.name} (${ds.org}) ===
209
+ RULES: Only use tokens below. No hardcoded hex. Load font via figma.loadFontAsync(). Use spacing scale for all padding/gaps.
210
+
211
+ TOKENS:
212
+ Colors: [${colorNames}] Apply: primary→CTAs, bg→backgrounds, surface→cards/inputs, text→body, error→destructive
213
+ Font: ${ds.tokens.typography.fontFamily} | Scale: [${scaleNames}] Apply: 2xl→titles, xl→headings, lg→subheadings, md→body, sm→labels, xs→helper
214
+ Spacing: ${ds.tokens.spacing.length}-step scale (${ds.tokens.spacing[0]}-${ds.tokens.spacing[ds.tokens.spacing.length - 1]}px)
215
+ Radius: sm=${r.sm} md=${r.md} lg=${r.lg}
216
+
217
+ COMPONENTS: ${ds.components.join(", ")}
218
+ SYSTEM: ${ds.promptContext}
219
+ === END DESIGN SYSTEM ===`;
220
+ }
221
+
222
+ const FIGMA_GET_VARIABLES_INSTRUCTION = "2. figma_get_variables(verbosity:\"inventory\") — reuse existing tokens, never hardcode hex.\n3. figma_get_pages — list ALL pages in file. Check for pages dedicated to the requested component/topic. If found, navigate there and screenshot to study existing patterns.\n4. figma_search_components — find existing components. If a relevant component exists, use figma_get_node or figma_component_archaeologist to study its structure, variants, and properties BEFORE building.";
223
+
224
+ function buildSystemPrompt(dsId) {
225
+ if (dsId) {
226
+ const ds = getDesignSystemById(dsId);
227
+ const dsName = ds ? ds.name : dsId;
228
+ const addendum = buildDesignSystemAddendum(dsId);
229
+ const modified = SYSTEM_PROMPT.replace(
230
+ FIGMA_GET_VARIABLES_INSTRUCTION,
231
+ `2. You are using the **${dsName}** design system. Use ONLY the ${dsName} tokens defined below. Do NOT use file variables that conflict with the selected design system. The design system tokens are the single source of truth.\n3. figma_get_pages — list ALL pages. Check for pages dedicated to the requested component/topic. Navigate + screenshot to study existing patterns.\n4. figma_search_components — find existing components. Use figma_get_node or figma_component_archaeologist to study structure, variants, properties BEFORE building.`
232
+ );
233
+ return `${modified}\n${addendum}`;
234
+ }
235
+
236
+ // No DS selected — file variables are primary source, fall back to Carbon
237
+ const addendum = buildDesignSystemAddendum("carbon");
238
+ const modified = SYSTEM_PROMPT.replace(
239
+ FIGMA_GET_VARIABLES_INSTRUCTION,
240
+ "2. ALWAYS call figma_get_variables(verbosity:\"inventory\") FIRST. If the file has variables/tokens, use THOSE — they are the primary source. Only fall back to Carbon tokens below when no file variables exist.\n3. figma_get_pages — list ALL pages. Check for pages dedicated to the requested component/topic. Navigate + screenshot to study existing patterns.\n4. figma_search_components — find existing components. Use figma_get_node or figma_component_archaeologist to study structure, variants, properties BEFORE building."
241
+ );
242
+ return `${modified}\n${addendum}`;
243
+ }
244
+
245
+ // ── Chat Mode System Prompt (lightweight — no tools, no design execution) ────
246
+
247
+ const CHAT_SYSTEM_PROMPT = `You are a helpful design assistant in Chat mode. Your ONLY job is to answer questions and have conversations. You must NEVER use any tools, execute any code, call any MCP functions, create anything in Figma, or take any actions. Even if the user asks you to create, build, design, modify, or execute something — DO NOT do it. Instead, politely tell them: "That's a great task! Please switch to **Code mode** using the tab at the top to execute that. I'm here in Chat mode just to answer questions and help you think through ideas."
248
+
249
+ Answer questions clearly and concisely about design, Figma, UI/UX, tokens, variables, development, and any other topic. Give advice, explain concepts, suggest approaches — but never execute or build anything yourself.
250
+
251
+ When knowledge sources or web references are provided in the context, prioritize answers from those sources. Always cite the source name when referencing specific material. Format citations as: _Source: "Document Name"_ or _[Article Title](url)_.`;
252
+
253
+ function buildChatPrompt() {
254
+ return CHAT_SYSTEM_PROMPT;
255
+ }
256
+
257
+ // ── Active Skill Detection ───────────────────────────────────────────────────
258
+
259
+ function detectActiveSkills(text) {
260
+ const lower = (text || "").toLowerCase();
261
+ const skills = [];
262
+ if (/(accessibility annotation|a11y annotation|focus order|aria annotation|accessible document)/.test(lower)) skills.push("A11y Annotator");
263
+ if (/(accessible|accessibility|a11y|wcag|screen reader|keyboard navigation|aria)/.test(lower)) skills.push("Accessibility");
264
+ if (/(design\s*system|design\s*tokens?|token\s*system|scaffol|primitives|variable\s*collection|ds\s*setup|ds\s*foundation)/.test(lower)) skills.push("Design System");
265
+ if (/(component\s*set|component\s*library|componentset|\bbutton\s*component|\bmodal\s*component|\binput\s*component|\btoggle\s*component|\bcreate.*component|\bvariant\b.*\b(size|state|style)\b|(create|make|build|design|add)\s+(a\s+|an\s+)?(button|modal|dialog|input|toggle|switch|checkbox|radio|tooltip|avatar|badge|alert|toast|tabs?|dropdown|select|table|card|navbar)\s*$)/.test(lower)) skills.push("Component Builder");
266
+ if (/(audit|health\s*report|lint|drift|governance|consistency\s*check|review\s*design|quality\s*check)/.test(lower)) skills.push("Auditor");
267
+ if (/(prototype|prototyping|interaction|animate|animation|transition|flow connect|link screens)/.test(lower)) skills.push("Prototyping");
268
+ if (/(sync.*code|code.*sync|handoff|spec|specification|developer handoff|generate spec)/.test(lower)) skills.push("Code Sync");
269
+ if (/(theme|color|style|brand|dark mode|light mode|palette)/.test(lower)) skills.push("Theme Factory");
270
+ if (/(screen|flow|page|dashboard|app ui|landing page|checkout|cart|wireframe|nav|header|footer|design|ui|ux|form|settings|detail|list|profile|onboarding|signup|login|home)/.test(lower)) skills.push("Frontend Design");
271
+ // Component Doc Generator — specific spec types (must be checked before Document Design)
272
+ const specTypeMatch = lower.match(/create[-\s]?(anatomy|api|propert(?:y|ies)|color|structure|screen[-\s]?reader)/);
273
+ if (specTypeMatch) {
274
+ const type = specTypeMatch[1].replace(/\s/g, '-').replace('properties', 'property');
275
+ skills.push(`Component Doc Generator:${type}`);
276
+ }
277
+ if (!specTypeMatch) {
278
+ // Specific spec type mentioned in natural language
279
+ if (/(anatomy\s*spec|anatomy\s*doc|anatomy\s*annotation)/.test(lower)) skills.push("Component Doc Generator:anatomy");
280
+ else if (/(api\s*spec|api\s*doc|api\s*table)/.test(lower)) skills.push("Component Doc Generator:api");
281
+ else if (/(propert(?:y|ies)\s*spec|propert(?:y|ies)\s*doc|propert(?:y|ies)\s*exhibit)/.test(lower)) skills.push("Component Doc Generator:property");
282
+ else if (/(color\s*(spec|annotation|token|mapping))/.test(lower)) skills.push("Component Doc Generator:color");
283
+ else if (/(structure\s*spec|spacing\s*spec|dimension\s*spec|structure\s*doc)/.test(lower)) skills.push("Component Doc Generator:structure");
284
+ else if (/(screen.?reader\s*spec|a11y\s*spec|accessibility\s*spec|voiceover\s*spec|talkback\s*spec)/.test(lower)) skills.push("Component Doc Generator:screen-reader");
285
+ // General "spec/document a component" — trigger the chooser
286
+ else if (/(component\s*spec|spec\s*(for|of)\s|document\s*(the|this|a|an|my|our|selected)?\s*.*component|generate\s*(a\s+)?spec|create\s*(a\s+)?spec|component\s*doc(?:ument(?:ation)?)?|generate\s*(a\s+)?(component\s+)?doc(?:ument(?:ation)?)?(\s+for)?|spec\s*doc|create\s*(a\s+)?doc(?:ument(?:ation)?)?\s*(for|of)\s*(the|this|a|my)?\s*component)/.test(lower)) skills.push("Component Doc Generator:all");
287
+ }
288
+ if (/(document|specification|spec\s*sheet|guidelines?\s*page|style\s*guide|design\s*doc|component\s*doc|reference\s*page|wiki|readme|changelog|api\s*doc)/.test(lower)) skills.push("Document Design");
289
+
290
+ // Cross-detection: documentation intent + component-type keyword → Component Doc Generator
291
+ // Catches "document the button", "documentation for the accordion", "document this", etc.
292
+ if (!skills.some(s => s.startsWith("Component Doc Generator:")) &&
293
+ /(document|spec|documentation)/.test(lower) &&
294
+ (/(button|modal|dialog|input|toggle|switch|checkbox|radio|tooltip|avatar|badge|alert|toast|tabs?|dropdown|select|table|card|navbar|accordion|component|this|selected)/.test(lower) ||
295
+ skills.includes("Component Builder"))) {
296
+ skills.push("Component Doc Generator:all");
297
+ }
298
+
299
+ // Design Decision — UX rationale widget generation
300
+ if (/(design\s*decision|ux\s*decision|design\s*rationale|decision\s*log|design\s*log|justify.*design|document.*decision|explain.*design\s*choice)/.test(lower)) skills.push("Design Decision");
301
+
302
+ return skills;
303
+ }
304
+
305
+ // ── Skill Addendum Builder ───────────────────────────────────────────────────
306
+
307
+ function buildSkillAddendum(skills) {
308
+ const sections = [];
309
+
310
+ if (skills.includes("Frontend Design")) {
311
+ sections.push(`
312
+ === FRONTEND DESIGN SKILL ===
313
+ COMPOSITION: Header zone → Content zone → Action zone (sticky CTA mobile, inline desktop).
314
+
315
+ LAYOUT PRESETS:
316
+ - Dashboard: sidebar(FIXED 240px) + main(FILL), card rows HORIZONTAL with FILL children.
317
+ - Form: single column max-width 600px, inputs FILL, section gaps 32px, field gaps 16px.
318
+ - List: search(FILL) + filters(HORIZONTAL,HUG) + list(VERTICAL,FILL). Items: icon(FIXED)+content(FILL)+action(HUG).
319
+ - Detail: hero(FILL,240px) + content(24px pad) + sticky CTA(FILL).
320
+ - Auth: centered card 400px, VERTICAL. Logo(FIXED)+heading+inputs(FILL)+button(FILL)+links(HUG).
321
+
322
+ AUTO-LAYOUT RULES:
323
+ - Stacked content → VERTICAL, children layoutSizingHorizontal="FILL", layoutSizingVertical="HUG"
324
+ - Row of chips/tags → HORIZONTAL, children layoutSizingHorizontal="HUG", layoutSizingVertical="HUG"
325
+ - Input/card in vertical parent → layoutSizingHorizontal="FILL", layoutSizingVertical="HUG"
326
+ - Icon/avatar → layoutSizingHorizontal="FIXED", layoutSizingVertical="FIXED", never FILL
327
+ - Structural wrappers → fills=[] (no white bg)
328
+ - Parent HUG + child FILL = conflict. Avoid.
329
+ - No FILL on nodes without auto-layout parent.
330
+ - ONE root frame per task.
331
+ Validate: figma_layout_intelligence(recursive:true).
332
+ === END FRONTEND DESIGN SKILL ===`);
333
+ }
334
+
335
+ // Component Doc Generator — load only the relevant spec reference on-demand
336
+ const docGenSkill = skills.find(s => s.startsWith("Component Doc Generator:"));
337
+ if (docGenSkill) {
338
+ const specType = docGenSkill.split(":")[1];
339
+
340
+ if (specType === "all") {
341
+ // Generate complete spec directly — no chooser, no 2-phase workflow
342
+ // Load the gold-standard template as writing reference
343
+ const fullTemplate = loadSpecReference('full-template');
344
+ sections.push(`
345
+ === COMPONENT DOC GENERATOR SKILL (HIGHEST PRIORITY) ===
346
+
347
+ Generate a COMPLETE component specification directly in Figma.
348
+
349
+ WORKFLOW — ONE TOOL CALL, ONE PAGE:
350
+ 1. Call figma_component_spec(outputFormat: "all") — this generates the FULL spec automatically.
351
+ 2. STOP. Do NOT call any other tools after this. The spec is complete.
352
+
353
+ The tool auto-generates ALL 11 sections: Overview, Anatomy, Variants, States, Properties/API, Spacing & Structure, Color Tokens, Typography, Accessibility, Usage Guidelines, Related Components. Each section includes rich descriptive content, tables, and actionable guidance — not just raw data.
354
+
355
+ QUALITY REFERENCE — the tool generates content matching this standard:
356
+ ${fullTemplate ? fullTemplate.slice(0, 6000) : '(Template not loaded — generate detailed, actionable content for each section.)'}
357
+
358
+ CRITICAL RULES:
359
+ - Call figma_component_spec ONCE with outputFormat: "all" — then STOP
360
+ - Do NOT call figma_execute to create additional spec pages
361
+ - Do NOT call figma_execute with code that creates pages named "Spec", "specification", or "Component Doc"
362
+ - figma_component_doc has been removed — use figma_component_spec instead
363
+ - Do NOT call figma_apg_doc — accessibility is already included in the spec
364
+ - Do NOT create a second page, do NOT enhance the output, do NOT add anything after
365
+ - The single tool call produces the COMPLETE production-grade document — no manual enrichment needed
366
+ - After the tool returns, reply with a SHORT summary (1-2 sentences). Do NOT call any more tools.
367
+
368
+ ERROR HANDLING:
369
+ - If figma_component_spec returns an error, report the error to the user verbatim. Do NOT attempt to recreate the spec manually with figma_execute. Do NOT create any pages.
370
+ - If figma_component_spec returns warnings, include them in your summary but do NOT try to fix them with additional tool calls.
371
+ === END COMPONENT DOC GENERATOR SKILL ===`);
372
+ } else {
373
+ // Specific spec type — generate focused spec with all content auto-enriched
374
+ sections.push(`
375
+ === COMPONENT DOC GENERATOR SKILL (HIGHEST PRIORITY) ===
376
+
377
+ Generate a ${specType.toUpperCase()} specification for a Figma component.
378
+
379
+ SINGLE-CALL WORKFLOW:
380
+ 1. Call figma_component_spec(outputFormat: "all", pageName: "[Component] ${specType.charAt(0).toUpperCase() + specType.slice(1)} Spec")
381
+ - The tool auto-enriches all sections from the knowledge base.
382
+ - All content is production-grade and specific to the component.
383
+
384
+ CRITICAL RULES:
385
+ - Call figma_component_spec ONCE — no two-phase workflow needed
386
+ - figma_component_doc has been removed
387
+ - The tool generates complete, detailed content automatically
388
+ - If the tool returns an error, report it to the user. Do NOT call figma_execute to manually create spec pages.
389
+ === END COMPONENT DOC GENERATOR SKILL ===`);
390
+ }
391
+ }
392
+
393
+ // Document Design — suppress when Component Doc Generator is active with a specific type
394
+ if (skills.includes("Document Design") && !skills.some(s => s.startsWith("Component Doc Generator:"))) {
395
+ sections.push(`
396
+ === DOCUMENT DESIGN SKILL ===
397
+
398
+ Call figma_component_spec(outputFormat: "all") ONCE — then STOP. Do NOT call figma_execute or any other tool to create additional pages. The single call produces the complete visual spec page. For a11y docs: figma_apg_doc.
399
+ === END DOCUMENT DESIGN SKILL ===`);
400
+ }
401
+
402
+ if (skills.includes("Component Builder")) {
403
+ sections.push(`
404
+ === COMPONENT BUILDER SKILL ===
405
+ WORKFLOW (for components, not screens):
406
+ 1. DEEP FILE SCAN (NEVER SKIP — this is the most important step):
407
+ a. figma_get_variables(verbosity:"inventory") — discover ALL file variables. These are your PRIMARY token source. Map every color, spacing, and radius variable before designing anything.
408
+ b. figma_get_pages — list ALL pages. Look for pages named after or related to the component you're building (e.g. "Accordion", "Buttons", "Form Controls"). If found: figma_navigate to that page → figma_take_screenshot → study the existing design, dimensions, spacing, states, and variant structure.
409
+ c. figma_search_components — find existing components. If a match or similar component exists: figma_get_node(nodeId, depth:3) or figma_component_archaeologist to deeply study its variant dimensions, properties, layer structure, and token usage. Replicate the same quality level.
410
+ d. If the file has an existing design system page or component library page, study it to understand the file's conventions (naming, spacing scale, color usage).
411
+ 2. Only AFTER completing the deep scan: plan your component based on what you learned from the file. Match existing patterns.
412
+ 3. Use figma.createComponent() (NEVER createFrame). Name all children semantically (e.g. "Header", "Title", "Content", "Icon", "Divider"). Auto-layout on ALL containers. Bind ALL colors to file variables or design tokens.
413
+ 4. Add component properties for ALL editable/toggleable parts:
414
+ - TEXT: addComponentProperty("titleText","TEXT","Default label") + componentPropertyReferences = { characters: "titleText" }
415
+ - BOOLEAN: addComponentProperty("expanded","BOOLEAN",false) + componentPropertyReferences = { visible: "expanded" }
416
+ - INSTANCE_SWAP: addComponentProperty("swapSlot","INSTANCE_SWAP",defaultComp.id) + componentPropertyReferences = { mainComponent: "swapSlot" }
417
+ 5. Call figma_variant_expander with nodeId, dimensions, namingConvention:"figma", autoApplyTokens:true, arrangeInGrid:true.
418
+ 6. Verify: figma_navigate → figma_take_screenshot. Check: ComponentSet visible? All variants in properties panel? All states/sizes present? Visual quality production-ready?
419
+
420
+ QUALITY STANDARD — Match professional design system components:
421
+ - Every component MUST have at minimum: Size (sm/md/lg), State (Enabled/Hover/Focus/Pressed/Disabled) variant dimensions.
422
+ - Add ALL relevant boolean dimensions: Expanded(true/false), Flush(true/false), Selected(true/false), etc.
423
+ - Add ALL relevant categorical dimensions: Alignment(Start/End), Type/Style variants.
424
+ - Add text properties for ALL user-facing labels (title, description, placeholder, etc.).
425
+ - Add instance swap slots for customizable sub-elements (icons, badges, etc.).
426
+ - Example — Accordion should have: Size(Large/Medium/Small) × State(Enabled/Hover/Focus/Pressed/Disabled) × Alignment(Start/End) × Flush(true/false) × Expanded(true/false) + Slot(instance swap) + Title text + Content text.
427
+
428
+ VARIANT DIMENSIONS BY COMPONENT:
429
+ - Button: state[Default,Hover,Pressed,Focused,Disabled,Loading] × size[sm,md,lg] × type[Primary,Secondary,Ghost,Destructive]
430
+ - Input/Select: state[Default,Focused,Error,Disabled] × size[sm,md,lg]
431
+ - Accordion: state[Enabled,Hover,Focus,Pressed,Disabled] × size[Large,Medium,Small] × alignment[Start,End] × flush[False,True] × expanded[False,True]
432
+ - Checkbox: state[Default,Checked,Indeterminate,Disabled] × size[sm,md]
433
+ - Toggle: state[Off,On,Disabled] × size[sm,md,lg]
434
+ - Badge/Tag: type[Default,Success,Warning,Error,Info] × size[sm,md]
435
+ - Tabs: state[Default,Selected,Hover,Disabled] × size[sm,md,lg]
436
+ - Card: size[sm,md,lg] × type[Default,Elevated,Outlined]
437
+ - Toast/Alert: type[Success,Warning,Error,Info] × dismissible[True,False]
438
+
439
+ RULES: Never createFrame for components. Never clone variants manually. Name "Property=Value" format. Cap ~30 variants; split if more needed. Run figma_layout_intelligence(recursive:true) after expansion.
440
+ === END COMPONENT BUILDER SKILL ===`);
441
+ }
442
+
443
+ if (skills.includes("Prototyping")) {
444
+ sections.push(`
445
+ === PROTOTYPING SKILL ===
446
+ WORKFLOW:
447
+ 1. SCAN: figma_prototype_scan(frameIds?, journeyDescription?) → discovers buttons/links/nav with IDs.
448
+ 2. REASON: Map journey steps to source elements + destination frames. Triggers: ON_CLICK, ON_HOVER, AFTER_DELAY, ON_DRAG. Animations: SLIDE_IN/OUT (nav), SMART_ANIMATE (in-place), DISSOLVE (overlays), PUSH (tabs). Back=SLIDE_IN RIGHT, Forward=LEFT.
449
+ 3. WIRE: figma_prototype_wire(connections[{fromElementId,toFrameId,trigger,animation{type,direction,duration,easing}}]). dryRun:true to preview.
450
+
451
+ READ: figma_prototype_map (connections diagram), figma_animation_specifier (dev-ready code).
452
+ Always scan before wiring. Wire both forward+back. Default: 0.3s EASE_IN_AND_OUT.
453
+ === END PROTOTYPING SKILL ===`);
454
+ }
455
+
456
+ if (skills.includes("Design Decision")) {
457
+ sections.push(`
458
+ === DESIGN DECISION SKILL (HIGHEST PRIORITY) ===
459
+ MANDATORY: You MUST use the figma_design_decision_log tool for ALL design decision requests.
460
+ DO NOT use figma_execute, figma_take_screenshot, or any other tool. DO NOT try to build the frame manually.
461
+ DO NOT attempt to screenshot the screen first. DO NOT call any other figma_ tool.
462
+ The ONLY tool you call is figma_design_decision_log — ONE call, that's it.
463
+
464
+ SINGLE-CALL WORKFLOW:
465
+ 1. Read the user's message to understand which screen/flow they want decisions for.
466
+ 2. If the user mentions or references a specific screen, use that context. If not, ask the user.
467
+ 3. Compose 8-12 UX design decisions based on the screen type and any grounding context provided.
468
+ 4. Call figma_design_decision_log ONCE with all data. Done.
469
+
470
+ MANDATORY TOOL CALL — always use this exact format:
471
+ figma_design_decision_log({
472
+ name: "Screen/Flow Name",
473
+ description: "Overview of the screen, user goals, and what design decisions are documented below.",
474
+ status: "Approved",
475
+ category: "Design Research",
476
+ pageName: "page name if known",
477
+ screenCount: 1,
478
+ decisions: [
479
+ {
480
+ title: "Decision Title",
481
+ rationale: "2-3 sentence explanation of WHY this pattern works, citing UX research.",
482
+ source: "NN Group"
483
+ }
484
+ ],
485
+ nearNodeId: "node ID if user selected a frame"
486
+ })
487
+
488
+ SOURCE BADGES — use ONLY these exact strings:
489
+ - "NN Group" — usability, IA, interaction design research
490
+ - "Baymard Institute" — e-commerce UX (checkout, cart, product pages)
491
+ - "UX Best Practice" — established patterns (Fitts's Law, Hick's Law, Gestalt, Jakob's Law)
492
+ - "Conversion Research" — CRO, urgency, social proof, trust signals
493
+ - "WCAG / Accessibility" — accessibility standards and inclusive design
494
+
495
+ RULES:
496
+ - NEVER use figma_execute or any other tool — ONLY figma_design_decision_log
497
+ - NEVER try to take a screenshot before generating — just generate directly
498
+ - Each decision must be specific, not generic advice
499
+ - Rationale: explain WHY the pattern works, 2-3 sentences, cite the principle
500
+ - Aim for 8-12 decisions covering layout, hierarchy, interaction, accessibility, conversion
501
+ === END DESIGN DECISION SKILL ===`);
502
+ }
503
+
504
+ return sections.join("\n");
505
+ }
506
+
507
+ // ── Dual Output Prompt (Figma + Code Generation) ─────────────────────────────
508
+
509
+ function buildDualOutputPrompt(dsId, frameworkConfig = {}) {
510
+ const base = buildSystemPrompt(dsId);
511
+ const framework = frameworkConfig.framework || "react";
512
+ const frameworkLabels = {
513
+ react: "React (TypeScript + CSS Modules)",
514
+ vue: "Vue 3 (Composition API + <style scoped>)",
515
+ svelte: "Svelte (TypeScript)",
516
+ html: "HTML + CSS + vanilla JS",
517
+ };
518
+ const frameworkLabel = frameworkLabels[framework] || frameworkLabels.react;
519
+
520
+ const codeAddendum = `
521
+
522
+ === DUAL OUTPUT MODE ===
523
+ After completing the Figma design (Steps 0-4 above), you MUST also generate
524
+ production-ready component code. Target framework: ${frameworkLabel}.
525
+
526
+ Emit each code file using this exact marker format (the relay server parses these):
527
+
528
+ <!-- FIGMA_INTELLIGENCE_CODE_OUTPUT: ComponentName/ComponentName.tsx -->
529
+ \`\`\`tsx
530
+ // component code here
531
+ \`\`\`
532
+ <!-- /FIGMA_INTELLIGENCE_CODE_OUTPUT -->
533
+
534
+ <!-- FIGMA_INTELLIGENCE_CODE_OUTPUT: ComponentName/ComponentName.module.css -->
535
+ \`\`\`css
536
+ /* styles here */
537
+ \`\`\`
538
+ <!-- /FIGMA_INTELLIGENCE_CODE_OUTPUT -->
539
+
540
+ <!-- FIGMA_INTELLIGENCE_CODE_OUTPUT: ComponentName/ComponentName.stories.tsx -->
541
+ \`\`\`tsx
542
+ // storybook story showing all variants
543
+ \`\`\`
544
+ <!-- /FIGMA_INTELLIGENCE_CODE_OUTPUT -->
545
+
546
+ ALSO generate a standalone interactive preview file:
547
+
548
+ <!-- FIGMA_INTELLIGENCE_CODE_OUTPUT: ComponentName/preview.html -->
549
+ \`\`\`html
550
+ <!-- Self-contained preview — opens in any browser, no build tools needed -->
551
+ \`\`\`
552
+ <!-- /FIGMA_INTELLIGENCE_CODE_OUTPUT -->
553
+
554
+ PREVIEW.HTML RULES (CRITICAL — this is how users test the component):
555
+ - Must be a SINGLE self-contained HTML file — no imports, no build step.
556
+ - Use React 18 via CDN (unpkg.com/react@18, unpkg.com/react-dom@18, unpkg.com/@babel/standalone).
557
+ - Include ALL component code inline (copy the full component + CSS into the HTML).
558
+ - Render EVERY variant/state in a grid: sizes, types, states (default, hover, disabled, loading, etc.).
559
+ - Add interactive controls: buttons to toggle states, inputs to change props live.
560
+ - Make hover/focus/active states work with real CSS :hover, :focus, :active pseudo-classes.
561
+ - Style the preview page with a clean dark background (#1a1a2e) and clear section labels.
562
+ - Add a "Props Playground" section with controls (dropdowns, toggles) to change variant/size/state dynamically.
563
+ - The file must work by simply opening it in a browser — drag and drop, file:// protocol, or http://.
564
+
565
+ CODE GENERATION RULES:
566
+ 1. Match component variants and properties EXACTLY to what was created in Figma.
567
+ 2. Use design tokens from the active design system — map Figma tokens to CSS custom properties or constants.
568
+ 3. Include TypeScript interfaces for all component props.
569
+ 4. Generate a Storybook story (CSF3 format) showing all variants.
570
+ 5. Use CSS Modules for styling (ComponentName.module.css).
571
+ 6. Name files using PascalCase matching the Figma component name.
572
+ 7. Export the component as the default export.
573
+ 8. Include all interactive states (hover, focus, disabled, loading) as CSS classes.
574
+ === END DUAL OUTPUT MODE ===`;
575
+
576
+ return base + codeAddendum;
577
+ }
578
+
579
+ // ── Exports ──────────────────────────────────────────────────────────────────
580
+
581
+ /**
582
+ * Build a notebook grounding addendum for the system prompt.
583
+ * Called by bridge-relay when notebooks are active, this wraps
584
+ * the grounding context with instructions for the AI provider.
585
+ */
586
+ function buildContentGroundingAddendum(groundingContext) {
587
+ if (!groundingContext) return "";
588
+ return `\n\n${groundingContext}\nWhen the user's question relates to topics in the notebook context above, prioritize information from those sources. Cite the notebook and source name when referencing specific material.`;
589
+ }
590
+
591
+ module.exports = {
592
+ SYSTEM_PROMPT,
593
+ CHAT_SYSTEM_PROMPT,
594
+ DESIGN_SYSTEMS,
595
+ buildSystemPrompt,
596
+ buildChatPrompt,
597
+ buildDualOutputPrompt,
598
+ buildSkillAddendum,
599
+ buildDesignSystemAddendum,
600
+ buildContentGroundingAddendum,
601
+ getDesignSystemById,
602
+ detectActiveSkills,
603
+ REPO_DIR,
604
+ };