@atezer/figma-mcp-bridge 1.7.30 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +366 -0
  2. package/README.md +3 -2
  3. package/agents/_orchestrator-protocol.md +185 -0
  4. package/agents/ds-auditor.md +73 -22
  5. package/agents/screen-builder.md +60 -22
  6. package/agents/token-syncer.md +63 -19
  7. package/dist/core/code-warnings.d.ts +38 -0
  8. package/dist/core/code-warnings.d.ts.map +1 -0
  9. package/dist/core/code-warnings.js +191 -0
  10. package/dist/core/code-warnings.js.map +1 -0
  11. package/dist/core/device-presets.d.ts +49 -0
  12. package/dist/core/device-presets.d.ts.map +1 -0
  13. package/dist/core/device-presets.js +141 -0
  14. package/dist/core/device-presets.js.map +1 -0
  15. package/dist/core/instructions.d.ts +4 -2
  16. package/dist/core/instructions.d.ts.map +1 -1
  17. package/dist/core/instructions.js +239 -29
  18. package/dist/core/instructions.js.map +1 -1
  19. package/dist/core/plugin-bridge-connector.d.ts +26 -0
  20. package/dist/core/plugin-bridge-connector.d.ts.map +1 -1
  21. package/dist/core/plugin-bridge-connector.js +18 -2
  22. package/dist/core/plugin-bridge-connector.js.map +1 -1
  23. package/dist/core/plugin-bridge-server.d.ts +2 -0
  24. package/dist/core/plugin-bridge-server.d.ts.map +1 -1
  25. package/dist/core/plugin-bridge-server.js +5 -1
  26. package/dist/core/plugin-bridge-server.js.map +1 -1
  27. package/dist/core/response-guard.d.ts +23 -0
  28. package/dist/core/response-guard.d.ts.map +1 -1
  29. package/dist/core/response-guard.js +113 -0
  30. package/dist/core/response-guard.js.map +1 -1
  31. package/dist/core/version.d.ts +1 -1
  32. package/dist/core/version.d.ts.map +1 -1
  33. package/dist/core/version.js +1 -1
  34. package/dist/core/version.js.map +1 -1
  35. package/dist/local-plugin-only.d.ts.map +1 -1
  36. package/dist/local-plugin-only.js +334 -101
  37. package/dist/local-plugin-only.js.map +1 -1
  38. package/f-mcp-plugin/code.js +514 -29
  39. package/f-mcp-plugin/ui.html +62 -6
  40. package/package.json +1 -1
  41. package/skills/SKILL_INDEX.md +13 -1
  42. package/skills/apply-figma-design-system/SKILL.md +37 -0
  43. package/skills/audit-figma-design-system/SKILL.md +38 -0
  44. package/skills/code-design-mapper/SKILL.md +37 -0
  45. package/skills/design-token-pipeline/SKILL.md +44 -0
  46. package/skills/figma-canvas-ops/SKILL.md +200 -243
  47. package/skills/fmcp-ds-audit-orchestrator/SKILL.md +205 -0
  48. package/skills/fmcp-intent-router/SKILL.md +574 -0
  49. package/skills/fmcp-screen-orchestrator/SKILL.md +166 -0
  50. package/skills/fmcp-screen-recipes/SKILL.md +528 -0
  51. package/skills/fmcp-token-sync-orchestrator/SKILL.md +198 -0
  52. package/skills/generate-figma-library/SKILL.md +38 -0
  53. package/skills/generate-figma-screen/SKILL.md +360 -6
  54. package/skills/implement-design/SKILL.md +32 -0
  55. package/skills/inspiration-intake/SKILL.md +220 -0
  56. package/skills/visual-qa-compare/SKILL.md +33 -0
@@ -5,6 +5,38 @@ metadata:
5
5
  mcp-server: user-figma-mcp-bridge
6
6
  personas:
7
7
  - uidev
