@fprad0/skill-master-mcp 0.0.9 → 0.0.11

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 (240) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +43 -9
  3. package/VERSION.md +3 -3
  4. package/bin/lib/client-config.mjs +268 -0
  5. package/bin/lib/menu-core.mjs +678 -33
  6. package/bin/skill-master-bootstrap-global.mjs +15 -1
  7. package/bin/skill-master-doctor.mjs +181 -0
  8. package/bin/skill-master-install-global-skills.mjs +30 -10
  9. package/bin/skill-master-menu.mjs +184 -36
  10. package/bin/skill-master-register-clients.mjs +43 -99
  11. package/dist/index.js +30 -5
  12. package/dist/index.js.map +1 -1
  13. package/docs/operations/GUIA_MULTI_COMPUTADOR.md +255 -0
  14. package/docs/operations/GUIA_NPM_PUBLICO.md +147 -0
  15. package/docs/skill-candidates/v0.0.10/cli-creator/LICENSE.txt +201 -0
  16. package/docs/skill-candidates/v0.0.10/cli-creator/SKILL.md +160 -0
  17. package/docs/skill-candidates/v0.0.10/cli-creator/agents/openai.yaml +4 -0
  18. package/docs/skill-candidates/v0.0.10/cli-creator/references/agent-cli-patterns.md +154 -0
  19. package/docs/skill-candidates/v0.0.10/developer-workstation-ops/SKILL.md +32 -0
  20. package/docs/skill-candidates/v0.0.10/figma/LICENSE.txt +2 -0
  21. package/docs/skill-candidates/v0.0.10/figma/SKILL.md +42 -0
  22. package/docs/skill-candidates/v0.0.10/figma/agents/openai.yaml +14 -0
  23. package/docs/skill-candidates/v0.0.10/figma/assets/figma-small.svg +3 -0
  24. package/docs/skill-candidates/v0.0.10/figma/assets/figma.png +0 -0
  25. package/docs/skill-candidates/v0.0.10/figma/assets/icon.svg +28 -0
  26. package/docs/skill-candidates/v0.0.10/figma/references/figma-mcp-config.md +35 -0
  27. package/docs/skill-candidates/v0.0.10/figma/references/figma-tools-and-prompts.md +34 -0
  28. package/docs/skill-candidates/v0.0.10/figma-code-connect-components/LICENSE.TXT +2 -0
  29. package/docs/skill-candidates/v0.0.10/figma-code-connect-components/SKILL.md +349 -0
  30. package/docs/skill-candidates/v0.0.10/figma-code-connect-components/agents/openai.yaml +14 -0
  31. package/docs/skill-candidates/v0.0.10/figma-code-connect-components/assets/figma-small.svg +3 -0
  32. package/docs/skill-candidates/v0.0.10/figma-code-connect-components/assets/figma.png +0 -0
  33. package/docs/skill-candidates/v0.0.10/figma-code-connect-components/assets/icon.svg +28 -0
  34. package/docs/skill-candidates/v0.0.10/figma-code-connect-components/references/mapping-checklist.md +7 -0
  35. package/docs/skill-candidates/v0.0.10/figma-code-connect-components/scripts/normalize_node_id.py +25 -0
  36. package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/LICENSE.TXT +2 -0
  37. package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/SKILL.md +537 -0
  38. package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/agents/openai.yaml +14 -0
  39. package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/assets/figma-small.svg +3 -0
  40. package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/assets/figma.png +0 -0
  41. package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/assets/icon.svg +28 -0
  42. package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/references/rule-template.md +15 -0
  43. package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/scripts/check_agents_md.sh +9 -0
  44. package/docs/skill-candidates/v0.0.10/figma-generate-design/LICENSE.TXT +2 -0
  45. package/docs/skill-candidates/v0.0.10/figma-generate-design/SKILL.md +341 -0
  46. package/docs/skill-candidates/v0.0.10/figma-generate-design/agents/openai.yaml +14 -0
  47. package/docs/skill-candidates/v0.0.10/figma-generate-design/assets/figma-small.svg +3 -0
  48. package/docs/skill-candidates/v0.0.10/figma-generate-design/assets/figma.png +0 -0
  49. package/docs/skill-candidates/v0.0.10/figma-generate-design/assets/icon.svg +28 -0
  50. package/docs/skill-candidates/v0.0.10/figma-generate-design/maintainers.yml +1 -0
  51. package/docs/skill-candidates/v0.0.10/figma-generate-library/LICENSE.TXT +2 -0
  52. package/docs/skill-candidates/v0.0.10/figma-generate-library/SKILL.md +314 -0
  53. package/docs/skill-candidates/v0.0.10/figma-generate-library/agents/openai.yaml +14 -0
  54. package/docs/skill-candidates/v0.0.10/figma-generate-library/assets/figma-small.svg +3 -0
  55. package/docs/skill-candidates/v0.0.10/figma-generate-library/assets/figma.png +0 -0
  56. package/docs/skill-candidates/v0.0.10/figma-generate-library/assets/icon.svg +28 -0
  57. package/docs/skill-candidates/v0.0.10/figma-generate-library/maintainers.yml +3 -0
  58. package/docs/skill-candidates/v0.0.10/figma-generate-library/references/code-connect-setup.md +260 -0
  59. package/docs/skill-candidates/v0.0.10/figma-generate-library/references/component-creation.md +1014 -0
  60. package/docs/skill-candidates/v0.0.10/figma-generate-library/references/discovery-phase.md +518 -0
  61. package/docs/skill-candidates/v0.0.10/figma-generate-library/references/documentation-creation.md +834 -0
  62. package/docs/skill-candidates/v0.0.10/figma-generate-library/references/error-recovery.md +540 -0
  63. package/docs/skill-candidates/v0.0.10/figma-generate-library/references/naming-conventions.md +527 -0
  64. package/docs/skill-candidates/v0.0.10/figma-generate-library/references/token-creation.md +962 -0
  65. package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/bindVariablesToComponent.js +110 -0
  66. package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/cleanupOrphans.js +127 -0
  67. package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/createComponentWithVariants.js +148 -0
  68. package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/createDocumentationPage.js +139 -0
  69. package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/createSemanticTokens.js +108 -0
  70. package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/createVariableCollection.js +49 -0
  71. package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/inspectFileStructure.js +121 -0
  72. package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/rehydrateState.js +92 -0
  73. package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/validateCreation.js +83 -0
  74. package/docs/skill-candidates/v0.0.10/figma-implement-design/LICENSE.txt +2 -0
  75. package/docs/skill-candidates/v0.0.10/figma-implement-design/SKILL.md +258 -0
  76. package/docs/skill-candidates/v0.0.10/figma-implement-design/agents/openai.yaml +14 -0
  77. package/docs/skill-candidates/v0.0.10/figma-implement-design/assets/figma-small.svg +3 -0
  78. package/docs/skill-candidates/v0.0.10/figma-implement-design/assets/figma.png +0 -0
  79. package/docs/skill-candidates/v0.0.10/figma-implement-design/assets/icon.svg +28 -0
  80. package/docs/skill-candidates/v0.0.10/figma-use/LICENSE.TXT +2 -0
  81. package/docs/skill-candidates/v0.0.10/figma-use/SKILL.md +233 -0
  82. package/docs/skill-candidates/v0.0.10/figma-use/agents/openai.yaml +14 -0
  83. package/docs/skill-candidates/v0.0.10/figma-use/assets/figma-small.svg +3 -0
  84. package/docs/skill-candidates/v0.0.10/figma-use/assets/figma.png +0 -0
  85. package/docs/skill-candidates/v0.0.10/figma-use/assets/icon.svg +28 -0
  86. package/docs/skill-candidates/v0.0.10/figma-use/maintainers.yml +1 -0
  87. package/docs/skill-candidates/v0.0.10/figma-use/references/api-reference.md +301 -0
  88. package/docs/skill-candidates/v0.0.10/figma-use/references/common-patterns.md +512 -0
  89. package/docs/skill-candidates/v0.0.10/figma-use/references/component-patterns.md +488 -0
  90. package/docs/skill-candidates/v0.0.10/figma-use/references/effect-style-patterns.md +123 -0
  91. package/docs/skill-candidates/v0.0.10/figma-use/references/gotchas.md +599 -0
  92. package/docs/skill-candidates/v0.0.10/figma-use/references/maintainers.yml +12 -0
  93. package/docs/skill-candidates/v0.0.10/figma-use/references/plugin-api-patterns.md +513 -0
  94. package/docs/skill-candidates/v0.0.10/figma-use/references/plugin-api-standalone.d.ts +11293 -0
  95. package/docs/skill-candidates/v0.0.10/figma-use/references/plugin-api-standalone.index.md +441 -0
  96. package/docs/skill-candidates/v0.0.10/figma-use/references/text-style-patterns.md +203 -0
  97. package/docs/skill-candidates/v0.0.10/figma-use/references/validation-and-recovery.md +109 -0
  98. package/docs/skill-candidates/v0.0.10/figma-use/references/variable-patterns.md +354 -0
  99. package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/maintainers.yml +9 -0
  100. package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-components--creating.md +17 -0
  101. package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-components--using.md +17 -0
  102. package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-components.md +50 -0
  103. package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-effect-styles.md +52 -0
  104. package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-text-styles.md +90 -0
  105. package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-variables--creating.md +13 -0
  106. package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-variables--using.md +13 -0
  107. package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-variables.md +64 -0
  108. package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds.md +41 -0
  109. package/docs/skill-candidates/v0.0.10/frontend-design/LICENSE.txt +177 -0
  110. package/docs/skill-candidates/v0.0.10/frontend-design/SKILL.md +55 -0
  111. package/docs/skill-candidates/v0.0.10/frontend-ui-ux-systems/SKILL.md +32 -0
  112. package/docs/skill-candidates/v0.0.10/github/SKILL.md +74 -0
  113. package/docs/skill-candidates/v0.0.10/github/agents/openai.yaml +6 -0
  114. package/docs/skill-candidates/v0.0.10/github/assets/github-small.svg +3 -0
  115. package/docs/skill-candidates/v0.0.10/github/assets/github.png +0 -0
  116. package/docs/skill-candidates/v0.0.10/image-graphic-design-rendering/SKILL.md +28 -0
  117. package/docs/skill-candidates/v0.0.10/language-quality-pt-en-fr-it-ru/SKILL.md +28 -0
  118. package/docs/skill-candidates/v0.0.10/math-physics-reasoning/SKILL.md +28 -0
  119. package/docs/skill-candidates/v0.0.10/mcp-builder/LICENSE.txt +202 -0
  120. package/docs/skill-candidates/v0.0.10/mcp-builder/SKILL.md +236 -0
  121. package/docs/skill-candidates/v0.0.10/mcp-builder/reference/evaluation.md +602 -0
  122. package/docs/skill-candidates/v0.0.10/mcp-builder/reference/mcp_best_practices.md +249 -0
  123. package/docs/skill-candidates/v0.0.10/mcp-builder/reference/node_mcp_server.md +970 -0
  124. package/docs/skill-candidates/v0.0.10/mcp-builder/reference/python_mcp_server.md +719 -0
  125. package/docs/skill-candidates/v0.0.10/mcp-builder/scripts/connections.py +151 -0
  126. package/docs/skill-candidates/v0.0.10/mcp-builder/scripts/evaluation.py +373 -0
  127. package/docs/skill-candidates/v0.0.10/mcp-builder/scripts/example_evaluation.xml +22 -0
  128. package/docs/skill-candidates/v0.0.10/mcp-builder/scripts/requirements.txt +2 -0
  129. package/docs/skill-candidates/v0.0.10/mcp-client-readiness/SKILL.md +31 -0
  130. package/docs/skill-candidates/v0.0.10/openai-docs/LICENSE.txt +201 -0
  131. package/docs/skill-candidates/v0.0.10/openai-docs/SKILL.md +161 -0
  132. package/docs/skill-candidates/v0.0.10/openai-docs/agents/openai.yaml +14 -0
  133. package/docs/skill-candidates/v0.0.10/openai-docs/assets/openai-small.svg +3 -0
  134. package/docs/skill-candidates/v0.0.10/openai-docs/assets/openai.png +0 -0
  135. package/docs/skill-candidates/v0.0.10/openai-docs/references/latest-model.md +37 -0
  136. package/docs/skill-candidates/v0.0.10/openai-docs/references/prompting-guide.md +244 -0
  137. package/docs/skill-candidates/v0.0.10/openai-docs/references/upgrade-guide.md +181 -0
  138. package/docs/skill-candidates/v0.0.10/openai-docs/scripts/fetch-codex-manual.mjs +598 -0
  139. package/docs/skill-candidates/v0.0.10/openai-docs/scripts/resolve-latest-model-info.js +147 -0
  140. package/docs/skill-candidates/v0.0.10/playwright/LICENSE.txt +201 -0
  141. package/docs/skill-candidates/v0.0.10/playwright/NOTICE.txt +14 -0
  142. package/docs/skill-candidates/v0.0.10/playwright/SKILL.md +147 -0
  143. package/docs/skill-candidates/v0.0.10/playwright/agents/openai.yaml +6 -0
  144. package/docs/skill-candidates/v0.0.10/playwright/assets/playwright-small.svg +3 -0
  145. package/docs/skill-candidates/v0.0.10/playwright/assets/playwright.png +0 -0
  146. package/docs/skill-candidates/v0.0.10/playwright/references/cli.md +116 -0
  147. package/docs/skill-candidates/v0.0.10/playwright/references/workflows.md +95 -0
  148. package/docs/skill-candidates/v0.0.10/playwright/scripts/playwright_cli.sh +25 -0
  149. package/docs/skill-candidates/v0.0.10/polyglot-backend-engineering/SKILL.md +32 -0
  150. package/docs/skill-candidates/v0.0.10/screenshot/LICENSE.txt +201 -0
  151. package/docs/skill-candidates/v0.0.10/screenshot/SKILL.md +267 -0
  152. package/docs/skill-candidates/v0.0.10/screenshot/agents/openai.yaml +6 -0
  153. package/docs/skill-candidates/v0.0.10/screenshot/assets/screenshot-small.svg +5 -0
  154. package/docs/skill-candidates/v0.0.10/screenshot/assets/screenshot.png +0 -0
  155. package/docs/skill-candidates/v0.0.10/screenshot/scripts/ensure_macos_permissions.sh +54 -0
  156. package/docs/skill-candidates/v0.0.10/screenshot/scripts/macos_display_info.swift +22 -0
  157. package/docs/skill-candidates/v0.0.10/screenshot/scripts/macos_permissions.swift +40 -0
  158. package/docs/skill-candidates/v0.0.10/screenshot/scripts/macos_window_info.swift +126 -0
  159. package/docs/skill-candidates/v0.0.10/screenshot/scripts/take_screenshot.ps1 +163 -0
  160. package/docs/skill-candidates/v0.0.10/screenshot/scripts/take_screenshot.py +585 -0
  161. package/docs/skill-candidates/v0.0.10/skill-master-orchestrator/SKILL.md +62 -0
  162. package/docs/skill-candidates/v0.0.10/skill-master-orchestrator/agents/openai.yaml +4 -0
  163. package/docs/skill-candidates/v0.0.10/skill-master-orchestrator/references/activation-policy.md +77 -0
  164. package/docs/skill-candidates/v0.0.10/skill-master-orchestrator/references/human-approval-policy.md +83 -0
  165. package/docs/skill-candidates/v0.0.10/skill-master-orchestrator/references/persona-dev-senior-master.md +46 -0
  166. package/docs/skill-candidates/v0.0.10/terminal-menu-operations/SKILL.md +30 -0
  167. package/docs/skill-candidates/v0.0.10/terminal-pixel-art-tui/SKILL.md +43 -0
  168. package/docs/skill-candidates/v0.0.10/webapp-testing/LICENSE.txt +202 -0
  169. package/docs/skill-candidates/v0.0.10/webapp-testing/SKILL.md +96 -0
  170. package/docs/skill-candidates/v0.0.10/webapp-testing/examples/console_logging.py +35 -0
  171. package/docs/skill-candidates/v0.0.10/webapp-testing/examples/element_discovery.py +40 -0
  172. package/docs/skill-candidates/v0.0.10/webapp-testing/examples/static_html_automation.py +33 -0
  173. package/docs/skill-candidates/v0.0.10/webapp-testing/scripts/with_server.py +106 -0
  174. package/docs/skill-candidates/v0.0.10/winui-app/LICENSE.txt +202 -0
  175. package/docs/skill-candidates/v0.0.10/winui-app/SKILL.md +94 -0
  176. package/docs/skill-candidates/v0.0.10/winui-app/agents/openai.yaml +5 -0
  177. package/docs/skill-candidates/v0.0.10/winui-app/assets/winui.png +0 -0
  178. package/docs/skill-candidates/v0.0.10/winui-app/config.yaml +50 -0
  179. package/docs/skill-candidates/v0.0.10/winui-app/references/_sections.md +96 -0
  180. package/docs/skill-candidates/v0.0.10/winui-app/references/accessibility-input-and-localization.md +51 -0
  181. package/docs/skill-candidates/v0.0.10/winui-app/references/build-run-and-launch-verification.md +72 -0
  182. package/docs/skill-candidates/v0.0.10/winui-app/references/community-toolkit-controls-and-helpers.md +57 -0
  183. package/docs/skill-candidates/v0.0.10/winui-app/references/controls-layout-and-adaptive-ui.md +84 -0
  184. package/docs/skill-candidates/v0.0.10/winui-app/references/foundation-environment-audit-and-remediation.md +82 -0
  185. package/docs/skill-candidates/v0.0.10/winui-app/references/foundation-setup-and-project-selection.md +67 -0
  186. package/docs/skill-candidates/v0.0.10/winui-app/references/foundation-template-first-recovery.md +62 -0
  187. package/docs/skill-candidates/v0.0.10/winui-app/references/foundation-winui-app-structure.md +62 -0
  188. package/docs/skill-candidates/v0.0.10/winui-app/references/motion-animations-and-polish.md +45 -0
  189. package/docs/skill-candidates/v0.0.10/winui-app/references/performance-diagnostics-and-responsiveness.md +46 -0
  190. package/docs/skill-candidates/v0.0.10/winui-app/references/sample-source-map.md +37 -0
  191. package/docs/skill-candidates/v0.0.10/winui-app/references/shell-navigation-and-windowing.md +67 -0
  192. package/docs/skill-candidates/v0.0.10/winui-app/references/styling-theming-materials-and-icons.md +71 -0
  193. package/docs/skill-candidates/v0.0.10/winui-app/references/testing-debugging-and-review-checklists.md +77 -0
  194. package/docs/skill-candidates/v0.0.10/winui-app/references/windows-app-sdk-lifecycle-notifications-and-deployment.md +52 -0
  195. package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/SKILL.md +399 -0
  196. package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/common-patterns.md +331 -0
  197. package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/complete-examples.md +872 -0
  198. package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/component-patterns.md +502 -0
  199. package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/data-fetching.md +767 -0
  200. package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/file-organization.md +502 -0
  201. package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/loading-and-error-states.md +501 -0
  202. package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/performance.md +406 -0
  203. package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/routing-guide.md +364 -0
  204. package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/styling-guide.md +428 -0
  205. package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/typescript-standards.md +418 -0
  206. package/docs/skill-candidates/v0.0.11/git-version-control-ops/SKILL.md +34 -0
  207. package/docs/skill-candidates/v0.0.11/go-engineering/SKILL.md +34 -0
  208. package/docs/skill-candidates/v0.0.11/java-engineering/SKILL.md +34 -0
  209. package/docs/skill-candidates/v0.0.11/javascript-engineering/SKILL.md +34 -0
  210. package/docs/skill-candidates/v0.0.11/json-contract-design/SKILL.md +34 -0
  211. package/docs/skill-candidates/v0.0.11/multi-client-mcp-ops/SKILL.md +36 -0
  212. package/docs/skill-candidates/v0.0.11/nextjs/SKILL.md +745 -0
  213. package/docs/skill-candidates/v0.0.11/nextjs/agents/openai.yaml +3 -0
  214. package/docs/skill-candidates/v0.0.11/nextjs/references/app-router-files.md +94 -0
  215. package/docs/skill-candidates/v0.0.11/python-engineering/SKILL.md +34 -0
  216. package/docs/skill-candidates/v0.0.11/ruby-engineering/SKILL.md +34 -0
  217. package/docs/skill-candidates/v0.0.11/senior-fullstack/SKILL.md +209 -0
  218. package/docs/skill-candidates/v0.0.11/senior-fullstack/references/architecture_patterns.md +103 -0
  219. package/docs/skill-candidates/v0.0.11/senior-fullstack/references/development_workflows.md +103 -0
  220. package/docs/skill-candidates/v0.0.11/senior-fullstack/references/tech_stack_guide.md +103 -0
  221. package/docs/skill-candidates/v0.0.11/senior-fullstack/scripts/code_quality_analyzer.py +114 -0
  222. package/docs/skill-candidates/v0.0.11/senior-fullstack/scripts/fullstack_scaffolder.py +114 -0
  223. package/docs/skill-candidates/v0.0.11/senior-fullstack/scripts/project_scaffolder.py +114 -0
  224. package/docs/skill-candidates/v0.0.11/shadcn/SKILL.md +573 -0
  225. package/docs/skill-candidates/v0.0.11/shadcn/agents/openai.yaml +3 -0
  226. package/docs/skill-candidates/v0.0.11/sql-postgresql-engineering/SKILL.md +34 -0
  227. package/docs/skill-candidates/v0.0.11/terminal-shell-ops/SKILL.md +34 -0
  228. package/docs/skill-candidates/v0.0.11/typescript-expert/SKILL.md +429 -0
  229. package/docs/skill-candidates/v0.0.11/typescript-expert/references/tsconfig-strict.json +92 -0
  230. package/docs/skill-candidates/v0.0.11/typescript-expert/references/typescript-cheatsheet.md +383 -0
  231. package/docs/skill-candidates/v0.0.11/typescript-expert/references/utility-types.ts +335 -0
  232. package/docs/skill-candidates/v0.0.11/typescript-expert/scripts/ts_diagnostic.py +203 -0
  233. package/docs/skill-candidates/v0.0.11/ui-component-primitives/SKILL.md +34 -0
  234. package/docs/skill-candidates/v0.0.11/web-mobile-design-systems/SKILL.md +34 -0
  235. package/docs/skill-candidates/v0.0.11/windows-linux-platform-ops/SKILL.md +34 -0
  236. package/manifests/channels/beta.json +7 -7
  237. package/manifests/channels/stable.json +8 -8
  238. package/network/unapproved-skill-candidates.json +34 -1
  239. package/package.json +7 -2
  240. package/scripts/verify-menu-actions.mjs +115 -0
