@atezer/figma-mcp-bridge 1.7.23 → 1.7.25

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 (119) hide show
  1. package/.claude-plugin/plugin.json +37 -0
  2. package/.cursor-plugin/plugin.json +21 -0
  3. package/CHANGELOG.md +30 -0
  4. package/README.md +4 -3
  5. package/agents/ds-auditor.md +29 -0
  6. package/agents/screen-builder.md +29 -0
  7. package/agents/token-syncer.md +26 -0
  8. package/assets/logo.png +0 -0
  9. package/commands/add-library.md +122 -0
  10. package/commands/ds-add.md +255 -0
  11. package/commands/ds-sync.md +314 -0
  12. package/commands/implement.md +43 -0
  13. package/commands/install-library.md +73 -0
  14. package/commands/setup.md +26 -0
  15. package/commands/test.md +39 -0
  16. package/commands/update.md +25 -0
  17. package/dist/core/config.d.ts +1 -5
  18. package/dist/core/config.d.ts.map +1 -1
  19. package/dist/core/config.js +11 -111
  20. package/dist/core/config.js.map +1 -1
  21. package/dist/core/plugin-bridge-server.d.ts.map +1 -1
  22. package/dist/core/plugin-bridge-server.js +1 -2
  23. package/dist/core/plugin-bridge-server.js.map +1 -1
  24. package/dist/core/response-guard.d.ts +1 -1
  25. package/dist/core/response-guard.js +1 -1
  26. package/dist/core/types/index.d.ts +2 -98
  27. package/dist/core/types/index.d.ts.map +1 -1
  28. package/dist/core/version.d.ts +1 -1
  29. package/dist/core/version.js +1 -1
  30. package/dist/local-plugin-only.d.ts.map +1 -1
  31. package/dist/local-plugin-only.js +14 -13
  32. package/dist/local-plugin-only.js.map +1 -1
  33. package/f-mcp-plugin/README.md +8 -15
  34. package/f-mcp-plugin/manifest.json +1 -3
  35. package/hooks/hooks.json +26 -0
  36. package/package.json +15 -31
  37. package/skills/BRAND_PROFILE_SCHEMA.md +113 -0
  38. package/skills/SKILL_INDEX.md +194 -0
  39. package/skills/TOOL_MAPPING.md +111 -0
  40. package/skills/ai-handoff-export/SKILL.md +254 -0
  41. package/skills/apply-figma-design-system/SKILL.md +104 -0
  42. package/skills/audit-figma-design-system/SKILL.md +278 -0
  43. package/skills/code-design-mapper/SKILL.md +370 -0
  44. package/skills/component-documentation/SKILL.md +190 -0
  45. package/skills/design-drift-detector/SKILL.md +407 -0
  46. package/skills/design-system-rules/SKILL.md +407 -0
  47. package/skills/design-token-pipeline/SKILL.md +619 -0
  48. package/skills/ds-impact-analysis/SKILL.md +266 -0
  49. package/skills/figjam-diagram-builder/SKILL.md +172 -0
  50. package/skills/figma-a11y-audit/SKILL.md +587 -0
  51. package/skills/figma-canvas-ops/SKILL.md +325 -0
  52. package/skills/figma-screen-analyzer/SKILL.md +235 -0
  53. package/skills/fix-figma-design-system-finding/SKILL.md +117 -0
  54. package/skills/fmcp-project-rules/SKILL.md +93 -0
  55. package/skills/generate-figma-library/SKILL.md +598 -0
  56. package/skills/generate-figma-screen/SKILL.md +689 -0
  57. package/skills/implement-design/SKILL.md +473 -0
  58. package/skills/ux-copy-guidance/SKILL.md +373 -0
  59. package/skills/visual-qa-compare/SKILL.md +166 -0
  60. package/dist/browser/base.d.ts +0 -50
  61. package/dist/browser/base.d.ts.map +0 -1
  62. package/dist/browser/base.js +0 -6
  63. package/dist/browser/base.js.map +0 -1
  64. package/dist/browser/local.d.ts +0 -81
  65. package/dist/browser/local.d.ts.map +0 -1
  66. package/dist/browser/local.js +0 -283
  67. package/dist/browser/local.js.map +0 -1
  68. package/dist/core/console-monitor.d.ts +0 -82
  69. package/dist/core/console-monitor.d.ts.map +0 -1
  70. package/dist/core/console-monitor.js +0 -428
  71. package/dist/core/console-monitor.js.map +0 -1
  72. package/dist/core/design-system-manifest.d.ts +0 -272
  73. package/dist/core/design-system-manifest.d.ts.map +0 -1
  74. package/dist/core/design-system-manifest.js +0 -261
  75. package/dist/core/design-system-manifest.js.map +0 -1
  76. package/dist/core/enrichment/enrichment-service.d.ts +0 -52
  77. package/dist/core/enrichment/enrichment-service.d.ts.map +0 -1
  78. package/dist/core/enrichment/enrichment-service.js +0 -272
  79. package/dist/core/enrichment/enrichment-service.js.map +0 -1
  80. package/dist/core/enrichment/index.d.ts +0 -8
  81. package/dist/core/enrichment/index.d.ts.map +0 -1
  82. package/dist/core/enrichment/index.js +0 -8
  83. package/dist/core/enrichment/index.js.map +0 -1
  84. package/dist/core/enrichment/relationship-mapper.d.ts +0 -106
  85. package/dist/core/enrichment/relationship-mapper.d.ts.map +0 -1
  86. package/dist/core/enrichment/relationship-mapper.js +0 -352
  87. package/dist/core/enrichment/relationship-mapper.js.map +0 -1
  88. package/dist/core/enrichment/style-resolver.d.ts +0 -80
  89. package/dist/core/enrichment/style-resolver.d.ts.map +0 -1
  90. package/dist/core/enrichment/style-resolver.js +0 -327
  91. package/dist/core/enrichment/style-resolver.js.map +0 -1
  92. package/dist/core/figma-api.d.ts +0 -137
  93. package/dist/core/figma-api.d.ts.map +0 -1
  94. package/dist/core/figma-api.js +0 -274
  95. package/dist/core/figma-api.js.map +0 -1
  96. package/dist/core/figma-desktop-connector.d.ts +0 -242
  97. package/dist/core/figma-desktop-connector.d.ts.map +0 -1
  98. package/dist/core/figma-desktop-connector.js +0 -1042
  99. package/dist/core/figma-desktop-connector.js.map +0 -1
  100. package/dist/core/figma-reconstruction-spec.d.ts +0 -162
  101. package/dist/core/figma-reconstruction-spec.d.ts.map +0 -1
  102. package/dist/core/figma-reconstruction-spec.js +0 -387
  103. package/dist/core/figma-reconstruction-spec.js.map +0 -1
  104. package/dist/core/figma-tools.d.ts +0 -21
  105. package/dist/core/figma-tools.d.ts.map +0 -1
  106. package/dist/core/figma-tools.js +0 -2920
  107. package/dist/core/figma-tools.js.map +0 -1
  108. package/dist/core/snippet-injector.d.ts +0 -24
  109. package/dist/core/snippet-injector.d.ts.map +0 -1
  110. package/dist/core/snippet-injector.js +0 -97
  111. package/dist/core/snippet-injector.js.map +0 -1
  112. package/dist/core/types/enriched.d.ts +0 -213
  113. package/dist/core/types/enriched.d.ts.map +0 -1
  114. package/dist/core/types/enriched.js +0 -6
  115. package/dist/core/types/enriched.js.map +0 -1
  116. package/dist/local.d.ts +0 -73
  117. package/dist/local.d.ts.map +0 -1
  118. package/dist/local.js +0 -2605
  119. package/dist/local.js.map +0 -1
