@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.
- package/CHANGELOG.md +15 -0
- package/README.md +43 -9
- package/VERSION.md +3 -3
- package/bin/lib/client-config.mjs +268 -0
- package/bin/lib/menu-core.mjs +678 -33
- package/bin/skill-master-bootstrap-global.mjs +15 -1
- package/bin/skill-master-doctor.mjs +181 -0
- package/bin/skill-master-install-global-skills.mjs +30 -10
- package/bin/skill-master-menu.mjs +184 -36
- package/bin/skill-master-register-clients.mjs +43 -99
- package/dist/index.js +30 -5
- package/dist/index.js.map +1 -1
- package/docs/operations/GUIA_MULTI_COMPUTADOR.md +255 -0
- package/docs/operations/GUIA_NPM_PUBLICO.md +147 -0
- package/docs/skill-candidates/v0.0.10/cli-creator/LICENSE.txt +201 -0
- package/docs/skill-candidates/v0.0.10/cli-creator/SKILL.md +160 -0
- package/docs/skill-candidates/v0.0.10/cli-creator/agents/openai.yaml +4 -0
- package/docs/skill-candidates/v0.0.10/cli-creator/references/agent-cli-patterns.md +154 -0
- package/docs/skill-candidates/v0.0.10/developer-workstation-ops/SKILL.md +32 -0
- package/docs/skill-candidates/v0.0.10/figma/LICENSE.txt +2 -0
- package/docs/skill-candidates/v0.0.10/figma/SKILL.md +42 -0
- package/docs/skill-candidates/v0.0.10/figma/agents/openai.yaml +14 -0
- package/docs/skill-candidates/v0.0.10/figma/assets/figma-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/figma/assets/figma.png +0 -0
- package/docs/skill-candidates/v0.0.10/figma/assets/icon.svg +28 -0
- package/docs/skill-candidates/v0.0.10/figma/references/figma-mcp-config.md +35 -0
- package/docs/skill-candidates/v0.0.10/figma/references/figma-tools-and-prompts.md +34 -0
- package/docs/skill-candidates/v0.0.10/figma-code-connect-components/LICENSE.TXT +2 -0
- package/docs/skill-candidates/v0.0.10/figma-code-connect-components/SKILL.md +349 -0
- package/docs/skill-candidates/v0.0.10/figma-code-connect-components/agents/openai.yaml +14 -0
- package/docs/skill-candidates/v0.0.10/figma-code-connect-components/assets/figma-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/figma-code-connect-components/assets/figma.png +0 -0
- package/docs/skill-candidates/v0.0.10/figma-code-connect-components/assets/icon.svg +28 -0
- package/docs/skill-candidates/v0.0.10/figma-code-connect-components/references/mapping-checklist.md +7 -0
- package/docs/skill-candidates/v0.0.10/figma-code-connect-components/scripts/normalize_node_id.py +25 -0
- package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/LICENSE.TXT +2 -0
- package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/SKILL.md +537 -0
- package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/agents/openai.yaml +14 -0
- package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/assets/figma-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/assets/figma.png +0 -0
- package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/assets/icon.svg +28 -0
- package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/references/rule-template.md +15 -0
- package/docs/skill-candidates/v0.0.10/figma-create-design-system-rules/scripts/check_agents_md.sh +9 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-design/LICENSE.TXT +2 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-design/SKILL.md +341 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-design/agents/openai.yaml +14 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-design/assets/figma-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-design/assets/figma.png +0 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-design/assets/icon.svg +28 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-design/maintainers.yml +1 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/LICENSE.TXT +2 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/SKILL.md +314 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/agents/openai.yaml +14 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/assets/figma-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/assets/figma.png +0 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/assets/icon.svg +28 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/maintainers.yml +3 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/references/code-connect-setup.md +260 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/references/component-creation.md +1014 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/references/discovery-phase.md +518 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/references/documentation-creation.md +834 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/references/error-recovery.md +540 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/references/naming-conventions.md +527 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/references/token-creation.md +962 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/bindVariablesToComponent.js +110 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/cleanupOrphans.js +127 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/createComponentWithVariants.js +148 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/createDocumentationPage.js +139 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/createSemanticTokens.js +108 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/createVariableCollection.js +49 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/inspectFileStructure.js +121 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/rehydrateState.js +92 -0
- package/docs/skill-candidates/v0.0.10/figma-generate-library/scripts/validateCreation.js +83 -0
- package/docs/skill-candidates/v0.0.10/figma-implement-design/LICENSE.txt +2 -0
- package/docs/skill-candidates/v0.0.10/figma-implement-design/SKILL.md +258 -0
- package/docs/skill-candidates/v0.0.10/figma-implement-design/agents/openai.yaml +14 -0
- package/docs/skill-candidates/v0.0.10/figma-implement-design/assets/figma-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/figma-implement-design/assets/figma.png +0 -0
- package/docs/skill-candidates/v0.0.10/figma-implement-design/assets/icon.svg +28 -0
- package/docs/skill-candidates/v0.0.10/figma-use/LICENSE.TXT +2 -0
- package/docs/skill-candidates/v0.0.10/figma-use/SKILL.md +233 -0
- package/docs/skill-candidates/v0.0.10/figma-use/agents/openai.yaml +14 -0
- package/docs/skill-candidates/v0.0.10/figma-use/assets/figma-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/figma-use/assets/figma.png +0 -0
- package/docs/skill-candidates/v0.0.10/figma-use/assets/icon.svg +28 -0
- package/docs/skill-candidates/v0.0.10/figma-use/maintainers.yml +1 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/api-reference.md +301 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/common-patterns.md +512 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/component-patterns.md +488 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/effect-style-patterns.md +123 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/gotchas.md +599 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/maintainers.yml +12 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/plugin-api-patterns.md +513 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/plugin-api-standalone.d.ts +11293 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/plugin-api-standalone.index.md +441 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/text-style-patterns.md +203 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/validation-and-recovery.md +109 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/variable-patterns.md +354 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/maintainers.yml +9 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-components--creating.md +17 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-components--using.md +17 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-components.md +50 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-effect-styles.md +52 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-text-styles.md +90 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-variables--creating.md +13 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-variables--using.md +13 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds-variables.md +64 -0
- package/docs/skill-candidates/v0.0.10/figma-use/references/working-with-design-systems/wwds.md +41 -0
- package/docs/skill-candidates/v0.0.10/frontend-design/LICENSE.txt +177 -0
- package/docs/skill-candidates/v0.0.10/frontend-design/SKILL.md +55 -0
- package/docs/skill-candidates/v0.0.10/frontend-ui-ux-systems/SKILL.md +32 -0
- package/docs/skill-candidates/v0.0.10/github/SKILL.md +74 -0
- package/docs/skill-candidates/v0.0.10/github/agents/openai.yaml +6 -0
- package/docs/skill-candidates/v0.0.10/github/assets/github-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/github/assets/github.png +0 -0
- package/docs/skill-candidates/v0.0.10/image-graphic-design-rendering/SKILL.md +28 -0
- package/docs/skill-candidates/v0.0.10/language-quality-pt-en-fr-it-ru/SKILL.md +28 -0
- package/docs/skill-candidates/v0.0.10/math-physics-reasoning/SKILL.md +28 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/LICENSE.txt +202 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/SKILL.md +236 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/reference/evaluation.md +602 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/reference/mcp_best_practices.md +249 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/reference/node_mcp_server.md +970 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/reference/python_mcp_server.md +719 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/scripts/connections.py +151 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/scripts/evaluation.py +373 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/docs/skill-candidates/v0.0.10/mcp-builder/scripts/requirements.txt +2 -0
- package/docs/skill-candidates/v0.0.10/mcp-client-readiness/SKILL.md +31 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/LICENSE.txt +201 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/SKILL.md +161 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/agents/openai.yaml +14 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/assets/openai-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/assets/openai.png +0 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/references/latest-model.md +37 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/references/prompting-guide.md +244 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/references/upgrade-guide.md +181 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/scripts/fetch-codex-manual.mjs +598 -0
- package/docs/skill-candidates/v0.0.10/openai-docs/scripts/resolve-latest-model-info.js +147 -0
- package/docs/skill-candidates/v0.0.10/playwright/LICENSE.txt +201 -0
- package/docs/skill-candidates/v0.0.10/playwright/NOTICE.txt +14 -0
- package/docs/skill-candidates/v0.0.10/playwright/SKILL.md +147 -0
- package/docs/skill-candidates/v0.0.10/playwright/agents/openai.yaml +6 -0
- package/docs/skill-candidates/v0.0.10/playwright/assets/playwright-small.svg +3 -0
- package/docs/skill-candidates/v0.0.10/playwright/assets/playwright.png +0 -0
- package/docs/skill-candidates/v0.0.10/playwright/references/cli.md +116 -0
- package/docs/skill-candidates/v0.0.10/playwright/references/workflows.md +95 -0
- package/docs/skill-candidates/v0.0.10/playwright/scripts/playwright_cli.sh +25 -0
- package/docs/skill-candidates/v0.0.10/polyglot-backend-engineering/SKILL.md +32 -0
- package/docs/skill-candidates/v0.0.10/screenshot/LICENSE.txt +201 -0
- package/docs/skill-candidates/v0.0.10/screenshot/SKILL.md +267 -0
- package/docs/skill-candidates/v0.0.10/screenshot/agents/openai.yaml +6 -0
- package/docs/skill-candidates/v0.0.10/screenshot/assets/screenshot-small.svg +5 -0
- package/docs/skill-candidates/v0.0.10/screenshot/assets/screenshot.png +0 -0
- package/docs/skill-candidates/v0.0.10/screenshot/scripts/ensure_macos_permissions.sh +54 -0
- package/docs/skill-candidates/v0.0.10/screenshot/scripts/macos_display_info.swift +22 -0
- package/docs/skill-candidates/v0.0.10/screenshot/scripts/macos_permissions.swift +40 -0
- package/docs/skill-candidates/v0.0.10/screenshot/scripts/macos_window_info.swift +126 -0
- package/docs/skill-candidates/v0.0.10/screenshot/scripts/take_screenshot.ps1 +163 -0
- package/docs/skill-candidates/v0.0.10/screenshot/scripts/take_screenshot.py +585 -0
- package/docs/skill-candidates/v0.0.10/skill-master-orchestrator/SKILL.md +62 -0
- package/docs/skill-candidates/v0.0.10/skill-master-orchestrator/agents/openai.yaml +4 -0
- package/docs/skill-candidates/v0.0.10/skill-master-orchestrator/references/activation-policy.md +77 -0
- package/docs/skill-candidates/v0.0.10/skill-master-orchestrator/references/human-approval-policy.md +83 -0
- package/docs/skill-candidates/v0.0.10/skill-master-orchestrator/references/persona-dev-senior-master.md +46 -0
- package/docs/skill-candidates/v0.0.10/terminal-menu-operations/SKILL.md +30 -0
- package/docs/skill-candidates/v0.0.10/terminal-pixel-art-tui/SKILL.md +43 -0
- package/docs/skill-candidates/v0.0.10/webapp-testing/LICENSE.txt +202 -0
- package/docs/skill-candidates/v0.0.10/webapp-testing/SKILL.md +96 -0
- package/docs/skill-candidates/v0.0.10/webapp-testing/examples/console_logging.py +35 -0
- package/docs/skill-candidates/v0.0.10/webapp-testing/examples/element_discovery.py +40 -0
- package/docs/skill-candidates/v0.0.10/webapp-testing/examples/static_html_automation.py +33 -0
- package/docs/skill-candidates/v0.0.10/webapp-testing/scripts/with_server.py +106 -0
- package/docs/skill-candidates/v0.0.10/winui-app/LICENSE.txt +202 -0
- package/docs/skill-candidates/v0.0.10/winui-app/SKILL.md +94 -0
- package/docs/skill-candidates/v0.0.10/winui-app/agents/openai.yaml +5 -0
- package/docs/skill-candidates/v0.0.10/winui-app/assets/winui.png +0 -0
- package/docs/skill-candidates/v0.0.10/winui-app/config.yaml +50 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/_sections.md +96 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/accessibility-input-and-localization.md +51 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/build-run-and-launch-verification.md +72 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/community-toolkit-controls-and-helpers.md +57 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/controls-layout-and-adaptive-ui.md +84 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/foundation-environment-audit-and-remediation.md +82 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/foundation-setup-and-project-selection.md +67 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/foundation-template-first-recovery.md +62 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/foundation-winui-app-structure.md +62 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/motion-animations-and-polish.md +45 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/performance-diagnostics-and-responsiveness.md +46 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/sample-source-map.md +37 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/shell-navigation-and-windowing.md +67 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/styling-theming-materials-and-icons.md +71 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/testing-debugging-and-review-checklists.md +77 -0
- package/docs/skill-candidates/v0.0.10/winui-app/references/windows-app-sdk-lifecycle-notifications-and-deployment.md +52 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/SKILL.md +399 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/common-patterns.md +331 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/complete-examples.md +872 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/component-patterns.md +502 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/data-fetching.md +767 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/file-organization.md +502 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/loading-and-error-states.md +501 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/performance.md +406 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/routing-guide.md +364 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/styling-guide.md +428 -0
- package/docs/skill-candidates/v0.0.11/frontend-dev-guidelines/resources/typescript-standards.md +418 -0
- package/docs/skill-candidates/v0.0.11/git-version-control-ops/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/go-engineering/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/java-engineering/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/javascript-engineering/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/json-contract-design/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/multi-client-mcp-ops/SKILL.md +36 -0
- package/docs/skill-candidates/v0.0.11/nextjs/SKILL.md +745 -0
- package/docs/skill-candidates/v0.0.11/nextjs/agents/openai.yaml +3 -0
- package/docs/skill-candidates/v0.0.11/nextjs/references/app-router-files.md +94 -0
- package/docs/skill-candidates/v0.0.11/python-engineering/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/ruby-engineering/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/senior-fullstack/SKILL.md +209 -0
- package/docs/skill-candidates/v0.0.11/senior-fullstack/references/architecture_patterns.md +103 -0
- package/docs/skill-candidates/v0.0.11/senior-fullstack/references/development_workflows.md +103 -0
- package/docs/skill-candidates/v0.0.11/senior-fullstack/references/tech_stack_guide.md +103 -0
- package/docs/skill-candidates/v0.0.11/senior-fullstack/scripts/code_quality_analyzer.py +114 -0
- package/docs/skill-candidates/v0.0.11/senior-fullstack/scripts/fullstack_scaffolder.py +114 -0
- package/docs/skill-candidates/v0.0.11/senior-fullstack/scripts/project_scaffolder.py +114 -0
- package/docs/skill-candidates/v0.0.11/shadcn/SKILL.md +573 -0
- package/docs/skill-candidates/v0.0.11/shadcn/agents/openai.yaml +3 -0
- package/docs/skill-candidates/v0.0.11/sql-postgresql-engineering/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/terminal-shell-ops/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/typescript-expert/SKILL.md +429 -0
- package/docs/skill-candidates/v0.0.11/typescript-expert/references/tsconfig-strict.json +92 -0
- package/docs/skill-candidates/v0.0.11/typescript-expert/references/typescript-cheatsheet.md +383 -0
- package/docs/skill-candidates/v0.0.11/typescript-expert/references/utility-types.ts +335 -0
- package/docs/skill-candidates/v0.0.11/typescript-expert/scripts/ts_diagnostic.py +203 -0
- package/docs/skill-candidates/v0.0.11/ui-component-primitives/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/web-mobile-design-systems/SKILL.md +34 -0
- package/docs/skill-candidates/v0.0.11/windows-linux-platform-ops/SKILL.md +34 -0
- package/manifests/channels/beta.json +7 -7
- package/manifests/channels/stable.json +8 -8
- package/network/unapproved-skill-candidates.json +34 -1
- package/package.json +7 -2
- package/scripts/verify-menu-actions.mjs +115 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: figma-use
|
|
3
|
+
description: "**MANDATORY prerequisite** — you MUST invoke this skill BEFORE every `use_figma` tool call. NEVER call `use_figma` directly without loading this skill first. Skipping it causes common, hard-to-debug failures. Trigger whenever the user wants to perform a write action or a unique read action that requires JavaScript execution in the Figma file context — e.g. create/edit/delete nodes, set up variables or tokens, build components and variants, modify auto-layout or fills, bind variables to properties, or inspect file structure programmatically."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# use_figma — Figma Plugin API Skill
|
|
7
|
+
|
|
8
|
+
Use `use_figma` MCP to execute JavaScript in Figma files via the Plugin API. All detailed reference docs live in `references/`.
|
|
9
|
+
|
|
10
|
+
**Always pass `skillNames: "figma-use"` when calling `use_figma`.** This is a logging parameter used to track skill usage — it does not affect execution.
|
|
11
|
+
|
|
12
|
+
**If the task involves building or updating a full page, screen, or multi-section layout in Figma from code**, also load [figma-generate-design](../figma-generate-design/SKILL.md). It provides the workflow for discovering design system components via `search_design_system`, importing them, and assembling screens incrementally. Both skills work together: this one for the API rules, that one for the screen-building workflow.
|
|
13
|
+
|
|
14
|
+
Before anything, load [plugin-api-standalone.index.md](references/plugin-api-standalone.index.md) to understand what is possible. When you are asked to write plugin API code, use this context to grep [plugin-api-standalone.d.ts](references/plugin-api-standalone.d.ts) for relevant types, methods, and properties. This is the definitive source of truth for the API surface. It is a large typings file, so do not load it all at once, grep for relevant sections as needed.
|
|
15
|
+
|
|
16
|
+
IMPORTANT: Whenever you work with design systems, start with [working-with-design-systems/wwds.md](references/working-with-design-systems/wwds.md) to understand the key concepts, processes, and guidelines for working with design systems in Figma. Then load the more specific references for components, variables, text styles, and effect styles as needed.
|
|
17
|
+
|
|
18
|
+
## 1. Critical Rules
|
|
19
|
+
|
|
20
|
+
1. **Use `return` to send data back.** The return value is JSON-serialized automatically (objects, arrays, strings, numbers). Do NOT call `figma.closePlugin()` or wrap code in an async IIFE — this is handled for you.
|
|
21
|
+
2. **Write plain JavaScript with top-level `await` and `return`.** Code is automatically wrapped in an async context. Do NOT wrap in `(async () => { ... })()`.
|
|
22
|
+
3. `figma.notify()` **throws "not implemented"** — never use it
|
|
23
|
+
3a. `getPluginData()` / `setPluginData()` are **not supported** in `use_figma` — do not use them. Use `getSharedPluginData()` / `setSharedPluginData()` instead (these ARE supported), or track node IDs by returning them and passing them to subsequent calls.
|
|
24
|
+
4. `console.log()` is NOT returned — use `return` for output
|
|
25
|
+
5. **Work incrementally in small steps.** Break large operations into multiple `use_figma` calls. Validate after each step. This is the single most important practice for avoiding bugs.
|
|
26
|
+
6. Colors are **0–1 range** (not 0–255): `{r: 1, g: 0, b: 0}` = red
|
|
27
|
+
7. Fills/strokes are **read-only arrays** — clone, modify, reassign
|
|
28
|
+
8. Font **MUST** be loaded before any text operation: `await figma.loadFontAsync({family, style})`
|
|
29
|
+
9. **Pages load incrementally** — use `await figma.setCurrentPageAsync(page)` to switch pages and load their content (see Page Rules below)
|
|
30
|
+
10. `setBoundVariableForPaint` returns a **NEW** paint — must capture and reassign
|
|
31
|
+
11. `createVariable` accepts collection **object or ID string** (object preferred)
|
|
32
|
+
12. **`layoutSizingHorizontal/Vertical = 'FILL'` MUST be set AFTER `parent.appendChild(child)`** — setting before append throws. Same applies to `'HUG'` on non-auto-layout nodes.
|
|
33
|
+
13. **Position new top-level nodes away from (0,0).** Nodes appended directly to the page default to (0,0). Scan `figma.currentPage.children` to find a clear position (e.g., to the right of the rightmost node). This only applies to page-level nodes — nodes nested inside other frames or auto-layout containers are positioned by their parent. See [Gotchas](references/gotchas.md).
|
|
34
|
+
14. **On `use_figma` error, STOP. Do NOT immediately retry.** Failed scripts are **atomic** — if a script errors, it is not executed at all and no changes are made to the file. Read the error message carefully, fix the script, then retry. See [Error Recovery](#6-error-recovery--self-correction).
|
|
35
|
+
15. **MUST `return` ALL created/mutated node IDs.** Whenever a script creates new nodes or mutates existing ones on the canvas, collect every affected node ID and return them in a structured object (e.g. `return { createdNodeIds: [...], mutatedNodeIds: [...] }`). This is essential for subsequent calls to reference, validate, or clean up those nodes.
|
|
36
|
+
16. **Always set `variable.scopes` explicitly when creating variables.** The default `ALL_SCOPES` pollutes every property picker — almost never what you want. Use specific scopes like `["FRAME_FILL", "SHAPE_FILL"]` for backgrounds, `["TEXT_FILL"]` for text colors, `["GAP"]` for spacing, etc. See [variable-patterns.md](references/variable-patterns.md) for the full list.
|
|
37
|
+
17. **`await` every Promise.** Never leave a Promise unawaited — unawaited async calls (e.g. `figma.loadFontAsync(...)` without `await`, or `figma.setCurrentPageAsync(page)` without `await`) will fire-and-forget, causing silent failures or race conditions. The script may return before the async operation completes, leading to missing data or half-applied changes.
|
|
38
|
+
|
|
39
|
+
> For detailed WRONG/CORRECT examples of each rule, see [Gotchas & Common Mistakes](references/gotchas.md).
|
|
40
|
+
|
|
41
|
+
## 2. Page Rules (Critical)
|
|
42
|
+
|
|
43
|
+
**Page context resets between `use_figma` calls** — `figma.currentPage` starts on the first page each time.
|
|
44
|
+
|
|
45
|
+
### Switching pages
|
|
46
|
+
|
|
47
|
+
Use `await figma.setCurrentPageAsync(page)` to switch pages and load their content. The sync setter `figma.currentPage = page` **throws an error** in `use_figma` runtimes.
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
// Switch to a specific page (loads its content)
|
|
51
|
+
const targetPage = figma.root.children.find((p) => p.name === "My Page");
|
|
52
|
+
await figma.setCurrentPageAsync(targetPage);
|
|
53
|
+
// targetPage.children is now populated
|
|
54
|
+
|
|
55
|
+
// Iterate over all pages
|
|
56
|
+
for (const page of figma.root.children) {
|
|
57
|
+
await figma.setCurrentPageAsync(page);
|
|
58
|
+
// page.children is now loaded — read or modify them here
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Across script runs
|
|
63
|
+
|
|
64
|
+
`figma.currentPage` resets to the **first page** at the start of each `use_figma` call. If your workflow spans multiple calls and targets a non-default page, call `await figma.setCurrentPageAsync(page)` at the start of each invocation.
|
|
65
|
+
|
|
66
|
+
You can call `use_figma` multiple times to incrementally build on the file state, or to retrieve information before writing another script. For example, write a script to get metadata about existing nodes, `return` that data, then use it in a subsequent script to modify those nodes.
|
|
67
|
+
|
|
68
|
+
## 3. `return` Is Your Output Channel
|
|
69
|
+
|
|
70
|
+
The agent sees **ONLY** the value you `return`. Everything else is invisible.
|
|
71
|
+
|
|
72
|
+
- **Returning IDs (CRITICAL)**: Every script that creates or mutates canvas nodes **MUST** return all affected node IDs — e.g. `return { createdNodeIds: [...], mutatedNodeIds: [...] }`. This is a hard requirement, not optional.
|
|
73
|
+
- **Progress reporting**: `return { createdNodeIds: [...], count: 5, errors: [] }`
|
|
74
|
+
- **Error info**: Thrown errors are automatically captured and returned — just let them propagate or `throw` explicitly.
|
|
75
|
+
- `console.log()` output is **never** returned to the agent
|
|
76
|
+
- Always return actionable data (IDs, counts, status) so subsequent calls can reference created objects
|
|
77
|
+
|
|
78
|
+
## 4. Editor Mode
|
|
79
|
+
|
|
80
|
+
`use_figma` works in **design mode** (editorType `"figma"`, the default). FigJam (`"figjam"`) has a different set of available node types — most design nodes are blocked there.
|
|
81
|
+
|
|
82
|
+
Available in design mode: Rectangle, Frame, Component, Text, Ellipse, Star, Line, Vector, Polygon, BooleanOperation, Slice, Page, Section, TextPath.
|
|
83
|
+
|
|
84
|
+
**Blocked** in design mode: Sticky, Connector, ShapeWithText, CodeBlock, Slide, SlideRow, Webpage.
|
|
85
|
+
|
|
86
|
+
## 5. Incremental Workflow (How to Avoid Bugs)
|
|
87
|
+
|
|
88
|
+
The most common cause of bugs is trying to do too much in a single `use_figma` call. **Work in small steps and validate after each one.**
|
|
89
|
+
|
|
90
|
+
### The pattern
|
|
91
|
+
|
|
92
|
+
1. **Inspect first.** Before creating anything, run a read-only `use_figma` to discover what already exists in the file — pages, components, variables, naming conventions. Match what's there.
|
|
93
|
+
2. **Do one thing per call.** Create variables in one call, create components in the next, compose layouts in another. Don't try to build an entire screen in one script.
|
|
94
|
+
3. **Return IDs from every call.** Always `return` created node IDs, variable IDs, collection IDs as objects (e.g. `return { createdNodeIds: [...] }`). You'll need these as inputs to subsequent calls.
|
|
95
|
+
4. **Validate after each step.** Use `get_metadata` to verify structure (counts, names, hierarchy, positions). Use `get_screenshot` after major milestones to catch visual issues.
|
|
96
|
+
5. **Fix before moving on.** If validation reveals a problem, fix it before proceeding to the next step. Don't build on a broken foundation.
|
|
97
|
+
|
|
98
|
+
### Suggested step order for complex tasks
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
Step 1: Inspect file — discover existing pages, components, variables, conventions
|
|
102
|
+
Step 2: Create tokens/variables (if needed)
|
|
103
|
+
→ validate with get_metadata
|
|
104
|
+
Step 3: Create individual components
|
|
105
|
+
→ validate with get_metadata + get_screenshot
|
|
106
|
+
Step 4: Compose layouts from component instances
|
|
107
|
+
→ validate with get_screenshot
|
|
108
|
+
Step 5: Final verification
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### What to validate at each step
|
|
112
|
+
|
|
113
|
+
| After... | Check with `get_metadata` | Check with `get_screenshot` |
|
|
114
|
+
|---|---|---|
|
|
115
|
+
| Creating variables | Collection count, variable count, mode names | — |
|
|
116
|
+
| Creating components | Child count, variant names, property definitions | Variants visible, not collapsed, grid readable |
|
|
117
|
+
| Binding variables | Node properties reflect bindings | Colors/tokens resolved correctly |
|
|
118
|
+
| Composing layouts | Instance nodes have mainComponent, hierarchy correct | No cropped/clipped text, no overlapping elements, correct spacing |
|
|
119
|
+
|
|
120
|
+
## 6. Error Recovery & Self-Correction
|
|
121
|
+
|
|
122
|
+
**`use_figma` is atomic — failed scripts do not execute.** If a script errors, no changes are made to the file. The file remains in the same state as before the call. This means there are no partial nodes, no orphaned elements from the failed script, and retrying after a fix is safe.
|
|
123
|
+
|
|
124
|
+
### When `use_figma` returns an error
|
|
125
|
+
|
|
126
|
+
1. **STOP.** Do not immediately fix the code and retry.
|
|
127
|
+
2. **Read the error message carefully.** Understand exactly what went wrong — wrong API usage, missing font, invalid property value, etc.
|
|
128
|
+
3. **If the error is unclear**, call `get_metadata` or `get_screenshot` to understand the current file state.
|
|
129
|
+
4. **Fix the script** based on the error message.
|
|
130
|
+
5. **Retry** the corrected script.
|
|
131
|
+
|
|
132
|
+
### Common self-correction patterns
|
|
133
|
+
|
|
134
|
+
| Error message | Likely cause | How to fix |
|
|
135
|
+
|---|---|---|
|
|
136
|
+
| `"not implemented"` | Used `figma.notify()` | Remove it — use `return` for output |
|
|
137
|
+
| `"node must be an auto-layout frame..."` | Set `FILL`/`HUG` before appending to auto-layout parent | Move `appendChild` before `layoutSizingX = 'FILL'` |
|
|
138
|
+
| `"Setting figma.currentPage is not supported"` | Used sync page setter | Use `await figma.setCurrentPageAsync(page)` |
|
|
139
|
+
| Property value out of range | Color channel > 1 (used 0–255 instead of 0–1) | Divide by 255 |
|
|
140
|
+
| `"Cannot read properties of null"` | Node doesn't exist (wrong ID, wrong page) | Check page context, verify ID |
|
|
141
|
+
| Script hangs / no response | Infinite loop or unresolved promise | Check for `while(true)` or missing `await`; ensure code terminates |
|
|
142
|
+
| `"The node with id X does not exist"` | Parent instance was implicitly detached by a child `detachInstance()`, changing IDs | Re-discover nodes by traversal from a stable (non-instance) parent frame |
|
|
143
|
+
|
|
144
|
+
### When the script succeeds but the result looks wrong
|
|
145
|
+
|
|
146
|
+
1. Call `get_metadata` to check structural correctness (hierarchy, counts, positions).
|
|
147
|
+
2. Call `get_screenshot` to check visual correctness. Look closely for cropped/clipped text (line heights cutting off content) and overlapping elements — these are common and easy to miss.
|
|
148
|
+
3. Identify the discrepancy — is it structural (wrong hierarchy, missing nodes) or visual (wrong colors, broken layout, clipped content)?
|
|
149
|
+
4. Write a targeted fix script that modifies only the broken parts — don't recreate everything.
|
|
150
|
+
|
|
151
|
+
> For the full validation workflow, see [Validation & Error Recovery](references/validation-and-recovery.md).
|
|
152
|
+
|
|
153
|
+
## 7. Pre-Flight Checklist
|
|
154
|
+
|
|
155
|
+
Before submitting ANY `use_figma` call, verify:
|
|
156
|
+
|
|
157
|
+
- [ ] Code uses `return` to send data back (NOT `figma.closePlugin()`)
|
|
158
|
+
- [ ] Code is NOT wrapped in an async IIFE (auto-wrapped for you)
|
|
159
|
+
- [ ] `return` value includes structured data with actionable info (IDs, counts)
|
|
160
|
+
- [ ] NO usage of `figma.notify()` anywhere
|
|
161
|
+
- [ ] NO usage of `console.log()` as output (use `return` instead)
|
|
162
|
+
- [ ] All colors use 0–1 range (not 0–255)
|
|
163
|
+
- [ ] Fills/strokes are reassigned as new arrays (not mutated in place)
|
|
164
|
+
- [ ] Page switches use `await figma.setCurrentPageAsync(page)` (sync setter throws)
|
|
165
|
+
- [ ] `layoutSizingVertical/Horizontal = 'FILL'` is set AFTER `parent.appendChild(child)`
|
|
166
|
+
- [ ] `loadFontAsync()` called BEFORE any text property changes
|
|
167
|
+
- [ ] `lineHeight`/`letterSpacing` use `{unit, value}` format (not bare numbers)
|
|
168
|
+
- [ ] `resize()` is called BEFORE setting sizing modes (resize resets them to FIXED)
|
|
169
|
+
- [ ] For multi-step workflows: IDs from previous calls are passed as string literals (not variables)
|
|
170
|
+
- [ ] New top-level nodes are positioned away from (0,0) to avoid overlapping existing content
|
|
171
|
+
- [ ] ALL created/mutated node IDs are collected and included in the `return` value
|
|
172
|
+
- [ ] Every async call (`loadFontAsync`, `setCurrentPageAsync`, `importComponentByKeyAsync`, etc.) is `await`ed — no fire-and-forget Promises
|
|
173
|
+
|
|
174
|
+
## 8. Discover Conventions Before Creating
|
|
175
|
+
|
|
176
|
+
**Always inspect the Figma file before creating anything.** Different files use different naming conventions, variable structures, and component patterns. Your code should match what's already there, not impose new conventions.
|
|
177
|
+
|
|
178
|
+
When in doubt about any convention (naming, scoping, structure), check the Figma file first, then the user's codebase. Only fall back to common patterns when neither exists.
|
|
179
|
+
|
|
180
|
+
### Quick inspection scripts
|
|
181
|
+
|
|
182
|
+
**List all pages and top-level nodes:**
|
|
183
|
+
```js
|
|
184
|
+
const pages = figma.root.children.map(p => `${p.name} id=${p.id} children=${p.children.length}`);
|
|
185
|
+
return pages.join('\n');
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**List existing components across all pages:**
|
|
189
|
+
```js
|
|
190
|
+
const results = [];
|
|
191
|
+
for (const page of figma.root.children) {
|
|
192
|
+
await figma.setCurrentPageAsync(page);
|
|
193
|
+
page.findAll(n => {
|
|
194
|
+
if (n.type === 'COMPONENT' || n.type === 'COMPONENT_SET')
|
|
195
|
+
results.push(`[${page.name}] ${n.name} (${n.type}) id=${n.id}`);
|
|
196
|
+
return false;
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
return results.join('\n');
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**List existing variable collections and their conventions:**
|
|
203
|
+
```js
|
|
204
|
+
const collections = await figma.variables.getLocalVariableCollectionsAsync();
|
|
205
|
+
const results = collections.map(c => ({
|
|
206
|
+
name: c.name, id: c.id,
|
|
207
|
+
varCount: c.variableIds.length,
|
|
208
|
+
modes: c.modes.map(m => m.name)
|
|
209
|
+
}));
|
|
210
|
+
return results;
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## 9. Reference Docs
|
|
214
|
+
|
|
215
|
+
Load these as needed based on what your task involves:
|
|
216
|
+
|
|
217
|
+
| Doc | When to load | What it covers |
|
|
218
|
+
|-----|-------------|----------------|
|
|
219
|
+
| [gotchas.md](references/gotchas.md) | Before any `use_figma` | Every known pitfall with WRONG/CORRECT code examples |
|
|
220
|
+
| [common-patterns.md](references/common-patterns.md) | Need working code examples | Script scaffolds: shapes, text, auto-layout, variables, components, multi-step workflows |
|
|
221
|
+
| [plugin-api-patterns.md](references/plugin-api-patterns.md) | Creating/editing nodes | Fills, strokes, Auto Layout, effects, grouping, cloning, styles |
|
|
222
|
+
| [api-reference.md](references/api-reference.md) | Need exact API surface | Node creation, variables API, core properties, what works and what doesn't |
|
|
223
|
+
| [validation-and-recovery.md](references/validation-and-recovery.md) | Multi-step writes or error recovery | `get_metadata` vs `get_screenshot` workflow, mandatory error recovery steps |
|
|
224
|
+
| [component-patterns.md](references/component-patterns.md) | Creating components/variants | combineAsVariants, component properties, INSTANCE_SWAP, variant layout, discovering existing components, metadata traversal |
|
|
225
|
+
| [variable-patterns.md](references/variable-patterns.md) | Creating/binding variables | Collections, modes, scopes, aliasing, binding patterns, discovering existing variables |
|
|
226
|
+
| [text-style-patterns.md](references/text-style-patterns.md) | Creating/applying text styles | Type ramps, font probing, listing styles, applying styles to nodes |
|
|
227
|
+
| [effect-style-patterns.md](references/effect-style-patterns.md) | Creating/applying effect styles | Drop shadows, listing styles, applying styles to nodes |
|
|
228
|
+
| [plugin-api-standalone.index.md](references/plugin-api-standalone.index.md) | Need to understand the full API surface | Index of all types, methods, and properties in the Plugin API |
|
|
229
|
+
| [plugin-api-standalone.d.ts](references/plugin-api-standalone.d.ts) | Need exact type signatures | Full typings file — grep for specific symbols, don't load all at once |
|
|
230
|
+
|
|
231
|
+
## 10. Snippet examples
|
|
232
|
+
|
|
233
|
+
You will see snippets throughout documentation here. These snippets contain useful plugin API code that can be repurposed. Use them as is, or as starter code as you go. If there are key concepts that are best documented as generic snippets, call them out and write to disk so you can reuse in the future.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "use_figma"
|
|
3
|
+
short_description: "Load the required rules before calling use_figma"
|
|
4
|
+
icon_small: "./assets/figma-small.svg"
|
|
5
|
+
icon_large: "./assets/figma.png"
|
|
6
|
+
default_prompt: "Use $figma-use and follow its rules before making any use_figma call."
|
|
7
|
+
|
|
8
|
+
dependencies:
|
|
9
|
+
tools:
|
|
10
|
+
- type: "mcp"
|
|
11
|
+
value: "figma"
|
|
12
|
+
description: "Figma MCP server"
|
|
13
|
+
transport: "streamable_http"
|
|
14
|
+
url: "https://mcp.figma.com/mcp"
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
|
2
|
+
<path fill="currentColor" fill-rule="evenodd" d="M4.994 5.986a2.014 2.014 0 1 0 0 4.028h2.069V5.986H4.994Zm5.063-.98h.055a2.014 2.014 0 1 0 0-4.026h-2.07v4.027h2.015Zm1.697.49A2.994 2.994 0 0 0 10.112 0H4.994a2.994 2.994 0 0 0-1.642 5.498A2.99 2.99 0 0 0 2 8a2.99 2.99 0 0 0 1.352 2.503A2.99 2.99 0 0 0 2 13.007C2 14.663 3.358 16 5.008 16c1.665 0 3.035-1.349 3.035-3.02v-2.765a2.984 2.984 0 0 0 2.014.778h.055a2.994 2.994 0 0 0 1.642-5.496Zm-1.642.49h-.055a2.014 2.014 0 1 0 0 4.028h.055a2.014 2.014 0 1 0 0-4.028Zm-7.132 7.02c0-1.111.902-2.013 2.014-2.013h2.069v1.987c0 1.123-.924 2.04-2.055 2.04a2.026 2.026 0 0 1-2.028-2.013Zm4.083-8H4.994a2.014 2.014 0 1 1 0-4.026h2.069v4.027Z" clip-rule="evenodd"/>
|
|
3
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
width="400"
|
|
3
|
+
height="400"
|
|
4
|
+
viewBox="0 0 400 400"
|
|
5
|
+
fill="none"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
>
|
|
8
|
+
<path
|
|
9
|
+
d="M97.5 302.5C97.5 274.195 120.445 251.25 148.75 251.25H200V302.5C200 330.805 177.055 353.75 148.75 353.75C120.445 353.75 97.5 330.805 97.5 302.5Z"
|
|
10
|
+
fill="#0ACF83"
|
|
11
|
+
/>
|
|
12
|
+
<path
|
|
13
|
+
d="M200 200C200 171.696 222.945 148.75 251.25 148.75C279.554 148.75 302.5 171.695 302.5 200C302.5 228.305 279.554 251.25 251.25 251.25C222.945 251.25 200 228.304 200 200Z"
|
|
14
|
+
fill="#1ABCFE"
|
|
15
|
+
/>
|
|
16
|
+
<path
|
|
17
|
+
d="M97.5 200C97.5 228.305 120.445 251.25 148.75 251.25H200V148.75H148.75C120.445 148.75 97.5 171.695 97.5 200Z"
|
|
18
|
+
fill="#A259FF"
|
|
19
|
+
/>
|
|
20
|
+
<path
|
|
21
|
+
d="M200 46.25V148.75H251.25C279.555 148.75 302.5 125.805 302.5 97.5C302.5 69.1954 279.555 46.25 251.25 46.25H200Z"
|
|
22
|
+
fill="#FF7262"
|
|
23
|
+
/>
|
|
24
|
+
<path
|
|
25
|
+
d="M97.5 97.5C97.5 125.805 120.445 148.75 148.75 148.75H200V46.25L148.75 46.25C120.445 46.25 97.5 69.1954 97.5 97.5Z"
|
|
26
|
+
fill="#F24E1E"
|
|
27
|
+
/>
|
|
28
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
SKILL.md: mcp_server
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
# Figma Plugin API Reference
|
|
2
|
+
|
|
3
|
+
> Part of the [use_figma skill](../SKILL.md). What works and what doesn't in the `use_figma` environment.
|
|
4
|
+
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
- Node Creation
|
|
8
|
+
- Grouping and Boolean Operations
|
|
9
|
+
- Library Imports
|
|
10
|
+
- Variables API
|
|
11
|
+
- Core Properties
|
|
12
|
+
- Node Manipulation
|
|
13
|
+
- Descriptions and Documentation Links
|
|
14
|
+
- SVG and Images
|
|
15
|
+
- Utilities and Plugin Lifecycle
|
|
16
|
+
- Node Traversal
|
|
17
|
+
- Unsupported APIs
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Node Creation (Design Mode)
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
figma.createRectangle()
|
|
24
|
+
figma.createFrame()
|
|
25
|
+
figma.createComponent() // Creates a ComponentNode
|
|
26
|
+
figma.createText()
|
|
27
|
+
figma.createEllipse()
|
|
28
|
+
figma.createStar()
|
|
29
|
+
figma.createLine()
|
|
30
|
+
figma.createVector()
|
|
31
|
+
figma.createPolygon()
|
|
32
|
+
figma.createBooleanOperation()
|
|
33
|
+
figma.createSlice()
|
|
34
|
+
figma.createPage() // Page node can be created, but child persistence is limited in headless mode
|
|
35
|
+
figma.createSection()
|
|
36
|
+
figma.createTextPath()
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Grouping & Boolean Operations
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
figma.group(nodes, parent, index?) // Group nodes
|
|
43
|
+
figma.flatten(nodes, parent?, index?) // Flatten to vector
|
|
44
|
+
figma.union(nodes, parent?, index?) // Boolean union
|
|
45
|
+
figma.subtract(nodes, parent?, index?) // Boolean subtract
|
|
46
|
+
figma.intersect(nodes, parent?, index?) // Boolean intersect
|
|
47
|
+
figma.exclude(nodes, parent?, index?) // Boolean exclude
|
|
48
|
+
figma.combineAsVariants(components, parent?) // Combine ComponentNodes into ComponentSet (Design/Sites only)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Library Component Import
|
|
52
|
+
|
|
53
|
+
These methods import components from **team libraries** (not the same file you're working in). For components in the current file, use `use_figma` with `figma.getNodeByIdAsync()` or `findOne()`/`findAll()` to locate them directly.
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
// Import a published component from a team library by key
|
|
57
|
+
const comp = await figma.importComponentByKeyAsync("COMPONENT_KEY")
|
|
58
|
+
const instance = comp.createInstance()
|
|
59
|
+
|
|
60
|
+
// Import a published component set from a team library by key
|
|
61
|
+
const compSet = await figma.importComponentSetByKeyAsync("COMPONENT_SET_KEY")
|
|
62
|
+
const variant =
|
|
63
|
+
compSet.children.find((c) => c.type === "COMPONENT" && c.name.includes("size=md")) ||
|
|
64
|
+
compSet.defaultVariant
|
|
65
|
+
const variantInstance = variant.createInstance()
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Library Style Import (Team Libraries)
|
|
69
|
+
|
|
70
|
+
These methods import styles from **team libraries** (not the same file). For styles in the current file, use `figma.getLocalPaintStyles()`, `figma.getLocalTextStyles()`, etc.
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
// Import a published style from a team library by key
|
|
74
|
+
const style = await figma.importStyleByKeyAsync("STYLE_KEY")
|
|
75
|
+
|
|
76
|
+
// Apply the imported style to a node
|
|
77
|
+
await node.setFillStyleIdAsync(style.id) // for PaintStyle as fill
|
|
78
|
+
await node.setStrokeStyleIdAsync(style.id) // for PaintStyle as stroke
|
|
79
|
+
await node.setTextStyleIdAsync(style.id) // for TextStyle
|
|
80
|
+
await node.setEffectStyleIdAsync(style.id) // for EffectStyle
|
|
81
|
+
await node.setGridStyleIdAsync(style.id) // for GridStyle
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Library Variable Import (Team Libraries)
|
|
85
|
+
|
|
86
|
+
This imports variables from **team libraries** (not the same file). For variables in the current file, use `figma.variables.getLocalVariables()` or `figma.variables.getVariableById()`.
|
|
87
|
+
|
|
88
|
+
```js
|
|
89
|
+
// Import a published variable from a team library by key
|
|
90
|
+
const variable = await figma.variables.importVariableByKeyAsync("VARIABLE_KEY")
|
|
91
|
+
|
|
92
|
+
// Bind the imported variable to node properties
|
|
93
|
+
node.setBoundVariable("width", variable) // FLOAT variable
|
|
94
|
+
|
|
95
|
+
// Bind to fills/strokes (COLOR variable) — returns a NEW paint, must capture it
|
|
96
|
+
const newPaint = figma.variables.setBoundVariableForPaint(paintCopy, "color", variable)
|
|
97
|
+
node.fills = [newPaint]
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Variables API
|
|
101
|
+
|
|
102
|
+
```js
|
|
103
|
+
// Collections
|
|
104
|
+
const collection = figma.variables.createVariableCollection("Name")
|
|
105
|
+
collection.name // Get/set name
|
|
106
|
+
collection.modes // Array of {modeId, name} — starts with 1 mode
|
|
107
|
+
collection.addMode("Dark") // Returns new modeId string
|
|
108
|
+
collection.renameMode(modeId, "Light")
|
|
109
|
+
|
|
110
|
+
// Variables
|
|
111
|
+
const variable = figma.variables.createVariable("name", collection, "COLOR")
|
|
112
|
+
// ^ object or ID string
|
|
113
|
+
// resolvedType: "COLOR" | "FLOAT" | "STRING" | "BOOLEAN"
|
|
114
|
+
variable.setValueForMode(modeId, value)
|
|
115
|
+
|
|
116
|
+
// Scopes — controls where variable appears in property pickers
|
|
117
|
+
variable.scopes = ["FRAME_FILL", "SHAPE_FILL"] // only fill pickers
|
|
118
|
+
variable.scopes = ["TEXT_FILL"] // only text color picker
|
|
119
|
+
variable.scopes = ["STROKE_COLOR"] // only stroke picker
|
|
120
|
+
variable.scopes = [] // hidden from all pickers (use for primitives)
|
|
121
|
+
// All valid scope values:
|
|
122
|
+
// ALL_SCOPES, TEXT_CONTENT, CORNER_RADIUS, WIDTH_HEIGHT, GAP,
|
|
123
|
+
// ALL_FILLS, FRAME_FILL, SHAPE_FILL, TEXT_FILL,
|
|
124
|
+
// STROKE_COLOR, STROKE_FLOAT, EFFECT_FLOAT, EFFECT_COLOR,
|
|
125
|
+
// OPACITY, FONT_FAMILY, FONT_STYLE, FONT_WEIGHT, FONT_SIZE,
|
|
126
|
+
// LINE_HEIGHT, LETTER_SPACING, PARAGRAPH_SPACING, PARAGRAPH_INDENT
|
|
127
|
+
|
|
128
|
+
// Querying
|
|
129
|
+
figma.variables.getVariableById(id)
|
|
130
|
+
figma.variables.getLocalVariables(resolvedType?)
|
|
131
|
+
figma.variables.getVariableCollectionById(id)
|
|
132
|
+
figma.variables.getLocalVariableCollections()
|
|
133
|
+
|
|
134
|
+
// Binding variables to paints (COLOR variables)
|
|
135
|
+
const newPaint = figma.variables.setBoundVariableForPaint(paintCopy, "color", variable)
|
|
136
|
+
// ⚠️ Returns a NEW paint — must capture return value!
|
|
137
|
+
node.fills = [newPaint]
|
|
138
|
+
|
|
139
|
+
// Binding variables to effects (COLOR/FLOAT variables)
|
|
140
|
+
const newEffect = figma.variables.setBoundVariableForEffect(effectCopy, field, variable)
|
|
141
|
+
// field for shadows: "color" (COLOR), "radius" | "spread" | "offsetX" | "offsetY" (FLOAT)
|
|
142
|
+
// field for blurs: "radius" (FLOAT)
|
|
143
|
+
// ⚠️ Returns a NEW effect — must capture return value!
|
|
144
|
+
node.effects = [newEffect]
|
|
145
|
+
|
|
146
|
+
// Binding variables to layout grids (FLOAT variables)
|
|
147
|
+
const newGrid = figma.variables.setBoundVariableForLayoutGrid(gridCopy, field, variable)
|
|
148
|
+
// field: "sectionSize" | "offset" | "count" | "gutterSize"
|
|
149
|
+
// ⚠️ Returns a NEW layout grid — must capture return value!
|
|
150
|
+
node.layoutGrids = [newGrid]
|
|
151
|
+
|
|
152
|
+
// Binding variables to node properties (FLOAT/STRING/BOOLEAN)
|
|
153
|
+
// Layout & sizing (FLOAT):
|
|
154
|
+
node.setBoundVariable("width", variable)
|
|
155
|
+
node.setBoundVariable("height", variable)
|
|
156
|
+
node.setBoundVariable("minWidth", variable)
|
|
157
|
+
node.setBoundVariable("maxWidth", variable)
|
|
158
|
+
node.setBoundVariable("minHeight", variable)
|
|
159
|
+
node.setBoundVariable("maxHeight", variable)
|
|
160
|
+
node.setBoundVariable("paddingLeft", variable)
|
|
161
|
+
node.setBoundVariable("paddingRight", variable)
|
|
162
|
+
node.setBoundVariable("paddingTop", variable)
|
|
163
|
+
node.setBoundVariable("paddingBottom", variable)
|
|
164
|
+
node.setBoundVariable("itemSpacing", variable)
|
|
165
|
+
node.setBoundVariable("counterAxisSpacing", variable)
|
|
166
|
+
// Corner radii (FLOAT) — use individual corners, NOT cornerRadius:
|
|
167
|
+
node.setBoundVariable("topLeftRadius", variable)
|
|
168
|
+
node.setBoundVariable("topRightRadius", variable)
|
|
169
|
+
node.setBoundVariable("bottomLeftRadius", variable)
|
|
170
|
+
node.setBoundVariable("bottomRightRadius", variable)
|
|
171
|
+
// Other (FLOAT):
|
|
172
|
+
node.setBoundVariable("opacity", variable)
|
|
173
|
+
node.setBoundVariable("strokeWeight", variable)
|
|
174
|
+
// ⚠️ fontSize, fontWeight, lineHeight are NOT bindable via setBoundVariable
|
|
175
|
+
// — set these directly as values on text nodes
|
|
176
|
+
|
|
177
|
+
// Aliases
|
|
178
|
+
figma.variables.createVariableAlias(variable)
|
|
179
|
+
|
|
180
|
+
// Explicit modes — CRITICAL for variant components
|
|
181
|
+
node.setExplicitVariableModeForCollection(collectionId, modeId)
|
|
182
|
+
// Without this, all nodes use the default (first) mode of the collection
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Core Properties
|
|
186
|
+
|
|
187
|
+
```js
|
|
188
|
+
figma.root // DocumentNode
|
|
189
|
+
figma.currentPage // Current page (read-only in use_figma; sync setter throws)
|
|
190
|
+
figma.setCurrentPageAsync(page) // Switch page and load its content (MUST await)
|
|
191
|
+
figma.fileKey // File key string
|
|
192
|
+
figma.mixed // Mixed sentinel value
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Node Manipulation
|
|
196
|
+
|
|
197
|
+
```js
|
|
198
|
+
// Fills & Strokes (read-only arrays — must clone)
|
|
199
|
+
node.fills = [{ type: 'SOLID', color: { r: 1, g: 0, b: 0 } }]
|
|
200
|
+
node.strokes = [{ type: 'SOLID', color: { r: 0, g: 0, b: 0 } }]
|
|
201
|
+
node.strokeWeight = 1
|
|
202
|
+
node.strokeAlign = 'INSIDE' // 'INSIDE' | 'CENTER' | 'OUTSIDE'
|
|
203
|
+
|
|
204
|
+
// Effects
|
|
205
|
+
node.effects = [{ type: 'DROP_SHADOW', color: {r:0,g:0,b:0,a:0.25}, offset:{x:0,y:4}, radius:4, visible:true }]
|
|
206
|
+
|
|
207
|
+
// Layout
|
|
208
|
+
node.layoutMode = 'HORIZONTAL' // 'NONE' | 'HORIZONTAL' | 'VERTICAL'
|
|
209
|
+
node.primaryAxisAlignItems = 'CENTER' // 'MIN' | 'CENTER' | 'MAX' | 'SPACE_BETWEEN'
|
|
210
|
+
node.counterAxisAlignItems = 'CENTER' // 'MIN' | 'CENTER' | 'MAX' | 'BASELINE'
|
|
211
|
+
node.paddingLeft = 8
|
|
212
|
+
node.paddingRight = 8
|
|
213
|
+
node.paddingTop = 4
|
|
214
|
+
node.paddingBottom = 4
|
|
215
|
+
node.itemSpacing = 4
|
|
216
|
+
node.layoutSizingHorizontal = 'HUG' // 'FIXED' | 'HUG' | 'FILL'
|
|
217
|
+
node.layoutSizingVertical = 'HUG' // 'FIXED' | 'HUG' | 'FILL'
|
|
218
|
+
|
|
219
|
+
// Sizing
|
|
220
|
+
node.resize(width, height) // ⚠️ Resets sizing modes to FIXED
|
|
221
|
+
node.resizeWithoutConstraints(width, height) // Doesn't affect constraints
|
|
222
|
+
|
|
223
|
+
// Corner radius
|
|
224
|
+
node.cornerRadius = 8
|
|
225
|
+
|
|
226
|
+
// Visibility & Opacity
|
|
227
|
+
node.visible = true
|
|
228
|
+
node.opacity = 0.5
|
|
229
|
+
|
|
230
|
+
// Naming & Hierarchy
|
|
231
|
+
node.name = "My Node"
|
|
232
|
+
parent.appendChild(child)
|
|
233
|
+
parent.insertChild(index, child)
|
|
234
|
+
node.remove()
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Descriptions & Documentation Links
|
|
238
|
+
|
|
239
|
+
```js
|
|
240
|
+
// Description — plain text, shown in Figma's component panel
|
|
241
|
+
node.description = "A short summary of this component's purpose and usage."
|
|
242
|
+
|
|
243
|
+
// Documentation links — array of {uri, label} shown as clickable links
|
|
244
|
+
componentSet.documentationLinks = [
|
|
245
|
+
{ uri: "https://example.com/docs", label: "Component Docs" }
|
|
246
|
+
]
|
|
247
|
+
// ⚠️ uri MUST be a valid URL (https://...) — relative paths will throw
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## SVG Import
|
|
251
|
+
|
|
252
|
+
```js
|
|
253
|
+
const svgNode = figma.createNodeFromSvg('<svg>...</svg>')
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## Images
|
|
257
|
+
|
|
258
|
+
```js
|
|
259
|
+
const image = figma.createImage(uint8Array)
|
|
260
|
+
node.fills = [{ type: 'IMAGE', scaleMode: 'FILL', imageHash: image.hash }]
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## Utilities
|
|
264
|
+
|
|
265
|
+
```js
|
|
266
|
+
figma.base64Encode(uint8Array) // Uint8Array → base64 string
|
|
267
|
+
figma.base64Decode(base64String) // base64 string → Uint8Array
|
|
268
|
+
figma.createComponentFromNode(node) // Convert existing node to component (Design/Sites only)
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## Plugin Lifecycle
|
|
272
|
+
|
|
273
|
+
```js
|
|
274
|
+
figma.closePlugin("message") // Close and return a message to the agent (success)
|
|
275
|
+
figma.closePluginWithFailure("error msg") // Close with error — ALWAYS use in catch blocks
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## Node Traversal
|
|
279
|
+
|
|
280
|
+
```js
|
|
281
|
+
node.findAll(pred?) // Find all descendants matching predicate
|
|
282
|
+
node.findOne(pred?) // Find first descendant matching predicate
|
|
283
|
+
node.findChildren(pred?) // Find direct children matching predicate
|
|
284
|
+
node.findChild(pred?) // Find first direct child matching predicate
|
|
285
|
+
node.children // Direct children array
|
|
286
|
+
node.parent // Parent node
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## What Does NOT Work
|
|
292
|
+
|
|
293
|
+
| API | Status |
|
|
294
|
+
|-----|--------|
|
|
295
|
+
| `figma.notify()` | **Throws "not implemented"** — most common mistake |
|
|
296
|
+
| `figma.showUI()` | No-op (silently ignored) |
|
|
297
|
+
| `figma.openExternal()` | No-op (silently ignored) |
|
|
298
|
+
| `figma.listAvailableFontsAsync()` | Not implemented |
|
|
299
|
+
| `figma.loadAllPagesAsync()` | Not implemented |
|
|
300
|
+
| `figma.variables.extendLibraryCollectionByKeyAsync()` | Not implemented |
|
|
301
|
+
| `figma.teamLibrary.*` | Not implemented (requires LiveGraph) |
|