@@ -0,0 +1,834 @@
1
+ > Part of the [figma-generate-library skill](../SKILL.md).
2
+
3
+ # Documentation Creation Reference
4
+
5
+ This reference covers Phase 2 of the design system build: the cover page, foundations documentation page (color swatches, type specimens, spacing bars, shadow cards, radius demo), page layout dimensions, and inline component documentation. Every code block is complete `use_figma`-ready JavaScript (helper-function form — no IIFE wrapper, no `closePlugin` — meant to be embedded in a larger script).
6
+
7
+ ---
8
+
9
+ ## 1. Cover Page
10
+
11
+ The cover page is always the first page in the file. It is a branded title card that sets context for anyone opening the file.
12
+
13
+ ### What to include
14
+
15
+ - File/system name as a large heading (48–72px)
16
+ - Version string or date
17
+ - Brief tagline (1 sentence)
18
+ - Optional: color block background using the primary brand color variable
19
+
20
+ ### Cover page dimensions
21
+
22
+ The cover frame should be **1440 × 900px** — this matches the default Figma canvas and looks correct in the page thumbnail.
23
+
24
+ ### use_figma for cover page
25
+
26
+ ```javascript
27
+ async function createCoverPage(systemName, tagline, version, primaryColorVar) {
28
+ // primaryColorVar: a Figma Variable object for the brand primary fill
29
+ const page = figma.createPage();
30
+ page.name = 'Cover';
31
+ await figma.setCurrentPageAsync(page);
32
+
33
+ await figma.loadFontAsync({ family: 'Inter', style: 'Bold' });
34
+ await figma.loadFontAsync({ family: 'Inter', style: 'Regular' });
35
+ await figma.loadFontAsync({ family: 'Inter', style: 'Medium' });
36
+
37
+ const frame = figma.createFrame();
38
+ frame.name = 'Cover';
39
+ frame.resize(1440, 900);
40
+ frame.x = 0;
41
+ frame.y = 0;
42
+ frame.layoutMode = 'VERTICAL';
43
+ frame.primaryAxisAlignItems = 'CENTER';
44
+ frame.counterAxisAlignItems = 'CENTER';
45
+ frame.itemSpacing = 16;
46
+ frame.paddingTop = 0;
47
+ frame.paddingBottom = 0;
48
+ frame.paddingLeft = 0;
49
+ frame.paddingRight = 0;
50
+
51
+ // Background: bind to primary variable if provided, else solid dark
52
+ if (primaryColorVar) {
53
+ const bgPaint = figma.variables.setBoundVariableForPaint(
54
+ { type: 'SOLID', color: { r: 0.05, g: 0.05, b: 0.05 } },
55
+ 'color',
56
+ primaryColorVar
57
+ );
58
+ frame.fills = [bgPaint];
59
+ } else {
60
+ frame.fills = [{ type: 'SOLID', color: { r: 0.06, g: 0.06, b: 0.07 } }];
61
+ }
62
+ page.appendChild(frame);
63
+
64
+ // System name heading
65
+ const title = figma.createText();
66
+ title.fontName = { family: 'Inter', style: 'Bold' };
67
+ title.characters = systemName;
68
+ title.fontSize = 64;
69
+ title.fills = [{ type: 'SOLID', color: { r: 1, g: 1, b: 1 } }];
70
+ title.textAlignHorizontal = 'CENTER';
71
+ frame.appendChild(title);
72
+
73
+ // Tagline
74
+ const tag = figma.createText();
75
+ tag.fontName = { family: 'Inter', style: 'Regular' };
76
+ tag.characters = tagline;
77
+ tag.fontSize = 20;
78
+ tag.fills = [{ type: 'SOLID', color: { r: 1, g: 1, b: 1, a: 0.7 } }];
79
+ tag.textAlignHorizontal = 'CENTER';
80
+ frame.appendChild(tag);
81
+
82
+ // Version
83
+ const ver = figma.createText();
84
+ ver.fontName = { family: 'Inter', style: 'Medium' };
85
+ ver.characters = version;
86
+ ver.fontSize = 13;
87
+ ver.fills = [{ type: 'SOLID', color: { r: 1, g: 1, b: 1, a: 0.45 } }];
88
+ ver.textAlignHorizontal = 'CENTER';
89
+ frame.appendChild(ver);
90
+
91
+ return { page, frameId: frame.id };
92
+ }
93
+ ```
94
+
95
+ ---
96
+
97
+ ## 2. Foundations Page
98
+
99
+ The Foundations page is always placed **before any component pages**. It visually documents the design tokens — colors, typography, spacing, shadows, and border radii — so designers and engineers can see available primitives at a glance.
100
+
101
+ ### Page layout dimensions
102
+
103
+ The outer documentation frame should be **1440px wide**. Sections stack vertically with **64–100px gaps** between them. Each section frame fills the full 1440px width and hugs its content vertically.
104
+
105
+ ### Full Foundations page skeleton
106
+
107
+ ```javascript
108
+ async function createFoundationsPage() {
109
+ const page = figma.createPage();
110
+ page.name = 'Foundations';
111
+ await figma.setCurrentPageAsync(page);
112
+
113
+ await figma.loadFontAsync({ family: 'Inter', style: 'Bold' });
114
+ await figma.loadFontAsync({ family: 'Inter', style: 'Medium' });
115
+ await figma.loadFontAsync({ family: 'Inter', style: 'Regular' });
116
+
117
+ // Root scroll frame
118
+ const root = figma.createFrame();
119
+ root.name = 'Foundations';
120
+ root.layoutMode = 'VERTICAL';
121
+ root.primaryAxisAlignItems = 'MIN';
122
+ root.counterAxisAlignItems = 'MIN';
123
+ root.itemSpacing = 80;
124
+ root.paddingTop = 80;
125
+ root.paddingBottom = 120;
126
+ root.paddingLeft = 80;
127
+ root.paddingRight = 80;
128
+ root.layoutSizingHorizontal = 'FIXED';
129
+ root.layoutSizingVertical = 'HUG';
130
+ root.resize(1440, 1);
131
+ root.fills = [{ type: 'SOLID', color: { r: 1, g: 1, b: 1 } }];
132
+ page.appendChild(root);
133
+
134
+ return { page, root };
135
+ }
136
+ ```
137
+
138
+ ---
139
+
140
+ ## 3. Color Swatches (bound to variables)
141
+
142
+ Color swatches must be **bound to actual Figma variables** — never hardcode hex values in swatch fills. This keeps documentation in sync automatically when variable values change.
143
+
144
+ ### Single color swatch
145
+
146
+ ```javascript
147
+ /**
148
+ * Creates a single color swatch card (rectangle + variable name label).
149
+ * The swatch rectangle fill is bound to the provided variable.
150
+ *
151
+ * @param {FrameNode} parent - The auto-layout row to append to.
152
+ * @param {string} varName - Display name (e.g. "color/bg/primary").
153
+ * @param {Variable} variable - The Figma Variable object to bind to.
154
+ * @returns {FrameNode} The swatch frame.
155
+ */
156
+ async function createColorSwatch(parent, varName, variable) {
157
+ await figma.loadFontAsync({ family: 'Inter', style: 'Regular' });
158
+
159
+ const swatchFrame = figma.createFrame();
160
+ swatchFrame.name = `Swatch/${varName}`;
161
+ swatchFrame.layoutMode = 'VERTICAL';
162
+ swatchFrame.primaryAxisAlignItems = 'MIN';
163
+ swatchFrame.counterAxisAlignItems = 'MIN';
164
+ swatchFrame.itemSpacing = 6;
165
+ swatchFrame.layoutSizingHorizontal = 'FIXED';
166
+ swatchFrame.layoutSizingVertical = 'HUG';
167
+ swatchFrame.resize(88, 1);
168
+ swatchFrame.fills = [];
169
+
170
+ // Color rectangle — bound to variable
171
+ const rect = figma.createRectangle();
172
+ rect.resize(88, 88);
173
+ rect.cornerRadius = 8;
174
+ const paint = figma.variables.setBoundVariableForPaint(
175
+ { type: 'SOLID', color: { r: 0.5, g: 0.5, b: 0.5 } },
176
+ 'color',
177
+ variable
178
+ );
179
+ rect.fills = [paint];
180
+ swatchFrame.appendChild(rect);
181
+
182
+ // Name label
183
+ const label = figma.createText();
184
+ label.fontName = { family: 'Inter', style: 'Regular' };
185
+ label.characters = varName.split('/').pop(); // show leaf name only
186
+ label.fontSize = 10;
187
+ label.fills = [{ type: 'SOLID', color: { r: 0.35, g: 0.35, b: 0.35 } }];
188
+ label.layoutSizingHorizontal = 'FILL';
189
+ swatchFrame.appendChild(label);
190
+
191
+ // Full path tooltip label (smaller, lighter)
192
+ const pathLabel = figma.createText();
193
+ pathLabel.fontName = { family: 'Inter', style: 'Regular' };
194
+ pathLabel.characters = varName;
195
+ pathLabel.fontSize = 9;
196
+ pathLabel.fills = [{ type: 'SOLID', color: { r: 0.6, g: 0.6, b: 0.6 } }];
197
+ pathLabel.layoutSizingHorizontal = 'FILL';
198
+ swatchFrame.appendChild(pathLabel);
199
+
200
+ parent.appendChild(swatchFrame);
201
+ return swatchFrame;
202
+ }
203
+ ```
204
+
205
+ ### Color section builder (primitives row + semantic grid)
206
+
207
+ ```javascript
208
+ /**
209
+ * Creates a complete color documentation section with a section heading,
210
+ * a row of primitive swatches, and a grid of semantic swatches.
211
+ *
212
+ * @param {FrameNode} root - The root vertical stack frame.
213
+ * @param {Variable[]} primitiveVars - Variables from the Primitives collection.
214
+ * @param {Variable[]} semanticVars - Variables from the semantic Color collection.
215
+ */
216
+ async function createColorSection(root, primitiveVars, semanticVars) {
217
+ await figma.loadFontAsync({ family: 'Inter', style: 'Bold' });
218
+ await figma.loadFontAsync({ family: 'Inter', style: 'Regular' });
219
+
220
+ // Section container
221
+ const section = figma.createFrame();
222
+ section.name = 'Section/Colors';
223
+ section.layoutMode = 'VERTICAL';
224
+ section.itemSpacing = 24;
225
+ section.layoutSizingHorizontal = 'FILL';
226
+ section.layoutSizingVertical = 'HUG';
227
+ section.fills = [];
228
+ root.appendChild(section);
229
+
230
+ // Section heading
231
+ const heading = figma.createText();
232
+ heading.fontName = { family: 'Inter', style: 'Bold' };
233
+ heading.characters = 'Colors';
234
+ heading.fontSize = 32;
235
+ heading.fills = [{ type: 'SOLID', color: { r: 0.07, g: 0.07, b: 0.07 } }];
236
+ section.appendChild(heading);
237
+
238
+ // Description
239
+ const desc = figma.createText();
240
+ desc.fontName = { family: 'Inter', style: 'Regular' };
241
+ desc.characters = 'Primitive color palette and semantic color tokens. Semantic tokens reference primitives — always use semantic tokens in components.';
242
+ desc.fontSize = 14;
243
+ desc.fills = [{ type: 'SOLID', color: { r: 0.4, g: 0.4, b: 0.4 } }];
244
+ desc.layoutSizingHorizontal = 'FILL';
245
+ section.appendChild(desc);
246
+
247
+ // Primitive swatches row
248
+ const primLabel = figma.createText();
249
+ primLabel.fontName = { family: 'Inter', style: 'Bold' };
250
+ primLabel.characters = 'Primitives';
251
+ primLabel.fontSize = 13;
252
+ primLabel.fills = [{ type: 'SOLID', color: { r: 0.55, g: 0.55, b: 0.55 } }];
253
+ section.appendChild(primLabel);
254
+
255
+ const primRow = figma.createFrame();
256
+ primRow.name = 'Primitives/Row';
257
+ primRow.layoutMode = 'HORIZONTAL';
258
+ primRow.itemSpacing = 12;
259
+ primRow.layoutSizingHorizontal = 'FILL';
260
+ primRow.layoutSizingVertical = 'HUG';
261
+ primRow.fills = [];
262
+ primRow.layoutWrap = 'WRAP';
263
+ section.appendChild(primRow);
264
+
265
+ for (const v of primitiveVars) {
266
+ await createColorSwatch(primRow, v.name, v);
267
+ }
268
+
269
+ // Semantic swatches grid
270
+ if (semanticVars.length > 0) {
271
+ const semLabel = figma.createText();
272
+ semLabel.fontName = { family: 'Inter', style: 'Bold' };
273
+ semLabel.characters = 'Semantic';
274
+ semLabel.fontSize = 13;
275
+ semLabel.fills = [{ type: 'SOLID', color: { r: 0.55, g: 0.55, b: 0.55 } }];
276
+ section.appendChild(semLabel);
277
+
278
+ const semRow = figma.createFrame();
279
+ semRow.name = 'Semantic/Row';
280
+ semRow.layoutMode = 'HORIZONTAL';
281
+ semRow.itemSpacing = 12;
282
+ semRow.layoutSizingHorizontal = 'FILL';
283
+ semRow.layoutSizingVertical = 'HUG';
284
+ semRow.fills = [];
285
+ semRow.layoutWrap = 'WRAP';
286
+ section.appendChild(semRow);
287
+
288
+ for (const v of semanticVars) {
289
+ await createColorSwatch(semRow, v.name, v);
290
+ }
291
+ }
292
+
293
+ return section;
294
+ }
295
+ ```
296
+
297
+ ---
298
+
299
+ ## 4. Type Specimens
300
+
301
+ Typography specimens show each text style rendered at its actual size with a sample string, the style name, and its specifications.
302
+
303
+ ### Single type specimen row
304
+
305
+ ```javascript
306
+ /**
307
+ * Creates a single type specimen row: style name (small label) + sample text +
308
+ * specification line (family · style · size · line-height).
309
+ *
310
+ * @param {FrameNode} parent - The parent vertical stack.
311
+ * @param {string} styleName - The text style name (e.g. "Display Large").
312
+ * @param {string} fontFamily - Font family (e.g. "Inter").
313
+ * @param {string} fontStyle - Font style (e.g. "Bold").
314
+ * @param {number} fontSize - Font size in pixels.
315
+ * @param {number} lineHeight - Line height in pixels.
316
+ * @returns {FrameNode} The specimen row frame.
317
+ */
318
+ async function createTypeSpecimen(parent, styleName, fontFamily, fontStyle, fontSize, lineHeight) {
319
+ await figma.loadFontAsync({ family: fontFamily, style: fontStyle });
320
+ await figma.loadFontAsync({ family: 'Inter', style: 'Medium' });
321
+ await figma.loadFontAsync({ family: 'Inter', style: 'Regular' });
322
+
323
+ const row = figma.createFrame();
324
+ row.name = `Type/${styleName}`;
325
+ row.layoutMode = 'VERTICAL';
326
+ row.itemSpacing = 6;
327
+ row.paddingTop = 16;
328
+ row.paddingBottom = 16;
329
+ row.layoutSizingHorizontal = 'FILL';
330
+ row.layoutSizingVertical = 'HUG';
331
+ row.fills = [];
332
+ parent.appendChild(row);
333
+
334
+ // Style name label (small, muted)
335
+ const nameText = figma.createText();
336
+ nameText.fontName = { family: 'Inter', style: 'Medium' };
337
+ nameText.characters = styleName;
338
+ nameText.fontSize = 11;
339
+ nameText.fills = [{ type: 'SOLID', color: { r: 0.55, g: 0.55, b: 0.55 } }];
340
+ nameText.layoutSizingHorizontal = 'FILL';
341
+ row.appendChild(nameText);
342
+
343
+ // Sample text rendered in the actual style
344
+ const specimen = figma.createText();
345
+ specimen.fontName = { family: fontFamily, style: fontStyle };
346
+ specimen.characters = 'The quick brown fox jumps over the lazy dog';
347
+ specimen.fontSize = fontSize;
348
+ specimen.lineHeight = { value: lineHeight, unit: 'PIXELS' };
349
+ specimen.fills = [{ type: 'SOLID', color: { r: 0.07, g: 0.07, b: 0.07 } }];
350
+ specimen.layoutSizingHorizontal = 'FILL';
351
+ row.appendChild(specimen);
352
+
353
+ // Specification line
354
+ const specs = figma.createText();
355
+ specs.fontName = { family: 'Inter', style: 'Regular' };
356
+ specs.characters = `${fontFamily} ${fontStyle} · ${fontSize}px · ${lineHeight}px line height`;
357
+ specs.fontSize = 11;
358
+ specs.fills = [{ type: 'SOLID', color: { r: 0.65, g: 0.65, b: 0.65 } }];
359
+ specs.layoutSizingHorizontal = 'FILL';
360
+ row.appendChild(specs);
361
+
362
+ // Divider line
363
+ const divider = figma.createRectangle();
364
+ divider.resize(1280, 1);
365
+ divider.fills = [{ type: 'SOLID', color: { r: 0.9, g: 0.9, b: 0.9 } }];
366
+ divider.layoutSizingHorizontal = 'FILL';
367
+ row.appendChild(divider);
368
+
369
+ return row;
370
+ }
371
+ ```
372
+
373
+ ### Typography section builder
374
+
375
+ ```javascript
376
+ /**
377
+ * Creates a complete typography documentation section.
378
+ * Pass an array of style definitions; the function renders one specimen per entry.
379
+ *
380
+ * @param {FrameNode} root - Root vertical stack.
381
+ * @param {Array<{name, family, style, size, lineHeight}>} typeStyles - Style definitions.
382
+ */
383
+ async function createTypographySection(root, typeStyles) {
384
+ await figma.loadFontAsync({ family: 'Inter', style: 'Bold' });
385
+
386
+ const section = figma.createFrame();
387
+ section.name = 'Section/Typography';
388
+ section.layoutMode = 'VERTICAL';
389
+ section.itemSpacing = 0;
390
+ section.layoutSizingHorizontal = 'FILL';
391
+ section.layoutSizingVertical = 'HUG';
392
+ section.fills = [];
393
+ root.appendChild(section);
394
+
395
+ const heading = figma.createText();
396
+ heading.fontName = { family: 'Inter', style: 'Bold' };
397
+ heading.characters = 'Typography';
398
+ heading.fontSize = 32;
399
+ heading.fills = [{ type: 'SOLID', color: { r: 0.07, g: 0.07, b: 0.07 } }];
400
+ section.appendChild(heading);
401
+
402
+ for (const ts of typeStyles) {
403
+ await createTypeSpecimen(section, ts.name, ts.family, ts.style, ts.size, ts.lineHeight);
404
+ }
405
+
406
+ return section;
407
+ }
408
+ ```
409
+
410
+ ---
411
+
412
+ ## 5. Spacing Bars
413
+
414
+ Spacing bars show each spacing token as a filled rectangle whose width equals the spacing value. Shorter bars for small values, longer bars for large values — the visual encoding is immediate.
415
+
416
+ ### Spacing bar row
417
+
418
+ ```javascript
419
+ /**
420
+ * Creates a single spacing bar: a colored rectangle sized to the spacing value,
421
+ * with a label showing name + pixel value + code syntax.
422
+ *
423
+ * @param {FrameNode} parent - Parent vertical stack.
424
+ * @param {string} name - Token name (e.g. "spacing/sm").
425
+ * @param {number} value - Spacing value in pixels.
426
+ * @param {Variable} variable - Figma Variable to bind the width to.
427
+ * @param {string} codeSyntax - CSS variable string (e.g. "var(--spacing-sm)").
428
+ */
429
+ async function createSpacingBar(parent, name, value, variable, codeSyntax) {
430
+ await figma.loadFontAsync({ family: 'Inter', style: 'Regular' });
431
+
432
+ const row = figma.createFrame();
433
+ row.name = `Spacing/${name}`;
434
+ row.layoutMode = 'HORIZONTAL';
435
+ row.counterAxisAlignItems = 'CENTER';
436
+ row.itemSpacing = 16;
437
+ row.layoutSizingHorizontal = 'FILL';
438
+ row.layoutSizingVertical = 'HUG';
439
+ row.fills = [];
440
+ parent.appendChild(row);
441
+
442
+ // The bar rectangle — width bound to spacing variable
443
+ const bar = figma.createRectangle();
444
+ bar.resize(value, 16);
445
+ bar.cornerRadius = 3;
446
+ bar.fills = [{ type: 'SOLID', color: { r: 0.22, g: 0.47, b: 0.98 } }];
447
+ // Bind width to the spacing variable so it reflects the actual token value
448
+ if (variable) {
449
+ bar.setBoundVariable('width', variable);
450
+ }
451
+ row.appendChild(bar);
452
+
453
+ // Label: "spacing/sm 8px var(--spacing-sm)"
454
+ const label = figma.createText();
455
+ label.fontName = { family: 'Inter', style: 'Regular' };
456
+ label.characters = `${name} ${value}px ${codeSyntax}`;
457
+ label.fontSize = 12;
458
+ label.fills = [{ type: 'SOLID', color: { r: 0.35, g: 0.35, b: 0.35 } }];
459
+ row.appendChild(label);
460
+
461
+ return row;
462
+ }
463
+ ```
464
+
465
+ ### Spacing section builder
466
+
467
+ ```javascript
468
+ /**
469
+ * Creates the full spacing documentation section.
470
+ *
471
+ * @param {FrameNode} root - Root vertical stack.
472
+ * @param {Array<{name, value, variable, codeSyntax}>} spacingTokens - Token definitions.
473
+ */
474
+ async function createSpacingSection(root, spacingTokens) {
475
+ await figma.loadFontAsync({ family: 'Inter', style: 'Bold' });
476
+
477
+ const section = figma.createFrame();
478
+ section.name = 'Section/Spacing';
479
+ section.layoutMode = 'VERTICAL';
480
+ section.itemSpacing = 12;
481
+ section.layoutSizingHorizontal = 'FILL';
482
+ section.layoutSizingVertical = 'HUG';
483
+ section.fills = [];
484
+ root.appendChild(section);
485
+
486
+ const heading = figma.createText();
487
+ heading.fontName = { family: 'Inter', style: 'Bold' };
488
+ heading.characters = 'Spacing';
489
+ heading.fontSize = 32;
490
+ heading.fills = [{ type: 'SOLID', color: { r: 0.07, g: 0.07, b: 0.07 } }];
491
+ section.appendChild(heading);
492
+
493
+ for (const tok of spacingTokens) {
494
+ await createSpacingBar(section, tok.name, tok.value, tok.variable, tok.codeSyntax);
495
+ }
496
+
497
+ return section;
498
+ }
499
+ ```
500
+
501
+ ---
502
+
503
+ ## 6. Shadow Cards (Elevation)
504
+
505
+ Elevation documentation shows cards with progressively stronger drop shadows, labeled with name and effect parameters.
506
+
507
+ ### Single shadow card
508
+
509
+ ```javascript
510
+ /**
511
+ * Creates a shadow card: a white rectangle with a drop shadow effect,
512
+ * labeled with the elevation name and shadow parameters.
513
+ *
514
+ * @param {FrameNode} parent - The horizontal row to append to.
515
+ * @param {string} name - Elevation name (e.g. "Shadow/Medium").
516
+ * @param {DropShadowEffect[]} effects - Array of Figma effect objects.
517
+ */
518
+ async function createShadowCard(parent, name, effects) {
519
+ await figma.loadFontAsync({ family: 'Inter', style: 'Regular' });
520
+ await figma.loadFontAsync({ family: 'Inter', style: 'Medium' });
521
+
522
+ const card = figma.createFrame();
523
+ card.name = `ShadowCard/${name}`;
524
+ card.layoutMode = 'VERTICAL';
525
+ card.primaryAxisAlignItems = 'CENTER';
526
+ card.counterAxisAlignItems = 'CENTER';
527
+ card.itemSpacing = 8;
528
+ card.paddingTop = 16;
529
+ card.paddingBottom = 16;
530
+ card.resize(120, 120);
531
+ card.cornerRadius = 8;
532
+ card.fills = [{ type: 'SOLID', color: { r: 1, g: 1, b: 1 } }];
533
+ card.effects = effects;
534
+ parent.appendChild(card);
535
+
536
+ // Elevation name
537
+ const nameLabel = figma.createText();
538
+ nameLabel.fontName = { family: 'Inter', style: 'Medium' };
539
+ nameLabel.characters = name.split('/').pop();
540
+ nameLabel.fontSize = 12;
541
+ nameLabel.textAlignHorizontal = 'CENTER';
542
+ nameLabel.fills = [{ type: 'SOLID', color: { r: 0.2, g: 0.2, b: 0.2 } }];
543
+ card.appendChild(nameLabel);
544
+
545
+ // Effect parameters as small text
546
+ if (effects.length > 0) {
547
+ const e = effects[0];
548
+ if (e.type === 'DROP_SHADOW') {
549
+ const params = figma.createText();
550
+ params.fontName = { family: 'Inter', style: 'Regular' };
551
+ params.characters = `x:${e.offset.x} y:${e.offset.y}\nblur:${e.radius}`;
552
+ params.fontSize = 10;
553
+ params.textAlignHorizontal = 'CENTER';
554
+ params.fills = [{ type: 'SOLID', color: { r: 0.55, g: 0.55, b: 0.55 } }];
555
+ card.appendChild(params);
556
+ }
557
+ }
558
+
559
+ return card;
560
+ }
561
+ ```
562
+
563
+ ### Shadow section builder
564
+
565
+ ```javascript
566
+ /**
567
+ * Creates the full elevation/shadow documentation section.
568
+ *
569
+ * @param {FrameNode} root - Root vertical stack.
570
+ * @param {Array<{name, effects}>} shadowTokens - Shadow definitions.
571
+ */
572
+ async function createShadowSection(root, shadowTokens) {
573
+ await figma.loadFontAsync({ family: 'Inter', style: 'Bold' });
574
+
575
+ const section = figma.createFrame();
576
+ section.name = 'Section/Elevation';
577
+ section.layoutMode = 'VERTICAL';
578
+ section.itemSpacing = 24;
579
+ section.layoutSizingHorizontal = 'FILL';
580
+ section.layoutSizingVertical = 'HUG';
581
+ section.fills = [];
582
+ root.appendChild(section);
583
+
584
+ const heading = figma.createText();
585
+ heading.fontName = { family: 'Inter', style: 'Bold' };
586
+ heading.characters = 'Elevation';
587
+ heading.fontSize = 32;
588
+ heading.fills = [{ type: 'SOLID', color: { r: 0.07, g: 0.07, b: 0.07 } }];
589
+ section.appendChild(heading);
590
+
591
+ // Cards row — extra top padding so shadows are visible
592
+ const row = figma.createFrame();
593
+ row.name = 'Elevation/Row';
594
+ row.layoutMode = 'HORIZONTAL';
595
+ row.itemSpacing = 32;
596
+ row.paddingTop = 24;
597
+ row.paddingBottom = 40;
598
+ row.layoutSizingHorizontal = 'FILL';
599
+ row.layoutSizingVertical = 'HUG';
600
+ row.fills = [{ type: 'SOLID', color: { r: 0.97, g: 0.97, b: 0.97 } }];
601
+ row.cornerRadius = 8;
602
+ row.paddingLeft = 24;
603
+ row.paddingRight = 24;
604
+ section.appendChild(row);
605
+
606
+ for (const tok of shadowTokens) {
607
+ await createShadowCard(row, tok.name, tok.effects);
608
+ }
609
+
610
+ return section;
611
+ }
612
+ ```
613
+
614
+ ---
615
+
616
+ ## 7. Border Radius Demo
617
+
618
+ Border radius documentation shows rectangles at each corner radius value, labeled with the token name and pixel value.
619
+
620
+ ### Single radius card
621
+
622
+ ```javascript
623
+ /**
624
+ * Creates a single border radius card: a square with corner radius applied,
625
+ * labeled with the token name and pixel value.
626
+ *
627
+ * @param {FrameNode} parent - The horizontal row to append to.
628
+ * @param {string} name - Token name (e.g. "radius/md").
629
+ * @param {number} value - Corner radius in pixels (0 for none, 9999 for full).
630
+ * @param {Variable} [variable] - Optional Figma Variable to bind corner radius.
631
+ */
632
+ async function createRadiusCard(parent, name, value, variable) {
633
+ await figma.loadFontAsync({ family: 'Inter', style: 'Regular' });
634
+ await figma.loadFontAsync({ family: 'Inter', style: 'Medium' });
635
+
636
+ const wrapper = figma.createFrame();
637
+ wrapper.name = `Radius/${name}`;
638
+ wrapper.layoutMode = 'VERTICAL';
639
+ wrapper.primaryAxisAlignItems = 'CENTER';
640
+ wrapper.counterAxisAlignItems = 'CENTER';
641
+ wrapper.itemSpacing = 8;
642
+ wrapper.fills = [];
643
+ wrapper.layoutSizingHorizontal = 'FIXED';
644
+ wrapper.layoutSizingVertical = 'HUG';
645
+ wrapper.resize(96, 1);
646
+ parent.appendChild(wrapper);
647
+
648
+ const rect = figma.createRectangle();
649
+ rect.resize(72, 72);
650
+ rect.fills = [{ type: 'SOLID', color: { r: 0.22, g: 0.47, b: 0.98, a: 0.15 } }];
651
+ rect.strokes = [{ type: 'SOLID', color: { r: 0.22, g: 0.47, b: 0.98 } }];
652
+ rect.strokeWeight = 1.5;
653
+
654
+ // Cap display value — 9999 is how Figma represents "full/pill"
655
+ const displayRadius = Math.min(value, 36);
656
+ rect.cornerRadius = displayRadius;
657
+
658
+ // Bind to variable if provided
659
+ if (variable) {
660
+ rect.setBoundVariable('cornerRadius', variable);
661
+ }
662
+ wrapper.appendChild(rect);
663
+
664
+ const nameLabel = figma.createText();
665
+ nameLabel.fontName = { family: 'Inter', style: 'Medium' };
666
+ nameLabel.characters = name.split('/').pop();
667
+ nameLabel.fontSize = 11;
668
+ nameLabel.textAlignHorizontal = 'CENTER';
669
+ nameLabel.fills = [{ type: 'SOLID', color: { r: 0.2, g: 0.2, b: 0.2 } }];
670
+ wrapper.appendChild(nameLabel);
671
+
672
+ const valueLabel = figma.createText();
673
+ valueLabel.fontName = { family: 'Inter', style: 'Regular' };
674
+ valueLabel.characters = value >= 9999 ? 'full' : `${value}px`;
675
+ valueLabel.fontSize = 10;
676
+ valueLabel.textAlignHorizontal = 'CENTER';
677
+ valueLabel.fills = [{ type: 'SOLID', color: { r: 0.55, g: 0.55, b: 0.55 } }];
678
+ wrapper.appendChild(valueLabel);
679
+
680
+ return wrapper;
681
+ }
682
+ ```
683
+
684
+ ### Radius section builder
685
+
686
+ ```javascript
687
+ /**
688
+ * Creates the full border radius documentation section.
689
+ *
690
+ * @param {FrameNode} root - Root vertical stack.
691
+ * @param {Array<{name, value, variable}>} radiusTokens - Radius token definitions.
692
+ */
693
+ async function createRadiusSection(root, radiusTokens) {
694
+ await figma.loadFontAsync({ family: 'Inter', style: 'Bold' });
695
+
696
+ const section = figma.createFrame();
697
+ section.name = 'Section/Radius';
698
+ section.layoutMode = 'VERTICAL';
699
+ section.itemSpacing = 24;
700
+ section.layoutSizingHorizontal = 'FILL';
701
+ section.layoutSizingVertical = 'HUG';
702
+ section.fills = [];
703
+ root.appendChild(section);
704
+
705
+ const heading = figma.createText();
706
+ heading.fontName = { family: 'Inter', style: 'Bold' };
707
+ heading.characters = 'Border Radius';
708
+ heading.fontSize = 32;
709
+ heading.fills = [{ type: 'SOLID', color: { r: 0.07, g: 0.07, b: 0.07 } }];
710
+ section.appendChild(heading);
711
+
712
+ const row = figma.createFrame();
713
+ row.name = 'Radius/Row';
714
+ row.layoutMode = 'HORIZONTAL';
715
+ row.itemSpacing = 24;
716
+ row.paddingTop = 24;
717
+ row.paddingBottom = 24;
718
+ row.paddingLeft = 24;
719
+ row.paddingRight = 24;
720
+ row.layoutSizingHorizontal = 'FILL';
721
+ row.layoutSizingVertical = 'HUG';
722
+ row.fills = [{ type: 'SOLID', color: { r: 0.97, g: 0.97, b: 0.97 } }];
723
+ row.cornerRadius = 8;
724
+ section.appendChild(row);
725
+
726
+ for (const tok of radiusTokens) {
727
+ await createRadiusCard(row, tok.name, tok.value, tok.variable);
728
+ }
729
+
730
+ return section;
731
+ }
732
+ ```
733
+
734
+ ---
735
+
736
+ ## 8. Documentation Alongside Components
737
+
738
+ Each component page should include a documentation frame directly on the canvas, placed to the left of the component set. This keeps docs and the component in sync without requiring a separate file.
739
+
740
+ ### Component page documentation frame
741
+
742
+ ```javascript
743
+ /**
744
+ * Creates the documentation frame for a component page: title, description,
745
+ * and usage notes, positioned at x=0 with the component set to its right.
746
+ *
747
+ * @param {PageNode} page - The component page (must already be current).
748
+ * @param {string} componentName - The component name.
749
+ * @param {string} description - What the component does and when to use it.
750
+ * @param {string[]} usageNotes - Bullet points for usage guidance.
751
+ * @returns {FrameNode} The documentation frame.
752
+ */
753
+ async function createComponentDocFrame(page, componentName, description, usageNotes) {
754
+ await figma.loadFontAsync({ family: 'Inter', style: 'Bold' });
755
+ await figma.loadFontAsync({ family: 'Inter', style: 'Regular' });
756
+
757
+ const doc = figma.createFrame();
758
+ doc.name = '_Doc';
759
+ doc.layoutMode = 'VERTICAL';
760
+ doc.itemSpacing = 16;
761
+ doc.paddingTop = 40;
762
+ doc.paddingBottom = 40;
763
+ doc.paddingLeft = 40;
764
+ doc.paddingRight = 40;
765
+ doc.layoutSizingHorizontal = 'FIXED';
766
+ doc.layoutSizingVertical = 'HUG';
767
+ doc.resize(360, 1);
768
+ doc.fills = [];
769
+ doc.x = 0;
770
+ doc.y = 0;
771
+ page.appendChild(doc);
772
+
773
+ // Component name — large heading
774
+ const title = figma.createText();
775
+ title.fontName = { family: 'Inter', style: 'Bold' };
776
+ title.characters = componentName;
777
+ title.fontSize = 28;
778
+ title.fills = [{ type: 'SOLID', color: { r: 0.07, g: 0.07, b: 0.07 } }];
779
+ title.layoutSizingHorizontal = 'FILL';
780
+ doc.appendChild(title);
781
+
782
+ // Description
783
+ const descText = figma.createText();
784
+ descText.fontName = { family: 'Inter', style: 'Regular' };
785
+ descText.characters = description;
786
+ descText.fontSize = 13;
787
+ descText.lineHeight = { value: 20, unit: 'PIXELS' };
788
+ descText.fills = [{ type: 'SOLID', color: { r: 0.35, g: 0.35, b: 0.35 } }];
789
+ descText.layoutSizingHorizontal = 'FILL';
790
+ doc.appendChild(descText);
791
+
792
+ // Divider
793
+ const divider = figma.createRectangle();
794
+ divider.resize(280, 1);
795
+ divider.fills = [{ type: 'SOLID', color: { r: 0.88, g: 0.88, b: 0.88 } }];
796
+ divider.layoutSizingHorizontal = 'FILL';
797
+ doc.appendChild(divider);
798
+
799
+ // Usage notes
800
+ if (usageNotes.length > 0) {
801
+ const usageHeading = figma.createText();
802
+ usageHeading.fontName = { family: 'Inter', style: 'Bold' };
803
+ usageHeading.characters = 'Usage';
804
+ usageHeading.fontSize = 13;
805
+ usageHeading.fills = [{ type: 'SOLID', color: { r: 0.07, g: 0.07, b: 0.07 } }];
806
+ doc.appendChild(usageHeading);
807
+
808
+ for (const note of usageNotes) {
809
+ const noteText = figma.createText();
810
+ noteText.fontName = { family: 'Inter', style: 'Regular' };
811
+ noteText.characters = `• ${note}`;
812
+ noteText.fontSize = 12;
813
+ noteText.lineHeight = { value: 18, unit: 'PIXELS' };
814
+ noteText.fills = [{ type: 'SOLID', color: { r: 0.4, g: 0.4, b: 0.4 } }];
815
+ noteText.layoutSizingHorizontal = 'FILL';
816
+ doc.appendChild(noteText);
817
+ }
818
+ }
819
+
820
+ return doc;
821
+ }
822
+ ```
823
+
824
+ ---
825
+
826
+ ## 9. Critical Rules
827
+
828
+ 1. **Bind swatches to variables** — use `setBoundVariableForPaint` for color fills, `setBoundVariable('width', ...)` for spacing bars, and `setBoundVariable('cornerRadius', ...)` for radius cards. Never hardcode values that have corresponding variables.
829
+ 2. **Foundations page comes before component pages** — always insert it between the file structure separators and the first component page.
830
+ 3. **Show both primitive and semantic layers** — if the system has a Primitives collection and a semantic Color collection, document both on the Foundations page with clear section labels.
831
+ 4. **Page frame width = 1440px** — this is the convention across Simple DS, Polaris, and Material 3. Use it unless you detect a different existing convention via `get_metadata`.
832
+ 5. **Section spacing = 64–80px** — the gap between color / typography / spacing / shadow / radius sections should be at minimum 64px so the page is scannable.
833
+ 6. **Match existing page style** — if the target file uses emoji page name prefixes or a decorative separator style, carry that through to the Foundations page name.
834
+ 7. **Include code syntax in labels** — where variables have code syntax set, display the CSS variable name in the swatch/bar label so developers can copy it directly.