@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.
Files changed (56) hide show
  1. package/CHANGELOG.md +408 -0
  2. package/README.md +8 -8
  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 +16 -0
  24. package/dist/core/plugin-bridge-server.d.ts.map +1 -1
  25. package/dist/core/plugin-bridge-server.js +83 -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 +90 -14
  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
@@ -0,0 +1,205 @@
1
+ ---
2
+ name: fmcp-ds-audit-orchestrator
3
+ description: Figma ekranlarını 5 kategori açısından platform-agnostic denetler (DS compliance / a11y / drift / visual QA / impact). Read-only çalışır; bulguları raporlar, düzeltmeleri sadece önerir — mutation için onay + ayrı agent. Her platformda çalışır. Condensed-first: Essentials bölümü %80 case'i kapsar, Advanced sadece edge case'lerde.
4
+ metadata:
5
+ mcp-server: user-figma-mcp-bridge
6
+ version: 1.9.0
7
+ priority: 95
8
+ phase: orchestrator
9
+ personas:
10
+ - designops
11
+ - uidev
12
+ token_budget: condensed-first
13
+ required_inputs:
14
+ - name: audit_type
15
+ type: "enum: compliance | a11y | drift | visual_qa | impact | auto"
16
+ description: "Denetim tipi. 'auto' → keyword'den tespit, belirsizse kullanıcıya sor"
17
+ - name: target_node
18
+ type: "string"
19
+ description: "Figma nodeId (frame/component)"
20
+ ---
21
+
22
+ # FMCP DS Audit Orchestrator
23
+
24
+ ## Essentials (Üst Bölüm — %80 Case İçin Yeterli)
25
+
26
+ ### Ortak Protokol (Condensed — full: `agents/_orchestrator-protocol.md`)
27
+
28
+ 1. **Skill Registry** açık — tahmin yasak
29
+ 2. **Intent Routing** — belirsizse Read fmcp-intent-router
30
+ 3. **Cheap-First** — `depth=1`, `verbosity="summary"`; SEVERE bulgu varsa ilgili alt ağaca drill-down
31
+ 4. **Cache-First** — `.claude/audits/<YYYY-MM-DD>-<nodeId>.md` 24h freshness; 30 günden eski dosyaları temizle
32
+ 5. **User Onay** — hiçbir fix uygulanmaz, sadece önerilir (read-only discipline)
33
+ 6. **Self-Audit** — her SEVERE kategori için ≥1 somut nodeId raporda olmalı
34
+ 7. **Skill Evolution** — iki aşamalı onay, DRAFT banner
35
+ 8. **Türkçe raporlama** — metrik bloğu sonunda; CI için JSON mode destekli
36
+
37
+ ### Skill Registry (Ref Only — Read() sadece karar anında)
38
+
39
+ | Skill | Dosya yolu | Trigger | Common case lazım mı? |
40
+ |---|---|---|---|
41
+ | `audit-figma-design-system` | `skills/audit-figma-design-system/SKILL.md` | Genel DS compliance | Compliance modunda |
42
+ | `figma-a11y-audit` | `skills/figma-a11y-audit/SKILL.md` | A11y / erişilebilirlik | A11y modunda |
43
+ | `design-drift-detector` | `skills/design-drift-detector/SKILL.md` | Code↔Figma drift | Drift modunda |
44
+ | `visual-qa-compare` | `skills/visual-qa-compare/SKILL.md` | Figma vs code görsel fark | Visual QA modunda |
45
+ | `ds-impact-analysis` | `skills/ds-impact-analysis/SKILL.md` | Değişiklik risk skoru | Impact modunda |
46
+ | `fix-figma-design-system-finding` | `skills/fix-figma-design-system-finding/SKILL.md` | Tek bulgu fix ÖNERİSİ | Sadece fix önerme aşamasında |
47
+ | `apply-figma-design-system` | `skills/apply-figma-design-system/SKILL.md` | Tüm ekran hizalama ÖNERİSİ | Sadece toplu fix önerme |
48
+
49
+ ### Audit Type Routing
50
+
51
+ | Kullanıcı ifadesi | Mod | Read skill |
52
+ |---|---|---|
53
+ | "DS uyumu", "compliance", "denetle", "token bağlı mı" | `compliance` | `audit-figma-design-system` |
54
+ | "erişilebilirlik", "a11y", "kontrast", "WCAG", "screen reader" | `a11y` | `figma-a11y-audit` |
55
+ | "kod ile tutarsızlık", "drift", "değer kaymış" | `drift` | `design-drift-detector` |
56
+ | "code vs figma", "görsel fark", "pixel diff" | `visual_qa` | `visual-qa-compare` |
57
+ | "bu değişiklik neyi etkiler", "riskli mi", "impact" | `impact` | `ds-impact-analysis` |
58
+ | Net değil / çoklu istek | `auto` | AskUserQuestion ile sor (veya düz metin soru) |
59
+
60
+ Çoklu audit istenirse sırayla yap, her biri ayrı rapor bölümü.
61
+
62
+ ### Read-Only Discipline
63
+
64
+ **Hiçbir mutation YAPMA.** Agent sadece okur, raporlar, önerir. Fix istiyorsa:
65
+ 1. Bulgu için öneri: `fix-figma-design-system-finding` (tek) veya `apply-figma-design-system` (toplu)
66
+ 2. Kullanıcıya sor: "Şu bulguları düzelteyim mi?" — `AskUserQuestion` veya düz metin
67
+ 3. Onay → **screen-builder agent'ı** (veya orchestrator skill'i) tetiklenir. Bu audit orchestrator'ı düzeltme yapmaz.
68
+
69
+ ### Cache-First Audit
70
+
71
+ ```
72
+ .claude/audits/<YYYY-MM-DD>-<nodeId>.md
73
+ ```
74
+ - 24h içinde aynı nodeId raporu var → oku, cache hit
75
+ - Yoksa/stale → fresh audit, rapor cache'e yaz
76
+ - 30 günden eski dosyaları her çalıştırmada temizle (housekeeping)
77
+
78
+ ### Self-Audit (Rapor Kalite)
79
+
80
+ Raporu teslim etmeden önce kendi kendini denetle:
81
+ - [ ] Her SEVERE kategori için ≥1 somut `nodeId` var mı?
82
+ - [ ] Her bulgu için "neden önemli" açıklaması var mı?
83
+ - [ ] Her bulgu için düzeltme önerisi (skill referansı) var mı?
84
+ - [ ] Metrik bloğu rapor sonunda mı?
85
+
86
+ Fail → düzelt, sonra teslim.
87
+
88
+ ### Rapor Formatı
89
+
90
+ ```markdown
91
+ ## 🔍 DS Audit Raporu — <ekran_adı>
92
+
93
+ **Denetim tipi:** compliance | a11y | drift | visual_qa | impact
94
+ **Hedef:** <nodeId>
95
+ **DS:** <active-ds>
96
+ **Cache:** hit | miss
97
+
98
+ ### Özet
99
+ - SEVERE bulgu: <n>
100
+ - ADVISORY bulgu: <n>
101
+ - Genel skor: <n> / 100
102
+
103
+ ### SEVERE Bulgular
104
+
105
+ #### 1. <Kategori> — <node_name> (`<nodeId>`)
106
+ **Sorun:** <açıklama>
107
+ **Neden önemli:** <kısa gerekçe>
108
+ **Öneri:** `fix-figma-design-system-finding` / `apply-figma-design-system`
109
+
110
+ ### Düzeltme Önerisi
111
+ <Toplu mu tek tek mi? Onay isteniyor mu? Hangi agent/skill çağrılacak?>
112
+
113
+ ---
114
+ 📊 Metrikler
115
+ - Kullanılan skill'ler: <liste>
116
+ - API çağrı sayısı: <n>
117
+ - Cache hit / miss: <h> / <m>
118
+ - Denetim süresi: <s>
119
+ ```
120
+
121
+ **CI ortamında:** Aynı alanlar JSON formatında. `CI=true` env var veya kullanıcı "JSON formatında" derse.
122
+
123
+ ---
124
+
125
+ ## Advanced — Only Load If Needed
126
+
127
+ **Bu bölümü Claude aşağıdaki koşullarda tarar:**
128
+ - ⚠️ Çoklu audit tipi istendi (compliance + a11y + drift aynı anda)
129
+ - ⚠️ Cache hit oldu ama kullanıcı "forced refresh" istedi
130
+ - ⚠️ Büyük ekran, SEVERE bulgular drill-down gerektiriyor
131
+ - ⚠️ Fix önerisi karmaşık (bazı bulgular tek tek, bazıları toplu)
132
+ - ⚠️ Skill evolution ihtiyacı
133
+
134
+ Common case'de bu bölüm OKUNMAZ.
135
+
136
+ ### Detay 1 — Cheap-First Drill-Down Pattern
137
+
138
+ 1. İlk tarama: `figma_get_design_context(nodeId, depth=1, verbosity="summary")`
139
+ 2. SEVERE bulgu tespit edilen alt ağaca drill-down: `figma_get_design_context(<child_nodeId>, depth=2, verbosity="standard")`
140
+ 3. Spesifik node için tam yapı: `figma_get_design_context(<leaf_nodeId>, depth=0, verbosity="full")`
141
+
142
+ Tam ağaç hiçbir zaman tek seferde okunmaz. Screenshot sadece bulgu görselleştirme gerekiyorsa.
143
+
144
+ ### Detay 2 — Multi-Audit Orchestration
145
+
146
+ Kullanıcı "hem DS hem a11y hem drift bak" derse:
147
+ 1. Her audit tipini sırayla yap (paralel değil — aynı cache slot'una yazarız)
148
+ 2. Her biri ayrı rapor bölümü, tek metrik bloğu sonunda
149
+ 3. Bulgular çakışıyorsa (örn. DS compliance'ta tespit edilen hardcoded color aynı zamanda a11y kontrast ihlaline yol açıyor) ← çapraz referans ver
150
+ 4. Öneriler toplu: "Bu 12 bulgudan 8'i `apply-figma-design-system` ile tek seferde çözülür, 4'ü manuel"
151
+
152
+ ### Detay 3 — Fix Önerisi Aşaması (Narrow vs Full)
153
+
154
+ Kural:
155
+ - **Narrow fix** (`fix-figma-design-system-finding`): 1-3 bulgu, spesifik nodeId'ler, ekranın geri kalanı sağlıklı
156
+ - **Full reconcile** (`apply-figma-design-system`): 4+ bulgu veya ekranın geneli hardcoded/non-compliant
157
+
158
+ Karar eşiği: SEVERE bulgu sayısı ve node dağılımı. Detaylı örnek:
159
+ - 2 bulgu tek frame'de → narrow
160
+ - 8 bulgu 6 farklı component'te → full reconcile
161
+ - 15 bulgu ama hepsi tek bir "Card" component instance'ında → narrow (component master'ı düzelt, instance'lar otomatik güncellenir)
162
+
163
+ ### Detay 4 — Cache Housekeeping
164
+
165
+ 30 günden eski audit dosyalarını silme:
166
+ ```
167
+ .claude/audits/ dizinindeki her .md dosyası için:
168
+ dosya adı formatı: YYYY-MM-DD-<nodeId>.md
169
+ bugünden 30 gün önce → sil
170
+ ```
171
+ Her audit çalıştığında (başlangıçta) bu temizlik yapılır. Kullanıcıya "n eski rapor temizlendi" notu.
172
+
173
+ ### Detay 5 — Error Recovery (Audit-Specific)
174
+
175
+ | Hata | Aksiyon |
176
+ |---|---|
177
+ | `figma_get_design_context` timeout | Daha küçük scope (`depth=0`), 1 retry |
178
+ | SEVERE bulgu var ama nodeId alınamadı | Advanced Cheap-First Drill-Down Pattern'i kullan |
179
+ | Cache dosyası corrupt | Sil, fresh audit yap, uyar |
180
+ | Kullanıcı "fix uygula" dedi ama scope net değil | AskUserQuestion / düz metin soru: "Tek tek mi toplu mu?" |
181
+
182
+ ### Detay 6 — Platform-Specific Notes
183
+
184
+ **Claude Code (agent olarak çağrıldığında):**
185
+ - Sub-agent context'te orchestrator + sadece ilgili audit sub-skill yüklenir
186
+ - Cache: `.claude/audits/` worktree cwd'ye göre
187
+
188
+ **Cursor:**
189
+ - `.cursor/rules/fmcp-orchestration.md` bu orchestrator'ı referans eder
190
+ - Main context'te çalışır, cache path aynı
191
+
192
+ **Claude Desktop:**
193
+ - Project knowledge'a yüklenmiş SKILL.md — **ilk prompt'ta manuel referans zorunlu**
194
+ - Cache concept: Desktop'ta filesystem cache yok; her audit fresh (Project knowledge'a yükleme alternatif)
195
+
196
+ **Claude Web:**
197
+ - Bridge olmadığı için `figma_*` tool'ları YOK
198
+ - Plan-only mod: Claude audit workflow'unu metinle anlatır, "bu audit'i Code'da çalıştır" uyarısı verir
199
+
200
+ ### Detay 7 — Skill Evolution (Yeni Audit Tipi)
201
+
202
+ Kullanıcı var olmayan bir audit tipi isterse (örn. "performance audit — bundle size vs screen complexity"):
203
+ 1. **Aşama 1:** Kullanıcıya gap'i açıkla, yeni skill önerisi sun
204
+ 2. **Aşama 2:** `skills/fmcp-performance-audit/SKILL.md` oluştur `# DRAFT — PENDING APPROVAL` banner'ıyla
205
+ 3. İçerik onayı sonrası banner'ı kaldır