@sxl-studio/bridge 1.7.2 → 1.8.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 (203) hide show
  1. package/README.md +342 -16
  2. package/dist/agent-recipes.d.ts +781 -11
  3. package/dist/agent-recipes.js +886 -13
  4. package/dist/agent-recipes.js.map +1 -1
  5. package/dist/agent-runbook.d.ts +50 -0
  6. package/dist/agent-runbook.js +243 -0
  7. package/dist/agent-runbook.js.map +1 -0
  8. package/dist/asset-upload.d.ts +63 -0
  9. package/dist/asset-upload.js +225 -0
  10. package/dist/asset-upload.js.map +1 -0
  11. package/dist/audit-store.d.ts +15 -0
  12. package/dist/audit-store.js +100 -0
  13. package/dist/audit-store.js.map +1 -0
  14. package/dist/audit.d.ts +4 -3
  15. package/dist/audit.js +37 -4
  16. package/dist/audit.js.map +1 -1
  17. package/dist/auth.d.ts +8 -1
  18. package/dist/auth.js +41 -1
  19. package/dist/auth.js.map +1 -1
  20. package/dist/bridge-agent-workflow-validation-cli.d.ts +2 -0
  21. package/dist/bridge-agent-workflow-validation-cli.js +68 -0
  22. package/dist/bridge-agent-workflow-validation-cli.js.map +1 -0
  23. package/dist/bridge-agent-workflow-validation.d.ts +42 -0
  24. package/dist/bridge-agent-workflow-validation.js +170 -0
  25. package/dist/bridge-agent-workflow-validation.js.map +1 -0
  26. package/dist/bridge-contract-audit.d.ts +45 -0
  27. package/dist/bridge-contract-audit.js +345 -0
  28. package/dist/bridge-contract-audit.js.map +1 -0
  29. package/dist/bridge-health-cli.d.ts +2 -0
  30. package/dist/bridge-health-cli.js +115 -0
  31. package/dist/bridge-health-cli.js.map +1 -0
  32. package/dist/bridge-health.d.ts +33 -0
  33. package/dist/bridge-health.js +594 -0
  34. package/dist/bridge-health.js.map +1 -0
  35. package/dist/bridge-live-validation-cli.d.ts +2 -0
  36. package/dist/bridge-live-validation-cli.js +114 -0
  37. package/dist/bridge-live-validation-cli.js.map +1 -0
  38. package/dist/bridge-live-validation.d.ts +39 -0
  39. package/dist/bridge-live-validation.js +1141 -0
  40. package/dist/bridge-live-validation.js.map +1 -0
  41. package/dist/bridge-performance-profile.d.ts +81 -0
  42. package/dist/bridge-performance-profile.js +227 -0
  43. package/dist/bridge-performance-profile.js.map +1 -0
  44. package/dist/bridge-readiness-cli.d.ts +30 -0
  45. package/dist/bridge-readiness-cli.js +242 -0
  46. package/dist/bridge-readiness-cli.js.map +1 -0
  47. package/dist/bridge-runtime-summary.d.ts +50 -0
  48. package/dist/bridge-runtime-summary.js +112 -0
  49. package/dist/bridge-runtime-summary.js.map +1 -0
  50. package/dist/bridge-workflow-smoke-cli.d.ts +2 -0
  51. package/dist/bridge-workflow-smoke-cli.js +126 -0
  52. package/dist/bridge-workflow-smoke-cli.js.map +1 -0
  53. package/dist/bridge-workflow-smoke.d.ts +39 -0
  54. package/dist/bridge-workflow-smoke.js +431 -0
  55. package/dist/bridge-workflow-smoke.js.map +1 -0
  56. package/dist/codeconnect-suggestions.d.ts +74 -0
  57. package/dist/codeconnect-suggestions.js +398 -0
  58. package/dist/codeconnect-suggestions.js.map +1 -0
  59. package/dist/codeconnect-template.d.ts +98 -0
  60. package/dist/codeconnect-template.js +280 -0
  61. package/dist/codeconnect-template.js.map +1 -0
  62. package/dist/command-queue.d.ts +11 -1
  63. package/dist/command-queue.js +200 -1
  64. package/dist/command-queue.js.map +1 -1
  65. package/dist/command-safety.d.ts +13 -0
  66. package/dist/command-safety.js +59 -0
  67. package/dist/command-safety.js.map +1 -0
  68. package/dist/enabled-library-search.d.ts +49 -0
  69. package/dist/enabled-library-search.js +151 -0
  70. package/dist/enabled-library-search.js.map +1 -0
  71. package/dist/figma-mcp-parity.d.ts +49 -0
  72. package/dist/figma-mcp-parity.js +368 -0
  73. package/dist/figma-mcp-parity.js.map +1 -0
  74. package/dist/figma-mcp-skills-parity.d.ts +61 -0
  75. package/dist/figma-mcp-skills-parity.js +434 -0
  76. package/dist/figma-mcp-skills-parity.js.map +1 -0
  77. package/dist/figma-rest-diagnostics.d.ts +50 -0
  78. package/dist/figma-rest-diagnostics.js +314 -0
  79. package/dist/figma-rest-diagnostics.js.map +1 -0
  80. package/dist/figma-rest.d.ts +27 -0
  81. package/dist/figma-rest.js +116 -0
  82. package/dist/figma-rest.js.map +1 -0
  83. package/dist/http-api.d.ts +16 -2
  84. package/dist/http-api.js +329 -17
  85. package/dist/http-api.js.map +1 -1
  86. package/dist/index.js +25 -1
  87. package/dist/index.js.map +1 -1
  88. package/dist/mcp-factory.d.ts +6 -1
  89. package/dist/mcp-factory.js +23 -4
  90. package/dist/mcp-factory.js.map +1 -1
  91. package/dist/mcp-runtime-probe.d.ts +22 -0
  92. package/dist/mcp-runtime-probe.js +777 -0
  93. package/dist/mcp-runtime-probe.js.map +1 -0
  94. package/dist/mcp-server.d.ts +2 -1
  95. package/dist/mcp-server.js +2 -2
  96. package/dist/mcp-server.js.map +1 -1
  97. package/dist/sxl-mcp-instructions.js +99 -26
  98. package/dist/sxl-mcp-instructions.js.map +1 -1
  99. package/dist/tools/audit.d.ts +22 -6
  100. package/dist/tools/audit.js +49 -7
  101. package/dist/tools/audit.js.map +1 -1
  102. package/dist/tools/capability-matrix.d.ts +22 -0
  103. package/dist/tools/capability-matrix.js +38 -0
  104. package/dist/tools/capability-matrix.js.map +1 -0
  105. package/dist/tools/catalogue-bootstrap.d.ts +1 -0
  106. package/dist/tools/catalogue-bootstrap.js +665 -30
  107. package/dist/tools/catalogue-bootstrap.js.map +1 -1
  108. package/dist/tools/code-connect-context.d.ts +3 -0
  109. package/dist/tools/code-connect-context.js +319 -0
  110. package/dist/tools/code-connect-context.js.map +1 -0
  111. package/dist/tools/code-connect-template.d.ts +3 -0
  112. package/dist/tools/code-connect-template.js +111 -0
  113. package/dist/tools/code-connect-template.js.map +1 -0
  114. package/dist/tools/composition.js +15 -30
  115. package/dist/tools/composition.js.map +1 -1
  116. package/dist/tools/compositions-orchestration.d.ts +14 -14
  117. package/dist/tools/compositions-orchestration.js +2 -2
  118. package/dist/tools/compositions-orchestration.js.map +1 -1
  119. package/dist/tools/data.js +839 -27
  120. package/dist/tools/data.js.map +1 -1
  121. package/dist/tools/design-context.d.ts +3 -0
  122. package/dist/tools/design-context.js +197 -0
  123. package/dist/tools/design-context.js.map +1 -0
  124. package/dist/tools/destructive-confirmation.d.ts +10 -0
  125. package/dist/tools/destructive-confirmation.js +25 -0
  126. package/dist/tools/destructive-confirmation.js.map +1 -0
  127. package/dist/tools/diagnostics.js +76 -51
  128. package/dist/tools/diagnostics.js.map +1 -1
  129. package/dist/tools/figma-mcp-design.d.ts +3 -0
  130. package/dist/tools/figma-mcp-design.js +377 -0
  131. package/dist/tools/figma-mcp-design.js.map +1 -0
  132. package/dist/tools/figma-nodes.js +57 -43
  133. package/dist/tools/figma-nodes.js.map +1 -1
  134. package/dist/tools/figma-rc-extended.js +23 -6
  135. package/dist/tools/figma-rc-extended.js.map +1 -1
  136. package/dist/tools/figma-rest.d.ts +39 -0
  137. package/dist/tools/figma-rest.js +279 -0
  138. package/dist/tools/figma-rest.js.map +1 -0
  139. package/dist/tools/git.js +11 -7
  140. package/dist/tools/git.js.map +1 -1
  141. package/dist/tools/large-data.d.ts +14 -0
  142. package/dist/tools/large-data.js +189 -0
  143. package/dist/tools/large-data.js.map +1 -0
  144. package/dist/tools/meta.d.ts +6 -1
  145. package/dist/tools/meta.js +89 -11
  146. package/dist/tools/meta.js.map +1 -1
  147. package/dist/tools/metadata.d.ts +3 -0
  148. package/dist/tools/metadata.js +140 -0
  149. package/dist/tools/metadata.js.map +1 -0
  150. package/dist/tools/mockup.d.ts +15 -156
  151. package/dist/tools/mockup.js +54 -121
  152. package/dist/tools/mockup.js.map +1 -1
  153. package/dist/tools/orchestration.js +75 -47
  154. package/dist/tools/orchestration.js.map +1 -1
  155. package/dist/tools/prompts.d.ts +3 -0
  156. package/dist/tools/prompts.js +219 -0
  157. package/dist/tools/prompts.js.map +1 -0
  158. package/dist/tools/registry.d.ts +19 -1
  159. package/dist/tools/registry.js +4 -4
  160. package/dist/tools/registry.js.map +1 -1
  161. package/dist/tools/resources.d.ts +19 -2
  162. package/dist/tools/resources.js +149 -5
  163. package/dist/tools/resources.js.map +1 -1
  164. package/dist/tools/schema-contracts.d.ts +4763 -0
  165. package/dist/tools/schema-contracts.js +814 -0
  166. package/dist/tools/schema-contracts.js.map +1 -0
  167. package/dist/tools/screenshot.d.ts +3 -0
  168. package/dist/tools/screenshot.js +144 -0
  169. package/dist/tools/screenshot.js.map +1 -0
  170. package/dist/tools/shared.d.ts +11 -1
  171. package/dist/tools/shared.js +55 -2
  172. package/dist/tools/shared.js.map +1 -1
  173. package/dist/tools/styles-orchestration.d.ts +2 -2
  174. package/dist/tools/styles-orchestration.js +13 -5
  175. package/dist/tools/styles-orchestration.js.map +1 -1
  176. package/dist/tools/styles.js +22 -8
  177. package/dist/tools/styles.js.map +1 -1
  178. package/dist/tools/tokens.d.ts +31 -692
  179. package/dist/tools/tokens.js +175 -135
  180. package/dist/tools/tokens.js.map +1 -1
  181. package/dist/tools/variable-defs.d.ts +3 -0
  182. package/dist/tools/variable-defs.js +338 -0
  183. package/dist/tools/variable-defs.js.map +1 -0
  184. package/dist/tools/variables-orchestration.js +13 -5
  185. package/dist/tools/variables-orchestration.js.map +1 -1
  186. package/dist/tools/variables.js +18 -15
  187. package/dist/tools/variables.js.map +1 -1
  188. package/dist/types.d.ts +53 -0
  189. package/dist/ultimate-readiness-audit.d.ts +37 -0
  190. package/dist/ultimate-readiness-audit.js +431 -0
  191. package/dist/ultimate-readiness-audit.js.map +1 -0
  192. package/dist/workflow-planner.d.ts +57 -0
  193. package/dist/workflow-planner.js +464 -0
  194. package/dist/workflow-planner.js.map +1 -0
  195. package/dist/workspace-blob-store.d.ts +6 -0
  196. package/dist/workspace-blob-store.js +9 -0
  197. package/dist/workspace-blob-store.js.map +1 -1
  198. package/dist/workspace-path-http.d.ts +24 -0
  199. package/dist/workspace-path-http.js +146 -0
  200. package/dist/workspace-path-http.js.map +1 -0
  201. package/dist/ws-server.js +16 -3
  202. package/dist/ws-server.js.map +1 -1
  203. package/package.json +21 -2