8
+ required_inputs:
9
+ - name: source_node_id
10
+ type: string
11
+ question: "Hangi Figma node'unu kodlayalım? (node ID veya Figma URL)"
12
+ required: true
13
+ - name: target_platform
14
+ type: enum
15
+ options:
16
+ - "iOS (SwiftUI)"
17
+ - "iOS (UIKit)"
18
+ - "Android (Jetpack Compose)"
19
+ - "Android (XML)"
20
+ - "Web (React + TypeScript)"
21
+ - "Web (Vue)"
22
+ - "Web (vanilla HTML/CSS)"
23
+ question: "Hangi platform için kod üretelim?"
24
+ required: true
25
+ - name: output_dir
26
+ type: string
27
+ question: "Kod nereye yazılsın? (örn: ./src/components veya 'chat' - çıktıyı inline göster)"
28
+ required: false
29
+ default: "chat"
30
+ - name: include_tests
31
+ type: boolean
32
+ question: "Unit test dosyaları da üretilsin mi?"
33
+ required: false
34
+ default: false
35
+ - name: use_existing_components
36
+ type: boolean
37
+ question: "Mevcut proje component'lerini kullanıp genişleteyim mi, yoksa sıfırdan mı?"
38
+ required: false
39
+ default: true
8
40
  ---
9
41
 
10
42
  # Implement Design (Multi-Platform)
