@atezer/figma-mcp-bridge 1.7.30 → 1.9.1
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 +408 -0
- package/README.md +8 -8
- package/agents/_orchestrator-protocol.md +185 -0
- package/agents/ds-auditor.md +73 -22
- package/agents/screen-builder.md +60 -22
- package/agents/token-syncer.md +63 -19
- package/dist/core/code-warnings.d.ts +38 -0
- package/dist/core/code-warnings.d.ts.map +1 -0
- package/dist/core/code-warnings.js +191 -0
- package/dist/core/code-warnings.js.map +1 -0
- package/dist/core/device-presets.d.ts +49 -0
- package/dist/core/device-presets.d.ts.map +1 -0
- package/dist/core/device-presets.js +141 -0
- package/dist/core/device-presets.js.map +1 -0
- package/dist/core/instructions.d.ts +4 -2
- package/dist/core/instructions.d.ts.map +1 -1
- package/dist/core/instructions.js +239 -29
- package/dist/core/instructions.js.map +1 -1
- package/dist/core/plugin-bridge-connector.d.ts +26 -0
- package/dist/core/plugin-bridge-connector.d.ts.map +1 -1
- package/dist/core/plugin-bridge-connector.js +18 -2
- package/dist/core/plugin-bridge-connector.js.map +1 -1
- package/dist/core/plugin-bridge-server.d.ts +16 -0
- package/dist/core/plugin-bridge-server.d.ts.map +1 -1
- package/dist/core/plugin-bridge-server.js +83 -1
- package/dist/core/plugin-bridge-server.js.map +1 -1
- package/dist/core/response-guard.d.ts +23 -0
- package/dist/core/response-guard.d.ts.map +1 -1
- package/dist/core/response-guard.js +113 -0
- package/dist/core/response-guard.js.map +1 -1
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.d.ts.map +1 -1
- package/dist/core/version.js +1 -1
- package/dist/core/version.js.map +1 -1
- package/dist/local-plugin-only.d.ts.map +1 -1
- package/dist/local-plugin-only.js +334 -101
- package/dist/local-plugin-only.js.map +1 -1
- package/f-mcp-plugin/code.js +514 -29
- package/f-mcp-plugin/ui.html +90 -14
- package/package.json +1 -1
- package/skills/SKILL_INDEX.md +13 -1
- package/skills/apply-figma-design-system/SKILL.md +37 -0
- package/skills/audit-figma-design-system/SKILL.md +38 -0
- package/skills/code-design-mapper/SKILL.md +37 -0
- package/skills/design-token-pipeline/SKILL.md +44 -0
- package/skills/figma-canvas-ops/SKILL.md +200 -243
- package/skills/fmcp-ds-audit-orchestrator/SKILL.md +205 -0
- package/skills/fmcp-intent-router/SKILL.md +574 -0
- package/skills/fmcp-screen-orchestrator/SKILL.md +166 -0
- package/skills/fmcp-screen-recipes/SKILL.md +528 -0
- package/skills/fmcp-token-sync-orchestrator/SKILL.md +198 -0
- package/skills/generate-figma-library/SKILL.md +38 -0
- package/skills/generate-figma-screen/SKILL.md +360 -6
- package/skills/implement-design/SKILL.md +32 -0
- package/skills/inspiration-intake/SKILL.md +220 -0
- package/skills/visual-qa-compare/SKILL.md +33 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Figma device frame presets — canonical dimensions used in Figma's
|
|
3
|
+
* built-in "Frame" picker (matches the iPhone/Android/iPad preset list).
|
|
4
|
+
*
|
|
5
|
+
* v1.8.1+: Used by figma_clone_screen_to_device to adapt a source
|
|
6
|
+
* screen to a target device size while preserving auto-layout and
|
|
7
|
+
* library instance bindings.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Built-in device presets — matches Figma's Frame picker as of 2025-2026.
|
|
11
|
+
* Values verified against the user-provided screenshot of Figma's frame panel.
|
|
12
|
+
*/
|
|
13
|
+
export const DEVICE_PRESETS = [
|
|
14
|
+
// ── Phone ─────────────────────────────────────────────────────────
|
|
15
|
+
{ name: "iPhone 17", width: 402, height: 874, category: "phone" },
|
|
16
|
+
{
|
|
17
|
+
name: "iPhone 16 & 17 Pro",
|
|
18
|
+
width: 402,
|
|
19
|
+
height: 874,
|
|
20
|
+
category: "phone",
|
|
21
|
+
aliases: ["iPhone 16 Pro", "iPhone 17 Pro"],
|
|
22
|
+
},
|
|
23
|
+
{ name: "iPhone 16", width: 393, height: 852, category: "phone" },
|
|
24
|
+
{
|
|
25
|
+
name: "iPhone 16 & 17 Pro Max",
|
|
26
|
+
width: 440,
|
|
27
|
+
height: 956,
|
|
28
|
+
category: "phone",
|
|
29
|
+
aliases: ["iPhone 16 Pro Max", "iPhone 17 Pro Max"],
|
|
30
|
+
},
|
|
31
|
+
{ name: "iPhone 16 Plus", width: 430, height: 932, category: "phone" },
|
|
32
|
+
{ name: "iPhone Air", width: 420, height: 912, category: "phone" },
|
|
33
|
+
{
|
|
34
|
+
name: "iPhone 14 & 15 Pro Max",
|
|
35
|
+
width: 430,
|
|
36
|
+
height: 932,
|
|
37
|
+
category: "phone",
|
|
38
|
+
aliases: ["iPhone 14 Pro Max", "iPhone 15 Pro Max"],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "iPhone 14 & 15 Pro",
|
|
42
|
+
width: 393,
|
|
43
|
+
height: 852,
|
|
44
|
+
category: "phone",
|
|
45
|
+
aliases: ["iPhone 14 Pro", "iPhone 15 Pro"],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "iPhone 13 & 14",
|
|
49
|
+
width: 390,
|
|
50
|
+
height: 844,
|
|
51
|
+
category: "phone",
|
|
52
|
+
aliases: ["iPhone 13", "iPhone 14"],
|
|
53
|
+
},
|
|
54
|
+
{ name: "iPhone 14 Plus", width: 428, height: 926, category: "phone" },
|
|
55
|
+
{ name: "Android Compact", width: 412, height: 917, category: "phone" },
|
|
56
|
+
{ name: "Android Medium", width: 700, height: 840, category: "phone" },
|
|
57
|
+
// ── Tablet ────────────────────────────────────────────────────────
|
|
58
|
+
{ name: "iPad Pro 13", width: 1024, height: 1366, category: "tablet" },
|
|
59
|
+
{ name: "iPad Pro 11", width: 834, height: 1194, category: "tablet" },
|
|
60
|
+
{ name: "iPad Mini", width: 744, height: 1133, category: "tablet" },
|
|
61
|
+
{ name: "Surface Pro 9", width: 1440, height: 960, category: "tablet" },
|
|
62
|
+
// ── Desktop ───────────────────────────────────────────────────────
|
|
63
|
+
{ name: "MacBook Pro 16", width: 1728, height: 1117, category: "desktop" },
|
|
64
|
+
{ name: "MacBook Pro 14", width: 1512, height: 982, category: "desktop" },
|
|
65
|
+
{
|
|
66
|
+
name: "Desktop",
|
|
67
|
+
width: 1440,
|
|
68
|
+
height: 1024,
|
|
69
|
+
category: "desktop",
|
|
70
|
+
aliases: ["Desktop 1440"],
|
|
71
|
+
},
|
|
72
|
+
{ name: "Desktop HD", width: 1920, height: 1080, category: "desktop" },
|
|
73
|
+
// ── Watch ─────────────────────────────────────────────────────────
|
|
74
|
+
{ name: "Apple Watch 45mm", width: 198, height: 242, category: "watch" },
|
|
75
|
+
{ name: "Apple Watch 41mm", width: 176, height: 215, category: "watch" },
|
|
76
|
+
];
|
|
77
|
+
/**
|
|
78
|
+
* Look up a device preset by name or alias (case-insensitive).
|
|
79
|
+
* Returns undefined if no match found.
|
|
80
|
+
*/
|
|
81
|
+
export function findPreset(name) {
|
|
82
|
+
if (!name)
|
|
83
|
+
return undefined;
|
|
84
|
+
const normalized = name.trim().toLowerCase();
|
|
85
|
+
// Direct name match
|
|
86
|
+
for (const preset of DEVICE_PRESETS) {
|
|
87
|
+
if (preset.name.toLowerCase() === normalized)
|
|
88
|
+
return preset;
|
|
89
|
+
}
|
|
90
|
+
// Alias match
|
|
91
|
+
for (const preset of DEVICE_PRESETS) {
|
|
92
|
+
if (preset.aliases) {
|
|
93
|
+
for (const alias of preset.aliases) {
|
|
94
|
+
if (alias.toLowerCase() === normalized)
|
|
95
|
+
return preset;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Partial match (contains substring)
|
|
100
|
+
for (const preset of DEVICE_PRESETS) {
|
|
101
|
+
if (preset.name.toLowerCase().includes(normalized))
|
|
102
|
+
return preset;
|
|
103
|
+
}
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Parse a custom device dimension string like "1200x800" or "1200×800".
|
|
108
|
+
* Returns undefined if the string is not a valid dimension pair.
|
|
109
|
+
*/
|
|
110
|
+
export function parseCustomDimension(input) {
|
|
111
|
+
if (!input)
|
|
112
|
+
return undefined;
|
|
113
|
+
const match = input.trim().match(/^(\d+)\s*[x×]\s*(\d+)$/i);
|
|
114
|
+
if (!match)
|
|
115
|
+
return undefined;
|
|
116
|
+
const width = Number.parseInt(match[1], 10);
|
|
117
|
+
const height = Number.parseInt(match[2], 10);
|
|
118
|
+
if (width < 100 || height < 100 || width > 10000 || height > 10000) {
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
return { width, height };
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Resolve a device string (name, alias, or custom "WxH") to concrete
|
|
125
|
+
* dimensions. Used by figma_clone_screen_to_device before sending the
|
|
126
|
+
* request to the plugin handler.
|
|
127
|
+
*/
|
|
128
|
+
export function resolveDevice(input) {
|
|
129
|
+
// Try preset first
|
|
130
|
+
const preset = findPreset(input);
|
|
131
|
+
if (preset) {
|
|
132
|
+
return { name: preset.name, width: preset.width, height: preset.height };
|
|
133
|
+
}
|
|
134
|
+
// Try custom dimension
|
|
135
|
+
const custom = parseCustomDimension(input);
|
|
136
|
+
if (custom) {
|
|
137
|
+
return { name: `Custom ${custom.width}×${custom.height}`, width: custom.width, height: custom.height };
|
|
138
|
+
}
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=device-presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-presets.js","sourceRoot":"","sources":["../../src/core/device-presets.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAeH;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC7C,qEAAqE;IACrE,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE;IACjE;QACC,IAAI,EAAE,oBAAo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K,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC7C,IAAI,KAAK,GAAG,GAAG,IAAI,MAAM,GAAG,GAAG,IAAI,KAAK,GAAG,KAAK,IAAI,MAAM,GAAG,KAAK,EAAE,CAAC;QACpE,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC5B,KAAa;IAEb,mBAAmB;IACnB,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;IAC1E,CAAC;IAED,uBAAuB;IACvB,MAAM,MAAM,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,IAAI,EAAE,UAAU,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;IACxG,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MCP Server Instructions — sent to AI clients during initialization.
|
|
3
|
-
* Helps Claude/Cursor distinguish F-MCP Bridge from the official Figma MCP
|
|
3
|
+
* Helps Claude/Cursor distinguish F-MCP Bridge from the official Figma MCP,
|
|
4
|
+
* teaches the context-safe workflow, and enforces design system continuity.
|
|
5
|
+
*
|
|
4
6
|
* No Node.js dependencies — safe for Cloudflare Workers.
|
|
5
7
|
*/
|
|
6
|
-
export declare const FMCP_INSTRUCTIONS = "F-MCP ATezer Bridge \u2014 Plugin-based Figma MCP server.\n\nWHAT IT IS:\nF-MCP connects directly to the Figma Plugin API via WebSocket bridge (ports 5454-5470).\nIt reads real-time state from open Figma files without needing a REST API token.\nAll F-MCP tool names start with \"figma_\" and belong to the \"figma-mcp-bridge\" MCP server.\n\nWHEN TO PREFER F-MCP BRIDGE (figma-mcp-bridge tools):\n- Reading live plugin state: variables, styles, components, document structure\n- Running Plugin API code (figma_execute) for custom queries or mutations\n- Capturing screenshots without a REST token (figma_capture_screenshot)\n- Creating/modifying nodes directly: frames, text, rectangles, groups\n- Variable CRUD (create, update, delete variables and collections)\n- Design token browsing and design-code parity checks\n- Multi-file targeting via fileKey or figmaUrl params\n- Batch export (SVG/PNG/JPG/PDF) via plugin exportAsync\n- When no Figma REST API token is available\n\nWHEN TO PREFER OFFICIAL FIGMA MCP:\n- Code Connect mappings and suggestions\n- Design system search across team libraries (search_design_system)\n- Creating new Figma files (create_new_file)\n- Running Plugin API code through official channel (use_figma)\n- Generating diagrams in FigJam (generate_diagram)\n- When official Figma Cloud API OAuth integration is needed\n\nCOEXISTENCE:\nBoth servers run simultaneously on different ports with different namespaces.\nF-MCP tools are prefixed \"figma_\" in the figma-mcp-bridge server.\nOfficial tools use their own names in separate MCP server namespaces.\nChoose based on the capability needed.";
|
|
8
|
+
export declare const FMCP_INSTRUCTIONS = "F-MCP ATezer Bridge \u2014 Plugin-based Figma MCP (WebSocket, no REST token).\nTool namespace: \"figma_*\". Server name: \"figma-mcp-bridge\".\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nINTENT ROUTER ENTRY (ALWAYS FIRST \u2014 v1.8.1+)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n\nBEFORE executing ANY figma_* write tool (figma_execute, figma_create_*,\nfigma_update_*, figma_clone_*, figma_instantiate_*, figma_set_*, etc.),\nyou MUST follow the Intent Router protocol:\n\nStep 1 \u2014 Load router skill\n Read skills/fmcp-intent-router/SKILL.md for the routing logic.\n\nStep 2 \u2014 Check state files\n - .claude/design-systems/active-ds.md\n - .claude/design-systems/last-intent.md\n - .claude/design-systems/intent-history.md\n\nStep 3 \u2014 Decide target skill\n Map user request to ONE of the 8 entry-point skills:\n generate-figma-screen, apply-figma-design-system,\n audit-figma-design-system, generate-figma-library,\n implement-design, code-design-mapper, visual-qa-compare,\n design-token-pipeline.\n If ambiguous, ask the user with AskUserQuestion.\n\nStep 4 \u2014 Read target skill's required_inputs metadata\n Parse the YAML frontmatter block \"required_inputs\".\n\nStep 5 \u2014 Gather missing inputs (smart skipping)\n Apply in order:\n (a) Use value from last-intent.md if default_source matches\n (b) Use parsed value from user's original request\n (c) Apply skip_if conditions (e.g., reference_benchmark given \u2192 skip\n screen_type, sections)\n (d) Ask ONE AskUserQuestion with max 4 remaining inputs\n (e) If 5+ still needed, do a second AskUserQuestion\n\nStep 6 \u2014 Summary + explicit confirmation (separate AskUserQuestion)\n Show ALL gathered inputs + approach summary + estimated outcome.\n Options: [\u2705 Evet ba\u015Fla] [\u270F\uFE0F De\u011Fi\u015Ftir] [\u274C \u0130ptal]\n DO NOT proceed without explicit confirmation.\n\nStep 7 \u2014 Execute target skill\n Run the target skill's own Step 0-N (DS check, work, self-audit).\n\nStep 8 \u2014 Persist outcome\n Update .claude/design-systems/last-intent.md\n Prepend entry to .claude/design-systems/intent-history.md (LRU 5)\n\nFAST PATH: If the user's request contains all required inputs\n(e.g., \"clone 139:3407 to iPhone 17 with SUI\"), skip Step 5.\nGo directly to Step 6 (confirmation), then Step 7.\n\nREPEAT PATH: If last-intent.md matches the new request, ask a\nsingle question: \"\u00D6ncekiyle ayn\u0131 m\u0131 devam edeyim?\"\nOptions: [\u2705 Ayn\u0131] [\u270F\uFE0F De\u011Fi\u015Ftir] [\u274C \u0130ptal]\n\nFORBIDDEN:\n- DO NOT skip Step 6 (explicit confirmation gate)\n- DO NOT assume default values when input is required\n- DO NOT execute figma_execute / figma_create_* without routing\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nCLONE vs BUILD DECISION (v1.8.2+ \u2014 CRITICAL)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n\nfigma_clone_screen_to_device is a NARROW-USE tool. Use it ONLY when:\n \u2022 Same design system\n \u2022 Same layout structure\n \u2022 Only the screen size changes (e.g. iPhone 13 \u2192 iPhone 17 migration)\n\nFor ALL of these cases, use figma_execute with build-from-scratch pattern\n(generate-figma-screen SKILL Step 4-5 \u2014 search_assets \u2192 instantiate_component\n\u2192 setBoundVariable \u2192 auto-layout FILL):\n\n \"3 alternatif tasar\u0131m yap\" \u2192 build, NOT clone\n \"Hero Card varyasyonu\" \u2192 build, NOT clone\n \"Farkl\u0131 layout\" \u2192 build, NOT clone\n \"Yeni ekran tasarla\" \u2192 build, NOT clone\n \"Bu ekran\u0131 daha iyi yap\" \u2192 build, NOT clone\n \"Benchmark'tan ilham al\" \u2192 build (benchmark = inspiration only)\n \"Redesign\" / \"iyile\u015Ftir\" \u2192 build, NOT clone\n\nRULE: If the user says ANY of {alternatif, varyasyon, farkl\u0131, yeni,\ntasarla, iyile\u015Ftir, redesign}, DO NOT suggest figma_clone_screen_to_device.\nDefault to build-from-scratch via figma_execute + Step 4-5 pattern.\n\nBenchmark is ALWAYS inspiration, never a copy source for alternatives.\nClone copies the benchmark's existing mistakes (hardcoded rectangles,\nmissing token bindings, non-responsive layouts) into the new screen.\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nTOOL FAILURE RECOVERY (v1.8.2+)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n\nIf a tool call fails (timeout, error, unexpected result):\n\n1. Retry ONCE with different parameters (smaller scope, different device,\n chunked code, lower minScore, etc.)\n2. If second failure: STOP. Do orphan cleanup. Report to user.\n3. NEVER retry same tool + same params 3+ times (infinite loop).\n4. After any write-tool failure: check for orphan nodes with\n figma_get_file_data. List them to the user. Delete only with consent.\n\nMulti-output turn budget:\n- Each alternative/output = separate turn\n- Max 90s per turn (hard limit)\n- Max 2 failed tool calls per turn\n- If budget exhausted \u2192 Turn FAILED \u2192 orphan cleanup \u2192 user checkpoint\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nCONTEXT-SAFE PROTOCOL (REQUIRED for Claude chat \u2014 v1.8.0+)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n\nTool responses are expensive. Follow this order, prefer the cheapest\nverbosity that answers the question, and reuse cached results.\n\nStep 1 \u2014 Plugin discovery\n figma_get_status()\n figma_list_connected_files() (only if multi-file)\n\nStep 2 \u2014 Structural overview (cheap, cached 60s)\n figma_get_file_data(depth=1, verbosity=\"summary\")\n or figma_get_design_system_summary()\n\nStep 3 \u2014 Target ONE node with the lowest verbosity that answers the\nquestion. All read tools are cached for 60s within a session:\n \u2022 identity only \u2192 depth=0, verbosity=\"summary\"\n \u2022 text + structure \u2192 depth=1, verbosity=\"summary\" \u2190 new default\n \u2022 layout/visual detail \u2192 depth=1, verbosity=\"standard\"\n \u2022 everything \u2192 depth=2, verbosity=\"full\"\n Do NOT call verbosity=\"full\" on the document root.\n\nStep 4 \u2014 Screenshots only when visual confirmation is needed.\n v1.8.0 defaults: JPG, scale=1, jpegQuality=70 (~80% smaller than\n PNG@2x). Use PNG scale=2 only when pixel-perfect asset export is\n required.\n\nStep 5 \u2014 Caching: within a session, repeated identical read calls\n return instantly from cache. Pass debug=true on a tool to bypass\n the cache and include _responseGuard/_metrics fields.\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nTOOL SELECTION (F-MCP Bridge vs Official Figma MCP)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n\nIf figma_get_status() returns ready=true, the F-MCP plugin is\nconnected to a specific file. Prefer F-MCP Bridge tools for that\nfile \u2014 DO NOT call official Figma MCP tools that read the same file.\n\n Official Figma MCP tool \u2192 F-MCP Bridge equivalent\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n search_design_system \u2192 figma_search_assets\n + figma_get_library_variables\n + figma_get_library_components\n get_metadata \u2192 figma_get_file_data\n get_design_context \u2192 figma_get_design_context\n get_screenshot \u2192 figma_capture_screenshot\n get_variable_defs \u2192 figma_get_variables\n use_figma \u2192 figma_execute\n\nThe official search_design_system often fails with \"Resource links\nare not supported\" or \"file could not be accessed\" \u2014 fall back to\nfigma_search_assets / figma_get_library_components immediately\n(F-MCP plugin reads directly via Plugin API).\n\nWHEN TO PREFER OFFICIAL FIGMA MCP:\n- Code Connect mappings (add_code_connect_map, get_code_connect_map)\n- Creating new Figma files (create_new_file)\n- FigJam diagram generation (generate_diagram)\n- When the F-MCP plugin is NOT connected to the target file\n\nCOEXISTENCE: Both servers run simultaneously. Choose by capability.\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nDESIGN SYSTEM CONTEXT (REQUIRED for screen/component creation)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n\nWhen the user asks to create a screen, alternative design, or new\ncomponent, the FIRST step is ALWAYS to confirm which design system\nto use. NEVER create UI without a confirmed DS context.\n\nStep A \u2014 Check for an existing DS preference:\n 1. Read .claude/libraries/active-ds.md (or .fmcp-brand-profile.json)\n 2. If present and mentions a DS (e.g. \"\u2756 SUI\"), use it directly\n 3. If absent, ask the user: \"Hangi tasar\u0131m sistemi ile ilerleyelim?\n (\u00D6rn: \u2756 SUI, Material Design, Apple HIG, kendi DS'iniz)\"\n\nStep B \u2014 Once the DS is confirmed:\n 1. Persist the choice to .claude/libraries/active-ds.md so future\n turns reuse it without asking again\n 2. Load DS variable keys via figma_get_library_variables({libraryName: \"...\"})\n 3. Load DS component keys via figma_get_library_components({libraryName: \"...\"})\n 4. Cache results in .claude/libraries/<ds-name>.md for 24h\n\nStep C \u2014 Token Binding is MANDATORY:\n Every node you create must bind its visual properties to DS tokens:\n \u2022 fills/strokes \u2192 setBoundVariableForPaint(...)\n \u2022 padding/gap/radius \u2192 setBoundVariable(\"paddingLeft\", v)\n \u2022 text typography \u2192 setTextStyleIdAsync(styleId) (never\n setBoundVariable(\"fontSize\", ...))\n \u2022 effects (shadows) \u2192 setEffectStyleIdAsync(styleId)\n\n Hardcoded hex colors, pixel padding, or font sizes are FORBIDDEN\n in code that creates Figma nodes. If a token does not exist for a\n needed value, ASK the user how to proceed \u2014 do not silently\n hardcode.\n\nStep D \u2014 Component instances over hand-built shapes:\n When you need a button, input, card, or other UI element that\n exists in the DS, ALWAYS use figma_instantiate_component with the\n library componentKey. NEVER hand-build it from rectangles + text\n unless the DS has no equivalent.\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nCOMMON GOTCHAS (Plugin API)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n\n1. layoutSizing & layoutPositioning ordering: appendChild MUST be\n called BEFORE setting layoutSizingHorizontal/Vertical = \"FILL\"\n or layoutPositioning = \"ABSOLUTE\". Setting these on an unparented\n node fails with \"parent node has layoutMode !== NONE\".\n\n2. Font weights are not universal: do NOT assume a DS font has\n \"Medium\". Call figma.listAvailableFontsAsync() first and use a\n pickStyle() fallback (\"Medium\" \u2192 \"Semi Bold\" \u2192 \"Regular\").\n\n3. layoutSizing = \"FILL\" before appendChild \u2014 same gotcha as #1.\n\n4. setCurrentPageAsync, not figma.currentPage = page (sync setter\n throws in dynamic-page mode).\n\n5. import is a reserved word \u2014 never use it as a function/var name\n in figma_execute code.\n\nFor full guidance, load the figma-canvas-ops skill before any\nfigma_execute write operation.";
|
|
7
9
|
//# sourceMappingURL=instructions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/core/instructions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/core/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,mogBA8OC,CAAC"}
|
|
@@ -1,37 +1,247 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MCP Server Instructions — sent to AI clients during initialization.
|
|
3
|
-
* Helps Claude/Cursor distinguish F-MCP Bridge from the official Figma MCP
|
|
3
|
+
* Helps Claude/Cursor distinguish F-MCP Bridge from the official Figma MCP,
|
|
4
|
+
* teaches the context-safe workflow, and enforces design system continuity.
|
|
5
|
+
*
|
|
4
6
|
* No Node.js dependencies — safe for Cloudflare Workers.
|
|
5
7
|
*/
|
|
6
|
-
export const FMCP_INSTRUCTIONS = `F-MCP ATezer Bridge — Plugin-based Figma MCP
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
8
|
+
export const FMCP_INSTRUCTIONS = `F-MCP ATezer Bridge — Plugin-based Figma MCP (WebSocket, no REST token).
|
|
9
|
+
Tool namespace: "figma_*". Server name: "figma-mcp-bridge".
|
|
10
|
+
|
|
11
|
+
═══════════════════════════════════════════════════════════════════
|
|
12
|
+
INTENT ROUTER ENTRY (ALWAYS FIRST — v1.8.1+)
|
|
13
|
+
═══════════════════════════════════════════════════════════════════
|
|
14
|
+
|
|
15
|
+
BEFORE executing ANY figma_* write tool (figma_execute, figma_create_*,
|
|
16
|
+
figma_update_*, figma_clone_*, figma_instantiate_*, figma_set_*, etc.),
|
|
17
|
+
you MUST follow the Intent Router protocol:
|
|
18
|
+
|
|
19
|
+
Step 1 — Load router skill
|
|
20
|
+
Read skills/fmcp-intent-router/SKILL.md for the routing logic.
|
|
21
|
+
|
|
22
|
+
Step 2 — Check state files
|
|
23
|
+
- .claude/design-systems/active-ds.md
|
|
24
|
+
- .claude/design-systems/last-intent.md
|
|
25
|
+
- .claude/design-systems/intent-history.md
|
|
26
|
+
|
|
27
|
+
Step 3 — Decide target skill
|
|
28
|
+
Map user request to ONE of the 8 entry-point skills:
|
|
29
|
+
generate-figma-screen, apply-figma-design-system,
|
|
30
|
+
audit-figma-design-system, generate-figma-library,
|
|
31
|
+
implement-design, code-design-mapper, visual-qa-compare,
|
|
32
|
+
design-token-pipeline.
|
|
33
|
+
If ambiguous, ask the user with AskUserQuestion.
|
|
34
|
+
|
|
35
|
+
Step 4 — Read target skill's required_inputs metadata
|
|
36
|
+
Parse the YAML frontmatter block "required_inputs".
|
|
37
|
+
|
|
38
|
+
Step 5 — Gather missing inputs (smart skipping)
|
|
39
|
+
Apply in order:
|
|
40
|
+
(a) Use value from last-intent.md if default_source matches
|
|
41
|
+
(b) Use parsed value from user's original request
|
|
42
|
+
(c) Apply skip_if conditions (e.g., reference_benchmark given → skip
|
|
43
|
+
screen_type, sections)
|
|
44
|
+
(d) Ask ONE AskUserQuestion with max 4 remaining inputs
|
|
45
|
+
(e) If 5+ still needed, do a second AskUserQuestion
|
|
46
|
+
|
|
47
|
+
Step 6 — Summary + explicit confirmation (separate AskUserQuestion)
|
|
48
|
+
Show ALL gathered inputs + approach summary + estimated outcome.
|
|
49
|
+
Options: [✅ Evet başla] [✏️ Değiştir] [❌ İptal]
|
|
50
|
+
DO NOT proceed without explicit confirmation.
|
|
51
|
+
|
|
52
|
+
Step 7 — Execute target skill
|
|
53
|
+
Run the target skill's own Step 0-N (DS check, work, self-audit).
|
|
54
|
+
|
|
55
|
+
Step 8 — Persist outcome
|
|
56
|
+
Update .claude/design-systems/last-intent.md
|
|
57
|
+
Prepend entry to .claude/design-systems/intent-history.md (LRU 5)
|
|
58
|
+
|
|
59
|
+
FAST PATH: If the user's request contains all required inputs
|
|
60
|
+
(e.g., "clone 139:3407 to iPhone 17 with SUI"), skip Step 5.
|
|
61
|
+
Go directly to Step 6 (confirmation), then Step 7.
|
|
62
|
+
|
|
63
|
+
REPEAT PATH: If last-intent.md matches the new request, ask a
|
|
64
|
+
single question: "Öncekiyle aynı mı devam edeyim?"
|
|
65
|
+
Options: [✅ Aynı] [✏️ Değiştir] [❌ İptal]
|
|
66
|
+
|
|
67
|
+
FORBIDDEN:
|
|
68
|
+
- DO NOT skip Step 6 (explicit confirmation gate)
|
|
69
|
+
- DO NOT assume default values when input is required
|
|
70
|
+
- DO NOT execute figma_execute / figma_create_* without routing
|
|
71
|
+
|
|
72
|
+
═══════════════════════════════════════════════════════════════════
|
|
73
|
+
CLONE vs BUILD DECISION (v1.8.2+ — CRITICAL)
|
|
74
|
+
═══════════════════════════════════════════════════════════════════
|
|
75
|
+
|
|
76
|
+
figma_clone_screen_to_device is a NARROW-USE tool. Use it ONLY when:
|
|
77
|
+
• Same design system
|
|
78
|
+
• Same layout structure
|
|
79
|
+
• Only the screen size changes (e.g. iPhone 13 → iPhone 17 migration)
|
|
80
|
+
|
|
81
|
+
For ALL of these cases, use figma_execute with build-from-scratch pattern
|
|
82
|
+
(generate-figma-screen SKILL Step 4-5 — search_assets → instantiate_component
|
|
83
|
+
→ setBoundVariable → auto-layout FILL):
|
|
84
|
+
|
|
85
|
+
"3 alternatif tasarım yap" → build, NOT clone
|
|
86
|
+
"Hero Card varyasyonu" → build, NOT clone
|
|
87
|
+
"Farklı layout" → build, NOT clone
|
|
88
|
+
"Yeni ekran tasarla" → build, NOT clone
|
|
89
|
+
"Bu ekranı daha iyi yap" → build, NOT clone
|
|
90
|
+
"Benchmark'tan ilham al" → build (benchmark = inspiration only)
|
|
91
|
+
"Redesign" / "iyileştir" → build, NOT clone
|
|
92
|
+
|
|
93
|
+
RULE: If the user says ANY of {alternatif, varyasyon, farklı, yeni,
|
|
94
|
+
tasarla, iyileştir, redesign}, DO NOT suggest figma_clone_screen_to_device.
|
|
95
|
+
Default to build-from-scratch via figma_execute + Step 4-5 pattern.
|
|
96
|
+
|
|
97
|
+
Benchmark is ALWAYS inspiration, never a copy source for alternatives.
|
|
98
|
+
Clone copies the benchmark's existing mistakes (hardcoded rectangles,
|
|
99
|
+
missing token bindings, non-responsive layouts) into the new screen.
|
|
100
|
+
|
|
101
|
+
═══════════════════════════════════════════════════════════════════
|
|
102
|
+
TOOL FAILURE RECOVERY (v1.8.2+)
|
|
103
|
+
═══════════════════════════════════════════════════════════════════
|
|
104
|
+
|
|
105
|
+
If a tool call fails (timeout, error, unexpected result):
|
|
106
|
+
|
|
107
|
+
1. Retry ONCE with different parameters (smaller scope, different device,
|
|
108
|
+
chunked code, lower minScore, etc.)
|
|
109
|
+
2. If second failure: STOP. Do orphan cleanup. Report to user.
|
|
110
|
+
3. NEVER retry same tool + same params 3+ times (infinite loop).
|
|
111
|
+
4. After any write-tool failure: check for orphan nodes with
|
|
112
|
+
figma_get_file_data. List them to the user. Delete only with consent.
|
|
113
|
+
|
|
114
|
+
Multi-output turn budget:
|
|
115
|
+
- Each alternative/output = separate turn
|
|
116
|
+
- Max 90s per turn (hard limit)
|
|
117
|
+
- Max 2 failed tool calls per turn
|
|
118
|
+
- If budget exhausted → Turn FAILED → orphan cleanup → user checkpoint
|
|
119
|
+
|
|
120
|
+
═══════════════════════════════════════════════════════════════════
|
|
121
|
+
CONTEXT-SAFE PROTOCOL (REQUIRED for Claude chat — v1.8.0+)
|
|
122
|
+
═══════════════════════════════════════════════════════════════════
|
|
123
|
+
|
|
124
|
+
Tool responses are expensive. Follow this order, prefer the cheapest
|
|
125
|
+
verbosity that answers the question, and reuse cached results.
|
|
126
|
+
|
|
127
|
+
Step 1 — Plugin discovery
|
|
128
|
+
figma_get_status()
|
|
129
|
+
figma_list_connected_files() (only if multi-file)
|
|
130
|
+
|
|
131
|
+
Step 2 — Structural overview (cheap, cached 60s)
|
|
132
|
+
figma_get_file_data(depth=1, verbosity="summary")
|
|
133
|
+
or figma_get_design_system_summary()
|
|
134
|
+
|
|
135
|
+
Step 3 — Target ONE node with the lowest verbosity that answers the
|
|
136
|
+
question. All read tools are cached for 60s within a session:
|
|
137
|
+
• identity only → depth=0, verbosity="summary"
|
|
138
|
+
• text + structure → depth=1, verbosity="summary" ← new default
|
|
139
|
+
• layout/visual detail → depth=1, verbosity="standard"
|
|
140
|
+
• everything → depth=2, verbosity="full"
|
|
141
|
+
Do NOT call verbosity="full" on the document root.
|
|
142
|
+
|
|
143
|
+
Step 4 — Screenshots only when visual confirmation is needed.
|
|
144
|
+
v1.8.0 defaults: JPG, scale=1, jpegQuality=70 (~80% smaller than
|
|
145
|
+
PNG@2x). Use PNG scale=2 only when pixel-perfect asset export is
|
|
146
|
+
required.
|
|
147
|
+
|
|
148
|
+
Step 5 — Caching: within a session, repeated identical read calls
|
|
149
|
+
return instantly from cache. Pass debug=true on a tool to bypass
|
|
150
|
+
the cache and include _responseGuard/_metrics fields.
|
|
151
|
+
|
|
152
|
+
═══════════════════════════════════════════════════════════════════
|
|
153
|
+
TOOL SELECTION (F-MCP Bridge vs Official Figma MCP)
|
|
154
|
+
═══════════════════════════════════════════════════════════════════
|
|
155
|
+
|
|
156
|
+
If figma_get_status() returns ready=true, the F-MCP plugin is
|
|
157
|
+
connected to a specific file. Prefer F-MCP Bridge tools for that
|
|
158
|
+
file — DO NOT call official Figma MCP tools that read the same file.
|
|
159
|
+
|
|
160
|
+
Official Figma MCP tool → F-MCP Bridge equivalent
|
|
161
|
+
───────────────────────────── ──────────────────────────────
|
|
162
|
+
search_design_system → figma_search_assets
|
|
163
|
+
+ figma_get_library_variables
|
|
164
|
+
+ figma_get_library_components
|
|
165
|
+
get_metadata → figma_get_file_data
|
|
166
|
+
get_design_context → figma_get_design_context
|
|
167
|
+
get_screenshot → figma_capture_screenshot
|
|
168
|
+
get_variable_defs → figma_get_variables
|
|
169
|
+
use_figma → figma_execute
|
|
170
|
+
|
|
171
|
+
The official search_design_system often fails with "Resource links
|
|
172
|
+
are not supported" or "file could not be accessed" — fall back to
|
|
173
|
+
figma_search_assets / figma_get_library_components immediately
|
|
174
|
+
(F-MCP plugin reads directly via Plugin API).
|
|
23
175
|
|
|
24
176
|
WHEN TO PREFER OFFICIAL FIGMA MCP:
|
|
25
|
-
- Code Connect mappings
|
|
26
|
-
- Design system search across team libraries (search_design_system)
|
|
177
|
+
- Code Connect mappings (add_code_connect_map, get_code_connect_map)
|
|
27
178
|
- Creating new Figma files (create_new_file)
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
179
|
+
- FigJam diagram generation (generate_diagram)
|
|
180
|
+
- When the F-MCP plugin is NOT connected to the target file
|
|
181
|
+
|
|
182
|
+
COEXISTENCE: Both servers run simultaneously. Choose by capability.
|
|
183
|
+
|
|
184
|
+
═══════════════════════════════════════════════════════════════════
|
|
185
|
+
DESIGN SYSTEM CONTEXT (REQUIRED for screen/component creation)
|
|
186
|
+
═══════════════════════════════════════════════════════════════════
|
|
187
|
+
|
|
188
|
+
When the user asks to create a screen, alternative design, or new
|
|
189
|
+
component, the FIRST step is ALWAYS to confirm which design system
|
|
190
|
+
to use. NEVER create UI without a confirmed DS context.
|
|
191
|
+
|
|
192
|
+
Step A — Check for an existing DS preference:
|
|
193
|
+
1. Read .claude/libraries/active-ds.md (or .fmcp-brand-profile.json)
|
|
194
|
+
2. If present and mentions a DS (e.g. "❖ SUI"), use it directly
|
|
195
|
+
3. If absent, ask the user: "Hangi tasarım sistemi ile ilerleyelim?
|
|
196
|
+
(Örn: ❖ SUI, Material Design, Apple HIG, kendi DS'iniz)"
|
|
197
|
+
|
|
198
|
+
Step B — Once the DS is confirmed:
|
|
199
|
+
1. Persist the choice to .claude/libraries/active-ds.md so future
|
|
200
|
+
turns reuse it without asking again
|
|
201
|
+
2. Load DS variable keys via figma_get_library_variables({libraryName: "..."})
|
|
202
|
+
3. Load DS component keys via figma_get_library_components({libraryName: "..."})
|
|
203
|
+
4. Cache results in .claude/libraries/<ds-name>.md for 24h
|
|
204
|
+
|
|
205
|
+
Step C — Token Binding is MANDATORY:
|
|
206
|
+
Every node you create must bind its visual properties to DS tokens:
|
|
207
|
+
• fills/strokes → setBoundVariableForPaint(...)
|
|
208
|
+
• padding/gap/radius → setBoundVariable("paddingLeft", v)
|
|
209
|
+
• text typography → setTextStyleIdAsync(styleId) (never
|
|
210
|
+
setBoundVariable("fontSize", ...))
|
|
211
|
+
• effects (shadows) → setEffectStyleIdAsync(styleId)
|
|
212
|
+
|
|
213
|
+
Hardcoded hex colors, pixel padding, or font sizes are FORBIDDEN
|
|
214
|
+
in code that creates Figma nodes. If a token does not exist for a
|
|
215
|
+
needed value, ASK the user how to proceed — do not silently
|
|
216
|
+
hardcode.
|
|
217
|
+
|
|
218
|
+
Step D — Component instances over hand-built shapes:
|
|
219
|
+
When you need a button, input, card, or other UI element that
|
|
220
|
+
exists in the DS, ALWAYS use figma_instantiate_component with the
|
|
221
|
+
library componentKey. NEVER hand-build it from rectangles + text
|
|
222
|
+
unless the DS has no equivalent.
|
|
223
|
+
|
|
224
|
+
═══════════════════════════════════════════════════════════════════
|
|
225
|
+
COMMON GOTCHAS (Plugin API)
|
|
226
|
+
═══════════════════════════════════════════════════════════════════
|
|
227
|
+
|
|
228
|
+
1. layoutSizing & layoutPositioning ordering: appendChild MUST be
|
|
229
|
+
called BEFORE setting layoutSizingHorizontal/Vertical = "FILL"
|
|
230
|
+
or layoutPositioning = "ABSOLUTE". Setting these on an unparented
|
|
231
|
+
node fails with "parent node has layoutMode !== NONE".
|
|
232
|
+
|
|
233
|
+
2. Font weights are not universal: do NOT assume a DS font has
|
|
234
|
+
"Medium". Call figma.listAvailableFontsAsync() first and use a
|
|
235
|
+
pickStyle() fallback ("Medium" → "Semi Bold" → "Regular").
|
|
236
|
+
|
|
237
|
+
3. layoutSizing = "FILL" before appendChild — same gotcha as #1.
|
|
238
|
+
|
|
239
|
+
4. setCurrentPageAsync, not figma.currentPage = page (sync setter
|
|
240
|
+
throws in dynamic-page mode).
|
|
241
|
+
|
|
242
|
+
5. import is a reserved word — never use it as a function/var name
|
|
243
|
+
in figma_execute code.
|
|
244
|
+
|
|
245
|
+
For full guidance, load the figma-canvas-ops skill before any
|
|
246
|
+
figma_execute write operation.`;
|
|
37
247
|
//# sourceMappingURL=instructions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/core/instructions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/core/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BA8OF,CAAC"}
|
|
@@ -101,7 +101,33 @@ export declare class PluginBridgeConnector {
|
|
|
101
101
|
captureScreenshot(nodeId: string | null, options?: {
|
|
102
102
|
format?: string;
|
|
103
103
|
scale?: number;
|
|
104
|
+
jpegQuality?: number;
|
|
104
105
|
}): Promise<PluginScreenshotPayload>;
|
|
106
|
+
/**
|
|
107
|
+
* v1.8.1+: Clone a source screen and adapt it to a target device dimension.
|
|
108
|
+
* Preserves library instances, bound variables, and auto-layout where possible.
|
|
109
|
+
*/
|
|
110
|
+
cloneScreenToDevice(params: {
|
|
111
|
+
sourceNodeId: string;
|
|
112
|
+
targetWidth: number;
|
|
113
|
+
targetHeight: number;
|
|
114
|
+
targetDeviceName: string;
|
|
115
|
+
newName?: string;
|
|
116
|
+
targetParentId?: string;
|
|
117
|
+
position?: {
|
|
118
|
+
x: number;
|
|
119
|
+
y: number;
|
|
120
|
+
};
|
|
121
|
+
}): Promise<unknown>;
|
|
122
|
+
/**
|
|
123
|
+
* v1.8.1+: Validate a screen against design-system discipline criteria.
|
|
124
|
+
* Returns a DS compliance score + violation list.
|
|
125
|
+
*/
|
|
126
|
+
validateScreen(params: {
|
|
127
|
+
nodeId: string;
|
|
128
|
+
expectedDs?: string;
|
|
129
|
+
minScore?: number;
|
|
130
|
+
}): Promise<unknown>;
|
|
105
131
|
setInstanceProperties(nodeId: string, properties: Record<string, unknown>): Promise<PluginCrudResult>;
|
|
106
132
|
getDocumentStructure(depth?: number, verbosity?: string, opts?: {
|
|
107
133
|
excludeScreenshot?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-bridge-connector.d.ts","sourceRoot":"","sources":["../../src/core/plugin-bridge-connector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,KAAK,EACX,sBAAsB,EAAE,mBAAmB,EAAE,sBAAsB,EACnE,uBAAuB,EAAE,uBA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,CAAA;KAAE,CAAC;IAKtG,oBAAoB,CACzB,KAAK,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC,GAClE,OAAO,CAAC;QAAE,OAAO,EAAE,KAAK,CAAC;YAAE,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC;IAKtG,iBAAiB,CAAC,OAAO,EAAE;QAChC,cAAc,EAAE,MAAM,CAAC;QACvB,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,MAAM,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,OAAO,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;SAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC5H,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAevB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAMjF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAG9B"}
|
|
@@ -161,6 +161,20 @@ export class PluginBridgeConnector {
|
|
|
161
161
|
async captureScreenshot(nodeId, options) {
|
|
162
162
|
return this.bridge.request("captureScreenshot", { nodeId, options }, this.fileKey);
|
|
163
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* v1.8.1+: Clone a source screen and adapt it to a target device dimension.
|
|
166
|
+
* Preserves library instances, bound variables, and auto-layout where possible.
|
|
167
|
+
*/
|
|
168
|
+
async cloneScreenToDevice(params) {
|
|
169
|
+
return this.bridge.request("cloneScreenToDevice", params, this.fileKey);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* v1.8.1+: Validate a screen against design-system discipline criteria.
|
|
173
|
+
* Returns a DS compliance score + violation list.
|
|
174
|
+
*/
|
|
175
|
+
async validateScreen(params) {
|
|
176
|
+
return this.bridge.request("validateScreen", params, this.fileKey);
|
|
177
|
+
}
|
|
164
178
|
async setInstanceProperties(nodeId, properties) {
|
|
165
179
|
return this.bridge.request("setInstanceProperties", { nodeId, properties }, this.fileKey);
|
|
166
180
|
}
|
|
@@ -181,10 +195,12 @@ export class PluginBridgeConnector {
|
|
|
181
195
|
return this.bridge.request("getDocumentStructure", params, this.fileKey);
|
|
182
196
|
}
|
|
183
197
|
async getNodeContext(nodeId, depth, verbosity, opts) {
|
|
198
|
+
// v1.8.0: Aligned with MCP tool defaults (depth=1, verbosity=summary)
|
|
199
|
+
// for context safety. Pre-v1.8.0 was depth=2, verbosity=standard.
|
|
184
200
|
const params = {
|
|
185
201
|
nodeId,
|
|
186
|
-
depth: depth ??
|
|
187
|
-
verbosity: verbosity ?? "
|
|
202
|
+
depth: depth ?? 1,
|
|
203
|
+
verbosity: verbosity ?? "summary",
|
|
188
204
|
};
|
|
189
205
|
if (opts?.excludeScreenshot !== undefined)
|
|
190
206
|
params.excludeScreenshot = opts.excludeScreenshot;
|