@@ -21,6 +21,42 @@ export declare const RECIPE_INDEX: {
21
21
  readonly version: 1;
22
22
  readonly context: "Decision tree for any documentation / palette / scenario request that targets a Figma file managed by SXL Studio. Always read this resource first; it routes the agent to a specific recipe instead of running ad-hoc figma.* JS.";
23
23
  readonly userIntents: readonly [{
24
+ readonly recipeId: "sxl-use";
25
+ readonly userPhrases: readonly ["управляй фигмой через bridge", "figma-use", "use_figma", "use figma to update the current design file", "create or modify nodes in figma", "read selection and edit canvas", "назначь переменные объектам", "work with variables styles and components", "use figma rest api", "diagnose figma rest token", "whoami figma token", "search known figma library", "get_libraries", "search_design_system", "search design system library", "upload images to figma", "загрузи изображения в фигму"];
26
+ }, {
27
+ readonly recipeId: "sxl-implement-design";
28
+ readonly userPhrases: readonly ["figma-implement-design", "figma-swiftui", "implement this figma design in swiftui", "convert figma selection to swiftui", "implement this figma design in code", "turn figma selection into code", "convert figma selection to code", "реализуй выбранный макет в коде"];
29
+ }, {
30
+ readonly recipeId: "sxl-generate-design";
31
+ readonly userPhrases: readonly ["нарисуй экран в фигме", "figma-generate-design", "generate_figma_design", "code to canvas", "push app page into figma", "build a real UI screen in Figma", "собери макет из дизайн-системы", "update this screen without rebuilding everything", "validate screen spec before applying"];
32
+ }, {
33
+ readonly recipeId: "sxl-generate-library";
34
+ readonly userPhrases: readonly ["создай дизайн-систему в фигме", "figma-generate-library", "generate a figma design system library", "generate library in figma from codebase", "generate library variables styles components docs", "экспортируй переменные и стили", "пересобери компоненты из композиций", "build design system foundations", "figma-create-design-system-rules", "create design system rules for this project", "generate rules for translating figma designs into code"];
35
+ }, {
36
+ readonly recipeId: "sxl-code-connect";
37
+ readonly userPhrases: readonly ["настрой code connect", "figma-code-connect", "figma-code-connect-components", "get_context_for_code_connect", "send_code_connect_mappings", "save code connect binding", "свяжи figma компонент с storybook", "show code connect registry", "component docs url files storybook binding"];
38
+ }, {
39
+ readonly recipeId: "sxl-audit";
40
+ readonly userPhrases: readonly ["проведи аудит макетов", "analyze variables styles and component usage", "проверь пропсы компонентов", "найди компоненты с prop value", "audit coverage drift unused analytics"];
41
+ }, {
42
+ readonly recipeId: "sxl-doc-builder";
43
+ readonly userPhrases: readonly ["нарисуй документацию в фигме", "build documentation in Figma", "документация компонентов токенов флоу", "render markdown scenario as Figma flow", "apply doc spec"];
44
+ }, {
45
+ readonly recipeId: "sxl-data-apply-mapping";
46
+ readonly userPhrases: readonly ["примени маппинг", "примени mapping", "apply mapping to selection", "apply data mapping", "подставь данные по маппингу", "fill selected nodes from dataset"];
47
+ }, {
48
+ readonly recipeId: "sxl-data-apply-all";
49
+ readonly userPhrases: readonly ["примени все маппинги", "apply all mappings", "apply all data mappings", "подставь данные по всем маппингам", "apply mappings on page", "apply mappings to document"];
50
+ }, {
51
+ readonly recipeId: "sxl-data-generate-instances";
52
+ readonly userPhrases: readonly ["сгенерируй инстансы из датасета", "generate instances from dataset", "generate instances from mapping", "создай строки из датасета", "render rows from mapping data", "generate cards from dataset mapping"];
53
+ }, {
54
+ readonly recipeId: "sxl-database-transfer";
55
+ readonly userPhrases: readonly ["экспортируй базу sxl", "импортируй базу sxl", "backup sxl database", "restore sxl database", "export database payload", "import database payload", "перенеси datasets assets mappings"];
56
+ }, {
57
+ readonly recipeId: "figma-mcp-companion";
58
+ readonly userPhrases: readonly ["figma-create-new-file", "create_new_file", "create a new figma file", "new figma design file", "figma-generate-diagram", "generate_diagram", "create a figjam diagram", "figma-use-figjam", "figma-use-slides", "create figma slides"];
59
+ }, {
24
60
  readonly recipeId: "doc-tokens";
25
61
  readonly userPhrases: readonly ["задокументируй токены", "build a token doc", "table of token values", "fill template TEXT layers with token values", "tokenPath, layerName binding", "show DTCG paths in doc frame"];
26
62
  }, {
@@ -49,7 +85,7 @@ export declare const RECIPE_INDEX: {
49
85
  readonly userPhrases: readonly ["сколько раз используется accent.medium", "where is this variable used", "посчитай где используется переменная", "render a page with all usages of accent.medium", "найди все объекты с переменной", "show me everywhere this token appears", "выведи на страницу все места где встречается переменная"];
50
86
  }, {
51
87
  readonly recipeId: "audit-coverage";
52
- readonly userPhrases: readonly ["проверь везде ли подкреплены переменные", "найди объекты без переменных", "audit raw values without variables", "review the file for missing bindings", "где hex заливки вместо токенов", "найди объекты с дефолтными цветами"];
88
+ readonly userPhrases: readonly ["проверь везде ли подкреплены переменные", "проверь на всех макетах установлены ли переменные и стили", "проверь на всех ли макетах и объектах установленные переменные", "проверь переменные и стили на макетах", "найди объекты без переменных", "check whether every screen object has variables and styles assigned", "check variable and style coverage across layouts", "audit raw values without variables", "review the file for missing bindings", "где hex заливки вместо токенов", "найди объекты с дефолтными цветами"];
53
89
  }, {
54
90
  readonly recipeId: "find-unused";
55
91
  readonly userPhrases: readonly ["какие переменные у меня не используются", "find unused variables", "which styles are dead", "почисть неиспользуемые токены", "найди мёртвые стили"];
@@ -151,6 +187,218 @@ export declare const RECIPE_INDEX: {
151
187
  readonly forbidden: readonly ["Calling use_figma with a hand-written figma.* script when an SXL Bridge tool covers the task.", "Shell payload assembly to /tmp/*.json + base64 loaders + node -e glue to invoke MCP.", "Hand-crafting composition / token / Doc Spec JSON when the plugin pipeline (export_composition_json / list_compositions / get_variables) is the source of truth.", "Skipping this index and jumping straight to a sub-recipe without confirming intent."];
152
188
  readonly doneCriteria: "Agent picked exactly one recipe, called only the tools it lists, and produced a verifiable result (doneWhen of that recipe).";
153
189
  };
190
+ export declare const RECIPE_SXL_USE: {
191
+ readonly id: "sxl-use";
192
+ readonly title: "SXL Use — read/write the current Figma Design file through Bridge";
193
+ readonly version: 1;
194
+ readonly context: "Foundational SXL skill for canvas reads/writes, variables, styles, components, token workspace operations, status checks, and design-to-code context. Mirrors the role of figma-use for SXL Studio and supplies the active-file context needed by figma-implement-design-style workflows: prefer Bridge tools and plugin handlers over arbitrary use_figma scripts.";
195
+ readonly userPhrases: readonly ["управляй фигмой через bridge", "create or modify nodes in figma", "read selection and edit canvas", "назначь переменные объектам", "work with variables styles and components", "figma-implement-design", "implement this figma design in code", "turn figma selection into code", "diagnose figma rest token", "whoami figma token", "search known figma library", "get_libraries", "search_design_system", "search organization design library", "get variable definitions used in selection", "покажи переменные и стили выделения"];
196
+ readonly decideBetween: readonly [{
197
+ readonly between: readonly ["sxl-use", "sxl-generate-design"];
198
+ readonly hint: "sxl-use handles low-level targeted reads/writes; sxl-generate-design assembles or updates full screens via Design DSL.";
199
+ }, {
200
+ readonly between: readonly ["sxl-use", "sxl-audit"];
201
+ readonly hint: "sxl-use writes after the target is known; sxl-audit discovers usage, coverage, drift, unused entries, or component prop statistics first.";
202
+ }];
203
+ readonly preferredTools: readonly ["get_bridge_runtime_summary", "get_plugin_status", "get_capability_matrix", "get_figma_mcp_skills_parity", "list_tools", "get_selection", "get_design_context", "get_metadata", "get_node_info", "get_node_tree", "get_screenshot", "get_variable_defs", "get_context_for_code_connect", "get_code_connect_suggestions", "get_libraries", "search_design_system", "get_variables", "get_local_styles", "search_enabled_library_assets", "inspect_enabled_libraries", "list_enabled_library_variables", "figma_rest_diagnose", "figma_rest_whoami", "figma_rest_get_file_nodes", "figma_rest_search_design_system", "upload_assets", "set_node_fill_variable", "batch_bind_variables"];
204
+ readonly schemaResources: readonly ["sxl://agent/schemas/code-connect-context-v1"];
205
+ readonly forbidden: readonly ["Calling use_figma with a hand-written figma.* script when a Bridge tool exists.", "Writing canvas changes before checking get_plugin_status.writesAllowed.", "Fetching image URLs in an ad-hoc script or sending raw imageBytes arrays when upload_assets can validate and apply assets.", "Looping single-node writes for bulk variable binding when batch_bind_variables covers the request."];
206
+ readonly steps: readonly ["Call get_bridge_runtime_summary before heavy workflows to check plugin connection, queue pressure, recent failures, and auth status.", "Call get_plugin_status and inspect editorType / writesAllowed before any write.", "Call get_capability_matrix or list_tools if tool choice is uncertain; prefer tools with dryRunSupported for writes.", "For Figma MCP-style library discovery, prefer get_libraries and search_design_system; they combine active-file enabled libraries, local components, and known REST file/team libraries where configured.", "When the plugin is not open, cross-file context is needed, or the request targets a known file/team library outside the active file, call figma_rest_diagnose first; get_libraries/search_design_system can then use fileKey/url/teamId with a configured FIGMA_TOKEN / FIGMA_ACCESS_TOKEN.", "For image insertion in Figma Design, call upload_assets with dryRun=true first; it validates PNG/JPG/GIF/WebP assets up to 10MB and applies them through set_image_fill.", "Read the narrowest needed context: current selection, node tree, variables, or styles.", "For design implementation requests, call get_design_context plus get_variable_defs/get_screenshot/get_context_for_code_connect when components or code mappings matter; the agent then edits project code outside the plugin.", "For writes, use the thickest Bridge command that covers the task; fall back to direct canvas tools only for small targeted edits.", "After writes, inspect the changed node or rerun the relevant audit/read tool."];
207
+ readonly doneCriteria: "Agent completed the requested Figma operation through Bridge tools, respected Design/Dev mode constraints, and did not use arbitrary use_figma scripts.";
208
+ };
209
+ export declare const RECIPE_SXL_IMPLEMENT_DESIGN: {
210
+ readonly id: "sxl-implement-design";
211
+ readonly title: "SXL Implement Design — read Figma context for code implementation";
212
+ readonly version: 1;
213
+ readonly context: "Read-only Bridge workflow for Figma-to-code requests, including current official figma-swiftui and legacy/client figma-implement-design-style aliases. It gathers active-file design context, screenshots, variable/style definitions, SXL codegen/composition data, and Code Connect hints so the agent can edit the repository code outside Figma. It must not mutate the Figma canvas.";
214
+ readonly userPhrases: readonly ["figma-implement-design", "figma-swiftui", "implement this figma design in swiftui", "convert figma selection to swiftui", "implement this figma design in code", "turn figma selection into code", "convert figma selection to code", "реализуй выбранный макет в коде"];
215
+ readonly decideBetween: readonly [{
216
+ readonly between: readonly ["sxl-implement-design", "sxl-use"];
217
+ readonly hint: "sxl-implement-design is read-only context for code implementation; sxl-use is broad active-file read/write control.";
218
+ }, {
219
+ readonly between: readonly ["sxl-implement-design", "sxl-generate-design"];
220
+ readonly hint: "sxl-implement-design turns Figma into repository code; sxl-generate-design builds Figma screens from a spec/code context.";
221
+ }];
222
+ readonly preferredTools: readonly ["get_bridge_runtime_summary", "get_figma_mcp_skills_parity", "get_design_context", "get_metadata", "get_screenshot", "get_variable_defs", "get_context_for_code_connect", "get_code_connect_suggestions", "get_codegen", "export_composition_json"];
223
+ readonly schemaResources: readonly ["sxl://agent/schemas/code-connect-context-v1"];
224
+ readonly forbidden: readonly ["Mutating the Figma canvas for an implement-design request.", "Calling upload_assets, set_node_fill_variable, batch_bind_variables, build_screen, or export_variables.", "Treating SXL codegen as final project code without adapting it to repository components and conventions."];
225
+ readonly steps: readonly ["Call get_bridge_runtime_summary to confirm Bridge/plugin state and queue pressure.", "Call get_design_context for the selected frame/component; include screenshot/context options when useful.", "Call get_variable_defs and get_screenshot when visual/token fidelity matters.", "Call get_context_for_code_connect and get_code_connect_suggestions when component mappings or Storybook context matter.", "Use get_codegen/export_composition_json only as reference material; then edit repository code with normal project tooling."];
226
+ readonly doneCriteria: "Agent collected read-only Figma/SXL context and implemented or updated repository code without mutating the Figma file.";
227
+ };
228
+ export declare const RECIPE_SXL_GENERATE_DESIGN: {
229
+ readonly id: "sxl-generate-design";
230
+ readonly title: "SXL Generate Design — build or update real UI screens in Figma";
231
+ readonly version: 1;
232
+ readonly context: "Screen-building skill for real editable Figma Design files. Use inspect_design_system + validate_screen_spec + build_screen/update_screen first; direct canvas tools are fallback only.";
233
+ readonly userPhrases: readonly ["нарисуй экран в фигме", "build a real UI screen in Figma", "собери макет из дизайн-системы", "update this screen without rebuilding everything", "validate screen spec before applying"];
234
+ readonly decideBetween: readonly [{
235
+ readonly between: readonly ["sxl-generate-design", "mockup-builder"];
236
+ readonly hint: "sxl-generate-design is the top-level screen skill; mockup-builder is the detailed recipe for the underlying build_mockup/build_screen DSL.";
237
+ }, {
238
+ readonly between: readonly ["sxl-generate-design", "sxl-doc-builder"];
239
+ readonly hint: "generate-design builds product UI screens; doc-builder builds documentation pages, palettes, component docs, and flows.";
240
+ }];
241
+ readonly preferredTools: readonly ["inspect_design_system", "validate_screen_spec", "build_screen", "update_screen", "find_components", "search_enabled_library_assets", "inspect_enabled_libraries", "get_variables", "audit_variable_coverage"];
242
+ readonly schemaResources: readonly ["sxl://agent/schemas/design-dsl-v1"];
243
+ readonly forbidden: readonly ["Creating a screen by hand with many create_frame/create_text/create_component_instance calls when build_screen covers it.", "Guessing component names or component prop keys without inspect_design_system / find_components.", "Committing build_screen/update_screen without a dryRun or validate_screen_spec preview.", "Hardcoding hex colors when a local Figma Variable is available."];
244
+ readonly steps: readonly ["Run inspect_design_system with includeProperties and a narrow query/prefix when possible; use search_enabled_library_assets when the user expects components/styles/variables from libraries enabled in the current file.", "Draft a Design DSL v1 spec using real component ids/keys, human prop keys, text overrides, and variable fill bindings.", "Call validate_screen_spec or build_screen/update_screen with dryRun: true and fix any unresolved components/props.", "Commit build_screen or update_screen only after the dry-run plan is clean or approved.", "Run audit_variable_coverage on the resulting root/page when variable binding quality matters."];
245
+ readonly doneCriteria: "A real Figma screen was created or updated with existing components, auto layout, and variable/style bindings where available. The flow used dryRun before write.";
246
+ };
247
+ export declare const RECIPE_SXL_GENERATE_LIBRARY: {
248
+ readonly id: "sxl-generate-library";
249
+ readonly title: "SXL Generate Library — variables, styles, compositions, and docs";
250
+ readonly version: 1;
251
+ readonly context: "Design-system skill for SXL Studio. Covers safe export_variables modes, bulk variable/style specs, composition generation, drift checks, library documentation, and the SXL context needed by figma-create-design-system-rules-style agent workflows.";
252
+ readonly userPhrases: readonly ["создай дизайн-систему в фигме", "generate library variables styles components docs", "экспортируй переменные и стили", "пересобери компоненты из композиций", "build design system foundations", "figma-create-design-system-rules", "create design system rules for this project", "generate rules for translating figma designs into code"];
253
+ readonly decideBetween: readonly [{
254
+ readonly between: readonly ["sxl-generate-library", "bulk-variables"];
255
+ readonly hint: "use bulk-variables for variable-only refactors; use sxl-generate-library when variables, styles, compositions, and docs are part of one system workflow.";
256
+ }, {
257
+ readonly between: readonly ["sxl-generate-library", "bulk-compositions"];
258
+ readonly hint: "bulk-compositions rebuilds existing composition files; sxl-generate-library orchestrates the broader library pipeline.";
259
+ }];
260
+ readonly preferredTools: readonly ["get_tokens_config", "get_figma_mcp_skills_parity", "search_enabled_library_assets", "inspect_enabled_libraries", "list_enabled_library_variables", "inspect_design_system", "get_context_for_code_connect", "get_code_connect_suggestions", "preview_export_variables", "export_variables", "import_variable_spec", "import_style_spec", "list_compositions", "bulk_generate_compositions", "audit_composition_drift", "build_component_doc"];
261
+ readonly forbidden: readonly ["Using destructive export options such as deleteOrphans, forceUpdateAll, or allowDestructiveReorder unless the user explicitly asked for them.", "Claiming export_variables applies codeSyntax/scopes by default; plugin safe default is applyCodeSyntaxAndScopes=false.", "Hand-crafting composition JSON instead of export_composition_json / compose_from_url / list_compositions.", "Bulk-generating compositions without dryRun first."];
262
+ readonly steps: readonly ["Read get_tokens_config and list_token_files/list_compositions to understand the workspace; use inspect_enabled_libraries/list_enabled_library_variables when reconciling enabled library definitions.", "For design-system-rules requests, call inspect_design_system and get_context_for_code_connect/get_code_connect_suggestions when code mappings matter; the agent writes the client-specific rule file in the repository, not through a plugin command.", "For token export, call preview_export_variables first; then call export_variables with only explicit settings and keep safe defaults unless requested.", "For large variable/style changes, use import_variable_spec/import_style_spec with dryRun first.", "Run audit_composition_drift before rebuilding existing components; use bulk_generate_compositions dryRun before commit.", "Build documentation with sxl-doc-builder recipes after foundations are generated."];
263
+ readonly doneCriteria: "Library foundations were exported/generated with non-destructive defaults, drift was inspected before rebuilds, and all bulk writes were previewed first.";
264
+ };
265
+ export declare const RECIPE_SXL_CODE_CONNECT: {
266
+ readonly id: "sxl-code-connect";
267
+ readonly title: "SXL Code Connect — bind Figma components to code, Storybook, and docs";
268
+ readonly version: 1;
269
+ readonly context: "Code Connect skill for SXL Studio. Manages full CodeConnectBinding payloads: docs URL, files, Storybook, component API, status, registry, and global settings.";
270
+ readonly userPhrases: readonly ["настрой code connect", "save code connect binding", "свяжи figma компонент с storybook", "show code connect registry", "component docs url files storybook binding"];
271
+ readonly decideBetween: readonly [{
272
+ readonly between: readonly ["sxl-code-connect", "doc-component"];
273
+ readonly hint: "code-connect links Figma nodes to code/docs metadata; doc-component renders documentation on the Figma canvas.";
274
+ }];
275
+ readonly preferredTools: readonly ["codeconnect_get_global_settings", "codeconnect_save_global_settings", "codeconnect_get_registry", "codeconnect_get_selection_status", "get_context_for_code_connect", "get_code_connect_suggestions", "generate_code_connect_template", "codeconnect_get_binding", "codeconnect_save_binding", "codeconnect_get_node_ui_status"];
276
+ readonly schemaResources: readonly ["sxl://agent/schemas/code-connect-context-v1", "sxl://agent/schemas/code-connect-template-v1"];
277
+ readonly forbidden: readonly ["Saving partial binding metadata that drops docsUrl/files/storybook/component API fields.", "Guessing node ids when selection status can identify the current component.", "Hand-writing filePath/importPath bindings before checking get_context_for_code_connect or get_code_connect_suggestions.", "Writing .figma.ts files without generate_code_connect_template dry-run preview.", "Treating Code Connect as composition JSON; keep bindings as metadata, not generated component structure."];
278
+ readonly steps: readonly ["Read codeconnect_get_global_settings and codeconnect_get_registry to understand existing defaults.", "Use codeconnect_get_selection_status or get_node_info to confirm target node ids.", "Call get_context_for_code_connect with explicit targets/componentNames or current selection; review existing binding, component props, codegen/composition context, and highest-confidence local code candidates.", "For template-file workflows, call generate_code_connect_template without writeFile first; only writeFile=true after reviewing output path/content.", "Save the chosen binding with full metadata: componentName, docs URL, files[], Storybook data, component API, and status where available.", "Verify with codeconnect_get_binding and codeconnect_get_node_ui_status."];
279
+ readonly doneCriteria: "Target Figma component has a full Code Connect binding and the registry/UI status reflect it.";
280
+ };
281
+ export declare const RECIPE_SXL_AUDIT: {
282
+ readonly id: "sxl-audit";
283
+ readonly title: "SXL Audit — variables, styles, components, props, drift, and unused entries";
284
+ readonly version: 1;
285
+ readonly context: "Audit skill for read-only analysis and dry-run-first remediation. Covers variable/style coverage, usage, unused entries, component usage, component prop usage, and composition/style drift.";
286
+ readonly userPhrases: readonly ["проведи аудит макетов", "analyze variables styles and component usage", "проверь пропсы компонентов", "найди компоненты с prop value", "audit coverage drift unused analytics"];
287
+ readonly decideBetween: readonly [{
288
+ readonly between: readonly ["sxl-audit", "audit-coverage"];
289
+ readonly hint: "audit-coverage is the specialized recipe for missing variable/style bindings; sxl-audit is the broad audit router.";
290
+ }, {
291
+ readonly between: readonly ["sxl-audit", "composition-drift"];
292
+ readonly hint: "composition-drift is composition JSON vs Figma component; sxl-audit can route there when that is the user's unit.";
293
+ }];
294
+ readonly preferredTools: readonly ["audit_variable_coverage", "find_variable_coverage_misses", "audit_style_coverage", "find_style_coverage_misses", "analyze_component_usage", "find_component_usages", "analyze_component_prop_usage", "find_component_prop_usages", "find_unused_variables", "find_unused_styles", "audit_composition_drift"];
295
+ readonly forbidden: readonly ["Walking the entire document manually with use_figma for analytics already covered by Bridge audit tools.", "Requesting full detail lists before running summary tools.", "Applying audit suggestions without preview mode first and explicit user confirmation."];
296
+ readonly steps: readonly ["Choose the narrowest scope: selection, page, node, then file only when needed.", "Run summary tools first; use find_* paginated tools only for requested details.", "For component prop analytics, use analyze_component_prop_usage for counts and find_component_prop_usages for node ids.", "If the user asks to fix findings, switch to apply_coverage_suggestions / apply_style_coverage_suggestions / batch_bind_variables and preview before committing."];
297
+ readonly doneCriteria: "Agent returned a scoped audit report with counts and actionable findings; any remediation used preview mode before write.";
298
+ };
299
+ export declare const RECIPE_SXL_DOC_BUILDER: {
300
+ readonly id: "sxl-doc-builder";
301
+ readonly title: "SXL Doc Builder — render documentation in Figma";
302
+ readonly version: 1;
303
+ readonly context: "Documentation skill for Figma canvas output: token tables, variable palettes, component docs, doc flows, and markdown scenarios. Uses Bridge doc tools, never ad-hoc scripts.";
304
+ readonly userPhrases: readonly ["нарисуй документацию в фигме", "build documentation in Figma", "документация компонентов токенов флоу", "render markdown scenario as Figma flow", "apply doc spec"];
305
+ readonly decideBetween: readonly [{
306
+ readonly between: readonly ["sxl-doc-builder", "doc-component"];
307
+ readonly hint: "doc-component is the specialized single-component recipe; sxl-doc-builder routes all documentation types.";
308
+ }, {
309
+ readonly between: readonly ["sxl-doc-builder", "scenario-from-markdown"];
310
+ readonly hint: "scenario-from-markdown wins when the user provides markdown H1/H2 scenario text with Figma URLs.";
311
+ }];
312
+ readonly preferredTools: readonly ["apply_doc_spec", "build_component_doc", "build_doc_flow", "bind_variable_palette", "build_scenario_from_md", "build_token_documentation"];
313
+ readonly schemaResources: readonly ["sxl://agent/schemas/doc-spec-v2", "sxl://agent/schemas/token-doc-v1"];
314
+ readonly forbidden: readonly ["Creating throwaway JS scripts or /tmp payload loaders for documentation.", "Using use_figma to clone templates or enumerate variables when bind_variable_palette/apply_doc_spec exists.", "Hand-crafting composition JSON for docs; use export_composition_json or compose_from_url.", "Skipping dryRun on build_scenario_from_md or doc flows that support preview."];
315
+ readonly steps: readonly ["Route the request: token table, variable palette, component doc, flow, markdown scenario, or custom Doc Spec v2.", "Read the specialized recipe resource for that route before building payloads.", "Discover targetParentId/templateNodeId/layer names via template-discovery when templates are involved.", "Call the chosen doc tool with dryRun when supported, then commit.", "Inspect the created documentation root or report returned nodes."];
316
+ readonly doneCriteria: "Documentation was rendered in Figma through Bridge doc tools with real token/variable/component data and without ad-hoc scripts.";
317
+ };
318
+ export declare const RECIPE_SXL_DATA_APPLY_MAPPING: {
319
+ readonly id: "sxl-data-apply-mapping";
320
+ readonly title: "SXL Data — apply one mapping to explicit targets or current selection";
321
+ readonly version: 1;
322
+ readonly context: "Agent workflow for applying one SXL database mapping to explicit targetNodeIds or the current Figma selection. Agents must preview mapping fields, datasets, and target counts before writing.";
323
+ readonly userPhrases: readonly ["примени маппинг", "apply mapping to selection", "apply data mapping", "подставь данные по маппингу", "fill selected nodes from dataset"];
324
+ readonly decideBetween: readonly [{
325
+ readonly between: readonly ["sxl-data-apply-mapping", "sxl-data-apply-all"];
326
+ readonly hint: "Use apply-mapping when the user names one mapping or selected target. Use apply-all only when the user says all mappings or whole scope.";
327
+ }, {
328
+ readonly between: readonly ["sxl-data-apply-mapping", "sxl-data-generate-instances"];
329
+ readonly hint: "Use apply-mapping to fill existing selected layers. Use generate-instances when the task needs new rows/cards/instances.";
330
+ }];
331
+ readonly preferredTools: readonly ["get_plugin_status", "list_mappings", "get_mapping", "count_apply_targets", "apply_mapping"];
332
+ readonly forbidden: readonly ["Calling apply_mapping without dryRun preview and explicit approval.", "Passing legacy targetNodes when targetNodeIds are available; use explicit node ids for deterministic agent control.", "Applying to page/document scope with apply_mapping; use apply_all_mappings for broad scope."];
333
+ readonly steps: readonly ["Check plugin status and writesAllowed.", "List mappings and read the selected mapping before applying.", "Run count_apply_targets for selection and apply_mapping with dryRun:true.", "Present mapping fields, dataset row hints, and target count.", "Commit apply_mapping only after approval, preferably with targetNodeIds when the intended roots are known."];
334
+ readonly doneCriteria: "One selected SXL mapping was previewed, approved, and applied to the intended explicit targetNodeIds or current Figma selection.";
335
+ };
336
+ export declare const RECIPE_SXL_DATA_APPLY_ALL: {
337
+ readonly id: "sxl-data-apply-all";
338
+ readonly title: "SXL Data — apply all mappings in a scope";
339
+ readonly version: 1;
340
+ readonly context: "Agent workflow for applying all SXL mappings to explicit targetNodeIds or a selection/page/document scope. This is a bulk write and must be dry-run previewed before commit.";
341
+ readonly userPhrases: readonly ["примени все маппинги", "apply all mappings", "apply all data mappings", "подставь данные по всем маппингам", "apply mappings on page", "apply mappings to document"];
342
+ readonly decideBetween: readonly [{
343
+ readonly between: readonly ["sxl-data-apply-all", "sxl-data-apply-mapping"];
344
+ readonly hint: "Use apply-all only when the user explicitly asks for all mappings or a broad scope.";
345
+ }];
346
+ readonly preferredTools: readonly ["get_plugin_status", "list_mappings", "count_apply_targets", "apply_all_mappings"];
347
+ readonly forbidden: readonly ["Running apply_all_mappings without dryRun preview and explicit approval.", "Defaulting to document scope when the user did not ask for it; prefer selection/page unless specified.", "Deleting or changing mappings as part of apply; this workflow only fills data into existing nodes."];
348
+ readonly steps: readonly ["Check plugin status and writesAllowed.", "List mappings and choose explicit targetNodeIds when known, otherwise scope: selection, page, or document.", "Run count_apply_targets and apply_all_mappings with dryRun:true.", "Show mapping count, target count, and scope.", "Commit apply_all_mappings only after approval."];
349
+ readonly doneCriteria: "All requested mappings were previewed and applied only to the approved explicit target roots or Figma scope.";
350
+ };
351
+ export declare const RECIPE_SXL_DATA_GENERATE_INSTANCES: {
352
+ readonly id: "sxl-data-generate-instances";
353
+ readonly title: "SXL Data — generate instances from mapping rows";
354
+ readonly version: 1;
355
+ readonly context: "Agent workflow for generating repeated component instances/cards/rows from an SXL mapping and dataset. The selected Figma node is the template/container source.";
356
+ readonly userPhrases: readonly ["сгенерируй инстансы из датасета", "generate instances from dataset", "generate instances from mapping", "создай строки из датасета", "render rows from mapping data", "generate cards from dataset mapping"];
357
+ readonly decideBetween: readonly [{
358
+ readonly between: readonly ["sxl-data-generate-instances", "mockup-builder"];
359
+ readonly hint: "Use generate-instances when a mapping already exists and the selected Figma template should be duplicated. Use mockup-builder for declarative Design DSL screens.";
360
+ }, {
361
+ readonly between: readonly ["sxl-data-generate-instances", "sxl-data-apply-mapping"];
362
+ readonly hint: "Use generate-instances to create new repeated nodes; use apply-mapping to fill existing selected nodes.";
363
+ }];
364
+ readonly preferredTools: readonly ["get_plugin_status", "list_mappings", "get_mapping", "generate_instances"];
365
+ readonly forbidden: readonly ["Calling generate_instances without dryRun preview and explicit approval.", "Generating rows without targetNodeIds when the intended template/container root is already known.", "Hand-duplicating components through low-level canvas tools when the existing SXL generation engine should be used."];
366
+ readonly steps: readonly ["Check plugin status and writesAllowed.", "List mappings and read the mapping/dataset relationship.", "Use explicit targetNodeIds for the template/container root when known; otherwise confirm the active Figma selection.", "Run generate_instances with dryRun:true to estimate rows and validate mapping fields.", "Show requested row count, estimated generated rows, and dataset row counts.", "Commit generate_instances only after approval, preferably with targetNodeIds for deterministic remote control."];
367
+ readonly doneCriteria: "Instances were generated through SXL's mapping engine after dry-run preview, with the approved row count and intended explicit targetNodeIds or confirmed active selection.";
368
+ };
369
+ export declare const RECIPE_SXL_DATABASE_TRANSFER: {
370
+ readonly id: "sxl-database-transfer";
371
+ readonly title: "SXL Database — portable datasets/assets/mappings payloads";
372
+ readonly version: 1;
373
+ readonly context: "Agent workflow for backing up, restoring, or moving SXL Studio database datasets, local assets, and mappings between files/workspaces using portable Bridge payloads.";
374
+ readonly userPhrases: readonly ["экспортируй базу sxl", "импортируй базу sxl", "backup sxl database", "restore sxl database", "export database payload", "import database payload", "перенеси datasets assets mappings"];
375
+ readonly decideBetween: readonly [{
376
+ readonly between: readonly ["sxl-database-transfer", "sxl-data-apply-mapping"];
377
+ readonly hint: "Use database-transfer for moving/storing datasets/assets/mappings. Use data-apply when the goal is to fill nodes on canvas.";
378
+ }];
379
+ readonly preferredTools: readonly ["get_plugin_status", "list_datasets", "list_assets", "list_mappings", "export_database_payload", "import_database_payload"];
380
+ readonly forbidden: readonly ["Importing payloads without dryRun preview.", "Overwriting existing ids without confirmDestructive:true and a human-readable destructiveReason.", "Including asset content in export unless the user needs a full backup/restore payload."];
381
+ readonly steps: readonly ["Check plugin status and inspect existing datasets/assets/mappings.", "For backup/transfer, call export_database_payload; include asset content only when needed.", "For restore/import, call import_database_payload with dryRun:true first.", "Review counts, conflicts, and warnings.", "Commit import only after approval; existing id conflicts require destructive confirmation and reason."];
382
+ readonly doneCriteria: "SXL database payload was exported or imported through Bridge with dry-run conflict review and no accidental overwrites.";
383
+ };
384
+ export declare const RECIPE_FIGMA_MCP_COMPANION: {
385
+ readonly id: "figma-mcp-companion";
386
+ readonly title: "Official Figma MCP Companion — remote-only and non-Design scopes";
387
+ readonly version: 1;
388
+ readonly context: "Routing recipe for official Figma MCP features that Bridge should not fake through the local SXL plugin: new-file creation, FigJam/Slides, diagram generation, and hosted remote-only workflows. Bridge can explain parity and prepare local SXL context, but the agent must call official Figma MCP tools for these capabilities.";
389
+ readonly userPhrases: readonly ["figma-create-new-file", "create_new_file", "create a new figma file", "figma-generate-diagram", "generate_diagram", "create a figjam diagram", "figma-use-figjam", "figma-use-slides"];
390
+ readonly decideBetween: readonly [{
391
+ readonly between: readonly ["figma-mcp-companion", "sxl-use"];
392
+ readonly hint: "Use sxl-use for the active Figma Design file, SXL plugin workflows, Figma Design asset upload, and get_libraries/search_design_system. Use companion when the request names remote-only official Figma MCP features, FigJam, Slides, or new-file creation.";
393
+ }, {
394
+ readonly between: readonly ["figma-mcp-companion", "sxl-generate-design"];
395
+ readonly hint: "Use sxl-generate-design when building into an existing Figma Design file through SXL Bridge. Use companion when the first step is creating a new Figma file or using official generate_figma_design in a supported hosted MCP client.";
396
+ }];
397
+ readonly preferredTools: readonly ["get_figma_mcp_parity", "get_bridge_runtime_summary", "figma_rest_diagnose"];
398
+ readonly forbidden: readonly ["Pretending Bridge can create new Figma files, FigJam boards, Slides decks, or Mermaid diagrams through the local plugin.", "Routing Figma Design get_libraries/search_design_system to companion without first checking Bridge get_libraries/search_design_system coverage.", "Replacing official Figma MCP FigJam/Slides workflows with Figma Design canvas commands."];
399
+ readonly steps: readonly ["Call get_figma_mcp_parity to identify the exact official Figma MCP companion tool and explain why Bridge is not primary for this request.", "If the request also needs SXL Studio state, call get_bridge_runtime_summary and relevant SXL reads after the official MCP step has produced/selected a Figma Design file.", "Use official Figma MCP tools for create_new_file, generate_diagram, FigJam, Slides, and remote-only generate_figma_design workflows."];
400
+ readonly doneCriteria: "Agent routed the user to official Figma MCP for remote-only/non-Design work and did not claim the local SXL plugin can perform unsupported operations.";
401
+ };
154
402
  export declare const RECIPE_TEMPLATE_DISCOVERY: {
155
403
  readonly id: "template-discovery";
156
404
  readonly title: "Find the swatch / card template inside a content frame";
@@ -168,6 +416,7 @@ export declare const RECIPE_DOC_SPEC_V2: {
168
416
  readonly version: 1;
169
417
  readonly context: "Doc Spec v2 lets you compose a single apply_doc_spec call from a list of sections. Each section is independent: combine only what the user asked for. Read this resource before assembling a custom spec.";
170
418
  readonly preferredTools: readonly ["apply_doc_spec", "build_component_doc", "bind_variable_palette", "build_doc_flow"];
419
+ readonly schemaResources: readonly ["sxl://agent/schemas/doc-spec-v2"];
171
420
  readonly sections: readonly [{
172
421
  readonly type: "title";
173
422
  readonly note: "Either creates a TEXT node or writes into an existing layerName.";
@@ -240,7 +489,7 @@ export declare const RECIPE_DOC_FLOW: {
240
489
  readonly userPhrases: readonly ["сделай flow по этим ссылкам", "build a screen flow doc", "story of pages from these urls", "scenario doc with multiple frames"];
241
490
  readonly preferredTools: readonly ["build_doc_flow", "compose_from_url", "duplicate_subtree", "apply_doc_spec"];
242
491
  readonly forbidden: readonly ["Calling use_figma to clone many frames into one container — use build_doc_flow.", "Skipping captions when the user provided a description per page — pass them via pages[].title / description."];
243
- readonly steps: readonly ["Resolve each Figma URL to a node id (parseFigmaUrl handles `&node-id=` segments).", "Call build_doc_flow with pages[] (each with nodeId and optional title / description).", "If a page references a composition file rather than a node, call compose_from_url first to materialise it."];
492
+ readonly steps: readonly ["Resolve each Figma URL to a node id (parseFigmaUrl handles `&node-id=` segments).", "Call build_doc_flow with pages[] (each with nodeId or compositionFileId, plus optional title / description).", "When a page references an existing composition file, pass pages[].compositionFileId directly; Bridge/plugin will generate/apply it and render an instance or clone in the flow."];
244
493
  readonly doneCriteria: "All requested pages appear inside a single auto-layout container with optional captions; no use_figma script was used.";
245
494
  };
246
495
  export declare const RECIPE_COMPOSE_WITH_VARIABLES: {
@@ -307,16 +556,16 @@ export declare const RECIPE_AUDIT_COVERAGE: {
307
556
  readonly id: "audit-coverage";
308
557
  readonly title: "Audit nodes that lack a variable / style binding";
309
558
  readonly version: 1;
310
- readonly userPhrases: readonly ["проверь везде ли подкреплены переменные", "найди объекты без переменных", "audit raw values without variables", "review the file for missing bindings", "где hex заливки вместо токенов"];
559
+ readonly userPhrases: readonly ["проверь везде ли подкреплены переменные", "проверь на всех макетах установлены ли переменные и стили", "проверь на всех ли макетах и объектах установленные переменные", "проверь переменные и стили на макетах", "найди объекты без переменных", "check whether every screen object has variables and styles assigned", "check variable and style coverage across layouts", "audit raw values without variables", "review the file for missing bindings", "где hex заливки вместо токенов"];
311
560
  readonly decideBetween: readonly [{
312
561
  readonly between: readonly ["audit-coverage", "find-unused"];
313
562
  readonly hint: "audit-coverage finds where to ADD bindings (raw values). find-unused finds variables/styles to DELETE.";
314
563
  }];
315
564
  readonly context: "audit_variable_coverage returns SUMMARY only (counts + topOffenders). When `suggest=true` (default) the plugin matches every raw value against existing local variables; the suggestion in topOffenders / details lets the agent propose batch_bind_variables payloads. Style coverage (audit_style_coverage) reports nodes where neither a styleId nor a variable is bound.";
316
- readonly preferredTools: readonly ["audit_variable_coverage", "find_variable_coverage_misses", "audit_style_coverage", "find_style_coverage_misses", "batch_bind_variables"];
565
+ readonly preferredTools: readonly ["audit_variable_coverage", "find_variable_coverage_misses", "audit_style_coverage", "find_style_coverage_misses"];
317
566
  readonly forbidden: readonly ["Walking the document manually with use_figma — audit_* tools cover the case (chunked, alias-aware).", "Applying suggested bindings without user confirmation — coverage suggestions can be wrong on intentional raw values.", "Running on scope='file' first when 'page' is enough — start narrow, widen on demand."];
318
- readonly steps: readonly ["Start narrow: audit_variable_coverage { scope: 'page' } — confirm magnitude.", "If acceptable, widen: scope: 'file'.", "For details / fix-up: find_variable_coverage_misses { limit, cursor } assemble a batch_bind_variables payload from suggestion entries.", "For style coverage do the same with audit_style_coverage / find_style_coverage_misses."];
319
- readonly doneCriteria: "Agent returned a summary (and optionally a batch_bind_variables proposal) without using use_figma. Coverage gaps are quantified per property and per page.";
567
+ readonly steps: readonly ["Start narrow: audit_variable_coverage { scope: 'page' } — confirm magnitude.", "If acceptable, widen: scope: 'file'.", "For details: find_variable_coverage_misses { limit, cursor } and find_style_coverage_misses { limit, cursor }.", "For style coverage do the same with audit_style_coverage / find_style_coverage_misses.", "If the user asks to fix the findings, switch to auto-bind-from-audit and run apply_coverage_suggestions / apply_style_coverage_suggestions in preview mode first."];
568
+ readonly doneCriteria: "Agent returned a read-only summary and optional paginated findings without using use_figma. Coverage gaps are quantified per property and per page; remediation is a separate dry-run-first workflow.";
320
569
  };
321
570
  export declare const RECIPE_BULK_VARIABLES: {
322
571
  readonly id: "bulk-variables";
@@ -416,11 +665,12 @@ export declare const RECIPE_MOCKUP_BUILDER: {
416
665
  readonly between: readonly ["mockup-builder", "doc-flow"];
417
666
  readonly hint: "mockup-builder = single auto-layout screen; doc-flow = multiple pages stacked side-by-side as a story.";
418
667
  }];
419
- readonly context: "Phase D: thick orchestration over `figma.createInstance / setProperties / setBoundVariableForPaint / loadFontAsync`. Pipeline: (1) `find_components` to discover ids / keys + componentPropertyDefinitions; (2) `build_mockup` to assemble an auto-layout container from a declarative item tree (`instance | section | spacer | text`) with property / text / fill-binding overrides; (3) `apply_mockup_dataset` when the same template needs to be cloned per-row from a structured list.";
420
- readonly preferredTools: readonly ["find_components", "build_mockup", "apply_mockup_dataset", "get_variables"];
421
- readonly forbidden: readonly ["Calling use_figma to write a hand-rolled `figma.createInstance(...) / setProperties(...)` loop when build_mockup covers the assembly.", "Guessing component names instead of running find_components first — the user's file may have arbitrary local names.", "Skipping dryRun for build_mockup / apply_mockup_dataset — always preview the resolved plan before writing to canvas.", "Hand-coding fill colours when a Figma Variable is available — use fillBindings { variableId } so the mockup picks up theme switches automatically.", "Loading fonts manually — build_mockup loads fonts on demand with a safe Inter Regular fallback.", "Assuming property names like `size#123:0` — pass the human key (`size`); the plugin maps to the internal `name#defId` suffix via `componentProperties`."];
422
- readonly steps: readonly ["Run find_components { query | prefix?, includeProperties: true, kind?: 'COMPONENT' | 'COMPONENT_SET', limit?: 50 } to enumerate available components. Cache the (id, name, propertyDefinitions, defaultVariantId) list.", "If the user wants library components, set includeRemoteInstances: true so library components instantiated in this file are included; otherwise stay local-only.", "Decide the layout: VERTICAL stack of sections, HORIZONTAL row of cards, or WRAP grid. Pick itemSpacing / padding to match the user's intent (e.g. 16px gutters).", "Build the items[] tree. Use `instance` for components (one of componentId | componentKey | componentName), `section` for nested auto-layout frames, `spacer` for explicit gaps, `text` for bare TEXT layers (TEXT styles can be applied via textStyleId).", "For property / text / fill overrides on instances: pass `properties` (human keys), `textOverrides[]` (layerName + value), `fillBindings[]` (variableId; optional layerName when only one child should receive the fill).", "Call build_mockup { ..., dryRun: true } first. The plugin returns a resolved plan with per-item ok/error. If any errors → fix the spec, do not commit.", "Re-call build_mockup without dryRun to write to canvas. Capture rootNodeId for downstream tools (e.g. document the mockup, run audit_variable_coverage on it).", "If the user wants N cards from a dataset, leave one template instance inside the mockup (kind: 'instance'), then call apply_mockup_dataset { templateNodeId, rows[], dryRun: true } → preview → commit. removeTemplate: true deletes the placeholder after cloning."];
423
- readonly doneCriteria: "Agent produced one (or a sequence of) Phase D calls (find_components build_mockup [dryRun commit] optional apply_mockup_dataset) that the plugin executed without use_figma. The user approved each diff before commit. The mockup uses real components by id/key (not duplicated geometry) and binds Figma Variables instead of raw hex when a variable is available.";
668
+ readonly context: "Phase D: thick orchestration over `figma.createInstance / setProperties / setBoundVariableForPaint / loadFontAsync`. Pipeline: (1) `inspect_design_system` to aggregate components, variables, styles, token config, and compositions; (2) optional `find_components` to narrow ids / keys + componentPropertyDefinitions; (3) `validate_screen_spec` or `build_screen { dryRun: true }` to preview; (4) `build_screen` / `update_screen` to assemble an auto-layout container from a declarative item tree (`instance | section | spacer | text`) with property / text / fill-binding overrides; (5) `apply_mockup_dataset` when the same template needs to be cloned per-row from a structured list.";
669
+ readonly preferredTools: readonly ["inspect_design_system", "validate_screen_spec", "build_screen", "update_screen", "find_components", "build_mockup", "apply_mockup_dataset", "get_variables"];
670
+ readonly schemaResources: readonly ["sxl://agent/schemas/design-dsl-v1"];
671
+ readonly forbidden: readonly ["Calling use_figma to write a hand-rolled `figma.createInstance(...) / setProperties(...)` loop when build_screen/build_mockup covers the assembly.", "Guessing component names instead of running inspect_design_system or find_components first the user's file may have arbitrary local names.", "Skipping dryRun for build_screen / update_screen / build_mockup / apply_mockup_dataset always preview the resolved plan before writing to canvas.", "Hand-coding fill colours when a Figma Variable is available use fillBindings { variableId } so the mockup picks up theme switches automatically.", "Loading fonts manually build_mockup loads fonts on demand with a safe Inter Regular fallback.", "Assuming property names like `size#123:0` pass the human key (`size`); the plugin maps to the internal `name#defId` suffix via `componentProperties`."];
672
+ readonly steps: readonly ["Run inspect_design_system { query | prefix?, includeProperties: true, includeRemoteInstances?: true } to aggregate components, variables, local styles, token config, and composition index.", "Run find_components { query | prefix?, includeProperties: true, kind?: 'COMPONENT' | 'COMPONENT_SET', limit?: 50 } when the aggregate response needs narrowing. Cache the (id, name, propertyDefinitions, defaultVariantId) list.", "If the user wants library components, set includeRemoteInstances: true so library components instantiated in this file are included; otherwise stay local-only.", "Decide the layout: VERTICAL stack of sections, HORIZONTAL row of cards, or WRAP grid. Pick itemSpacing / padding to match the user's intent (e.g. 16px gutters).", "Build the items[] tree. Use `instance` for components (one of componentId | componentKey | componentName), `section` for nested auto-layout frames, `spacer` for explicit gaps, `text` for bare TEXT layers (TEXT styles can be applied via textStyleId).", "For property / text / fill overrides on instances: pass `properties` (human keys), `textOverrides[]` (layerName + value), `fillBindings[]` (variableId; optional layerName when only one child should receive the fill).", "Call validate_screen_spec or build_screen { ..., dryRun: true } first. The plugin returns a resolved plan with per-item ok/error. If any errors → fix the spec, do not commit.", "Re-call build_screen without dryRun to write a new canvas root, or update_screen { targetRootId, ... } to modify an existing frame without recreating the whole screen. Capture rootNodeId for downstream tools (e.g. document the mockup, run audit_variable_coverage on it).", "If the user wants N cards from a dataset, leave one template instance inside the mockup (kind: 'instance'), then call apply_mockup_dataset { templateNodeId, rows[], dryRun: true } → preview → commit. removeTemplate: true deletes the placeholder after cloning."];
673
+ readonly doneCriteria: "Agent produced one (or a sequence of) Phase D calls (inspect_design_system → validate/build_screen [dryRun → commit] → optional apply_mockup_dataset) that the plugin executed without use_figma. The user approved each diff before commit. The mockup uses real components by id/key (not duplicated geometry) and binds Figma Variables instead of raw hex when a variable is available.";
424
674
  };
425
675
  export declare const RECIPE_BULK_COMPOSITIONS: {
426
676
  readonly id: "bulk-compositions";
@@ -470,3 +720,523 @@ export declare const RECIPE_COMPOSITION_DRIFT: {
470
720
  readonly steps: readonly ["Run audit_composition_drift with appropriate filters: `prefix: 'W'` for the whole DS, `names: [...]` for a curated list, no filters for the full workspace.", "Group findings by status (linked / unlinked / drift / missing) and surface counts to the user.", "For each `drift` / `missing` finding, surface: composition name, fileId, status, reason, expected vs actual variant count, tracked componentSetId.", "If user wants to fix drift: call bulk_generate_compositions { fileIds: [drift+missing fileIds], operation: 'generate', dryRun: true } first → preview → commit.", "For `unlinked` findings: ask whether to generate them as new components (bulk_generate_compositions { operation: 'auto' }) or leave them."];
471
721
  readonly doneCriteria: "Agent returned a deterministic drift report with per-composition status. No canvas writes happened during the audit. If the user approved a fix, a follow-up bulk_generate_compositions was issued with explicit dryRun preview.";
472
722
  };
723
+ export declare const ALL_AGENT_RECIPES: readonly [{
724
+ readonly id: "sxl-use";
725
+ readonly title: "SXL Use — read/write the current Figma Design file through Bridge";
726
+ readonly version: 1;
727
+ readonly context: "Foundational SXL skill for canvas reads/writes, variables, styles, components, token workspace operations, status checks, and design-to-code context. Mirrors the role of figma-use for SXL Studio and supplies the active-file context needed by figma-implement-design-style workflows: prefer Bridge tools and plugin handlers over arbitrary use_figma scripts.";
728
+ readonly userPhrases: readonly ["управляй фигмой через bridge", "create or modify nodes in figma", "read selection and edit canvas", "назначь переменные объектам", "work with variables styles and components", "figma-implement-design", "implement this figma design in code", "turn figma selection into code", "diagnose figma rest token", "whoami figma token", "search known figma library", "get_libraries", "search_design_system", "search organization design library", "get variable definitions used in selection", "покажи переменные и стили выделения"];
729
+ readonly decideBetween: readonly [{
730
+ readonly between: readonly ["sxl-use", "sxl-generate-design"];
731
+ readonly hint: "sxl-use handles low-level targeted reads/writes; sxl-generate-design assembles or updates full screens via Design DSL.";
732
+ }, {
733
+ readonly between: readonly ["sxl-use", "sxl-audit"];
734
+ readonly hint: "sxl-use writes after the target is known; sxl-audit discovers usage, coverage, drift, unused entries, or component prop statistics first.";
735
+ }];
736
+ readonly preferredTools: readonly ["get_bridge_runtime_summary", "get_plugin_status", "get_capability_matrix", "get_figma_mcp_skills_parity", "list_tools", "get_selection", "get_design_context", "get_metadata", "get_node_info", "get_node_tree", "get_screenshot", "get_variable_defs", "get_context_for_code_connect", "get_code_connect_suggestions", "get_libraries", "search_design_system", "get_variables", "get_local_styles", "search_enabled_library_assets", "inspect_enabled_libraries", "list_enabled_library_variables", "figma_rest_diagnose", "figma_rest_whoami", "figma_rest_get_file_nodes", "figma_rest_search_design_system", "upload_assets", "set_node_fill_variable", "batch_bind_variables"];
737
+ readonly schemaResources: readonly ["sxl://agent/schemas/code-connect-context-v1"];
738
+ readonly forbidden: readonly ["Calling use_figma with a hand-written figma.* script when a Bridge tool exists.", "Writing canvas changes before checking get_plugin_status.writesAllowed.", "Fetching image URLs in an ad-hoc script or sending raw imageBytes arrays when upload_assets can validate and apply assets.", "Looping single-node writes for bulk variable binding when batch_bind_variables covers the request."];
739
+ readonly steps: readonly ["Call get_bridge_runtime_summary before heavy workflows to check plugin connection, queue pressure, recent failures, and auth status.", "Call get_plugin_status and inspect editorType / writesAllowed before any write.", "Call get_capability_matrix or list_tools if tool choice is uncertain; prefer tools with dryRunSupported for writes.", "For Figma MCP-style library discovery, prefer get_libraries and search_design_system; they combine active-file enabled libraries, local components, and known REST file/team libraries where configured.", "When the plugin is not open, cross-file context is needed, or the request targets a known file/team library outside the active file, call figma_rest_diagnose first; get_libraries/search_design_system can then use fileKey/url/teamId with a configured FIGMA_TOKEN / FIGMA_ACCESS_TOKEN.", "For image insertion in Figma Design, call upload_assets with dryRun=true first; it validates PNG/JPG/GIF/WebP assets up to 10MB and applies them through set_image_fill.", "Read the narrowest needed context: current selection, node tree, variables, or styles.", "For design implementation requests, call get_design_context plus get_variable_defs/get_screenshot/get_context_for_code_connect when components or code mappings matter; the agent then edits project code outside the plugin.", "For writes, use the thickest Bridge command that covers the task; fall back to direct canvas tools only for small targeted edits.", "After writes, inspect the changed node or rerun the relevant audit/read tool."];
740
+ readonly doneCriteria: "Agent completed the requested Figma operation through Bridge tools, respected Design/Dev mode constraints, and did not use arbitrary use_figma scripts.";
741
+ }, {
742
+ readonly id: "sxl-implement-design";
743
+ readonly title: "SXL Implement Design — read Figma context for code implementation";
744
+ readonly version: 1;
745
+ readonly context: "Read-only Bridge workflow for Figma-to-code requests, including current official figma-swiftui and legacy/client figma-implement-design-style aliases. It gathers active-file design context, screenshots, variable/style definitions, SXL codegen/composition data, and Code Connect hints so the agent can edit the repository code outside Figma. It must not mutate the Figma canvas.";
746
+ readonly userPhrases: readonly ["figma-implement-design", "figma-swiftui", "implement this figma design in swiftui", "convert figma selection to swiftui", "implement this figma design in code", "turn figma selection into code", "convert figma selection to code", "реализуй выбранный макет в коде"];
747
+ readonly decideBetween: readonly [{
748
+ readonly between: readonly ["sxl-implement-design", "sxl-use"];
749
+ readonly hint: "sxl-implement-design is read-only context for code implementation; sxl-use is broad active-file read/write control.";
750
+ }, {
751
+ readonly between: readonly ["sxl-implement-design", "sxl-generate-design"];
752
+ readonly hint: "sxl-implement-design turns Figma into repository code; sxl-generate-design builds Figma screens from a spec/code context.";
753
+ }];
754
+ readonly preferredTools: readonly ["get_bridge_runtime_summary", "get_figma_mcp_skills_parity", "get_design_context", "get_metadata", "get_screenshot", "get_variable_defs", "get_context_for_code_connect", "get_code_connect_suggestions", "get_codegen", "export_composition_json"];
755
+ readonly schemaResources: readonly ["sxl://agent/schemas/code-connect-context-v1"];
756
+ readonly forbidden: readonly ["Mutating the Figma canvas for an implement-design request.", "Calling upload_assets, set_node_fill_variable, batch_bind_variables, build_screen, or export_variables.", "Treating SXL codegen as final project code without adapting it to repository components and conventions."];
757
+ readonly steps: readonly ["Call get_bridge_runtime_summary to confirm Bridge/plugin state and queue pressure.", "Call get_design_context for the selected frame/component; include screenshot/context options when useful.", "Call get_variable_defs and get_screenshot when visual/token fidelity matters.", "Call get_context_for_code_connect and get_code_connect_suggestions when component mappings or Storybook context matter.", "Use get_codegen/export_composition_json only as reference material; then edit repository code with normal project tooling."];
758
+ readonly doneCriteria: "Agent collected read-only Figma/SXL context and implemented or updated repository code without mutating the Figma file.";
759
+ }, {
760
+ readonly id: "sxl-generate-design";
761
+ readonly title: "SXL Generate Design — build or update real UI screens in Figma";
762
+ readonly version: 1;
763
+ readonly context: "Screen-building skill for real editable Figma Design files. Use inspect_design_system + validate_screen_spec + build_screen/update_screen first; direct canvas tools are fallback only.";
764
+ readonly userPhrases: readonly ["нарисуй экран в фигме", "build a real UI screen in Figma", "собери макет из дизайн-системы", "update this screen without rebuilding everything", "validate screen spec before applying"];
765
+ readonly decideBetween: readonly [{
766
+ readonly between: readonly ["sxl-generate-design", "mockup-builder"];
767
+ readonly hint: "sxl-generate-design is the top-level screen skill; mockup-builder is the detailed recipe for the underlying build_mockup/build_screen DSL.";
768
+ }, {
769
+ readonly between: readonly ["sxl-generate-design", "sxl-doc-builder"];
770
+ readonly hint: "generate-design builds product UI screens; doc-builder builds documentation pages, palettes, component docs, and flows.";
771
+ }];
772
+ readonly preferredTools: readonly ["inspect_design_system", "validate_screen_spec", "build_screen", "update_screen", "find_components", "search_enabled_library_assets", "inspect_enabled_libraries", "get_variables", "audit_variable_coverage"];
773
+ readonly schemaResources: readonly ["sxl://agent/schemas/design-dsl-v1"];
774
+ readonly forbidden: readonly ["Creating a screen by hand with many create_frame/create_text/create_component_instance calls when build_screen covers it.", "Guessing component names or component prop keys without inspect_design_system / find_components.", "Committing build_screen/update_screen without a dryRun or validate_screen_spec preview.", "Hardcoding hex colors when a local Figma Variable is available."];
775
+ readonly steps: readonly ["Run inspect_design_system with includeProperties and a narrow query/prefix when possible; use search_enabled_library_assets when the user expects components/styles/variables from libraries enabled in the current file.", "Draft a Design DSL v1 spec using real component ids/keys, human prop keys, text overrides, and variable fill bindings.", "Call validate_screen_spec or build_screen/update_screen with dryRun: true and fix any unresolved components/props.", "Commit build_screen or update_screen only after the dry-run plan is clean or approved.", "Run audit_variable_coverage on the resulting root/page when variable binding quality matters."];
776
+ readonly doneCriteria: "A real Figma screen was created or updated with existing components, auto layout, and variable/style bindings where available. The flow used dryRun before write.";
777
+ }, {
778
+ readonly id: "sxl-generate-library";
779
+ readonly title: "SXL Generate Library — variables, styles, compositions, and docs";
780
+ readonly version: 1;
781
+ readonly context: "Design-system skill for SXL Studio. Covers safe export_variables modes, bulk variable/style specs, composition generation, drift checks, library documentation, and the SXL context needed by figma-create-design-system-rules-style agent workflows.";
782
+ readonly userPhrases: readonly ["создай дизайн-систему в фигме", "generate library variables styles components docs", "экспортируй переменные и стили", "пересобери компоненты из композиций", "build design system foundations", "figma-create-design-system-rules", "create design system rules for this project", "generate rules for translating figma designs into code"];
783
+ readonly decideBetween: readonly [{
784
+ readonly between: readonly ["sxl-generate-library", "bulk-variables"];
785
+ readonly hint: "use bulk-variables for variable-only refactors; use sxl-generate-library when variables, styles, compositions, and docs are part of one system workflow.";
786
+ }, {
787
+ readonly between: readonly ["sxl-generate-library", "bulk-compositions"];
788
+ readonly hint: "bulk-compositions rebuilds existing composition files; sxl-generate-library orchestrates the broader library pipeline.";
789
+ }];
790
+ readonly preferredTools: readonly ["get_tokens_config", "get_figma_mcp_skills_parity", "search_enabled_library_assets", "inspect_enabled_libraries", "list_enabled_library_variables", "inspect_design_system", "get_context_for_code_connect", "get_code_connect_suggestions", "preview_export_variables", "export_variables", "import_variable_spec", "import_style_spec", "list_compositions", "bulk_generate_compositions", "audit_composition_drift", "build_component_doc"];
791
+ readonly forbidden: readonly ["Using destructive export options such as deleteOrphans, forceUpdateAll, or allowDestructiveReorder unless the user explicitly asked for them.", "Claiming export_variables applies codeSyntax/scopes by default; plugin safe default is applyCodeSyntaxAndScopes=false.", "Hand-crafting composition JSON instead of export_composition_json / compose_from_url / list_compositions.", "Bulk-generating compositions without dryRun first."];
792
+ readonly steps: readonly ["Read get_tokens_config and list_token_files/list_compositions to understand the workspace; use inspect_enabled_libraries/list_enabled_library_variables when reconciling enabled library definitions.", "For design-system-rules requests, call inspect_design_system and get_context_for_code_connect/get_code_connect_suggestions when code mappings matter; the agent writes the client-specific rule file in the repository, not through a plugin command.", "For token export, call preview_export_variables first; then call export_variables with only explicit settings and keep safe defaults unless requested.", "For large variable/style changes, use import_variable_spec/import_style_spec with dryRun first.", "Run audit_composition_drift before rebuilding existing components; use bulk_generate_compositions dryRun before commit.", "Build documentation with sxl-doc-builder recipes after foundations are generated."];
793
+ readonly doneCriteria: "Library foundations were exported/generated with non-destructive defaults, drift was inspected before rebuilds, and all bulk writes were previewed first.";
794
+ }, {
795
+ readonly id: "sxl-code-connect";
796
+ readonly title: "SXL Code Connect — bind Figma components to code, Storybook, and docs";
797
+ readonly version: 1;
798
+ readonly context: "Code Connect skill for SXL Studio. Manages full CodeConnectBinding payloads: docs URL, files, Storybook, component API, status, registry, and global settings.";
799
+ readonly userPhrases: readonly ["настрой code connect", "save code connect binding", "свяжи figma компонент с storybook", "show code connect registry", "component docs url files storybook binding"];
800
+ readonly decideBetween: readonly [{
801
+ readonly between: readonly ["sxl-code-connect", "doc-component"];
802
+ readonly hint: "code-connect links Figma nodes to code/docs metadata; doc-component renders documentation on the Figma canvas.";
803
+ }];
804
+ readonly preferredTools: readonly ["codeconnect_get_global_settings", "codeconnect_save_global_settings", "codeconnect_get_registry", "codeconnect_get_selection_status", "get_context_for_code_connect", "get_code_connect_suggestions", "generate_code_connect_template", "codeconnect_get_binding", "codeconnect_save_binding", "codeconnect_get_node_ui_status"];
805
+ readonly schemaResources: readonly ["sxl://agent/schemas/code-connect-context-v1", "sxl://agent/schemas/code-connect-template-v1"];
806
+ readonly forbidden: readonly ["Saving partial binding metadata that drops docsUrl/files/storybook/component API fields.", "Guessing node ids when selection status can identify the current component.", "Hand-writing filePath/importPath bindings before checking get_context_for_code_connect or get_code_connect_suggestions.", "Writing .figma.ts files without generate_code_connect_template dry-run preview.", "Treating Code Connect as composition JSON; keep bindings as metadata, not generated component structure."];
807
+ readonly steps: readonly ["Read codeconnect_get_global_settings and codeconnect_get_registry to understand existing defaults.", "Use codeconnect_get_selection_status or get_node_info to confirm target node ids.", "Call get_context_for_code_connect with explicit targets/componentNames or current selection; review existing binding, component props, codegen/composition context, and highest-confidence local code candidates.", "For template-file workflows, call generate_code_connect_template without writeFile first; only writeFile=true after reviewing output path/content.", "Save the chosen binding with full metadata: componentName, docs URL, files[], Storybook data, component API, and status where available.", "Verify with codeconnect_get_binding and codeconnect_get_node_ui_status."];
808
+ readonly doneCriteria: "Target Figma component has a full Code Connect binding and the registry/UI status reflect it.";
809
+ }, {
810
+ readonly id: "sxl-audit";
811
+ readonly title: "SXL Audit — variables, styles, components, props, drift, and unused entries";
812
+ readonly version: 1;
813
+ readonly context: "Audit skill for read-only analysis and dry-run-first remediation. Covers variable/style coverage, usage, unused entries, component usage, component prop usage, and composition/style drift.";
814
+ readonly userPhrases: readonly ["проведи аудит макетов", "analyze variables styles and component usage", "проверь пропсы компонентов", "найди компоненты с prop value", "audit coverage drift unused analytics"];
815
+ readonly decideBetween: readonly [{
816
+ readonly between: readonly ["sxl-audit", "audit-coverage"];
817
+ readonly hint: "audit-coverage is the specialized recipe for missing variable/style bindings; sxl-audit is the broad audit router.";
818
+ }, {
819
+ readonly between: readonly ["sxl-audit", "composition-drift"];
820
+ readonly hint: "composition-drift is composition JSON vs Figma component; sxl-audit can route there when that is the user's unit.";
821
+ }];
822
+ readonly preferredTools: readonly ["audit_variable_coverage", "find_variable_coverage_misses", "audit_style_coverage", "find_style_coverage_misses", "analyze_component_usage", "find_component_usages", "analyze_component_prop_usage", "find_component_prop_usages", "find_unused_variables", "find_unused_styles", "audit_composition_drift"];
823
+ readonly forbidden: readonly ["Walking the entire document manually with use_figma for analytics already covered by Bridge audit tools.", "Requesting full detail lists before running summary tools.", "Applying audit suggestions without preview mode first and explicit user confirmation."];
824
+ readonly steps: readonly ["Choose the narrowest scope: selection, page, node, then file only when needed.", "Run summary tools first; use find_* paginated tools only for requested details.", "For component prop analytics, use analyze_component_prop_usage for counts and find_component_prop_usages for node ids.", "If the user asks to fix findings, switch to apply_coverage_suggestions / apply_style_coverage_suggestions / batch_bind_variables and preview before committing."];
825
+ readonly doneCriteria: "Agent returned a scoped audit report with counts and actionable findings; any remediation used preview mode before write.";
826
+ }, {
827
+ readonly id: "sxl-doc-builder";
828
+ readonly title: "SXL Doc Builder — render documentation in Figma";
829
+ readonly version: 1;
830
+ readonly context: "Documentation skill for Figma canvas output: token tables, variable palettes, component docs, doc flows, and markdown scenarios. Uses Bridge doc tools, never ad-hoc scripts.";
831
+ readonly userPhrases: readonly ["нарисуй документацию в фигме", "build documentation in Figma", "документация компонентов токенов флоу", "render markdown scenario as Figma flow", "apply doc spec"];
832
+ readonly decideBetween: readonly [{
833
+ readonly between: readonly ["sxl-doc-builder", "doc-component"];
834
+ readonly hint: "doc-component is the specialized single-component recipe; sxl-doc-builder routes all documentation types.";
835
+ }, {
836
+ readonly between: readonly ["sxl-doc-builder", "scenario-from-markdown"];
837
+ readonly hint: "scenario-from-markdown wins when the user provides markdown H1/H2 scenario text with Figma URLs.";
838
+ }];
839
+ readonly preferredTools: readonly ["apply_doc_spec", "build_component_doc", "build_doc_flow", "bind_variable_palette", "build_scenario_from_md", "build_token_documentation"];
840
+ readonly schemaResources: readonly ["sxl://agent/schemas/doc-spec-v2", "sxl://agent/schemas/token-doc-v1"];
841
+ readonly forbidden: readonly ["Creating throwaway JS scripts or /tmp payload loaders for documentation.", "Using use_figma to clone templates or enumerate variables when bind_variable_palette/apply_doc_spec exists.", "Hand-crafting composition JSON for docs; use export_composition_json or compose_from_url.", "Skipping dryRun on build_scenario_from_md or doc flows that support preview."];
842
+ readonly steps: readonly ["Route the request: token table, variable palette, component doc, flow, markdown scenario, or custom Doc Spec v2.", "Read the specialized recipe resource for that route before building payloads.", "Discover targetParentId/templateNodeId/layer names via template-discovery when templates are involved.", "Call the chosen doc tool with dryRun when supported, then commit.", "Inspect the created documentation root or report returned nodes."];
843
+ readonly doneCriteria: "Documentation was rendered in Figma through Bridge doc tools with real token/variable/component data and without ad-hoc scripts.";
844
+ }, {
845
+ readonly id: "sxl-data-apply-mapping";
846
+ readonly title: "SXL Data — apply one mapping to explicit targets or current selection";
847
+ readonly version: 1;
848
+ readonly context: "Agent workflow for applying one SXL database mapping to explicit targetNodeIds or the current Figma selection. Agents must preview mapping fields, datasets, and target counts before writing.";
849
+ readonly userPhrases: readonly ["примени маппинг", "apply mapping to selection", "apply data mapping", "подставь данные по маппингу", "fill selected nodes from dataset"];
850
+ readonly decideBetween: readonly [{
851
+ readonly between: readonly ["sxl-data-apply-mapping", "sxl-data-apply-all"];
852
+ readonly hint: "Use apply-mapping when the user names one mapping or selected target. Use apply-all only when the user says all mappings or whole scope.";
853
+ }, {
854
+ readonly between: readonly ["sxl-data-apply-mapping", "sxl-data-generate-instances"];
855
+ readonly hint: "Use apply-mapping to fill existing selected layers. Use generate-instances when the task needs new rows/cards/instances.";
856
+ }];
857
+ readonly preferredTools: readonly ["get_plugin_status", "list_mappings", "get_mapping", "count_apply_targets", "apply_mapping"];
858
+ readonly forbidden: readonly ["Calling apply_mapping without dryRun preview and explicit approval.", "Passing legacy targetNodes when targetNodeIds are available; use explicit node ids for deterministic agent control.", "Applying to page/document scope with apply_mapping; use apply_all_mappings for broad scope."];
859
+ readonly steps: readonly ["Check plugin status and writesAllowed.", "List mappings and read the selected mapping before applying.", "Run count_apply_targets for selection and apply_mapping with dryRun:true.", "Present mapping fields, dataset row hints, and target count.", "Commit apply_mapping only after approval, preferably with targetNodeIds when the intended roots are known."];
860
+ readonly doneCriteria: "One selected SXL mapping was previewed, approved, and applied to the intended explicit targetNodeIds or current Figma selection.";
861
+ }, {
862
+ readonly id: "sxl-data-apply-all";
863
+ readonly title: "SXL Data — apply all mappings in a scope";
864
+ readonly version: 1;
865
+ readonly context: "Agent workflow for applying all SXL mappings to explicit targetNodeIds or a selection/page/document scope. This is a bulk write and must be dry-run previewed before commit.";
866
+ readonly userPhrases: readonly ["примени все маппинги", "apply all mappings", "apply all data mappings", "подставь данные по всем маппингам", "apply mappings on page", "apply mappings to document"];
867
+ readonly decideBetween: readonly [{
868
+ readonly between: readonly ["sxl-data-apply-all", "sxl-data-apply-mapping"];
869
+ readonly hint: "Use apply-all only when the user explicitly asks for all mappings or a broad scope.";
870
+ }];
871
+ readonly preferredTools: readonly ["get_plugin_status", "list_mappings", "count_apply_targets", "apply_all_mappings"];
872
+ readonly forbidden: readonly ["Running apply_all_mappings without dryRun preview and explicit approval.", "Defaulting to document scope when the user did not ask for it; prefer selection/page unless specified.", "Deleting or changing mappings as part of apply; this workflow only fills data into existing nodes."];
873
+ readonly steps: readonly ["Check plugin status and writesAllowed.", "List mappings and choose explicit targetNodeIds when known, otherwise scope: selection, page, or document.", "Run count_apply_targets and apply_all_mappings with dryRun:true.", "Show mapping count, target count, and scope.", "Commit apply_all_mappings only after approval."];
874
+ readonly doneCriteria: "All requested mappings were previewed and applied only to the approved explicit target roots or Figma scope.";
875
+ }, {
876
+ readonly id: "sxl-data-generate-instances";
877
+ readonly title: "SXL Data — generate instances from mapping rows";
878
+ readonly version: 1;
879
+ readonly context: "Agent workflow for generating repeated component instances/cards/rows from an SXL mapping and dataset. The selected Figma node is the template/container source.";
880
+ readonly userPhrases: readonly ["сгенерируй инстансы из датасета", "generate instances from dataset", "generate instances from mapping", "создай строки из датасета", "render rows from mapping data", "generate cards from dataset mapping"];
881
+ readonly decideBetween: readonly [{
882
+ readonly between: readonly ["sxl-data-generate-instances", "mockup-builder"];
883
+ readonly hint: "Use generate-instances when a mapping already exists and the selected Figma template should be duplicated. Use mockup-builder for declarative Design DSL screens.";
884
+ }, {
885
+ readonly between: readonly ["sxl-data-generate-instances", "sxl-data-apply-mapping"];
886
+ readonly hint: "Use generate-instances to create new repeated nodes; use apply-mapping to fill existing selected nodes.";
887
+ }];
888
+ readonly preferredTools: readonly ["get_plugin_status", "list_mappings", "get_mapping", "generate_instances"];
889
+ readonly forbidden: readonly ["Calling generate_instances without dryRun preview and explicit approval.", "Generating rows without targetNodeIds when the intended template/container root is already known.", "Hand-duplicating components through low-level canvas tools when the existing SXL generation engine should be used."];
890
+ readonly steps: readonly ["Check plugin status and writesAllowed.", "List mappings and read the mapping/dataset relationship.", "Use explicit targetNodeIds for the template/container root when known; otherwise confirm the active Figma selection.", "Run generate_instances with dryRun:true to estimate rows and validate mapping fields.", "Show requested row count, estimated generated rows, and dataset row counts.", "Commit generate_instances only after approval, preferably with targetNodeIds for deterministic remote control."];
891
+ readonly doneCriteria: "Instances were generated through SXL's mapping engine after dry-run preview, with the approved row count and intended explicit targetNodeIds or confirmed active selection.";
892
+ }, {
893
+ readonly id: "sxl-database-transfer";
894
+ readonly title: "SXL Database — portable datasets/assets/mappings payloads";
895
+ readonly version: 1;
896
+ readonly context: "Agent workflow for backing up, restoring, or moving SXL Studio database datasets, local assets, and mappings between files/workspaces using portable Bridge payloads.";
897
+ readonly userPhrases: readonly ["экспортируй базу sxl", "импортируй базу sxl", "backup sxl database", "restore sxl database", "export database payload", "import database payload", "перенеси datasets assets mappings"];
898
+ readonly decideBetween: readonly [{
899
+ readonly between: readonly ["sxl-database-transfer", "sxl-data-apply-mapping"];
900
+ readonly hint: "Use database-transfer for moving/storing datasets/assets/mappings. Use data-apply when the goal is to fill nodes on canvas.";
901
+ }];
902
+ readonly preferredTools: readonly ["get_plugin_status", "list_datasets", "list_assets", "list_mappings", "export_database_payload", "import_database_payload"];
903
+ readonly forbidden: readonly ["Importing payloads without dryRun preview.", "Overwriting existing ids without confirmDestructive:true and a human-readable destructiveReason.", "Including asset content in export unless the user needs a full backup/restore payload."];
904
+ readonly steps: readonly ["Check plugin status and inspect existing datasets/assets/mappings.", "For backup/transfer, call export_database_payload; include asset content only when needed.", "For restore/import, call import_database_payload with dryRun:true first.", "Review counts, conflicts, and warnings.", "Commit import only after approval; existing id conflicts require destructive confirmation and reason."];
905
+ readonly doneCriteria: "SXL database payload was exported or imported through Bridge with dry-run conflict review and no accidental overwrites.";
906
+ }, {
907
+ readonly id: "figma-mcp-companion";
908
+ readonly title: "Official Figma MCP Companion — remote-only and non-Design scopes";
909
+ readonly version: 1;
910
+ readonly context: "Routing recipe for official Figma MCP features that Bridge should not fake through the local SXL plugin: new-file creation, FigJam/Slides, diagram generation, and hosted remote-only workflows. Bridge can explain parity and prepare local SXL context, but the agent must call official Figma MCP tools for these capabilities.";
911
+ readonly userPhrases: readonly ["figma-create-new-file", "create_new_file", "create a new figma file", "figma-generate-diagram", "generate_diagram", "create a figjam diagram", "figma-use-figjam", "figma-use-slides"];
912
+ readonly decideBetween: readonly [{
913
+ readonly between: readonly ["figma-mcp-companion", "sxl-use"];
914
+ readonly hint: "Use sxl-use for the active Figma Design file, SXL plugin workflows, Figma Design asset upload, and get_libraries/search_design_system. Use companion when the request names remote-only official Figma MCP features, FigJam, Slides, or new-file creation.";
915
+ }, {
916
+ readonly between: readonly ["figma-mcp-companion", "sxl-generate-design"];
917
+ readonly hint: "Use sxl-generate-design when building into an existing Figma Design file through SXL Bridge. Use companion when the first step is creating a new Figma file or using official generate_figma_design in a supported hosted MCP client.";
918
+ }];
919
+ readonly preferredTools: readonly ["get_figma_mcp_parity", "get_bridge_runtime_summary", "figma_rest_diagnose"];
920
+ readonly forbidden: readonly ["Pretending Bridge can create new Figma files, FigJam boards, Slides decks, or Mermaid diagrams through the local plugin.", "Routing Figma Design get_libraries/search_design_system to companion without first checking Bridge get_libraries/search_design_system coverage.", "Replacing official Figma MCP FigJam/Slides workflows with Figma Design canvas commands."];
921
+ readonly steps: readonly ["Call get_figma_mcp_parity to identify the exact official Figma MCP companion tool and explain why Bridge is not primary for this request.", "If the request also needs SXL Studio state, call get_bridge_runtime_summary and relevant SXL reads after the official MCP step has produced/selected a Figma Design file.", "Use official Figma MCP tools for create_new_file, generate_diagram, FigJam, Slides, and remote-only generate_figma_design workflows."];
922
+ readonly doneCriteria: "Agent routed the user to official Figma MCP for remote-only/non-Design work and did not claim the local SXL plugin can perform unsupported operations.";
923
+ }, {
924
+ readonly id: "doc-tokens";
925
+ readonly title: "Token documentation (Doc Spec v1 / v2 tokenTable)";
926
+ readonly version: 2;
927
+ readonly userPhrases: readonly ["задокументируй токены", "fill doc template with token values", "table of DTCG paths and resolved values"];
928
+ readonly decideBetween: readonly [{
929
+ readonly between: readonly ["doc-tokens", "variable-palette"];
930
+ readonly hint: "If the data source is local Figma variables (no DTCG file), switch to variable-palette.";
931
+ }];
932
+ readonly preferredTools: readonly ["list_token_files", "get_token_file_content", "build_token_documentation", "apply_token_doc_spec", "apply_doc_spec", "duplicate_subtree"];
933
+ readonly forbidden: readonly ["Hand-written DTCG / composition JSON as the source of truth — use plugin workspace files.", "Raw figma.* JS / use_figma scripts to traverse tokens — Bridge has list_token_files + get_token_file_content.", "Copy-pasting token values into the spec instead of letting the plugin resolve them."];
934
+ readonly steps: readonly ["Read sxl://tokens/config and sxl://tokens/files (or list_token_files) to locate token files.", "In Figma Design mode duplicate the doc template (or use an existing one) to obtain targetRootId.", "Build Doc Spec v1 (groups[].rows with layerName + tokenPath) — or v2 with a single tokenTable section if you also need title / description.", "Call build_token_documentation / apply_token_doc_spec (v1) or apply_doc_spec (v2) with { spec, targetRootId }.", "On unresolved paths re-check tokenPath spelling and confirm files are present in the workspace."];
935
+ readonly doneCriteria: "TEXT layers under targetRootId show resolved values; the response reports updated > 0 and no unresolved paths (unless dryRun).";
936
+ }, {
937
+ readonly id: "doc-component";
938
+ readonly title: "Component documentation (title + variants + props + optional measure)";
939
+ readonly version: 2;
940
+ readonly userPhrases: readonly ["задокументируй компонент", "document this component", "WButton documentation frame", "build component doc"];
941
+ readonly decideBetween: readonly [{
942
+ readonly between: readonly ["doc-component", "doc-spec-v2"];
943
+ readonly hint: "If you need anything beyond title/description/variants/props/measure (e.g. palette, tokenTable), pick doc-spec-v2 + apply_doc_spec.";
944
+ }];
945
+ readonly preferredTools: readonly ["build_component_doc", "apply_doc_spec", "export_composition_json", "get_codegen", "duplicate_subtree"];
946
+ readonly forbidden: readonly ["Synthesising composition JSON from get_node_tree — use export_composition_json / get_codegen.", "Calling use_figma to read componentPropertyDefinitions — the plugin already exposes it via build_component_doc.", "Mutating the component itself when documenting it — work on the doc frame, not the source."];
947
+ readonly steps: readonly ["Identify the component (componentNodeId). For a component set, pass the set id.", "Provide either targetRootId (existing doc frame) or targetParentId (createIfMissing=true).", "Call build_component_doc; toggle includeMeasure only if the user asked for size annotations.", "Refine specific sections (e.g. update description markdown) by re-running with new payload."];
948
+ readonly doneCriteria: "The doc frame contains a title, a variants matrix (when applicable), and a props table with all componentPropertyDefinitions.";
949
+ readonly phases: "Measuring/annotations: see Plugin/sxl/docs/23-doc-agent-phased-roadmap.md (Phase 3).";
950
+ }, {
951
+ readonly id: "doc-composition";
952
+ readonly title: "Documentation from composition file";
953
+ readonly version: 2;
954
+ readonly userPhrases: readonly ["render this composition file as documentation", "доку по composition.json", "build a frame from a composition file"];
955
+ readonly preferredTools: readonly ["list_compositions", "export_composition_json", "generate_composition", "apply_composition", "compose_from_url"];
956
+ readonly forbidden: readonly ["Hand-assembling composition trees in JSON — the plugin pipeline is the single source of truth.", "Using use_figma to draw the composition manually."];
957
+ readonly steps: readonly ["Prefer compose_from_url for a Figma URL → export_composition_json → create_token_file → generate_composition.", "Apply with apply_composition / generate_composition; do not hand-construct nodes."];
958
+ readonly doneCriteria: "Composition file in workspace + generated component / instance on the canvas matching the source.";
959
+ }, {
960
+ readonly id: "doc-flow";
961
+ readonly title: "Multi-page screen flow / scenario";
962
+ readonly version: 2;
963
+ readonly userPhrases: readonly ["сделай flow по этим ссылкам", "build a screen flow doc", "story of pages from these urls", "scenario doc with multiple frames"];
964
+ readonly preferredTools: readonly ["build_doc_flow", "compose_from_url", "duplicate_subtree", "apply_doc_spec"];
965
+ readonly forbidden: readonly ["Calling use_figma to clone many frames into one container — use build_doc_flow.", "Skipping captions when the user provided a description per page — pass them via pages[].title / description."];
966
+ readonly steps: readonly ["Resolve each Figma URL to a node id (parseFigmaUrl handles `&node-id=` segments).", "Call build_doc_flow with pages[] (each with nodeId or compositionFileId, plus optional title / description).", "When a page references an existing composition file, pass pages[].compositionFileId directly; Bridge/plugin will generate/apply it and render an instance or clone in the flow."];
967
+ readonly doneCriteria: "All requested pages appear inside a single auto-layout container with optional captions; no use_figma script was used.";
968
+ }, {
969
+ readonly id: "variable-palette";
970
+ readonly title: "Color (or variable) cards from a Figma variable collection";
971
+ readonly version: 2;
972
+ readonly userPhrases: readonly ["добавь все цвета коллекции projects карточками", "render figma variable collection as cards", "swatches from local variable collection", "по коллекции переменных нарисуй палитру"];
973
+ readonly decideBetween: readonly [{
974
+ readonly between: readonly ["variable-palette", "doc-tokens"];
975
+ readonly hint: "If user names a DTCG file or token path (`core.color.*`), switch to doc-tokens.";
976
+ }];
977
+ readonly context: "Example: fill a frame's content with one card per COLOR variable in the Projects collection, using an existing card component / instance as template.";
978
+ readonly preferredTools: readonly ["get_plugin_status", "get_variables", "get_node_tree", "find_nodes", "bind_variable_palette", "apply_doc_spec"];
979
+ readonly forbidden: readonly ["use_figma (official Figma MCP) with a custom JavaScript payload — SXL session cannot execute that in the plugin; bind_variable_palette covers the same flow.", "Shell payloads (/tmp/*.json, base64 loaders, copy-paste into tokens/system, node -e glue) to invoke MCP — pass JSON directly to bind_variable_palette.", "Pretending the task requires a 'Figma script' when get_variables + bind_variable_palette is enough."];
980
+ readonly steps: readonly ["get_plugin_status — confirm writesAllowed (Figma Design, not Dev Mode read-only).", "Use sxl://agent/recipes/template-discovery to locate templateNodeId + swatchLayerName under the user's content frame.", "Call bind_variable_palette with { templateNodeId, collectionName, variableType: 'COLOR', swatchLayerName, labelLayerName? }.", "Inspect the response: created should equal the variable count; bound should equal created (one fill bind per swatch)."];
981
+ readonly doneCriteria: "One card per target variable next to the template; each swatch is bound to its variable; no use_figma script was used.";
982
+ }, {
983
+ readonly id: "doc-spec-v2";
984
+ readonly title: "Doc Spec v2 — sections vocabulary";
985
+ readonly version: 1;
986
+ readonly context: "Doc Spec v2 lets you compose a single apply_doc_spec call from a list of sections. Each section is independent: combine only what the user asked for. Read this resource before assembling a custom spec.";
987
+ readonly preferredTools: readonly ["apply_doc_spec", "build_component_doc", "bind_variable_palette", "build_doc_flow"];
988
+ readonly schemaResources: readonly ["sxl://agent/schemas/doc-spec-v2"];
989
+ readonly sections: readonly [{
990
+ readonly type: "title";
991
+ readonly note: "Either creates a TEXT node or writes into an existing layerName.";
992
+ }, {
993
+ readonly type: "description";
994
+ readonly note: "Markdown subset → formatted runs. Use **bold**, *italic*, `code`, # headings.";
995
+ }, {
996
+ readonly type: "variants";
997
+ readonly note: "ComponentSet → matrix / grid / list of instances. Use groupBy for matrix rows.";
998
+ }, {
999
+ readonly type: "props";
1000
+ readonly note: "componentPropertyDefinitions → table TEXT block. include filters which kinds.";
1001
+ }, {
1002
+ readonly type: "tokenTable";
1003
+ readonly note: "v1 surface preserved: layerName + tokenPath. Picks values from DTCG workspace.";
1004
+ }, {
1005
+ readonly type: "palette";
1006
+ readonly note: "Local Figma Variables → cards by cloning templateNodeId.";
1007
+ }, {
1008
+ readonly type: "measure";
1009
+ readonly note: "Experimental: node.annotations = [...].";
1010
+ }];
1011
+ readonly forbidden: readonly ["Generating section types not in the schema (the validator rejects them).", "Using `palette.collectionName` for a DTCG file path — palette only inspects local Figma Variables.", "Putting v1 fields (`groups`, `version: \"1\"`) into a v2 spec — use apply_token_doc_spec for v1."];
1012
+ readonly steps: readonly ["Decide which sections are needed (intent router → user request).", "Resolve targetRootId (existing frame) or targetParentId (with createIfMissing).", "Call apply_doc_spec with the assembled spec; rely on per-section reports for partial failures."];
1013
+ readonly doneCriteria: "apply_doc_spec returns ok=true (or section-level report shows which section failed and why).";
1014
+ }, {
1015
+ readonly id: "template-discovery";
1016
+ readonly title: "Find the swatch / card template inside a content frame";
1017
+ readonly version: 1;
1018
+ readonly context: "Many doc tasks (variable-palette, doc-spec-v2.palette, doc-component.variants) need a templateNodeId — an existing scene node we can clone. This recipe shows how to locate it deterministically without scripts.";
1019
+ readonly userPhrases: readonly ["find template card in content", "locate swatch template", "templateNodeId под content фрейма"];
1020
+ readonly preferredTools: readonly ["get_node_tree", "find_nodes", "get_node_info", "read_node_properties"];
1021
+ readonly forbidden: readonly ["Cloning the entire content frame instead of one card.", "Guessing node ids — always verify via get_node_tree / find_nodes.", "Falling back to use_figma to traverse the file: get_node_tree returns enough info for SXL templates."];
1022
+ readonly steps: readonly ["From the user URL, parse node-id (`figma.com/design/.../?node-id=151-2` → `151:2`).", "Call get_node_tree with that nodeId and depth=4 to inspect the frame and its content.", "Pick the first child of the content layer (or one named 'card', 'swatch', 'token-card' — let the user confirm if ambiguous).", "Read swatch / label / value layer names with get_node_tree (depth=2 from the picked card) and pass them to bind_variable_palette / palette section."];
1023
+ readonly doneCriteria: "templateNodeId + swatchLayerName (and optionally labelLayerName / valueLayerName) confirmed against the file before any clone.";
1024
+ }, {
1025
+ readonly id: "compose-with-variables";
1026
+ readonly title: "Export composition and generate component with Figma variable bindings";
1027
+ readonly version: 1;
1028
+ readonly userPhrases: readonly ["получи JSON компонента и сгенерируй его назначив переменные", "export composition and generate component with variables assigned", "сохрани компонент в репо и создай с привязкой переменных фигмы", "generate component from figma url with variable bindings", "создай компонент сет и привяжи переменные экспортированные из фигмы", "get code JSON and generate component assigning all variables"];
1029
+ readonly decideBetween: readonly [{
1030
+ readonly between: readonly ["compose-with-variables", "doc-composition"];
1031
+ readonly hint: "If the goal is documentation (render a frame, not generate a reusable component), use doc-composition.";
1032
+ }];
1033
+ readonly context: "Variable references inside a composition JSON are automatically applied during generate_composition — the plugin binds Figma local variables to nodes without extra steps. Use batch_bind_variables only for bindings NOT captured in the composition JSON.";
1034
+ readonly preferredTools: readonly ["compose_from_url", "export_composition_json", "create_token_file", "generate_composition", "get_variables", "batch_bind_variables"];
1035
+ readonly forbidden: readonly ["Hand-crafting composition JSON from get_node_tree — always use export_composition_json / get_codegen.", "Calling bind_variable N times in a loop — use batch_bind_variables for bulk wiring.", "Skipping get_plugin_status before canvas writes — confirm writesAllowed first."];
1036
+ readonly steps: readonly ["Call compose_from_url { url, generate: true } — exports composition JSON, saves token file, generates Figma component. Variable references inside the JSON are auto-bound.", "If additional bindings are needed (not in composition JSON): call get_variables to list local variables, then batch_bind_variables with the required {nodeId, variableId, field} entries.", "Verify result with get_drift_status or get_selection_summary."];
1037
+ readonly doneCriteria: "Composition token file exists in workspace; Figma component generated on canvas; variable bindings visible in Figma inspector.";
1038
+ }, {
1039
+ readonly id: "scenario-from-markdown";
1040
+ readonly title: "Multi-page scenario / flow from a markdown spec document";
1041
+ readonly version: 1;
1042
+ readonly userPhrases: readonly ["вот md файл сценария, создай flow в фигме", "build scenario from this markdown document", "у меня есть md с описанием флоу", "render this spec as a figma flow", "создай сценарий из md файла", "scenario document → figma pages", "make a user flow from this spec", "go through this markdown and create a figma scenario"];
1043
+ readonly decideBetween: readonly [{
1044
+ readonly between: readonly ["scenario-from-markdown", "doc-flow"];
1045
+ readonly hint: "If the user provides individual Figma URLs (not a markdown document), use doc-flow / build_doc_flow directly.";
1046
+ }];
1047
+ readonly context: "The markdown spec format: H1 = flow container title, H2 sections = pages, Figma URL per section = source node to clone, paragraph text = page caption. build_scenario_from_md parses this automatically.";
1048
+ readonly preferredTools: readonly ["build_scenario_from_md", "build_doc_flow"];
1049
+ readonly forbidden: readonly ["Hand-parsing Figma URLs from markdown and assembling pages[] manually — use build_scenario_from_md.", "Calling use_figma to create frames and place screenshots.", "Generating a node-by-node script when build_scenario_from_md covers the whole flow."];
1050
+ readonly steps: readonly ["Run build_scenario_from_md { markdown, dryRun: true } — confirm the parsed pages list (title, nodeId, description) is correct.", "If nodeIds are missing: check that Figma URLs in the markdown include ?node-id= parameters.", "Run build_scenario_from_md with targetParentId (or targetRootId for an existing container) and dryRun: false."];
1051
+ readonly doneCriteria: "All H2 pages from the markdown appear as frames inside a single auto-layout container; each page has the correct caption.";
1052
+ }, {
1053
+ readonly id: "variable-usage";
1054
+ readonly title: "Find usages of a Figma variable (count + visualize)";
1055
+ readonly version: 1;
1056
+ readonly userPhrases: readonly ["сколько раз используется accent.medium", "where is this variable used", "посчитай где используется переменная", "render a page with all usages of accent.medium", "найди все объекты с переменной", "выведи на страницу все места где встречается переменная"];
1057
+ readonly decideBetween: readonly [{
1058
+ readonly between: readonly ["variable-usage", "audit-coverage"];
1059
+ readonly hint: "If user wants to find missing bindings (no variable assigned) → audit-coverage. If user names a variable and asks 'where is it used' → variable-usage.";
1060
+ }];
1061
+ readonly context: "analyze_variable_usage returns a token-friendly summary (counts only). For the full node list, use find_variable_usages with cursor pagination. To visualize the result on the canvas, call render_variable_usage_page (creates a fresh page with cloned references). All three resolve transitive aliases — a variable that aliases the target counts as a usage and is included in target.aliasChain.";
1062
+ readonly preferredTools: readonly ["get_variables", "analyze_variable_usage", "find_variable_usages", "render_variable_usage_page"];
1063
+ readonly forbidden: readonly ["Writing a use_figma script that walks node.boundVariables manually — analyze_variable_usage already does it (with alias resolution).", "Calling find_variable_usages without limit/cursor for huge files — pagination keeps the agent fast and cheap.", "Cloning nodes by hand into a new page — use render_variable_usage_page (chunked + auto-layout)."];
1064
+ readonly steps: readonly ["Identify the variable (variableId is best). If only a name, get_variables narrows it down.", "Call analyze_variable_usage { variable, scope: 'page'|'file' } first — small response, decides next step.", "If user wants details: find_variable_usages { variable, scope, limit }, optionally paginate via the returned cursor.", "If user wants visualization: render_variable_usage_page { variable, scope: 'file', maxClones }. Confirm writesAllowed first via get_plugin_status."];
1065
+ readonly doneCriteria: "Agent returned a count + breakdown (analyze) or a paginated record list (find) or created a 'Usage: <variable>' page (render). Transitive aliases included in target.aliasChain.";
1066
+ }, {
1067
+ readonly id: "audit-coverage";
1068
+ readonly title: "Audit nodes that lack a variable / style binding";
1069
+ readonly version: 1;
1070
+ readonly userPhrases: readonly ["проверь везде ли подкреплены переменные", "проверь на всех макетах установлены ли переменные и стили", "проверь на всех ли макетах и объектах установленные переменные", "проверь переменные и стили на макетах", "найди объекты без переменных", "check whether every screen object has variables and styles assigned", "check variable and style coverage across layouts", "audit raw values without variables", "review the file for missing bindings", "где hex заливки вместо токенов"];
1071
+ readonly decideBetween: readonly [{
1072
+ readonly between: readonly ["audit-coverage", "find-unused"];
1073
+ readonly hint: "audit-coverage finds where to ADD bindings (raw values). find-unused finds variables/styles to DELETE.";
1074
+ }];
1075
+ readonly context: "audit_variable_coverage returns SUMMARY only (counts + topOffenders). When `suggest=true` (default) the plugin matches every raw value against existing local variables; the suggestion in topOffenders / details lets the agent propose batch_bind_variables payloads. Style coverage (audit_style_coverage) reports nodes where neither a styleId nor a variable is bound.";
1076
+ readonly preferredTools: readonly ["audit_variable_coverage", "find_variable_coverage_misses", "audit_style_coverage", "find_style_coverage_misses"];
1077
+ readonly forbidden: readonly ["Walking the document manually with use_figma — audit_* tools cover the case (chunked, alias-aware).", "Applying suggested bindings without user confirmation — coverage suggestions can be wrong on intentional raw values.", "Running on scope='file' first when 'page' is enough — start narrow, widen on demand."];
1078
+ readonly steps: readonly ["Start narrow: audit_variable_coverage { scope: 'page' } — confirm magnitude.", "If acceptable, widen: scope: 'file'.", "For details: find_variable_coverage_misses { limit, cursor } and find_style_coverage_misses { limit, cursor }.", "For style coverage do the same with audit_style_coverage / find_style_coverage_misses.", "If the user asks to fix the findings, switch to auto-bind-from-audit and run apply_coverage_suggestions / apply_style_coverage_suggestions in preview mode first."];
1079
+ readonly doneCriteria: "Agent returned a read-only summary and optional paginated findings without using use_figma. Coverage gaps are quantified per property and per page; remediation is a separate dry-run-first workflow.";
1080
+ }, {
1081
+ readonly id: "find-unused";
1082
+ readonly title: "Find unused local variables and styles";
1083
+ readonly version: 1;
1084
+ readonly userPhrases: readonly ["какие переменные у меня не используются", "find unused variables", "which styles are dead", "почисть неиспользуемые токены", "найди мёртвые стили"];
1085
+ readonly context: "find_unused_variables walks the file once, building two reference sets: bindings on every node + alias targets in any variable mode. unused = local variables \\ referenced. find_unused_styles does the equivalent for paint/text/effect styles. Both are read-only.";
1086
+ readonly preferredTools: readonly ["find_unused_variables", "find_unused_styles", "batch_delete_variables"];
1087
+ readonly forbidden: readonly ["Deleting variables / styles without explicit user confirmation — false positives are possible (e.g. variables used only in published libraries).", "Running unused detection without explaining the scan boundary — it covers the current document only."];
1088
+ readonly steps: readonly ["Run find_unused_variables / find_unused_styles — return the lists.", "Confirm with the user which entries to remove (group by collection / styleType for clarity).", "If approved: batch_delete_variables for variables; styles need manual removal (no batch tool yet)."];
1089
+ readonly doneCriteria: "Agent returned a deterministic list of unused variables / styles. Deletions only happened after explicit confirmation.";
1090
+ }, {
1091
+ readonly id: "bulk-variables";
1092
+ readonly title: "Bulk create / dedupe / rebind / reorder Figma Variables";
1093
+ readonly version: 1;
1094
+ readonly userPhrases: readonly ["создай набор переменных по этому списку", "import these variables in bulk", "bulk create variables from spec", "обнови переменные пакетно", "перепривяжи алиасы переменных", "rebind aliases from old token to new", "найди дубликаты переменных и слей их", "dedupe variables across collections", "приведи коллекцию в алфавитный порядок", "reorder variables alphabetically"];
1095
+ readonly decideBetween: readonly [{
1096
+ readonly between: readonly ["bulk-variables", "doc-tokens"];
1097
+ readonly hint: "If the user wants to render existing token values as documentation, switch to doc-tokens.";
1098
+ }, {
1099
+ readonly between: readonly ["bulk-variables", "auto-bind-from-audit"];
1100
+ readonly hint: "auto-bind-from-audit applies suggestions from audit_variable_coverage; bulk-variables operates on the variables themselves (CRUD + alias refactors).";
1101
+ }];
1102
+ readonly context: "Phase B 'thick' commands cover four recurring refactors: (1) declarative bulk import / update via import_variable_spec, (2) duplicate detection + merge via dedupe_variables, (3) alias rewrites across modes via rebind_variable_aliases, (4) read-only ordering analysis via analyze_variable_order. All write commands accept a dry-run mode that returns the exact plan without touching Figma — agents should ALWAYS preview first and surface the plan to the user before committing.";
1103
+ readonly preferredTools: readonly ["get_variables", "import_variable_spec", "dedupe_variables", "rebind_variable_aliases", "analyze_variable_order", "batch_bind_variables"];
1104
+ readonly forbidden: readonly ["Calling create_variable / set_variable_mode_value in a loop for 5+ items — use import_variable_spec.", "Hand-writing a rebinding loop with rename_variable + set_variable_mode_value — use rebind_variable_aliases.", "Treating analyze_variable_order as a write command — Figma Plugin API does not expose stable variable reordering, so this is diff-only.", "Skipping dryRun on dedupe / rebind / import — always preview before committing.", "Using use_figma scripts to traverse local variables — get_variables + Phase B tools cover the case."];
1105
+ readonly steps: readonly ["Read the user's intent: bulk create vs dedupe vs rebind vs reorder. Each maps to one Phase B tool.", "For BULK CREATE / UPDATE: pass spec.collections[] to import_variable_spec with dryRun: true first. The response lists added / updated / skipped variables and unresolved aliases. Re-call without dryRun to commit.", "For DEDUPE: dedupe_variables { strategy: 'byName' | 'byDefaultModeValue' } — default is dry-run. Confirm the proposed survivor with the user, then re-call with apply: true.", "For ALIAS REBIND: rebind_variable_aliases { mappings: [{ fromVariableId, toVariableId }], dryRun: true } first. The response counts how many valuesByMode entries would change. Re-call with dryRun: false to commit.", "For ORDER: analyze_variable_order { collectionId, strategy } — read-only analysis. Return the moves[] to the user; manual reorder in the Variables panel is required."];
1106
+ readonly doneCriteria: "Agent produced a single Phase B call (or two: dryRun preview + commit) that the plugin executed; the user has the diff before any write. No use_figma / batch loops were used.";
1107
+ }, {
1108
+ readonly id: "auto-bind-from-audit";
1109
+ readonly title: "Auto-apply audit_variable_coverage suggestions";
1110
+ readonly version: 1;
1111
+ readonly userPhrases: readonly ["примени предложенные переменные к аудиту", "apply variable coverage suggestions", "автопривяжи переменные где есть подсказки", "fix the audit by binding suggested variables", "convert audit suggestions into bindings"];
1112
+ readonly decideBetween: readonly [{
1113
+ readonly between: readonly ["auto-bind-from-audit", "audit-coverage"];
1114
+ readonly hint: "audit-coverage produces the diagnosis (no writes); auto-bind-from-audit applies the prescribed variable. Always run audit first, confirm, then auto-bind.";
1115
+ }];
1116
+ readonly context: "find_variable_coverage_misses returns suggestions per node + property: { nodeId, property, suggestion: { variableId, variableName } }. apply_coverage_suggestions translates that array into setBoundVariableForPaint / setBoundVariableForEffect / setBoundVariable writes. Default mode is dry-run — agent receives a preview the user can sign off on. Commit happens only when dryRun: false.";
1117
+ readonly preferredTools: readonly ["audit_variable_coverage", "find_variable_coverage_misses", "apply_coverage_suggestions", "batch_bind_variables"];
1118
+ readonly forbidden: readonly ["Applying suggestions blindly without showing them to the user — coverage suggestions can be wrong on intentional raw values.", "Calling bind_variable in a loop for each suggestion — apply_coverage_suggestions handles paths like fills[0].color / effects[2].color in one round-trip.", "Skipping the dry-run preview — apply_coverage_suggestions is destructive (it writes bindings on the canvas)."];
1119
+ readonly steps: readonly ["Run find_variable_coverage_misses { scope: 'page' | 'file', limit, withSuggestion: true }. Filter entries that have a non-null suggestion.", "Build the suggestions[] array: { nodeId, property, variableId } per entry.", "Call apply_coverage_suggestions with dryRun: true (default). Surface the preview[] to the user.", "On confirmation, re-call apply_coverage_suggestions with dryRun: false to commit. Canvas write — Dev Mode is blocked."];
1120
+ readonly doneCriteria: "Bindings prescribed by the audit are applied to the canvas; the response reports applied / failed counts. No use_figma scripts were used.";
1121
+ }, {
1122
+ readonly id: "bulk-styles";
1123
+ readonly title: "Bulk create / dedupe / rebind LOCAL Figma styles + apply coverage suggestions (Phase C)";
1124
+ readonly version: 1;
1125
+ readonly userPhrases: readonly ["создай набор стилей по этому списку", "import these paint / text / effect styles in bulk", "bulk create paint styles from spec", "обнови стили пакетно", "найди дубликаты стилей и слей их", "dedupe styles across the file", "перепривяжи стили со старого на новый", "rebind style consumers from one style to another", "примени предложенные стили к аудиту", "apply style coverage suggestions", "конвертируй raw paints в стили"];
1126
+ readonly decideBetween: readonly [{
1127
+ readonly between: readonly ["bulk-styles", "bulk-variables"];
1128
+ readonly hint: "bulk-styles wraps Figma local STYLES (fillStyleId / textStyleId / effectStyleId). For Figma VARIABLES (boundVariables / valuesByMode) use bulk-variables instead.";
1129
+ }, {
1130
+ readonly between: readonly ["bulk-styles", "audit-coverage"];
1131
+ readonly hint: "audit-coverage only LISTS missing bindings. bulk-styles applies them (apply_style_coverage_suggestions) and refactors styles in bulk.";
1132
+ }, {
1133
+ readonly between: readonly ["bulk-styles", "style-drift"];
1134
+ readonly hint: "style-drift verifies that styles match the source of truth (read-only). bulk-styles modifies styles or their consumers.";
1135
+ }];
1136
+ readonly context: "Phase C 'thick' commands cover four recurring style refactors: (1) declarative bulk import / update via import_style_spec (PaintStyle + TextStyle + EffectStyle), (2) duplicate detection + merge via dedupe_styles (byName | bySignature), (3) bulk styleId rewriting on consumer nodes via rebind_style_consumers, (4) converting find_style_coverage_misses into setStyleId* writes via apply_style_coverage_suggestions. All write commands accept dry-run / preview mode that returns the plan WITHOUT touching Figma — agent should ALWAYS preview first and surface the diff to the user before committing.";
1137
+ readonly preferredTools: readonly ["get_local_styles", "import_style_spec", "dedupe_styles", "rebind_style_consumers", "find_style_coverage_misses", "apply_style_coverage_suggestions"];
1138
+ readonly forbidden: readonly ["Calling create_paint_style / create_text_style / create_effect_style in a loop for 5+ items — use import_style_spec.", "Hand-writing a styleId rewriting loop with set_fill_style / set_stroke_style — use rebind_style_consumers.", "Skipping dryRun on dedupe_styles / rebind_style_consumers / apply_style_coverage_suggestions — always preview before committing.", "Using use_figma scripts to traverse local styles — get_local_styles + Phase C tools cover the case.", "Applying coverage suggestions blindly — coverage suggestions can be wrong on intentional raw values."];
1139
+ readonly steps: readonly ["Read the user's intent: bulk create vs dedupe vs rebind consumers vs auto-bind from audit. Each maps to one Phase C tool.", "For BULK CREATE / UPDATE: build spec.{paintStyles, textStyles, effectStyles}[] and call import_style_spec with dryRun: true first. SOLID paints accept `color: '#rrggbb[aa]'` shortcut. Re-call without dryRun to commit.", "For DEDUPE: dedupe_styles { strategy: 'byName' | 'bySignature', styleType?: 'PAINT' | 'TEXT' | 'EFFECT' | 'ALL' } — default is dry-run. Confirm the proposed survivor (style with most consumers wins), then re-call with apply: true.", "For STYLE REBIND: rebind_style_consumers { mappings: [{ fromStyleId, toStyleId }], dryRun: true } first. The response counts (node, field) pairs that would change. Re-call with dryRun: false to commit.", "For AUTO-BIND FROM AUDIT: find_style_coverage_misses → assemble suggestions[{ nodeId, property, styleId }] → apply_style_coverage_suggestions { suggestions, dryRun: true }. Style assignments are PER-NODE (PaintStyle covers the whole fills[] array), so duplicates by (nodeId, field) land in skipped[]. Surface preview, then re-call with dryRun: false."];
1140
+ readonly doneCriteria: "Agent produced a Phase C call (or two: dryRun preview + commit) that the plugin executed; the user approved the diff before any write. No use_figma / set_*_style loops were used.";
1141
+ }, {
1142
+ readonly id: "style-drift";
1143
+ readonly title: "Audit drift between local Paint styles and the source of truth (Phase C)";
1144
+ readonly version: 1;
1145
+ readonly userPhrases: readonly ["проверь дрейф стилей и переменных", "audit style drift vs variables", "стили рассинхронизированы с токенами", "find paint styles that drifted from variables", "сверь PaintStyle со списком ожидаемых цветов", "verify styles against expected colors"];
1146
+ readonly decideBetween: readonly [{
1147
+ readonly between: readonly ["style-drift", "audit-coverage"];
1148
+ readonly hint: "style-drift verifies EXISTING style values vs source of truth. audit-coverage finds nodes WITHOUT a style binding.";
1149
+ }, {
1150
+ readonly between: readonly ["style-drift", "bulk-styles"];
1151
+ readonly hint: "style-drift is READ-ONLY (Dev Mode safe). When drift is found and the user wants to fix it, switch to bulk-styles → import_style_spec to overwrite the drifted style values.";
1152
+ }];
1153
+ readonly context: "audit_style_drift compares local PaintStyles to the source of truth in two modes: byName-vs-variables (auto-pairs styles with like-named local Variables) or explicit ({ styleId, expectedColor } expectations from a token snapshot). Returns findings[] (drift > tolerance) and skipped[] (styles that couldn't be compared — non-SOLID, non-COLOR variable, etc.). NO canvas writes — fully Dev-Mode-compatible.";
1154
+ readonly preferredTools: readonly ["audit_style_drift", "get_variables", "import_style_spec"];
1155
+ readonly forbidden: readonly ["Walking PaintStyles + Variables manually with use_figma — audit_style_drift covers it (alias-aware).", "Setting tolerance > 0 silently — when fuzzy matching is enabled, surface the value to the user.", "Treating findings[] as canonical: skipped[] entries (no matching variable, non-SOLID paint, etc.) often need a follow-up question."];
1156
+ readonly steps: readonly ["Decide the comparison source: token-driven workflow → byName-vs-variables; token snapshot from the transformer → explicit.", "Call audit_style_drift { request: { mode: 'byName-vs-variables' } } (or explicit + expectations[]) with optional tolerance.", "Surface findings[] grouped by source. For each, show actualColor → expectedColor + delta. Surface skipped[] separately.", "If user wants to fix drift: build an import_style_spec.paintStyles[] payload that overrides the drifted values, dryRun first, then commit."];
1157
+ readonly doneCriteria: "Agent produced a deterministic drift report. No canvas writes happened during the audit. If the user requested a fix, a follow-up import_style_spec was issued with explicit dryRun preview.";
1158
+ }, {
1159
+ readonly id: "mockup-builder";
1160
+ readonly title: "Assemble a mockup screen from existing design-system components (Phase D)";
1161
+ readonly version: 1;
1162
+ readonly userPhrases: readonly ["собери макет страницы из компонентов", "build a mockup from existing components", "сделай дашборд из карточек", "render a screen using design system components", "lay out cards in auto-layout", "сложи макет из WCard и WButton", "render a list of N cards from this dataset", "построй продуктовую страницу по описанию", "assemble a settings screen from existing components"];
1163
+ readonly decideBetween: readonly [{
1164
+ readonly between: readonly ["mockup-builder", "doc-component"];
1165
+ readonly hint: "mockup-builder ASSEMBLES a screen from many components; doc-component DOCUMENTS a single component (variants + props).";
1166
+ }, {
1167
+ readonly between: readonly ["mockup-builder", "compose-with-variables"];
1168
+ readonly hint: "mockup-builder is the consumer (lays out instances); compose-with-variables is the producer (creates / refactors the component itself).";
1169
+ }, {
1170
+ readonly between: readonly ["mockup-builder", "doc-flow"];
1171
+ readonly hint: "mockup-builder = single auto-layout screen; doc-flow = multiple pages stacked side-by-side as a story.";
1172
+ }];
1173
+ readonly context: "Phase D: thick orchestration over `figma.createInstance / setProperties / setBoundVariableForPaint / loadFontAsync`. Pipeline: (1) `inspect_design_system` to aggregate components, variables, styles, token config, and compositions; (2) optional `find_components` to narrow ids / keys + componentPropertyDefinitions; (3) `validate_screen_spec` or `build_screen { dryRun: true }` to preview; (4) `build_screen` / `update_screen` to assemble an auto-layout container from a declarative item tree (`instance | section | spacer | text`) with property / text / fill-binding overrides; (5) `apply_mockup_dataset` when the same template needs to be cloned per-row from a structured list.";
1174
+ readonly preferredTools: readonly ["inspect_design_system", "validate_screen_spec", "build_screen", "update_screen", "find_components", "build_mockup", "apply_mockup_dataset", "get_variables"];
1175
+ readonly schemaResources: readonly ["sxl://agent/schemas/design-dsl-v1"];
1176
+ readonly forbidden: readonly ["Calling use_figma to write a hand-rolled `figma.createInstance(...) / setProperties(...)` loop when build_screen/build_mockup covers the assembly.", "Guessing component names instead of running inspect_design_system or find_components first — the user's file may have arbitrary local names.", "Skipping dryRun for build_screen / update_screen / build_mockup / apply_mockup_dataset — always preview the resolved plan before writing to canvas.", "Hand-coding fill colours when a Figma Variable is available — use fillBindings { variableId } so the mockup picks up theme switches automatically.", "Loading fonts manually — build_mockup loads fonts on demand with a safe Inter Regular fallback.", "Assuming property names like `size#123:0` — pass the human key (`size`); the plugin maps to the internal `name#defId` suffix via `componentProperties`."];
1177
+ readonly steps: readonly ["Run inspect_design_system { query | prefix?, includeProperties: true, includeRemoteInstances?: true } to aggregate components, variables, local styles, token config, and composition index.", "Run find_components { query | prefix?, includeProperties: true, kind?: 'COMPONENT' | 'COMPONENT_SET', limit?: 50 } when the aggregate response needs narrowing. Cache the (id, name, propertyDefinitions, defaultVariantId) list.", "If the user wants library components, set includeRemoteInstances: true so library components instantiated in this file are included; otherwise stay local-only.", "Decide the layout: VERTICAL stack of sections, HORIZONTAL row of cards, or WRAP grid. Pick itemSpacing / padding to match the user's intent (e.g. 16px gutters).", "Build the items[] tree. Use `instance` for components (one of componentId | componentKey | componentName), `section` for nested auto-layout frames, `spacer` for explicit gaps, `text` for bare TEXT layers (TEXT styles can be applied via textStyleId).", "For property / text / fill overrides on instances: pass `properties` (human keys), `textOverrides[]` (layerName + value), `fillBindings[]` (variableId; optional layerName when only one child should receive the fill).", "Call validate_screen_spec or build_screen { ..., dryRun: true } first. The plugin returns a resolved plan with per-item ok/error. If any errors → fix the spec, do not commit.", "Re-call build_screen without dryRun to write a new canvas root, or update_screen { targetRootId, ... } to modify an existing frame without recreating the whole screen. Capture rootNodeId for downstream tools (e.g. document the mockup, run audit_variable_coverage on it).", "If the user wants N cards from a dataset, leave one template instance inside the mockup (kind: 'instance'), then call apply_mockup_dataset { templateNodeId, rows[], dryRun: true } → preview → commit. removeTemplate: true deletes the placeholder after cloning."];
1178
+ readonly doneCriteria: "Agent produced one (or a sequence of) Phase D calls (inspect_design_system → validate/build_screen [dryRun → commit] → optional apply_mockup_dataset) that the plugin executed without use_figma. The user approved each diff before commit. The mockup uses real components by id/key (not duplicated geometry) and binds Figma Variables instead of raw hex when a variable is available.";
1179
+ }, {
1180
+ readonly id: "bulk-compositions";
1181
+ readonly title: "Bulk generate / apply many composition files in one call (Phase E)";
1182
+ readonly version: 1;
1183
+ readonly userPhrases: readonly ["сгенерируй все компоненты дизайн-системы", "regenerate every WAccordion / WButton / WInput from JSON", "пересобери компоненты по композициям", "apply all SXL compositions in this workspace", "обнови компоненты после правок в JSON", "rebuild every composition that drifted", "перегенерируй все компоненты после очистки файла", "fresh-bake the design system from compositions"];
1184
+ readonly decideBetween: readonly [{
1185
+ readonly between: readonly ["bulk-compositions", "compose-with-variables"];
1186
+ readonly use_bulk_compositions_when: "the composition JSON files already exist in the plugin workspace (`tokens/components/W*.json`) and you want to (re)build many components in one call";
1187
+ readonly use_compose_with_variables_when: "the composition JSON does NOT exist yet — you start from a Figma URL, export composition JSON, and generate one component";
1188
+ }, {
1189
+ readonly between: readonly ["bulk-compositions", "composition-drift"];
1190
+ readonly use_bulk_compositions_when: "the user wants to WRITE (generate / apply) compositions";
1191
+ readonly use_composition_drift_when: "the user only wants to KNOW which compositions are out of sync (read-only)";
1192
+ }, {
1193
+ readonly between: readonly ["bulk-compositions", "doc-component"];
1194
+ readonly use_bulk_compositions_when: "the goal is to (re)build the actual COMPONENT in Figma from composition JSON";
1195
+ readonly use_doc_component_when: "the goal is to render a documentation FRAME for an existing component";
1196
+ }];
1197
+ readonly context: "Phase E thick orchestration around `handleGenerateComposition` / `handleApplyComposition`. Discovers every `$type:composition` file in the plugin workspace (same source as `list_compositions`), filters by `fileIds | names | prefix`, then runs the per-file pipeline with per-item error isolation (`continueOnError: true` by default). `operation: 'auto'` mirrors the manual UX (apply if a tracked component already exists, otherwise generate); `'generate'` forces a fresh ComponentSet rebuild; `'apply'` forces apply onto an existing component. `dryRun: true` returns the resolved plan WITHOUT touching the canvas — Dev Mode safe.";
1198
+ readonly preferredTools: readonly ["list_compositions", "audit_composition_drift", "bulk_generate_compositions"];
1199
+ readonly forbidden: readonly ["Calling generate_composition / apply_composition in a hand-written loop for 3+ files — use bulk_generate_compositions to keep per-item error isolation, progress events, and idempotency.", "Using bulk_generate_compositions with `operation: 'apply'` against compositions that have no diff-id tracking entry — the handler will fall back to `generate` per item; if the user explicitly asked for apply-only, run audit_composition_drift first to confirm tracking exists.", "Skipping dryRun when the user expects a preview — agent must surface the resolved plan (file count, expected variant counts, errors) before committing canvas writes.", "Operating on every composition without filters when the user only mentioned a single component family — pass `prefix: 'WAccordion'` / `names: [...]` to keep the run small and idempotent.", "Interpreting `success: true, variantsCreated: 0` as a failure — that's normal idempotent behaviour for `apply` when nothing changed."];
1200
+ readonly steps: readonly ["Discover what's in the workspace: read `sxl://compositions/index` (or call list_compositions) to get the full set of composition files + names.", "(Optional) Run audit_composition_drift first when the user is unsure which components actually drifted. Use the report to build the `fileIds` filter for the next step.", "Pick filter scope: `fileIds: [...]` for surgical re-builds, `prefix: 'W'` for a whole DS family, `names: ['WButton', 'WInput']` for a curated list. Omit all filters only when the user explicitly asked to rebuild everything.", "Pick operation: `auto` (default — manual UX), `generate` (force rebuild — use after structural changes / corrupted tracking), `apply` (force apply onto existing — use only when tracking is healthy).", "Call bulk_generate_compositions { ..., dryRun: true } first. The plugin returns the resolved plan with per-item composition name + parse status. If any errors → fix the JSON / config, do not commit.", "Re-call without dryRun to commit. Capture summary { total, processed, created, updated, failed, elapsedMs } and surface it to the user.", "On per-item failures, the run continues by default. Group `items[].errors` by composition for the user; if `continueOnError: false` was set, only `items` up to the first failure are present."];
1201
+ readonly doneCriteria: "Agent produced one or two bulk_generate_compositions calls (dryRun → commit) that touched only the requested compositions. Per-item errors were surfaced; failures did not silently rebuild the wrong components. No hand-written generate/apply loops were issued.";
1202
+ }, {
1203
+ readonly id: "composition-drift";
1204
+ readonly title: "Audit drift between composition JSON files and Figma components (Phase E)";
1205
+ readonly version: 1;
1206
+ readonly userPhrases: readonly ["проверь рассинхрон композиций и компонентов", "audit composition drift", "какие компоненты не соответствуют JSON", "find compositions that drifted from Figma", "сверь tokens/components с реальными ComponentSet", "verify SXL compositions still match the Figma design system", "какие компоненты потерялись", "show compositions whose tracked component was deleted"];
1207
+ readonly decideBetween: readonly [{
1208
+ readonly between: readonly ["composition-drift", "bulk-compositions"];
1209
+ readonly use_composition_drift_when: "user wants the LIST of out-of-sync compositions (read-only — Dev Mode safe)";
1210
+ readonly use_bulk_compositions_when: "user wants to FIX the drift (write — bulk_generate_compositions { fileIds: drifted, operation: 'generate' })";
1211
+ }, {
1212
+ readonly between: readonly ["composition-drift", "style-drift"];
1213
+ readonly use_composition_drift_when: "the unit of comparison is a composition JSON ↔ Figma ComponentSet";
1214
+ readonly use_style_drift_when: "the unit of comparison is a local PaintStyle ↔ Variable / token snapshot";
1215
+ }, {
1216
+ readonly between: readonly ["composition-drift", "find-unused"];
1217
+ readonly use_composition_drift_when: "the goal is to verify EXISTING compositions still match the Figma scene";
1218
+ readonly use_find_unused_when: "the goal is to clean up dangling local variables / styles (different unit)";
1219
+ }];
1220
+ readonly context: "audit_composition_drift compares every `$type:composition` file in the plugin workspace against the Figma component it tracked in `diff-id.compositions`. Per-composition status: `linked` (tracking entry valid + Figma node matches), `unlinked` (no tracking — never generated), `drift` (Figma node renamed / variant count mismatch / wrong type), `missing` (tracking points to a deleted node). Findings include human-readable `reason`. Fully Dev-Mode-compatible — never touches the canvas.";
1221
+ readonly preferredTools: readonly ["audit_composition_drift", "list_compositions", "bulk_generate_compositions"];
1222
+ readonly forbidden: readonly ["Walking diff-id.json + Figma scene tree manually with use_figma — audit_composition_drift covers it.", "Treating `unlinked` as drift — it just means the composition was never generated. Surface it as a separate bucket.", "Auto-fixing without confirmation — drift can mean the designer intentionally renamed the Figma component; ask before running bulk_generate_compositions."];
1223
+ readonly steps: readonly ["Run audit_composition_drift with appropriate filters: `prefix: 'W'` for the whole DS, `names: [...]` for a curated list, no filters for the full workspace.", "Group findings by status (linked / unlinked / drift / missing) and surface counts to the user.", "For each `drift` / `missing` finding, surface: composition name, fileId, status, reason, expected vs actual variant count, tracked componentSetId.", "If user wants to fix drift: call bulk_generate_compositions { fileIds: [drift+missing fileIds], operation: 'generate', dryRun: true } first → preview → commit.", "For `unlinked` findings: ask whether to generate them as new components (bulk_generate_compositions { operation: 'auto' }) or leave them."];
1224
+ readonly doneCriteria: "Agent returned a deterministic drift report with per-composition status. No canvas writes happened during the audit. If the user approved a fix, a follow-up bulk_generate_compositions was issued with explicit dryRun preview.";
1225
+ }];
1226
+ export type AgentIntentRoute = {
1227
+ recipeId: string;
1228
+ title: string;
1229
+ score: number;
1230
+ matchedPhrases: string[];
1231
+ preferredTools: readonly string[];
1232
+ schemaResources: readonly string[];
1233
+ dryRunFirst: boolean;
1234
+ doneCriteria: string;
1235
+ };
1236
+ export declare function routeAgentIntent(request: string, options?: {
1237
+ limit?: number;
1238
+ }): {
1239
+ ok: true;
1240
+ request: string;
1241
+ routes: AgentIntentRoute[];
1242
+ };