@fprad0/skill-master-mcp 0.0.8 → 0.0.10
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 +18 -0
- package/README.md +61 -8
- package/VERSION.md +3 -3
- package/bin/lib/menu-core.mjs +798 -7
- package/bin/skill-master-bootstrap-global.mjs +48 -0
- package/bin/skill-master-doctor.mjs +168 -0
- package/bin/skill-master-install-global-skills.mjs +97 -0
- package/bin/skill-master-menu.mjs +184 -36
- package/bin/skill-master-register-clients.mjs +177 -0
- package/dist/domain-router.d.ts +11 -0
- package/dist/domain-router.d.ts.map +1 -0
- package/dist/domain-router.js +79 -0
- package/dist/domain-router.js.map +1 -0
- package/dist/index.js +159 -0
- package/dist/index.js.map +1 -1
- package/dist/moral-governance.d.ts +24 -0
- package/dist/moral-governance.d.ts.map +1 -0
- package/dist/moral-governance.js +143 -0
- package/dist/moral-governance.js.map +1 -0
- package/dist/prompt-router.d.ts +4 -0
- package/dist/prompt-router.d.ts.map +1 -1
- package/dist/prompt-router.js +18 -2
- package/dist/prompt-router.js.map +1 -1
- package/docs/planning/V0_0_9_APROVACAO_CRITICA_MENSAGENS_DE_VENDA.md +85 -0
- package/docs/planning/V0_0_9_FONTES_E_CRITERIOS_DE_AUTORIDADE.md +139 -0
- package/docs/planning/V0_0_9_MATRIZ_SKILLS_MULTIDISCIPLINARES.md +105 -0
- package/docs/planning/V0_0_9_POLITICA_MORAL_CATOLICA_PARA_IA.md +181 -0
- package/docs/planning/V0_0_9_PROMPTS_EXECUCAO.md +59 -0
- package/docs/planning/V0_0_9_ROADMAP_DISCERNIMENTO_E_CONHECIMENTO_AMPLO.md +181 -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.9/ai-ethics-human-dignity/SKILL.md +32 -0
- package/docs/skill-candidates/v0.0.9/broad-domain-router/SKILL.md +41 -0
- package/docs/skill-candidates/v0.0.9/catholic-moral-discernment/SKILL.md +31 -0
- package/docs/skill-candidates/v0.0.9/engineering-systems-master/SKILL.md +31 -0
- package/docs/skill-candidates/v0.0.9/language-quality-pt-en-fr/SKILL.md +28 -0
- package/docs/skill-candidates/v0.0.9/math-science-reasoning/SKILL.md +29 -0
- package/docs/skill-candidates/v0.0.9/philosophy-sociology-discernment/SKILL.md +28 -0
- package/docs/skill-candidates/v0.0.9/professional-boundary-triage/SKILL.md +40 -0
- package/docs/skill-candidates/v0.0.9/release-ethics-gate/SKILL.md +32 -0
- package/docs/skill-candidates/v0.0.9/source-authority-reviewer/SKILL.md +31 -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 -1
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* inspectFileStructure
|
|
3
|
+
*
|
|
4
|
+
* Reads the current Figma file and returns a structural inventory:
|
|
5
|
+
* all pages (with child counts), all local variable collections (with mode
|
|
6
|
+
* names and variable counts), all component sets, all local text styles,
|
|
7
|
+
* and all local effect styles.
|
|
8
|
+
*
|
|
9
|
+
* This is a read-only discovery function — it never creates or mutates nodes.
|
|
10
|
+
* Run it at the start of Phase 0 to understand what already exists before
|
|
11
|
+
* planning any creation work.
|
|
12
|
+
*
|
|
13
|
+
* @returns {Promise<{
|
|
14
|
+
* pages: Array<{id: string, name: string, childCount: number}>,
|
|
15
|
+
* variableCollections: Array<{
|
|
16
|
+
* id: string,
|
|
17
|
+
* name: string,
|
|
18
|
+
* modes: Array<{modeId: string, name: string}>,
|
|
19
|
+
* variableCount: number,
|
|
20
|
+
* variableNames: string[]
|
|
21
|
+
* }>,
|
|
22
|
+
* componentSets: Array<{id: string, name: string, variantCount: number, pageId: string, pageName: string}>,
|
|
23
|
+
* textStyles: Array<{id: string, name: string, fontFamily: string, fontStyle: string, fontSize: number}>,
|
|
24
|
+
* effectStyles: Array<{id: string, name: string, effectCount: number}>
|
|
25
|
+
* }>}
|
|
26
|
+
*/
|
|
27
|
+
async function inspectFileStructure() {
|
|
28
|
+
const result = {
|
|
29
|
+
pages: [],
|
|
30
|
+
variableCollections: [],
|
|
31
|
+
componentSets: [],
|
|
32
|
+
textStyles: [],
|
|
33
|
+
effectStyles: [],
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// --- Pages ---
|
|
37
|
+
for (const page of figma.root.children) {
|
|
38
|
+
result.pages.push({
|
|
39
|
+
id: page.id,
|
|
40
|
+
name: page.name,
|
|
41
|
+
childCount: page.children.length,
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// --- Variable collections ---
|
|
46
|
+
const collections = figma.variables.getLocalVariableCollections()
|
|
47
|
+
for (const coll of collections) {
|
|
48
|
+
const variableNames = coll.variableIds
|
|
49
|
+
.map((id) => figma.variables.getVariableById(id))
|
|
50
|
+
.filter(Boolean)
|
|
51
|
+
.map((v) => v.name)
|
|
52
|
+
|
|
53
|
+
result.variableCollections.push({
|
|
54
|
+
id: coll.id,
|
|
55
|
+
name: coll.name,
|
|
56
|
+
modes: coll.modes.map((m) => ({ modeId: m.modeId, name: m.name })),
|
|
57
|
+
variableCount: coll.variableIds.length,
|
|
58
|
+
variableNames,
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// --- Component sets (and standalone components) ---
|
|
63
|
+
// We need to load all pages to inspect components across the whole file.
|
|
64
|
+
const originalPage = figma.currentPage
|
|
65
|
+
|
|
66
|
+
for (const page of figma.root.children) {
|
|
67
|
+
await figma.setCurrentPageAsync(page)
|
|
68
|
+
|
|
69
|
+
const componentSetsOnPage = page.findAllWithCriteria({ types: ['COMPONENT_SET'] })
|
|
70
|
+
for (const cs of componentSetsOnPage) {
|
|
71
|
+
result.componentSets.push({
|
|
72
|
+
id: cs.id,
|
|
73
|
+
name: cs.name,
|
|
74
|
+
variantCount: cs.children.length,
|
|
75
|
+
pageId: page.id,
|
|
76
|
+
pageName: page.name,
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Also capture standalone components (not inside a component set)
|
|
81
|
+
const standaloneComponents = page
|
|
82
|
+
.findAllWithCriteria({ types: ['COMPONENT'] })
|
|
83
|
+
.filter((c) => c.parent && c.parent.type !== 'COMPONENT_SET')
|
|
84
|
+
for (const comp of standaloneComponents) {
|
|
85
|
+
result.componentSets.push({
|
|
86
|
+
id: comp.id,
|
|
87
|
+
name: comp.name,
|
|
88
|
+
variantCount: 1,
|
|
89
|
+
pageId: page.id,
|
|
90
|
+
pageName: page.name,
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Restore original page
|
|
96
|
+
await figma.setCurrentPageAsync(originalPage)
|
|
97
|
+
|
|
98
|
+
// --- Text styles ---
|
|
99
|
+
const textStyles = figma.getLocalTextStyles()
|
|
100
|
+
for (const ts of textStyles) {
|
|
101
|
+
result.textStyles.push({
|
|
102
|
+
id: ts.id,
|
|
103
|
+
name: ts.name,
|
|
104
|
+
fontFamily: ts.fontName.family,
|
|
105
|
+
fontStyle: ts.fontName.style,
|
|
106
|
+
fontSize: ts.fontSize,
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// --- Effect styles ---
|
|
111
|
+
const effectStyles = figma.getLocalEffectStyles()
|
|
112
|
+
for (const es of effectStyles) {
|
|
113
|
+
result.effectStyles.push({
|
|
114
|
+
id: es.id,
|
|
115
|
+
name: es.name,
|
|
116
|
+
effectCount: es.effects.length,
|
|
117
|
+
})
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return result
|
|
121
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scans the entire Figma file for nodes tagged with dsb_* pluginData
|
|
3
|
+
* and returns a complete state map for session recovery.
|
|
4
|
+
*
|
|
5
|
+
* Use this at the start of every new session, after context truncation,
|
|
6
|
+
* or when resuming an interrupted build.
|
|
7
|
+
*
|
|
8
|
+
* @param {string} runId - The run ID to filter by (optional — if omitted, returns ALL dsb-tagged nodes)
|
|
9
|
+
* @returns {{ runId: string, taggedNodes: Object<string, {nodeId: string, type: string, name: string, phase: string}>, variableCollections: Array, variables: Array, styles: Array }}
|
|
10
|
+
*/
|
|
11
|
+
async function rehydrateState(runId) {
|
|
12
|
+
const taggedNodes = {}
|
|
13
|
+
const variableCollections = []
|
|
14
|
+
const variables = []
|
|
15
|
+
const styles = []
|
|
16
|
+
|
|
17
|
+
// Scan all pages for dsb-tagged scene nodes
|
|
18
|
+
for (const page of figma.root.children) {
|
|
19
|
+
await figma.setCurrentPageAsync(page)
|
|
20
|
+
|
|
21
|
+
// Check the page itself
|
|
22
|
+
const pageRunId = page.getPluginData('dsb_run_id')
|
|
23
|
+
const pageKey = page.getPluginData('dsb_key')
|
|
24
|
+
if (pageKey && (!runId || pageRunId === runId)) {
|
|
25
|
+
taggedNodes[pageKey] = {
|
|
26
|
+
nodeId: page.id,
|
|
27
|
+
type: page.type,
|
|
28
|
+
name: page.name,
|
|
29
|
+
phase: page.getPluginData('dsb_phase') || 'unknown',
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Scan all descendants
|
|
34
|
+
page.findAll((node) => {
|
|
35
|
+
const nodeRunId = node.getPluginData('dsb_run_id')
|
|
36
|
+
const nodeKey = node.getPluginData('dsb_key')
|
|
37
|
+
if (nodeKey && (!runId || nodeRunId === runId)) {
|
|
38
|
+
taggedNodes[nodeKey] = {
|
|
39
|
+
nodeId: node.id,
|
|
40
|
+
type: node.type,
|
|
41
|
+
name: node.name,
|
|
42
|
+
phase: node.getPluginData('dsb_phase') || 'unknown',
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return false // don't collect, just scan
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Inventory variable collections (variables don't support pluginData — use name-based lookup)
|
|
50
|
+
const collections = figma.variables.getLocalVariableCollections()
|
|
51
|
+
for (const coll of collections) {
|
|
52
|
+
variableCollections.push({
|
|
53
|
+
id: coll.id,
|
|
54
|
+
name: coll.name,
|
|
55
|
+
modes: coll.modes.map((m) => ({ modeId: m.modeId, name: m.name })),
|
|
56
|
+
variableCount: coll.variableIds.length,
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Inventory variables (name + collection for idempotency key)
|
|
61
|
+
const allVars = figma.variables.getLocalVariables()
|
|
62
|
+
for (const v of allVars) {
|
|
63
|
+
variables.push({
|
|
64
|
+
id: v.id,
|
|
65
|
+
name: v.name,
|
|
66
|
+
collectionId: v.variableCollectionId,
|
|
67
|
+
resolvedType: v.resolvedType,
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Inventory styles
|
|
72
|
+
for (const s of figma.getLocalTextStyles()) {
|
|
73
|
+
styles.push({ id: s.id, name: s.name, type: 'TEXT' })
|
|
74
|
+
}
|
|
75
|
+
for (const s of figma.getLocalEffectStyles()) {
|
|
76
|
+
styles.push({ id: s.id, name: s.name, type: 'EFFECT' })
|
|
77
|
+
}
|
|
78
|
+
for (const s of figma.getLocalPaintStyles()) {
|
|
79
|
+
styles.push({ id: s.id, name: s.name, type: 'PAINT' })
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
runId: runId || 'all',
|
|
84
|
+
taggedNodes,
|
|
85
|
+
taggedNodeCount: Object.keys(taggedNodes).length,
|
|
86
|
+
variableCollections,
|
|
87
|
+
variableCount: variables.length,
|
|
88
|
+
variables,
|
|
89
|
+
styleCount: styles.length,
|
|
90
|
+
styles,
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* validateCreation
|
|
3
|
+
*
|
|
4
|
+
* Verifies that a set of nodes exist and match expected structural properties.
|
|
5
|
+
* Designed to run immediately after a creation script to catch partial failures
|
|
6
|
+
* before proceeding to the next build phase.
|
|
7
|
+
*
|
|
8
|
+
* Each check specifies a node ID and any combination of expected properties.
|
|
9
|
+
* A check passes when all specified expectations are met; it fails (with a
|
|
10
|
+
* reason string) as soon as any expectation is violated.
|
|
11
|
+
*
|
|
12
|
+
* @param {Array<{
|
|
13
|
+
* nodeId: string,
|
|
14
|
+
* expectedChildCount?: number,
|
|
15
|
+
* expectedName?: string,
|
|
16
|
+
* expectedType?: NodeType
|
|
17
|
+
* }>} checks
|
|
18
|
+
* - `nodeId`: The Figma node ID to look up via figma.getNodeById.
|
|
19
|
+
* - `expectedChildCount`: If set, the node must have exactly this many direct children.
|
|
20
|
+
* Applies to any node with a `children` property (frames, component sets, etc.).
|
|
21
|
+
* - `expectedName`: If set, the node's `.name` must exactly match this string.
|
|
22
|
+
* - `expectedType`: If set, the node's `.type` must exactly match this string.
|
|
23
|
+
* @returns {{
|
|
24
|
+
* passed: string[],
|
|
25
|
+
* failed: Array<{nodeId: string, reason: string}>
|
|
26
|
+
* }}
|
|
27
|
+
* `passed`: Array of nodeIds that passed all checks.
|
|
28
|
+
* `failed`: Array of objects with the nodeId and a human-readable reason string.
|
|
29
|
+
*/
|
|
30
|
+
function validateCreation(checks) {
|
|
31
|
+
const passed = []
|
|
32
|
+
const failed = []
|
|
33
|
+
|
|
34
|
+
for (const check of checks) {
|
|
35
|
+
const node = figma.getNodeById(check.nodeId)
|
|
36
|
+
|
|
37
|
+
// Node must exist
|
|
38
|
+
if (!node) {
|
|
39
|
+
failed.push({
|
|
40
|
+
nodeId: check.nodeId,
|
|
41
|
+
reason: `Node not found. It may not have been created, or was deleted.`,
|
|
42
|
+
})
|
|
43
|
+
continue
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const reasons = []
|
|
47
|
+
|
|
48
|
+
// Type check
|
|
49
|
+
if (check.expectedType !== undefined && node.type !== check.expectedType) {
|
|
50
|
+
reasons.push(`type is "${node.type}", expected "${check.expectedType}"`)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Name check
|
|
54
|
+
if (check.expectedName !== undefined && node.name !== check.expectedName) {
|
|
55
|
+
reasons.push(`name is "${node.name}", expected "${check.expectedName}"`)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Child count check
|
|
59
|
+
if (check.expectedChildCount !== undefined) {
|
|
60
|
+
if (!('children' in node)) {
|
|
61
|
+
reasons.push(
|
|
62
|
+
`node type "${node.type}" does not have children, but expectedChildCount=${check.expectedChildCount} was specified`,
|
|
63
|
+
)
|
|
64
|
+
} else {
|
|
65
|
+
const actualCount = node.children.length
|
|
66
|
+
if (actualCount !== check.expectedChildCount) {
|
|
67
|
+
reasons.push(`has ${actualCount} children, expected ${check.expectedChildCount}`)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (reasons.length > 0) {
|
|
73
|
+
failed.push({
|
|
74
|
+
nodeId: check.nodeId,
|
|
75
|
+
reason: reasons.join('; '),
|
|
76
|
+
})
|
|
77
|
+
} else {
|
|
78
|
+
passed.push(check.nodeId)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return { passed, failed }
|
|
83
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Use of these Figma skills and related files ("Materials") is governed by the Figma Developer Terms (available at https://www.figma.com/legal/developer-terms/). By accessing, downloading, or using these Materials — including through automated systems or AI agents — you agree to the Figma Developer Terms.
|
|
2
|
+
These Materials are currently offered as a Beta feature. Figma may modify, suspend, or discontinue them at any time without notice.
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: figma-implement-design
|
|
3
|
+
description: Translates Figma designs into production-ready application code with 1:1 visual fidelity. Use when implementing UI code from Figma files, when user mentions "implement design", "generate code", "implement component", provides Figma URLs, or asks to build components matching Figma specs. For Figma canvas writes via `use_figma`, use `figma-use`.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Implement Design
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
This skill provides a structured workflow for translating Figma designs into production-ready code with pixel-perfect accuracy. It ensures consistent integration with the Figma MCP server, proper use of design tokens, and 1:1 visual parity with designs.
|
|
11
|
+
|
|
12
|
+
## Skill Boundaries
|
|
13
|
+
|
|
14
|
+
- Use this skill when the deliverable is code in the user's repository.
|
|
15
|
+
- If the user asks to create/edit/delete nodes inside Figma itself, switch to [figma-use](../figma-use/SKILL.md).
|
|
16
|
+
- If the user asks to build or update a full-page screen in Figma from code or a description, switch to [figma-generate-design](../figma-generate-design/SKILL.md).
|
|
17
|
+
- If the user asks only for Code Connect mappings, switch to [figma-code-connect-components](../figma-code-connect-components/SKILL.md).
|
|
18
|
+
- If the user asks to author reusable agent rules (`CLAUDE.md`/`AGENTS.md`), switch to [figma-create-design-system-rules](../figma-create-design-system-rules/SKILL.md).
|
|
19
|
+
|
|
20
|
+
## Prerequisites
|
|
21
|
+
|
|
22
|
+
- Figma MCP server must be connected and accessible
|
|
23
|
+
- User must provide a Figma URL in the format: `https://figma.com/design/:fileKey/:fileName?node-id=1-2`
|
|
24
|
+
- `:fileKey` is the file key
|
|
25
|
+
- `1-2` is the node ID (the specific component or frame to implement)
|
|
26
|
+
- **OR** when using `figma-desktop` MCP: User can select a node directly in the Figma desktop app (no URL required)
|
|
27
|
+
- Project should have an established design system or component library (preferred)
|
|
28
|
+
|
|
29
|
+
## Required Workflow
|
|
30
|
+
|
|
31
|
+
**Follow these steps in order. Do not skip steps.**
|
|
32
|
+
|
|
33
|
+
### Step 1: Get Node ID
|
|
34
|
+
|
|
35
|
+
#### Option A: Parse from Figma URL
|
|
36
|
+
|
|
37
|
+
When the user provides a Figma URL, extract the file key and node ID to pass as arguments to MCP tools.
|
|
38
|
+
|
|
39
|
+
**URL format:** `https://figma.com/design/:fileKey/:fileName?node-id=1-2`
|
|
40
|
+
|
|
41
|
+
**Extract:**
|
|
42
|
+
|
|
43
|
+
- **File key:** `:fileKey` (the segment after `/design/`)
|
|
44
|
+
- **Node ID:** `1-2` (the value of the `node-id` query parameter)
|
|
45
|
+
|
|
46
|
+
**Note:** When using the local desktop MCP (`figma-desktop`), `fileKey` is not passed as a parameter to tool calls. The server automatically uses the currently open file, so only `nodeId` is needed.
|
|
47
|
+
|
|
48
|
+
**Example:**
|
|
49
|
+
|
|
50
|
+
- URL: `https://figma.com/design/kL9xQn2VwM8pYrTb4ZcHjF/DesignSystem?node-id=42-15`
|
|
51
|
+
- File key: `kL9xQn2VwM8pYrTb4ZcHjF`
|
|
52
|
+
- Node ID: `42-15`
|
|
53
|
+
|
|
54
|
+
#### Option B: Use Current Selection from Figma Desktop App (figma-desktop MCP only)
|
|
55
|
+
|
|
56
|
+
When using the `figma-desktop` MCP and the user has NOT provided a URL, the tools automatically use the currently selected node from the open Figma file in the desktop app.
|
|
57
|
+
|
|
58
|
+
**Note:** Selection-based prompting only works with the `figma-desktop` MCP server. The remote server requires a link to a frame or layer to extract context. The user must have the Figma desktop app open with a node selected.
|
|
59
|
+
|
|
60
|
+
### Step 2: Fetch Design Context
|
|
61
|
+
|
|
62
|
+
Run `get_design_context` with the extracted file key and node ID.
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
get_design_context(fileKey=":fileKey", nodeId="1-2")
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
This provides the structured data including:
|
|
69
|
+
|
|
70
|
+
- Layout properties (Auto Layout, constraints, sizing)
|
|
71
|
+
- Typography specifications
|
|
72
|
+
- Color values and design tokens
|
|
73
|
+
- Component structure and variants
|
|
74
|
+
- Spacing and padding values
|
|
75
|
+
|
|
76
|
+
**If the response is too large or truncated:**
|
|
77
|
+
|
|
78
|
+
1. Run `get_metadata(fileKey=":fileKey", nodeId="1-2")` to get the high-level node map
|
|
79
|
+
2. Identify the specific child nodes needed from the metadata
|
|
80
|
+
3. Fetch individual child nodes with `get_design_context(fileKey=":fileKey", nodeId=":childNodeId")`
|
|
81
|
+
|
|
82
|
+
### Step 3: Capture Visual Reference
|
|
83
|
+
|
|
84
|
+
Run `get_screenshot` with the same file key and node ID for a visual reference.
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
get_screenshot(fileKey=":fileKey", nodeId="1-2")
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
This screenshot serves as the source of truth for visual validation. Keep it accessible throughout implementation.
|
|
91
|
+
|
|
92
|
+
### Step 4: Download Required Assets
|
|
93
|
+
|
|
94
|
+
Download any assets (images, icons, SVGs) returned by the Figma MCP server.
|
|
95
|
+
|
|
96
|
+
**IMPORTANT:** Follow these asset rules:
|
|
97
|
+
|
|
98
|
+
- If the Figma MCP server returns a `localhost` source for an image or SVG, use that source directly
|
|
99
|
+
- DO NOT import or add new icon packages - all assets should come from the Figma payload
|
|
100
|
+
- DO NOT use or create placeholders if a `localhost` source is provided
|
|
101
|
+
- Assets are served through the Figma MCP server's built-in assets endpoint
|
|
102
|
+
|
|
103
|
+
### Step 5: Translate to Project Conventions
|
|
104
|
+
|
|
105
|
+
Translate the Figma output into this project's framework, styles, and conventions.
|
|
106
|
+
|
|
107
|
+
**Key principles:**
|
|
108
|
+
|
|
109
|
+
- Treat the Figma MCP output (typically React + Tailwind) as a representation of design and behavior, not as final code style
|
|
110
|
+
- Replace Tailwind utility classes with the project's preferred utilities or design system tokens
|
|
111
|
+
- Reuse existing components (buttons, inputs, typography, icon wrappers) instead of duplicating functionality
|
|
112
|
+
- Use the project's color system, typography scale, and spacing tokens consistently
|
|
113
|
+
- Respect existing routing, state management, and data-fetch patterns
|
|
114
|
+
|
|
115
|
+
### Step 6: Achieve 1:1 Visual Parity
|
|
116
|
+
|
|
117
|
+
Strive for pixel-perfect visual parity with the Figma design.
|
|
118
|
+
|
|
119
|
+
**Guidelines:**
|
|
120
|
+
|
|
121
|
+
- Prioritize Figma fidelity to match designs exactly
|
|
122
|
+
- Avoid hardcoded values - use design tokens from Figma where available
|
|
123
|
+
- When conflicts arise between design system tokens and Figma specs, prefer design system tokens but adjust spacing or sizes minimally to match visuals
|
|
124
|
+
- Follow WCAG requirements for accessibility
|
|
125
|
+
- Add component documentation as needed
|
|
126
|
+
|
|
127
|
+
### Step 7: Validate Against Figma
|
|
128
|
+
|
|
129
|
+
Before marking complete, validate the final UI against the Figma screenshot.
|
|
130
|
+
|
|
131
|
+
**Validation checklist:**
|
|
132
|
+
|
|
133
|
+
- [ ] Layout matches (spacing, alignment, sizing)
|
|
134
|
+
- [ ] Typography matches (font, size, weight, line height)
|
|
135
|
+
- [ ] Colors match exactly
|
|
136
|
+
- [ ] Interactive states work as designed (hover, active, disabled)
|
|
137
|
+
- [ ] Responsive behavior follows Figma constraints
|
|
138
|
+
- [ ] Assets render correctly
|
|
139
|
+
- [ ] Accessibility standards met
|
|
140
|
+
|
|
141
|
+
## Implementation Rules
|
|
142
|
+
|
|
143
|
+
### Component Organization
|
|
144
|
+
|
|
145
|
+
- Place UI components in the project's designated design system directory
|
|
146
|
+
- Follow the project's component naming conventions
|
|
147
|
+
- Avoid inline styles unless truly necessary for dynamic values
|
|
148
|
+
|
|
149
|
+
### Design System Integration
|
|
150
|
+
|
|
151
|
+
- ALWAYS use components from the project's design system when possible
|
|
152
|
+
- Map Figma design tokens to project design tokens
|
|
153
|
+
- When a matching component exists, extend it rather than creating a new one
|
|
154
|
+
- Document any new components added to the design system
|
|
155
|
+
|
|
156
|
+
### Code Quality
|
|
157
|
+
|
|
158
|
+
- Avoid hardcoded values - extract to constants or design tokens
|
|
159
|
+
- Keep components composable and reusable
|
|
160
|
+
- Add TypeScript types for component props
|
|
161
|
+
- Include JSDoc comments for exported components
|
|
162
|
+
|
|
163
|
+
## Examples
|
|
164
|
+
|
|
165
|
+
### Example 1: Implementing a Button Component
|
|
166
|
+
|
|
167
|
+
User says: "Implement this Figma button component: https://figma.com/design/kL9xQn2VwM8pYrTb4ZcHjF/DesignSystem?node-id=42-15"
|
|
168
|
+
|
|
169
|
+
**Actions:**
|
|
170
|
+
|
|
171
|
+
1. Parse URL to extract fileKey=`kL9xQn2VwM8pYrTb4ZcHjF` and nodeId=`42-15`
|
|
172
|
+
2. Run `get_design_context(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42-15")`
|
|
173
|
+
3. Run `get_screenshot(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42-15")` for visual reference
|
|
174
|
+
4. Download any button icons from the assets endpoint
|
|
175
|
+
5. Check if project has existing button component
|
|
176
|
+
6. If yes, extend it with new variant; if no, create new component using project conventions
|
|
177
|
+
7. Map Figma colors to project design tokens (e.g., `primary-500`, `primary-hover`)
|
|
178
|
+
8. Validate against screenshot for padding, border radius, typography
|
|
179
|
+
|
|
180
|
+
**Result:** Button component matching Figma design, integrated with project design system.
|
|
181
|
+
|
|
182
|
+
### Example 2: Building a Dashboard Layout
|
|
183
|
+
|
|
184
|
+
User says: "Build this dashboard: https://figma.com/design/pR8mNv5KqXzGwY2JtCfL4D/Dashboard?node-id=10-5"
|
|
185
|
+
|
|
186
|
+
**Actions:**
|
|
187
|
+
|
|
188
|
+
1. Parse URL to extract fileKey=`pR8mNv5KqXzGwY2JtCfL4D` and nodeId=`10-5`
|
|
189
|
+
2. Run `get_metadata(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10-5")` to understand the page structure
|
|
190
|
+
3. Identify main sections from metadata (header, sidebar, content area, cards) and their child node IDs
|
|
191
|
+
4. Run `get_design_context(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId=":childNodeId")` for each major section
|
|
192
|
+
5. Run `get_screenshot(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10-5")` for the full page
|
|
193
|
+
6. Download all assets (logos, icons, charts)
|
|
194
|
+
7. Build layout using project's layout primitives
|
|
195
|
+
8. Implement each section using existing components where possible
|
|
196
|
+
9. Validate responsive behavior against Figma constraints
|
|
197
|
+
|
|
198
|
+
**Result:** Complete dashboard matching Figma design with responsive layout.
|
|
199
|
+
|
|
200
|
+
## Best Practices
|
|
201
|
+
|
|
202
|
+
### Always Start with Context
|
|
203
|
+
|
|
204
|
+
Never implement based on assumptions. Always fetch `get_design_context` and `get_screenshot` first.
|
|
205
|
+
|
|
206
|
+
### Incremental Validation
|
|
207
|
+
|
|
208
|
+
Validate frequently during implementation, not just at the end. This catches issues early.
|
|
209
|
+
|
|
210
|
+
### Document Deviations
|
|
211
|
+
|
|
212
|
+
If you must deviate from the Figma design (e.g., for accessibility or technical constraints), document why in code comments.
|
|
213
|
+
|
|
214
|
+
### Reuse Over Recreation
|
|
215
|
+
|
|
216
|
+
Always check for existing components before creating new ones. Consistency across the codebase is more important than exact Figma replication.
|
|
217
|
+
|
|
218
|
+
### Design System First
|
|
219
|
+
|
|
220
|
+
When in doubt, prefer the project's design system patterns over literal Figma translation.
|
|
221
|
+
|
|
222
|
+
## Common Issues and Solutions
|
|
223
|
+
|
|
224
|
+
### Issue: Figma output is truncated
|
|
225
|
+
|
|
226
|
+
**Cause:** The design is too complex or has too many nested layers to return in a single response.
|
|
227
|
+
**Solution:** Use `get_metadata` to get the node structure, then fetch specific nodes individually with `get_design_context`.
|
|
228
|
+
|
|
229
|
+
### Issue: Design doesn't match after implementation
|
|
230
|
+
|
|
231
|
+
**Cause:** Visual discrepancies between the implemented code and the original Figma design.
|
|
232
|
+
**Solution:** Compare side-by-side with the screenshot from Step 3. Check spacing, colors, and typography values in the design context data.
|
|
233
|
+
|
|
234
|
+
### Issue: Assets not loading
|
|
235
|
+
|
|
236
|
+
**Cause:** The Figma MCP server's assets endpoint is not accessible or the URLs are being modified.
|
|
237
|
+
**Solution:** Verify the Figma MCP server's assets endpoint is accessible. The server serves assets at `localhost` URLs. Use these directly without modification.
|
|
238
|
+
|
|
239
|
+
### Issue: Design token values differ from Figma
|
|
240
|
+
|
|
241
|
+
**Cause:** The project's design system tokens have different values than those specified in the Figma design.
|
|
242
|
+
**Solution:** When project tokens differ from Figma values, prefer project tokens for consistency but adjust spacing/sizing to maintain visual fidelity.
|
|
243
|
+
|
|
244
|
+
## Understanding Design Implementation
|
|
245
|
+
|
|
246
|
+
The Figma implementation workflow establishes a reliable process for translating designs to code:
|
|
247
|
+
|
|
248
|
+
**For designers:** Confidence that implementations will match their designs with pixel-perfect accuracy.
|
|
249
|
+
**For developers:** A structured approach that eliminates guesswork and reduces back-and-forth revisions.
|
|
250
|
+
**For teams:** Consistent, high-quality implementations that maintain design system integrity.
|
|
251
|
+
|
|
252
|
+
By following this workflow, you ensure that every Figma design is implemented with the same level of care and attention to detail.
|
|
253
|
+
|
|
254
|
+
## Additional Resources
|
|
255
|
+
|
|
256
|
+
- [Figma MCP Server Documentation](https://developers.figma.com/docs/figma-mcp-server/)
|
|
257
|
+
- [Figma MCP Server Tools and Prompts](https://developers.figma.com/docs/figma-mcp-server/tools-and-prompts/)
|
|
258
|
+
- [Figma Variables and Design Tokens](https://help.figma.com/hc/en-us/articles/15339657135383-Guide-to-variables-in-Figma)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Figma Implement Design"
|
|
3
|
+
short_description: "Turn Figma designs into production-ready code"
|
|
4
|
+
icon_small: "./assets/figma-small.svg"
|
|
5
|
+
icon_large: "./assets/figma.png"
|
|
6
|
+
default_prompt: "Use $figma-implement-design to implement this Figma design in this codebase, matching layout, states, and responsive behavior."
|
|
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>
|
|
@@ -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,2 @@
|
|
|
1
|
+
Use of these Figma skills and related files ("Materials") is governed by the Figma Developer Terms (available at https://www.figma.com/legal/developer-terms/). By accessing, downloading, or using these Materials — including through automated systems or AI agents — you agree to the Figma Developer Terms.
|
|
2
|
+
These Materials are currently offered as a Beta feature. Figma may modify, suspend, or discontinue them at any time without notice.
|