@@ -0,0 +1,314 @@
1
+ # Design System Güncelle (Resume Destekli)
2
+
3
+ Mevcut bir tasarım sistemi kütüphanesini Figma'dan senkronize eder. Tam sync, kısmi sync ve resume (yarım kalanı devam ettirme) destekler.
4
+
5
+ ## Argüman
6
+ $ARGUMENTS
7
+
8
+ Argüman olabilir:
9
+ - Boş → aktif veya tek kütüphaneyi sync et (belirsizse kullanıcıya sor)
10
+ - `<library-id>` → o kütüphanenin tüm section'larını sync et
11
+ - `<library-id> <section>` → sadece o section (tokens, components, icons, mobile, assets)
12
+ - `<library-id> --restart` → checkpoint'ten bağımsız sıfırdan başla
13
+
14
+ ---
15
+
16
+ ## Adım 1: Hedef Belirleme
17
+
18
+ 1. `$ARGUMENTS` boşsa:
19
+ - `.claude/design-systems/` altındaki kütüphaneleri listele
20
+ - Tek kütüphane → onu kullan
21
+ - Birden fazla → kullanıcıya sor: "Hangi kütüphaneyi güncelleyeyim?"
22
+
23
+ 2. Kütüphane ID → `.claude/design-systems/<id>/` dizini yoksa:
24
+ ```
25
+ ❌ "<id>" adında bir kütüphane bulunamadı.
26
+ 💡 Mevcut kütüphaneleri görmek için: ls .claude/design-systems/
27
+ ```
28
+
29
+ 3. Section belirtilmemişse → tüm section'lar (meta'ya göre)
30
+
31
+ ---
32
+
33
+ ## Adım 2: `_meta.md` Oku
34
+
35
+ `.claude/design-systems/<id>/_meta.md` dosyasını oku ve şu bilgileri çıkar:
36
+
37
+ - Kaynak-section eşleştirme tablosu
38
+ - Sync durumu (TAMAMLANDI / YARIM KALDI / HATA)
39
+ - Son sync tarihi
40
+ - İstatistikler
41
+
42
+ **Eğer durum "YARIM KALDI" ise:**
43
+ ```
44
+ 📋 Son sync yarım kalmış: components 87/163
45
+ Kaldığı yerden devam edeyim mi? (evet / sıfırdan başla / iptal)
46
+ ```
47
+
48
+ ---
49
+
50
+ ## Adım 3: Bağlantı Kontrolü
51
+
52
+ `mcp__figma-mcp-bridge__figma_list_connected_files` çağır.
53
+
54
+ Kaynak-section tablosundaki her file key için:
55
+ - Bağlı → ✅ işaretle
56
+ - Bağlı değil → ❌ işaretle
57
+
58
+ Hiçbir kaynak bağlı değilse → DUR:
59
+ ```
60
+ ❌ Hiçbir Figma kaynağı bağlı değil.
61
+ Lütfen:
62
+ 1. İlgili Figma dosyalarını aç
63
+ 2. F-MCP Bridge plugin'i çalıştır
64
+ 3. Tekrar dene
65
+ ```
66
+
67
+ Bazı kaynaklar bağlı, bazıları değil → kullanıcıya bildir:
68
+ ```
69
+ ⚠️ Bazı kaynaklar bağlı değil:
70
+ ✅ main (❖ SUI)
71
+ ❌ assets (💼 Assets)
72
+
73
+ Sadece bağlı olanları güncelleyeyim mi? (evet / iptal)
74
+ ```
75
+
76
+ ---
77
+
78
+ ## Adım 4: Yedekleme
79
+
80
+ Her section'ın mevcut MD dosyasını `.bak` olarak kopyala:
81
+
82
+ ```bash
83
+ # Her section için
84
+ cp .claude/design-systems/<id>/tokens.md .claude/design-systems/<id>/tokens.md.bak
85
+ cp .claude/design-systems/<id>/components.md .claude/design-systems/<id>/components.md.bak
86
+ # ...
87
+ ```
88
+
89
+ **Not:** Dosya yoksa `.bak` oluşturulmaz (yeni section için sorun değil).
90
+
91
+ ---
92
+
93
+ ## Adım 5: Resume Kontrolü (Her Section İçin)
94
+
95
+ Her hedef section için:
96
+
97
+ 1. Mevcut MD dosyasını oku (varsa)
98
+ 2. `### <BileşenAdı>` başlıklarını regex ile çıkar → **"done" listesi**
99
+ 3. Figma'dan güncel listeyi al (`figma_search_components`)
100
+ 4. `kalan = güncel - done`
101
+ 5. Eğer `kalan` boşsa → section zaten tam, atla
102
+ 6. Değilse → sadece eksik olanları işle
103
+
104
+ **Örnek:**
105
+ ```
106
+ 📖 components.md'de 87 bileşen başlığı var
107
+ 📋 Figma'da 163 bileşen var
108
+ 🎯 İşlenecek: 76 bileşen (kaldığı yerden)
109
+ ```
110
+
111
+ ---
112
+
113
+ ## Adım 6: Section Bazlı Sync
114
+
115
+ ### 6a. Tokens Section
116
+
117
+ Kaynaklardan `tokens.md` yazan olanlar için:
118
+
119
+ ```
120
+ 📥 Tokens çekiliyor...
121
+ ```
122
+
123
+ 1. `mcp__figma-mcp-bridge__figma_get_variables` (fileKey, verbosity: "full")
124
+ 2. `mcp__figma-mcp-bridge__figma_get_styles` (fileKey, verbosity: "full")
125
+ 3. Gelen data'dan tokens.md'yi yeniden üret:
126
+ - Header + son sync tarihi
127
+ - Primitive Colors (aile tablosu)
128
+ - Semantic Colors (Light/Dark)
129
+ - Typography
130
+ - Spacing & Scale
131
+ - Breakpoints
132
+ - Border Radius
133
+ - Depth (Shadow)
134
+ 4. Dosyayı tek seferde yaz (tokens.md append-based değil)
135
+ 5. Progress: "✅ tokens: <N> token"
136
+
137
+ ### 6b. Components / Icons / Mobile Section
138
+
139
+ Bileşen bazlı section'lar için **batch'li resume destekli akış**:
140
+
141
+ ```
142
+ 📥 Components çekiliyor (76/163 eksik)...
143
+ ```
144
+
145
+ 1. Figma'dan full isim listesi çek (zaten Adım 5'te yaptın)
146
+ 2. "Kalan" listesini 5'er batch'e böl
147
+ 3. Her batch için:
148
+ a. **Paralel** 5 `figma_get_component` çağrısı
149
+ b. Her başarılı bileşen için:
150
+ - Markdown bloğu oluştur (variant, size, state, platform notları)
151
+ - `### <BileşenAdı>` başlığı ile MD'nin sonuna append et
152
+ - Progress: "📊 X/<toplam> (son: <ad> ✓)"
153
+ c. Başarısız olanlar için:
154
+ - 3 retry (1s, 2s, 4s exponential backoff)
155
+ - Hâlâ başarısız → `failed_items` listesine ekle + devam
156
+ 4. Batch arası pause yok, hemen sonraki batch'e geç
157
+
158
+ **Not:** Her bileşen tek seferde append edilir. Yarım yazma yok.
159
+
160
+ ### 6c. Assets Section
161
+
162
+ Assets genellikle logo/grafik. `figma_search_components` + liste olarak yaz. Detay fetch gerekmez.
163
+
164
+ ---
165
+
166
+ ## Adım 7: Hata Yönetimi
167
+
168
+ | Hata Tipi | Davranış |
169
+ |-----------|----------|
170
+ | **API timeout (tek bileşen)** | 3x retry (1s, 2s, 4s) → sonra `failed_items`'a ekle, devam et |
171
+ | **Figma bridge disconnect (orta)** | DUR + `_meta.md`'yi "YARIM KALDI" olarak işaretle + kullanıcıya bildir |
172
+ | **Permission denied** | O section'ı atla + uyar, diğer section'larla devam |
173
+ | **Invalid response** | Skip + `failed_items`'a ekle, devam |
174
+ | **Disk full** | DUR + kullanıcıya bildir |
175
+ | **Kullanıcı iptal (Ctrl+C)** | Mevcut durum korunur, yarım append yok |
176
+
177
+ ---
178
+
179
+ ## Adım 8: `_meta.md` Güncelle
180
+
181
+ Sync tamamlandıktan (veya yarım kaldıktan) sonra `_meta.md`'yi güncelle:
182
+
183
+ ### Tam Başarı:
184
+ ```markdown
185
+ ## Sync Durumu
186
+ - **Son başarılı sync:** 2026-04-09T12:30:00Z
187
+ - **Durum:** ✅ TAMAMLANDI
188
+ - **Eksik section'lar:** (yok)
189
+ ```
190
+
191
+ ### Kısmi Başarı:
192
+ ```markdown
193
+ ## Sync Durumu
194
+ - **Son başarılı sync:** 2026-04-09T12:30:00Z
195
+ - **Durum:** ⚠️ KISMI BAŞARI
196
+ - **Başarısız öğeler:** Custom Button (timeout), Slot (invalid type)
197
+ - **Devam komutu:** `/ds-sync sui components`
198
+ ```
199
+
200
+ ### Yarım Kaldı:
201
+ ```markdown
202
+ ## Sync Durumu
203
+ - **Son başarılı sync:** (önceki) 2026-04-05T10:00:00Z
204
+ - **Durum:** ⚠️ YARIM KALDI (components: 87/163)
205
+ - **Eksik section'lar:** components
206
+ - **Devam komutu:** `/ds-sync sui components`
207
+ ```
208
+
209
+ İstatistikleri de güncelle:
210
+ ```markdown
211
+ ## İstatistikler
212
+ - Token sayısı: 841
213
+ - Bileşen sayısı: 160 (3 başarısız)
214
+ - İkon sayısı: 697
215
+ ```
216
+
217
+ Sync geçmişine yeni satır ekle:
218
+ ```markdown
219
+ ## Sync Geçmişi
220
+ - 2026-04-09: initial sync
221
+ - 2026-04-09: components yeniden senkronize edildi (160/163)
222
+ ```
223
+
224
+ ---
225
+
226
+ ## Adım 9: Cleanup
227
+
228
+ ### Tam Başarı:
229
+ - `.bak` dosyalarını sil (gerekmez artık)
230
+ - Kullanıcıya rapor:
231
+ ```
232
+ ✅ SUI sync tamamlandı.
233
+ ⏱️ Süre: 18 dakika 32 saniye
234
+ 📊 İstatistikler:
235
+ • tokens: 841 öğe
236
+ • components: 163 öğe ✓
237
+ • icons: 697 öğe ✓
238
+ • mobile: 30 öğe ✓
239
+ ```
240
+
241
+ ### Kısmi Başarı:
242
+ - `.bak` dosyalarını TUT (rollback mümkün)
243
+ - Kullanıcıya rapor:
244
+ ```
245
+ ⚠️ Kısmi başarı:
246
+ ✅ 160/163 bileşen tamamlandı
247
+ ❌ 3 hata:
248
+ • Custom Button (timeout)
249
+ • Slot (invalid type)
250
+ • .Stepper_2 (permission)
251
+ 💡 Tekrar denemek için: /ds-sync sui components
252
+ ```
253
+
254
+ ### Tam Başarısızlık (hiçbir şey alınamadı):
255
+ - `.bak`'tan geri yükle:
256
+ ```bash
257
+ cp tokens.md.bak tokens.md
258
+ cp components.md.bak components.md
259
+ ```
260
+ - Hata raporu göster
261
+
262
+ ---
263
+
264
+ ## Progress Formatı
265
+
266
+ Sync sırasında kullanıcıya düzenli olarak bildirim ver:
267
+
268
+ ```
269
+ 📥 SUI sync başlıyor (tahmini 18 dk)...
270
+ 📊 tokens: 841/841 ✓ (45s)
271
+ 📊 components: 5/163 (son: Button ✓)
272
+ 📊 components: 10/163 (son: Input ✓)
273
+ 📊 components: 15/163 (son: Select ✓)
274
+ ...
275
+ 📊 components: 163/163 ✓ (8m 20s)
276
+ 📊 icons: 200/697 (son: .check/v1 ✓)
277
+ 📊 icons: 697/697 ✓ (5m 12s)
278
+ 📊 mobile: 30/30 ✓ (1m 45s)
279
+ ✅ Tamamlandı.
280
+ ```
281
+
282
+ ---
283
+
284
+ ## Resume Senaryosu Detay
285
+
286
+ **Senaryo:** Kullanıcı dün `/ds-sync sui` çalıştırdı, 87/163 bileşende crash oldu. Bugün tekrar çalıştırıyor.
287
+
288
+ ```
289
+ Kullanıcı: /ds-sync sui
290
+ Claude: [_meta.md oku]
291
+ Claude: "📋 Son sync yarım kalmış: components 87/163
292
+ Kaldığı yerden devam edeyim mi? (evet/sıfırdan/iptal)"
293
+ Kullanıcı: "evet"
294
+ Claude: [components.md oku, 87 başlık say]
295
+ Claude: [figma_search_components → 163 isim]
296
+ Claude: [kalan = 163 - 87 = 76]
297
+ Claude: "📖 76 bileşen eksik. Devam ediyorum..."
298
+ Claude: [88, 89, 90, ... 163]
299
+ Claude: [mobile section'a geç]
300
+ Claude: [icons section'a geç]
301
+ Claude: "✅ SUI sync tamamlandı."
302
+ ```
303
+
304
+ **Kod yok. Sadece talimatlar.** Claude Read + figma MCP + Write araçlarıyla yapar.
305
+
306
+ ---
307
+
308
+ ## Doğal Dil Desteği
309
+
310
+ Slash command olmadan da aynı mantığı uygula:
311
+ - "SUI'yi güncelle" → `/ds-sync sui`
312
+ - "Sadece SUI bileşenlerini güncelle" → `/ds-sync sui components`
313
+ - "Yarım kalan SUI sync'i devam ettir" → `/ds-sync sui` (resume otomatik)
314
+ - "devam et" (önceki sync'ten sonra) → resume
@@ -0,0 +1,43 @@
1
+ # Implement Command
2
+
3
+ Implement a feature or fix using best practices for this MCP server project.
4
+
5
+ ## Instructions
6
+
7
+ When implementing features for the F-MCP ATezer server:
8
+
9
+ 1. **Use MCP SDK Patterns**
10
+ - Follow Model Context Protocol TypeScript SDK conventions
11
+ - Use `McpServer` from `@modelcontextprotocol/sdk/server/mcp.js`
12
+ - Use Zod for input schema validation
13
+ - Return proper content structures: `{ content: [{ type: "text", text: "..." }] }`
14
+
15
+ 2. **Follow Architecture**
16
+ - Maintain separation of concerns (Server → Tools → Managers)
17
+ - Use Puppeteer for browser automation
18
+ - Use Chrome DevTools Protocol for console monitoring
19
+ - Implement intelligent log truncation (from AgentDesk patterns)
20
+
21
+ 3. **Code Quality**
22
+ - Write TypeScript with strict mode
23
+ - Add JSDoc comments for public APIs
24
+ - Follow existing code style (Prettier + ESLint)
25
+ - Write tests for new features (Jest)
26
+
27
+ 4. **Testing**
28
+ - Unit tests for business logic
29
+ - Integration tests for tool handlers
30
+ - Maintain 70%+ code coverage
31
+
32
+ 5. **Documentation**
33
+ - Update README.md if adding new tools
34
+ - Update docs/ARCHITECTURE.md for significant changes
35
+ - Add inline comments for complex logic
36
+
37
+ ## Example Usage
38
+
39
+ ```
40
+ /sc:implement Add error categorization to console logs
41
+ ```
42
+
43
+ This will activate the implementation agent with context about the MCP server project.
@@ -0,0 +1,73 @@
1
+ # Tasarım Sistemi Kütüphanesi Kur / Güncelle
2
+
3
+ Kullanıcı "kütüphane kur", "library kur", "library install", "kütüphane yükle", "kütüphane güncelle" dediğinde veya bir `.md` dosya yolu verip "bunu kur" dediğinde bu komutu uygula.
4
+
5
+ ## Kullanım
6
+
7
+ ```
8
+ /install-library /Users/isim/Downloads/sui.md
9
+ ```
10
+
11
+ ## Akış
12
+
13
+ ### Adım 1 — Dosyayı bul
14
+
15
+ Kullanıcı bir dosya yolu verdiyse onu kullan. Vermediyse sor:
16
+ > "Kütüphane dosyasının yolunu verin (örn: ~/Downloads/sui.md)"
17
+
18
+ Dosyanın varlığını kontrol et. Yoksa: "Bu dosya bulunamadı. Yolu kontrol edin."
19
+
20
+ ### Adım 2 — Dosyayı doğrula
21
+
22
+ Dosyayı oku ve şunları kontrol et:
23
+ 1. İlk satırda `# ` ile başlayan bir başlık var mı
24
+ 2. `File Key` içeren bir tablo satırı var mı
25
+ 3. `## Genel Bilgi` bölümü var mı
26
+
27
+ Üçünden biri yoksa:
28
+ > "Bu dosya geçerli bir kütüphane dosyası gibi görünmüyor. `/add-library` ile yeni bir kütüphane oluşturabilirsiniz."
29
+
30
+ ### Adım 3 — Kütüphane adını çıkar
31
+
32
+ Dosyanın ilk satırındaki başlıktan kütüphane adını al:
33
+ - `# SUI — Sahibinden Design System` → dosya adı: `sui.md`
34
+ - `# Primer — GitHub Design System` → dosya adı: `primer.md`
35
+
36
+ Adı küçük harfe çevir, Türkçe karakterleri koru, boşlukları tire yap.
37
+
38
+ ### Adım 4 — Kopyala veya güncelle
39
+
40
+ Hedef: `.claude/libraries/{kütüphane-adı}.md`
41
+
42
+ **Yeni kurulum:** Dosyayı hedefe kopyala.
43
+
44
+ **Güncelleme (dosya zaten varsa):**
45
+ 1. Mevcut dosyadaki `Son tarama` tarihini oku
46
+ 2. Yeni dosyadaki `Son tarama` tarihini oku
47
+ 3. Kullanıcıya bildir:
48
+ > "SUI kütüphanesi zaten kurulu (son tarama: 2026-04-10). Yeni versiyon: 2026-04-15. Güncellemek istediğinize emin misiniz?"
49
+ 4. Onay alırsan üzerine yaz
50
+
51
+ ### Adım 5 — Sistem dosyalarını kontrol et
52
+
53
+ 1. **`.gitignore`** — `.claude/libraries/` satırı yoksa ekle
54
+ 2. Dosya başarıyla kopyalandığını doğrula
55
+
56
+ ### Adım 6 — Kullanıcıya bildir
57
+
58
+ Kısa özet:
59
+
60
+ **Yeni kurulum için:**
61
+ > ✅ {Kütüphane Adı} kuruldu.
62
+ >
63
+ > Skill'ler artık bu kütüphaneyi otomatik olarak tanıyacak. Figma'da plugin bağlıyken kütüphanedeki bileşen ve token'lara erişebilirsiniz.
64
+
65
+ **Güncelleme için:**
66
+ > ✅ {Kütüphane Adı} güncellendi ({eski tarih} → {yeni tarih}).
67
+
68
+ ## Kurallar
69
+
70
+ - Kullanıcıya teknik adım anlatma. Dosya yolunu al, gerisini sen yap.
71
+ - `project-context.md`'yi DEĞİŞTİRME — kütüphane sistemi zaten `.claude/libraries/` dizinini taramayı biliyor.
72
+ - Dosya kopyalaması için `cp` komutu kullan, dosya içeriğini okuyup yazma (büyük dosyalarda sorun olur).
73
+ - Güncelleme sırasında eski dosyayı yedekleme — kullanıcı zaten orijinal dosyaya sahip.
@@ -0,0 +1,26 @@
1
+ # F-MCP Kurulum
2
+
3
+ Kullanıcı "kur", "setup", "install", "bunu kur", GitHub linki verip kurulum isterse bu komutu uygula.
4
+
5
+ ## Talimatlar
6
+
7
+ Kullanıcıya terminal komutu verme. Her şeyi sen yap:
8
+
9
+ 1. Repo clone edilmiş mi kontrol et: `ls package.json 2>/dev/null && node -e "console.log(require('./package.json').name)"`
10
+ 2. Clone edilmişse: `bash scripts/setup.sh` çalıştır
11
+ 3. Clone edilmemişse: `git clone https://github.com/atezer/FMCP.git && cd FMCP && bash scripts/setup.sh` çalıştır
12
+ 4. Kullanıcıya sadece şunu söyle:
13
+
14
+ > Kurulum tamamlandı. Claude'u yeniden başlat ve Figma'da Plugins → F-MCP ATezer Bridge → yeşil "Ready" yazısını gör.
15
+
16
+ ## Hata durumunda
17
+
18
+ - Git yoksa: Xcode Command Line Tools kurulumu öner (macOS'ta otomatik gelir)
19
+ - Node.js yoksa: setup.sh zaten Homebrew ile otomatik kurar
20
+ - Her şey başarısızsa: kullanıcıya "https://github.com/atezer/FMCP adresindeki README'yi takip edin" de
21
+
22
+ ## Önemli
23
+
24
+ - Kullanıcıya ASLA terminal komutu yapıştırmasını söyleme
25
+ - Kullanıcıya ASLA teknik adımları açıklama
26
+ - Sadece sonucu bildir ve "yeniden başlat" de
@@ -0,0 +1,39 @@
1
+ # Test Command
2
+
3
+ Run tests and ensure code quality for the F-MCP ATezer server.
4
+
5
+ ## Instructions
6
+
7
+ 1. **Run Test Suite**
8
+ ```bash
9
+ npm test
10
+ ```
11
+
12
+ 2. **Watch Mode** (for development)
13
+ ```bash
14
+ npm run test:watch
15
+ ```
16
+
17
+ 3. **Coverage Report**
18
+ ```bash
19
+ npm run test:coverage
20
+ ```
21
+
22
+ 4. **Test Requirements**
23
+ - All new code must have tests
24
+ - Maintain 70%+ coverage threshold
25
+ - Tests must pass before commits
26
+ - Use descriptive test names
27
+
28
+ 5. **Test Structure**
29
+ - Unit tests: `src/**/*.test.ts`
30
+ - Integration tests: `tests/**/*.test.ts`
31
+ - Use Jest with ts-jest preset
32
+
33
+ ## Example Usage
34
+
35
+ ```
36
+ /sc:test
37
+ ```
38
+
39
+ This will run the complete test suite and report results.
@@ -0,0 +1,25 @@
1
+ # F-MCP Güncelleme
2
+
3
+ Kullanıcı "güncelle", "update", "F-MCP'yi güncelle" gibi bir şey söylediğinde bu komutu uygula.
4
+
5
+ ## Talimatlar
6
+
7
+ Kullanıcıya terminal komutu verme. Her şeyi sen yap:
8
+
9
+ 1. Repo kökünde `bash scripts/update.sh` çalıştır
10
+ 2. Sonucu kontrol et — yeni sürüm numarasını kullanıcıya bildir
11
+ 3. Kullanıcıya sadece şunu söyle:
12
+
13
+ > Güncelleme tamamlandı (vX.Y.Z). Claude'u yeniden başlat ve Figma'da plugin'i kapat-aç.
14
+
15
+ ## Hata durumunda
16
+
17
+ - `scripts/update.sh` yoksa: `git pull origin main && npm install && npm run build:local` çalıştır
18
+ - Node.js yoksa: `bash scripts/setup.sh` öner (bu da otomatik kurar)
19
+ - Git conflict varsa: kullanıcıya bildir, `git stash` ile çöz
20
+
21
+ ## Önemli
22
+
23
+ - Kullanıcıya ASLA terminal komutu yapıştırmasını söyleme
24
+ - Kullanıcıya ASLA teknik adımları açıklama
25
+ - Sadece sonucu bildir ve "yeniden başlat" de
@@ -7,11 +7,7 @@ import type { ServerConfig } from './types/index.js';
7
7
  */
8
8
  export declare function loadConfig(): ServerConfig;
9
9
  /**
10
- * Validate configuration
11
- */
12
- export declare function validateConfig(config: ServerConfig): void;
13
- /**
14
- * Get configuration with validation
10
+ * Get configuration
15
11
  */
16
12
  export declare function getConfig(): ServerConfig;
17
13
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAuErD;;GAEG;AACH,wBAAgB,UAAU,IAAI,YAAY,CAqBzC;AA+BD;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAkCzD;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,YAAY,CAIxC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA2BrD;;GAEG;AACH,wBAAgB,UAAU,IAAI,YAAY,CAyBzC;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,YAAY,CAExC"}
@@ -4,53 +4,12 @@
4
4
  import { readFileSync, existsSync } from 'fs';
5
5
  import { homedir } from 'os';
6
6
  import { join } from 'path';
7
- /**
8
- * Auto-detect server mode based on environment
9
- */
10
- function detectMode() {
11
- // If running in Workers environment, return cloudflare
12
- if (typeof globalThis !== 'undefined' && 'caches' in globalThis) {
13
- return 'cloudflare';
14
- }
15
- // Explicit env var override
16
- const modeEnv = process.env.FIGMA_MCP_MODE?.toLowerCase();
17
- if (modeEnv === 'local' || modeEnv === 'cloudflare') {
18
- return modeEnv;
19
- }
20
- // Default to local for Node.js environments
21
- return 'local';
22
- }
23
7
  /**
24
8
  * Default configuration values
25
9
  */
26
10
  const DEFAULT_CONFIG = {
27
- mode: detectMode(),
28
- browser: {
29
- headless: false,
30
- args: [
31
- '--disable-blink-features=AutomationControlled',
32
- '--disable-dev-shm-usage',
33
- '--no-sandbox', // Note: Only use in trusted environments
34
- ],
35
- },
36
- console: {
37
- bufferSize: 1000,
38
- filterLevels: ['log', 'info', 'warn', 'error', 'debug'],
39
- truncation: {
40
- maxStringLength: 500,
41
- maxArrayLength: 10,
42
- maxObjectDepth: 3,
43
- removeDuplicates: true,
44
- },
45
- },
46
- screenshots: {
47
- defaultFormat: 'png',
48
- quality: 90,
49
- storePath: join(process.env.TMPDIR || '/tmp', 'figma-mcp-bridge', 'screenshots'),
50
- },
11
+ mode: 'local',
51
12
  local: {
52
- debugHost: process.env.FIGMA_DEBUG_HOST || 'localhost',
53
- debugPort: parseInt(process.env.FIGMA_DEBUG_PORT || '9222', 10),
54
13
  pluginBridgePort: parseInt(process.env.FIGMA_MCP_BRIDGE_PORT || process.env.FIGMA_PLUGIN_BRIDGE_PORT || '5454', 10),
55
14
  auditLogPath: process.env.FIGMA_MCP_AUDIT_LOG_PATH || undefined,
56
15
  },
@@ -78,9 +37,14 @@ export function loadConfig() {
78
37
  try {
79
38
  const fileContent = readFileSync(configPath, 'utf-8');
80
39
  const userConfig = JSON.parse(fileContent);
81
- // Deep merge with defaults
82
- const config = mergeConfig(DEFAULT_CONFIG, userConfig);
83
- return config;
40
+ // Merge with defaults
41
+ return {
42
+ mode: 'local',
43
+ local: {
44
+ ...DEFAULT_CONFIG.local,
45
+ ...(userConfig.local || {}),
46
+ },
47
+ };
84
48
  }
85
49
  catch (error) {
86
50
  console.error(`Failed to load config from ${configPath}:`, error);
@@ -92,73 +56,9 @@ export function loadConfig() {
92
56
  return DEFAULT_CONFIG;
93
57
  }
94
58
  /**
95
- * Deep merge two configuration objects
96
- */
97
- function mergeConfig(defaults, overrides) {
98
- return {
99
- mode: overrides.mode || defaults.mode,
100
- browser: {
101
- ...defaults.browser,
102
- ...(overrides.browser || {}),
103
- },
104
- console: {
105
- ...defaults.console,
106
- ...(overrides.console || {}),
107
- truncation: {
108
- ...defaults.console.truncation,
109
- ...(overrides.console?.truncation || {}),
110
- },
111
- },
112
- screenshots: {
113
- ...defaults.screenshots,
114
- ...(overrides.screenshots || {}),
115
- },
116
- local: {
117
- ...defaults.local,
118
- ...(overrides.local || {}),
119
- },
120
- };
121
- }
122
- /**
123
- * Validate configuration
124
- */
125
- export function validateConfig(config) {
126
- // Validate browser config
127
- if (!Array.isArray(config.browser.args)) {
128
- throw new Error('browser.args must be an array');
129
- }
130
- // Validate console config
131
- if (config.console.bufferSize <= 0) {
132
- throw new Error('console.bufferSize must be positive');
133
- }
134
- if (!Array.isArray(config.console.filterLevels)) {
135
- throw new Error('console.filterLevels must be an array');
136
- }
137
- // Validate truncation config
138
- const { truncation } = config.console;
139
- if (truncation.maxStringLength <= 0) {
140
- throw new Error('console.truncation.maxStringLength must be positive');
141
- }
142
- if (truncation.maxArrayLength <= 0) {
143
- throw new Error('console.truncation.maxArrayLength must be positive');
144
- }
145
- if (truncation.maxObjectDepth <= 0) {
146
- throw new Error('console.truncation.maxObjectDepth must be positive');
147
- }
148
- // Validate screenshot config
149
- if (!['png', 'jpeg'].includes(config.screenshots.defaultFormat)) {
150
- throw new Error('screenshots.defaultFormat must be "png" or "jpeg"');
151
- }
152
- if (config.screenshots.quality < 0 || config.screenshots.quality > 100) {
153
- throw new Error('screenshots.quality must be between 0 and 100');
154
- }
155
- }
156
- /**
157
- * Get configuration with validation
59
+ * Get configuration
158
60
  */
159
61
  export function getConfig() {
160
- const config = loadConfig();
161
- validateConfig(config);
162
- return config;
62
+ return loadConfig();
163
63
  }
164
64
  //# sourceMappingURL=config.js.map