@@ -0,0 +1,220 @@
1
+ ---
2
+ name: inspiration-intake
3
+ description: Image (kullanıcı tarafından sohbete yüklenmiş) veya Figma benchmark linkini "inspiration only" disiplinle structural niyete dönüştürür. DEĞER (renk hex, font adı, radius/spacing px) ASLA çıkarmaz — yalnızca layout yönü, hiyerarşi, bölüm sırası, spacing intent. Çıktı JSON olarak caller'a döner, caller bunu `generate-figma-screen`'in `reference_benchmark` parametresine structural_intent olarak iletir.
4
+ metadata:
5
+ mcp-server: user-figma-mcp-bridge
6
+ version: 1.8.3
7
+ priority: 90
8
+ phase: intake
9
+ personas:
10
+ - designer
11
+ - uidev
12
+ required_inputs:
13
+ - name: source_type
14
+ type: "enum: image_uploaded | image_url | figma_node | figma_url"
15
+ description: "Kaynak tipi. image_uploaded: kullanıcı sohbete görseli yüklemiş. image_url: internet URL'i. figma_node: Figma nodeId. figma_url: tam Figma linki."
16
+ - name: source_ref
17
+ type: string
18
+ description: "image_uploaded için sohbete yüklenen görsel referansı (Claude zaten görüyor); image_url için URL; figma_node için nodeId (örn. '139:3407'); figma_url için tam Figma linki."
19
+ outputs:
20
+ - name: structural_intent_json
21
+ type: object
22
+ schema: "{ layout_direction, sections[], hierarchy_notes, spacing_intent }"
23
+ ---
24
+
25
+ # Inspiration Intake — Inspiration Only Structural Extraction
26
+
27
+ ## Neden Var?
28
+
29
+ FCM'de ekran üretmek için kullanıcı üç farklı girdi türünden biriyle gelebilir:
30
+
31
+ 1. **Fikir metni** ("sepet ekranı yap") — bu zaten `generate-figma-screen` tarafından işlenir
32
+ 2. **Figma benchmark** ("şu linkteki ekrandan ilham al") — benchmark'ın **layout niyetini** almak ama **değerlerini** almamak gerekir
33
+ 3. **İnternet görseli** (dribbble/behance link veya direkt yüklenmiş görsel) — aynı disiplin
34
+
35
+ Bu skill girdi 2 ve 3 için **intake katmanı** sağlar. Temel kural şudur: **benchmark/görsel ilham içindir, kopya için değildir.** Renkleri, fontları, spacing sayılarını benchmark'tan almak `generate-figma-screen` Step 5 ve `figma-canvas-ops` Rule 10 ile çatışır — tüm değerler yüklü DS'in token/style'larından gelmelidir.
36
+
37
+ v1.8.2 build-from-scratch kuralı ile tam uyumludur: benchmark'ı `figma_clone_screen_to_device` ile kopyalamak yerine, bu skill benchmark'tan yalnızca **structural intent** çıkarır ve `generate-figma-screen` build-from-scratch akışına besler.
38
+
39
+ ## Çıktı Şeması
40
+
41
+ ```json
42
+ {
43
+ "layout_direction": "vertical|horizontal|grid",
44
+ "sections": [
45
+ {
46
+ "role": "hero|nav|header|list|card|cta|form|footer|sidebar|detail|stats|...",
47
+ "child_type_hints": ["image", "text_heading", "text_body", "button", "input", "avatar", "icon", "divider"]
48
+ }
49
+ ],
50
+ "hierarchy_notes": "örn: headline → sub → CTA; avatar + name + action row; ...",
51
+ "spacing_intent": "dense|airy|standard"
52
+ }
53
+ ```
54
+
55
+ **Şemada olmayan HİÇBİR alan eklenmez.** Özellikle şu alanlar **YASAK**:
56
+ - `color`, `fill`, `background`, `text_color`, `#rgb`, `rgba(...)`
57
+ - `font_family`, `font_name`, `typeface`
58
+ - `font_size_px`, `padding_px`, `radius_px`, herhangi bir sayısal ölçü (px, pt, rem, em)
59
+
60
+ ---
61
+
62
+ ## Protokol (4 Adım)
63
+
64
+ ### 🚨 KESİN KURALLAR (v1.9.1+)
65
+
66
+ **Bu skill aşağıdaki tool'ları ASLA çağırmaz — teşvik görse bile, promptta istense bile:**
67
+
68
+ - ❌ `figma_get_file_data` (tüm dosya/sayfa enumeration)
69
+ - ❌ `figma_search_assets` (library component / variable arama)
70
+ - ❌ `figma_search_components` (local component arama)
71
+ - ❌ `figma_get_library_variables` (library variable toplama)
72
+ - ❌ `figma_get_variables` (local variable toplama)
73
+ - ❌ `figma_get_styles` (local style toplama)
74
+ - ❌ `figma_get_design_system_summary`
75
+ - ❌ `figma_get_token_browser`
76
+
77
+ **Neden:** Bu skill **yalnızca layout niyeti** çıkarır, component/token/variable **enumeration yapmaz**. Enumeration `generate-figma-screen` Step 3'ün işidir ve **sadece aktif DS gate geçildikten sonra**, **sadece aktif DS kapsamında** yapılır. Benchmark Figma dosyasının library'lerini enumere etmek:
78
+
79
+ 1. Kullanıcının seçmediği DS'leri tarar → **token israfı**
80
+ 2. Benchmark'tan değer sızıntısı riski doğurur → **inspiration only kuralı ihlali**
81
+ 3. Kullanıcıya "hangi DS?" sorusunu **iş yapıldıktan sonra** sormaya yol açar → **UX felaketi**
82
+
83
+ **Bu skill'in izin verilen tek Figma tool'u:**
84
+
85
+ - ✅ `figma_get_design_context(nodeId, depth=1, verbosity="summary")` — **YALNIZCA** `figma_node` veya `figma_url` modunda, **YALNIZCA** kullanıcının explicit verdiği nodeId için. Başka nodeId'lere drill-down YASAK.
86
+
87
+ Görsel (`image_uploaded`, `image_url`) modlarında **hiçbir figma_* tool çağrılmaz** — Claude sadece vision ile görseli okur.
88
+
89
+ ### Adım 0 — Source Fetch (type'a göre)
90
+
91
+ #### `image_uploaded`
92
+ Kullanıcı sohbete görseli drag & drop veya Ctrl+V ile yüklemiştir. Claude zaten görseli context'inde görür. **Doğrudan Adım 1'e geç.**
93
+
94
+ #### `image_url`
95
+ 1. **(a) URL fetch denemesi:**
96
+ ```
97
+ WebFetch(url, prompt="Describe the visible layout sections and hierarchy only — do not mention colors, fonts, or pixel sizes")
98
+ ```
99
+ 2. **(b) Fetch sonucu görsel içermez** (çoğu zaman WebFetch sadece text summary döner — bu beklenen sonuçtur):
100
+ - **DUR ve kullanıcıya mesaj** (sohbete yaz):
101
+ > "URL'den görsel indirme şu an desteklenmiyor. Lütfen görseli doğrudan sohbete yükle (drag & drop veya Ctrl+V), sonra devam ederim."
102
+ - Skill **duraklatılır**. Kullanıcı görseli yüklediğinde `image_uploaded` moduna düş ve Adım 1'e geç.
103
+
104
+ #### `figma_node` / `figma_url`
105
+ 1. `figma_url` verildiyse nodeId'yi parse et (URL'de `node-id=X-Y` → `X:Y`)
106
+ 2. **Minimal read:**
107
+ ```
108
+ figma_get_design_context(
109
+ nodeId=<parsed>,
110
+ depth=1,
111
+ verbosity="summary"
112
+ )
113
+ ```
114
+ 3. Yalnızca **yapı** bilgisi (child tipleri, layout yönü, bölüm sayısı) okunur. Renk, font, padding değerleri **göz ardı edilir** — Adım 1 bunları çıktıya geçirmez.
115
+
116
+ ### Adım 1 — Structural Extraction
117
+
118
+ Kaynaktan yalnızca şu alanları çıkar:
119
+
120
+ 1. **`layout_direction`** — genel akış: üstten alta (vertical), soldan sağa (horizontal), grid
121
+ 2. **`sections`** — ana bölümler listesi, her biri:
122
+ - `role` — semantik etiket (hero, nav, list, card, cta, ...). Açıklayıcı olsun, "section_1" gibi jenerik YASAK.
123
+ - `child_type_hints` — içindeki öğe tipleri (image, text_heading, text_body, button, input, avatar, icon, divider). Bunlar DS component kategori hint'idir, değer değil.
124
+ 3. **`hierarchy_notes`** — kritik okuma sırası: "headline → sub → CTA" gibi kısa notasyon
125
+ 4. **`spacing_intent`** — genel his: dense (sıkışık, bilgi yoğun), airy (nefes alan, premium), standard (dengeli). Bu **üç enum'dan biri**, sayı değil.
126
+
127
+ ### Adım 2 — "Inspiration Only" Guard (Self-Check)
128
+
129
+ Çıktı üretildikten sonra kendi kendini denetler. Şu paternlerden herhangi biri çıktıda varsa çıktıyı **REJECT** et, Adım 1'e dön ve yeniden üret:
130
+
131
+ | Pattern | Regex (kavramsal) | Örnek YASAK |
132
+ |---|---|---|
133
+ | Hex kodu | `#[0-9a-fA-F]{3,8}` | `#0066cc`, `#fff` |
134
+ | RGB fonksiyonu | `rgb\(.*\)`, `rgba\(.*\)` | `rgb(255, 0, 0)` |
135
+ | HSL fonksiyonu | `hsl\(.*\)` | `hsl(210, 50%, 40%)` |
136
+ | Font family | Inter, Roboto, SF Pro, Helvetica, Arial, ... | `"font": "Inter"` |
137
+ | Numeric size | Sayı + px/pt/rem/em | `"padding": 16`, `"size": "24px"` |
138
+ | Color names (semantic sınıra yakın) | red, blue, green, ... | `"color": "blue"` — semantic rol olarak "primary" kabul ama "blue" YASAK |
139
+
140
+ Semantik kabul edilenler: `primary`, `secondary`, `hero`, `cta`, `dense`, `airy`, `standard`, `vertical`, `horizontal`, `grid`, `image`, `text_heading`, `text_body`, `button`, `input`, `avatar`, `icon`, `divider`, bölüm `role` değerleri.
141
+
142
+ ### Adım 3 — Handoff
143
+
144
+ 1. Validated JSON'u caller'a döndür (stdout veya sohbet output'u olarak)
145
+ 2. Caller (tipik olarak `screen-builder`) bu JSON'u `generate-figma-screen`'in `required_inputs.reference_benchmark` alanına **structural_intent** olarak besler
146
+ 3. `generate-figma-screen` kendi Step 2.5'te aesthetic direction'ı **brand profile** veya **active-ds**'ten çeker — inspiration-intake yalnızca layout niyeti sağlar
147
+ 4. Kısa rapor yaz:
148
+ ```
149
+ 📥 Inspiration Intake — <source_type>
150
+ Kaynak: <source_ref kısaltılmış>
151
+ Layout: <direction>
152
+ Bölüm sayısı: <n>
153
+ Spacing intent: <intent>
154
+ Çıktı: generate-figma-screen reference_benchmark'ına iletildi
155
+ ```
156
+
157
+ ---
158
+
159
+ ## Kullanım Örneği
160
+
161
+ ### Örnek 1 — Yüklenmiş görsel
162
+
163
+ **Kullanıcı:** [sohbete bir mobil app screenshot yükler] "bu tarzda bir sepet ekranı yap"
164
+
165
+ **Caller (screen-builder):**
166
+ 1. Mode tespit: `image_uploaded`
167
+ 2. `Read("skills/inspiration-intake/SKILL.md")`
168
+ 3. Skill workflow: Adım 0 → direkt Adım 1 → yapısal çıkarma:
169
+ ```json
170
+ {
171
+ "layout_direction": "vertical",
172
+ "sections": [
173
+ { "role": "header", "child_type_hints": ["text_heading", "icon"] },
174
+ { "role": "list", "child_type_hints": ["image", "text_heading", "text_body", "button"] },
175
+ { "role": "cta", "child_type_hints": ["button"] }
176
+ ],
177
+ "hierarchy_notes": "header → scrollable list → bottom sticky CTA",
178
+ "spacing_intent": "standard"
179
+ }
180
+ ```
181
+ 4. Adım 2 guard: hex/font/px yok → PASS
182
+ 5. Adım 3: JSON'u `generate-figma-screen`'e ilet
183
+
184
+ ### Örnek 2 — Figma benchmark
185
+
186
+ **Kullanıcı:** "figma.com/file/abc/xyz?node-id=139-3407 bu ekrandan 3 alternatif üret"
187
+
188
+ **Caller (screen-builder):**
189
+ 1. Mode tespit: `figma_url`
190
+ 2. `Read("skills/inspiration-intake/SKILL.md")`
191
+ 3. Skill workflow:
192
+ - Adım 0: nodeId parse `139:3407`, `figma_get_design_context(nodeId="139:3407", depth=1, verbosity="summary")`
193
+ - Adım 1: sections listesini çıkar (değer yok)
194
+ - Adım 2: guard PASS
195
+ - Adım 3: JSON döner
196
+ 4. Caller 3 farklı varyasyon için `generate-figma-screen`'i 3 kez çağırır (her biri ayrı turn), her birine aynı `structural_intent`'i besler ama farklı aesthetic angle
197
+
198
+ ### Örnek 3 — URL fallback
199
+
200
+ **Kullanıcı:** "https://dribbble.com/shots/xyz-landing-page buradan ilham al, kurumsal SaaS için tasarla"
201
+
202
+ **Caller (screen-builder):**
203
+ 1. Mode tespit: `image_url`
204
+ 2. `Read("skills/inspiration-intake/SKILL.md")`
205
+ 3. Skill workflow:
206
+ - Adım 0a: `WebFetch("https://dribbble.com/shots/xyz-landing-page", ...)` dener
207
+ - Adım 0b: Sonuç text-only summary → **dur ve kullanıcıya mesaj yaz**
208
+ - Skill duraklar, caller kullanıcı yanıtını bekler
209
+ 4. Kullanıcı görseli yükler → mode `image_uploaded` → caller skill'i yeniden çağırır → normal akış
210
+
211
+ ---
212
+
213
+ ## Kurallar (Özet)
214
+
215
+ 1. **Değer çıkarma YASAK.** Sadece yapı + semantik rol + spacing enum.
216
+ 2. **Self-check zorunlu.** Çıktıda hex/font/px var mı? Varsa REJECT.
217
+ 3. **Minimal API.** `figma_get_design_context` → `depth=1`, `verbosity="summary"`.
218
+ 4. **URL fetch fallback hazır.** WebFetch image döndürmez — kullanıcıdan yükleme iste, skill'i duraklat.
219
+ 5. **Caller'a teslim.** Skill karar vermez, sadece structural_intent üretir ve döner.
220
+ 6. **Rapor Türkçe.** Metrik bloğu ortak protokole uygun.
@@ -6,6 +6,39 @@ metadata:
6
6
  personas:
7
7
  - uidev
8
8
  - designops
9
+ required_inputs:
10
+ - name: figma_source
11
+ type: string
12
+ question: "Figma kaynağı nedir? (Node ID veya Figma URL)"
13
+ required: true
14
+ - name: rendered_source
15
+ type: enum
16
+ options:
17
+ - "Local dev server URL (http://localhost:...)"
18
+ - "Production URL (https://...)"
19
+ - "Screenshot dosyası (path ver)"
20
+ - "Base64 image (clipboard)"
21
+ question: "Kod tarafındaki UI'ı nerede görelim?"
22
+ required: true
23
+ - name: rendered_url
24
+ type: string
25
+ question: "URL / path nedir?"
26
+ required: false
27
+ skip_if: "rendered_source == 'Base64 image (clipboard)'"
28
+ - name: diff_threshold
29
+ type: enum
30
+ options:
31
+ - "Sıkı (pixel-perfect)"
32
+ - "Normal (%5 tolerans)"
33
+ - "Gevşek (%15 tolerans)"
34
+ question: "Fark toleransı nedir?"
35
+ required: false
36
+ default: "Normal (%5 tolerans)"
37
+ - name: report_categories
38
+ type: string_list
39
+ question: "Hangi kategorilerde farkları raporlayayım? (spacing, color, typography, layout, shadows — 'all' veya seçili)"
40
+ required: false
41
+ default: "all"
9
42
  ---
10
43
 
11
44
  # Visual QA Compare — Figma vs Kod Görsel Karşılaştırma