@atezer/figma-mcp-bridge 1.7.24 → 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 (44) hide show
  1. package/.claude-plugin/plugin.json +37 -0
  2. package/.cursor-plugin/plugin.json +21 -0
  3. package/README.md +4 -3
  4. package/agents/ds-auditor.md +29 -0
  5. package/agents/screen-builder.md +29 -0
  6. package/agents/token-syncer.md +26 -0
  7. package/assets/logo.png +0 -0
  8. package/commands/add-library.md +122 -0
  9. package/commands/ds-add.md +255 -0
  10. package/commands/ds-sync.md +314 -0
  11. package/commands/implement.md +43 -0
  12. package/commands/install-library.md +73 -0
  13. package/commands/setup.md +26 -0
  14. package/commands/test.md +39 -0
  15. package/commands/update.md +25 -0
  16. package/dist/core/response-guard.d.ts +1 -1
  17. package/dist/core/response-guard.js +1 -1
  18. package/dist/core/version.d.ts +1 -1
  19. package/dist/core/version.js +1 -1
  20. package/hooks/hooks.json +26 -0
  21. package/package.json +8 -1
  22. package/skills/BRAND_PROFILE_SCHEMA.md +113 -0
  23. package/skills/SKILL_INDEX.md +194 -0
  24. package/skills/TOOL_MAPPING.md +111 -0
  25. package/skills/ai-handoff-export/SKILL.md +254 -0
  26. package/skills/apply-figma-design-system/SKILL.md +104 -0
  27. package/skills/audit-figma-design-system/SKILL.md +278 -0
  28. package/skills/code-design-mapper/SKILL.md +370 -0
  29. package/skills/component-documentation/SKILL.md +190 -0
  30. package/skills/design-drift-detector/SKILL.md +407 -0
  31. package/skills/design-system-rules/SKILL.md +407 -0
  32. package/skills/design-token-pipeline/SKILL.md +619 -0
  33. package/skills/ds-impact-analysis/SKILL.md +266 -0
  34. package/skills/figjam-diagram-builder/SKILL.md +172 -0
  35. package/skills/figma-a11y-audit/SKILL.md +587 -0
  36. package/skills/figma-canvas-ops/SKILL.md +325 -0
  37. package/skills/figma-screen-analyzer/SKILL.md +235 -0
  38. package/skills/fix-figma-design-system-finding/SKILL.md +117 -0
  39. package/skills/fmcp-project-rules/SKILL.md +93 -0
  40. package/skills/generate-figma-library/SKILL.md +598 -0
  41. package/skills/generate-figma-screen/SKILL.md +689 -0
  42. package/skills/implement-design/SKILL.md +473 -0
  43. package/skills/ux-copy-guidance/SKILL.md +373 -0
  44. package/skills/visual-qa-compare/SKILL.md +166 -0
@@ -0,0 +1,370 @@
1
+ ---
2
+ name: code-design-mapper
3
+ description: Figma tasarım bileşenlerini iOS, Android ve Web platformlarındaki kod bileşenlerine eşler. Bir Figma component'i birden fazla platform implementasyonuyla eşleşebilir. Enterprise plan gerektirmez, lokal çalışır. "code connect", "connect component", "map component", "bileşen eşle", "component mapping", "hangi kod bu bileşene karşılık geliyor", "bileşen eşleme tablosu" ifadeleriyle tetiklenir. F-MCP Bridge plugin bağlantısı gerektirir.
4
+ metadata:
5
+ mcp-server: user-figma-mcp-bridge
6
+ personas:
7
+ - uidev
8
+ - designops
9
+ ---
10
+
11
+ # Code-Design Mapper (Multi-Platform)
12
+
13
+ ## Overview
14
+
15
+ Bu skill, Figma tasarım bileşenlerini **iOS, Android ve Web** platformlarındaki kod karşılıklarına eşler. Tek bir Figma component'i 3 farklı platform implementasyonuyla eşleşebilir.
16
+
17
+ Figma resmi Code Connect'ten farkları:
18
+ - Enterprise plan gerektirmez
19
+ - Published component zorunluluğu yok
20
+ - **Multi-platform mapping**: 1 Figma component → N platform implementasyonu
21
+ - Her platformun implementasyon durumu ayrı izlenir
22
+ - Platformlar arası tutarlılık kontrolü
23
+
24
+ REST API veya Figma access token gerekmez.
25
+
26
+ ## Code Connect Uyarlama Notu
27
+
28
+ Resmi Figma MCP'de Code Connect akışı `get_code_connect_suggestions` ve `send_code_connect_mappings` araçlarıyla çalışır. **F-MCP Bridge'de bu araçlar kayıtlı değildir** (FUTURE.md'de planlı).
29
+
30
+ F-MCP ile eşdeğer iş akışı:
31
+
32
+ | Resmi Code Connect adımı | F-MCP Bridge karşılığı |
33
+ |---|---|
34
+ | Resmi: code connect suggestions | `figma_search_components` + `figma_get_component` + `figma_get_component_for_development` |
35
+ | Bileşen–kod eşleme | AI ile `.figma-mappings.json` üretimi (bu skill'in ana akışı) |
36
+ | Resmi: send code connect mappings | **yok** — eşleme dosyası repoda kalır, Figma'ya gönderilmez |
37
+
38
+ **Resmi Code Connect `.figma.js` şablonları gerekiyorsa:** Kullanıcıya resmi Figma MCP sunucusunu etkinleştirmesi ve [topluluk figma-code-connect skill'ini](https://github.com/figma/mcp-server-guide/blob/main/skills/figma-code-connect/SKILL.md) kullanması önerilir.
39
+
40
+ **Bridge'e Code Connect araçları eklendiğinde** bu bölüm ve iş akışı güncellenmeli.
41
+
42
+ ## Prerequisites
43
+
44
+ - F-MCP Bridge plugin Figma'da çalışıyor ve bağlı olmalı
45
+ - En az bir platformda component implementasyonu mevcut olmalı
46
+ - Platform proje dizinleri biliniyor olmalı
47
+
48
+ ## F-MCP skill koordinasyonu
49
+
50
+ - **Önce:** Stabil kütüphane instance’ları için isteğe bağlı **apply-figma-design-system** veya **audit-figma-design-system**.
51
+ - **Sonra:** `.figma-mappings.json` ile **design-drift-detector** ve **implement-design**; manifest için **ai-handoff-export**.
52
+
53
+ ## Required Workflow
54
+
55
+ **Bu adımları sırayla uygula. Adım atlama.**
56
+
57
+ ### Step 1: Plugin Bağlantısını Doğrula
58
+
59
+ ```
60
+ figma_get_status()
61
+ ```
62
+
63
+ ### Step 2: Platform Projelerini Belirle
64
+
65
+ Kullanıcıdan veya codebase'den platform proje köklerini belirle:
66
+
67
+ ```
68
+ Hangi platformlarda çalışıyorsunuz ve proje dizinleri nerede?
69
+
70
+ - iOS: ör. ios-app/ veya MyApp.xcodeproj/
71
+ - Android: ör. android-app/ veya app/src/main/
72
+ - Web: ör. web-app/ veya src/
73
+ ```
74
+
75
+ Her platform için component dizinlerini tespit et:
76
+
77
+ | Platform | Yaygın Component Dizinleri |
78
+ |----------|---------------------------|
79
+ | **iOS (SwiftUI)** | `Sources/Components/`, `Views/`, `UI/` |
80
+ | **iOS (UIKit)** | `Views/`, `UI/Components/`, `Cells/` |
81
+ | **Android (Compose)** | `ui/components/`, `presentation/components/` |
82
+ | **Android (XML)** | `res/layout/`, `res/values/styles.xml` |
83
+ | **Web (React)** | `src/components/`, `components/ui/` |
84
+ | **Web (Vue)** | `src/components/`, `views/` |
85
+ | **Web (Legacy)** | `templates/`, `partials/`, `public/js/` |
86
+
87
+ ### Step 3: Figma Component'lerini Keşfet
88
+
89
+ Belirli component:
90
+
91
+ ```
92
+ figma_get_component(nodeId="<NODE_ID>")
93
+ ```
94
+
95
+ Tüm component'ler (aktif sayfa):
96
+
97
+ ```
98
+ figma_search_components(query="", currentPageOnly=true, limit=50)
99
+ ```
100
+
101
+ **Uyarı:** `currentPageOnly=false` büyük dosyalarda timeout'a neden olabilir. Önce `currentPageOnly=true` (varsayılan) ile dene. Component başka sayfadaysa dikkatli şekilde `false` kullan.
102
+
103
+ ### Step 4: Component Detaylarını Çek
104
+
105
+ ```
106
+ figma_get_component_for_development(nodeId="<NODE_ID>", scale=2, format="PNG")
107
+ ```
108
+
109
+ Bu tek çağrıda hem metadata hem base64 screenshot döner. Ancak base64 screenshot context'i şişirir — çok fazla component taranacaksa önce `figma_get_component(nodeId="...")` (sadece metadata) kullan, screenshot'ı sadece eşleşme onayı için al.
110
+
111
+ Her component için Figma'daki bilgiler:
112
+ - Component adı ve yolu
113
+ - Variant özellikleri (variant props ve değerleri)
114
+ - Child yapısı
115
+ - Görsel referans (base64 screenshot — context ağır)
116
+
117
+ ### Step 5: Her Platformda Eşleşme Ara
118
+
119
+ Her Figma component'i için, **her platformda ayrı ayrı** eşleşme ara:
120
+
121
+ **iOS arama:**
122
+ - `.swift` dosyalarında `struct ComponentName: View` (SwiftUI)
123
+ - `.swift` dosyalarında `class ComponentName: UIView` (UIKit)
124
+ - `.xib` / `.storyboard` dosyalarında custom class referansları
125
+
126
+ **Android arama:**
127
+ - `.kt` dosyalarında `@Composable fun ComponentName` (Compose)
128
+ - `res/layout/` altında `component_name.xml` (XML)
129
+ - Custom View class'ları
130
+
131
+ **Web arama:**
132
+ - `.tsx`/`.jsx` dosyalarında `export function ComponentName` veya `export const ComponentName`
133
+ - `.vue` dosyalarında `<script>` içinde component tanımı
134
+ - `.html`/`.hbs` dosyalarında template/partial
135
+
136
+ ### Step 6: Eşleşmeleri Kullanıcıya Sun
137
+
138
+ **Multi-platform sunum formatı:**
139
+
140
+ ```
141
+ Figma Component: Button (42:15)
142
+ Variant'lar: primary | secondary | ghost × sm | md | lg
143
+
144
+ Platform Eşleşmeleri:
145
+ ┌──────────┬────────────────────────────────────┬──────────┐
146
+ │ Platform │ Kod Dosyası │ Durum │
147
+ ├──────────┼────────────────────────────────────┼──────────┤
148
+ │ iOS │ Sources/UI/ButtonComponent.swift │ Eşleşti │
149
+ │ Android │ ui/components/ButtonComponent.kt │ Eşleşti │
150
+ │ Web │ src/components/Button.tsx │ Eşleşti │
151
+ └──────────┴────────────────────────────────────┴──────────┘
152
+
153
+ Figma Component: Avatar (42:30)
154
+ ┌──────────┬────────────────────────────────────┬──────────────┐
155
+ │ Platform │ Kod Dosyası │ Durum │
156
+ ├──────────┼────────────────────────────────────┼──────────────┤
157
+ │ iOS │ Sources/UI/AvatarView.swift │ Eşleşti │
158
+ │ Android │ — │ Eksik │
159
+ │ Web │ src/components/Avatar.tsx │ Eşleşti │
160
+ └──────────┴────────────────────────────────────┴──────────────┘
161
+
162
+ Bu eşleşmeleri kaydetmek ister misiniz?
163
+ ```
164
+
165
+ ### Step 7: Multi-Platform Mapping Dosyasını Oluştur/Güncelle
166
+
167
+ **Önemli:** `.figma-mappings.json` dosyası AI agent tarafından oluşturulur ve yönetilir. Hiçbir MCP aracı bu dosyayı okumaz veya yazmaz — tamamen agent-tarafı bir artifact'tir.
168
+
169
+ Proje kökünde `.figma-mappings.json` dosyası:
170
+
171
+ ```json
172
+ {
173
+ "version": "2.0",
174
+ "lastUpdated": "2026-03-12T10:30:00Z",
175
+ "figmaFile": "Design System",
176
+ "platforms": {
177
+ "ios": {
178
+ "rootDir": "ios-app/",
179
+ "framework": "SwiftUI",
180
+ "language": "Swift",
181
+ "componentDirs": ["Sources/UI/", "Sources/Components/"]
182
+ },
183
+ "android": {
184
+ "rootDir": "android-app/",
185
+ "framework": "Compose",
186
+ "language": "Kotlin",
187
+ "componentDirs": ["app/src/main/java/com/app/ui/components/"]
188
+ },
189
+ "web": {
190
+ "rootDir": "web-app/",
191
+ "framework": "React",
192
+ "language": "TypeScript",
193
+ "componentDirs": ["src/components/", "src/ui/"]
194
+ }
195
+ },
196
+ "components": [
197
+ {
198
+ "figmaNodeId": "42:15",
199
+ "figmaName": "Button",
200
+ "figmaPath": "Components/Button",
201
+ "variants": {
202
+ "variant": ["primary", "secondary", "ghost"],
203
+ "size": ["sm", "md", "lg"]
204
+ },
205
+ "implementations": {
206
+ "ios": {
207
+ "codePath": "ios-app/Sources/UI/ButtonComponent.swift",
208
+ "componentName": "ButtonComponent",
209
+ "propMapping": {
210
+ "variant": { "codeProp": "style", "codeType": "ButtonStyle" },
211
+ "size": { "codeProp": "size", "codeType": "ButtonSize" }
212
+ },
213
+ "status": "synced",
214
+ "lastSync": "2026-03-12T10:30:00Z"
215
+ },
216
+ "android": {
217
+ "codePath": "android-app/app/src/main/java/com/app/ui/components/ButtonComponent.kt",
218
+ "componentName": "ButtonComponent",
219
+ "propMapping": {
220
+ "variant": { "codeProp": "variant", "codeType": "ButtonVariant" },
221
+ "size": { "codeProp": "size", "codeType": "ButtonSize" }
222
+ },
223
+ "status": "synced",
224
+ "lastSync": "2026-03-12T10:30:00Z"
225
+ },
226
+ "web": {
227
+ "codePath": "web-app/src/components/Button.tsx",
228
+ "componentName": "Button",
229
+ "propMapping": {
230
+ "variant": { "codeProp": "variant", "codeType": "string" },
231
+ "size": { "codeProp": "size", "codeType": "string" }
232
+ },
233
+ "status": "synced",
234
+ "lastSync": "2026-03-12T10:30:00Z"
235
+ }
236
+ }
237
+ },
238
+ {
239
+ "figmaNodeId": "42:30",
240
+ "figmaName": "Avatar",
241
+ "figmaPath": "Components/Avatar",
242
+ "variants": {
243
+ "size": ["xs", "sm", "md", "lg", "xl"]
244
+ },
245
+ "implementations": {
246
+ "ios": {
247
+ "codePath": "ios-app/Sources/UI/AvatarView.swift",
248
+ "componentName": "AvatarView",
249
+ "status": "synced",
250
+ "lastSync": "2026-03-12T10:30:00Z"
251
+ },
252
+ "android": null,
253
+ "web": {
254
+ "codePath": "web-app/src/components/Avatar.tsx",
255
+ "componentName": "Avatar",
256
+ "status": "outdated",
257
+ "lastSync": "2026-02-15T14:00:00Z"
258
+ }
259
+ }
260
+ }
261
+ ],
262
+ "coverageSummary": {
263
+ "totalComponents": 25,
264
+ "ios": { "implemented": 20, "missing": 5, "outdated": 2 },
265
+ "android": { "implemented": 18, "missing": 7, "outdated": 1 },
266
+ "web": { "implemented": 22, "missing": 3, "outdated": 3 }
267
+ }
268
+ }
269
+ ```
270
+
271
+ ### Step 8: Platform Coverage Raporu Oluştur
272
+
273
+ Mapping tamamlandıktan sonra coverage raporu sun:
274
+
275
+ ```
276
+ Design System Platform Coverage Raporu
277
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
278
+ Toplam Figma Component: 25
279
+
280
+ iOS Android Web
281
+ Impl. 20/25 18/25 22/25
282
+ % 80% 72% 88%
283
+ Güncel 18/20 17/18 19/22
284
+ Eksik 5 7 3
285
+
286
+ Eksik Component'ler:
287
+ Android: Avatar, Tooltip, Breadcrumb, Stepper, DatePicker
288
+ iOS: Breadcrumb, DataTable, Pagination, RichText, CodeBlock
289
+ Web: Stepper, DatePicker, BottomSheet
290
+ ```
291
+
292
+ ## Mevcut Mapping'leri Güncelleme
293
+
294
+ "Mapping'leri güncelle" veya "sync" dendiğinde:
295
+
296
+ 1. `.figma-mappings.json` oku
297
+ 2. Her component + her platform için güncel durumu kontrol et
298
+ 3. Figma'da variant değişikliği varsa → `status: "outdated"`
299
+ 4. Kodda component silinmişse → `status: "missing"`
300
+ 5. Coverage summary'yi güncelle
301
+
302
+ ## Eksik Platform Implementasyonu Başlatma
303
+
304
+ Coverage raporunda eksik görünen component'i implement etmek için:
305
+
306
+ 1. Mapping'den eksik platformu ve Figma nodeId'yi belirle
307
+ 2. `figma_get_component_for_development(nodeId="...")` ile Figma verisini al
308
+ 3. **implement-design** skill'ini hedef platform belirterek kullan
309
+ 4. Oluşturulan implementasyonu mapping'e ekle
310
+
311
+ ## Examples
312
+
313
+ ### Örnek 1: Tekli Component — 3 Platform Eşleme
314
+
315
+ Kullanıcı: "Button component'ini tüm platformlarda eşle, nodeId: 42:15"
316
+
317
+ **Akış:**
318
+
319
+ 1. `figma_get_status()` → bağlı
320
+ 2. `figma_get_component_for_development(nodeId="42:15")` → Button, variants
321
+ 3. iOS'ta ara → `ButtonComponent.swift` bulundu
322
+ 4. Android'de ara → `ButtonComponent.kt` bulundu
323
+ 5. Web'de ara → `Button.tsx` bulundu
324
+ 6. 3 platform eşleşmesini sun
325
+ 7. Kullanıcı onayladı → `.figma-mappings.json`'a kaydet
326
+
327
+ ### Örnek 2: Platform Eksikleri Tespiti
328
+
329
+ Kullanıcı: "Tüm component'leri tara, hangi platformlarda eksik göster"
330
+
331
+ **Akış:**
332
+
333
+ 1. `figma_search_components(query="", currentPageOnly=false)` → 25 component
334
+ 2. Her component için 3 platformda ara
335
+ 3. Coverage raporu oluştur
336
+ 4. Kullanıcıya öncelik öner: "Android'de 7 component eksik, en kritikleri: Avatar, Tooltip"
337
+
338
+ ### Örnek 3: Sadece Bir Platform İçin Eşleme
339
+
340
+ Kullanıcı: "Android Compose component'lerini Figma ile eşle"
341
+
342
+ **Akış:**
343
+
344
+ 1. Sadece Android component dizinlerini tara
345
+ 2. Figma component'leriyle eşleştir
346
+ 3. Sadece Android sütununu güncelle, diğer platformları koru
347
+
348
+ ## Common Issues and Solutions
349
+
350
+ ### Sorun: Platform projesi farklı repo'da
351
+
352
+ **Çözüm:** `platforms.ios.rootDir` alanını absolute path veya relative path olarak ayarla. Farklı repo'lar için workspace root'a göre path ver.
353
+
354
+ ### Sorun: Aynı Figma component'i platformlarda farklı isimle
355
+
356
+ **Çözüm:** Her platform implementasyonunun `componentName` alanı bağımsızdır. Figma'da "SegmentedControl" → iOS'ta "Picker", Android'de "TabRow", Web'de "SegmentedControl" olabilir.
357
+
358
+ ### Sorun: Platform-spesifik component (ör. BottomSheet sadece mobile)
359
+
360
+ **Çözüm:** Web implementasyonu `null` olarak bırak, coverage raporunda "N/A" göster. Platform-specific component'leri mapping'de işaretle.
361
+
362
+ ### Sorun: Legacy ve modern aynı platformda
363
+
364
+ **Çözüm:** `platforms` altında ayrı entry ekle: `"web-legacy": { "framework": "jQuery", ... }`. Bir Figma component'in hem modern hem legacy web karşılığı olabilir.
365
+
366
+ ## Evolution Triggers
367
+
368
+ - Bridge'e Code Connect araçları (suggestions / send mappings) eklenirse Code Connect uyarlama bölümü ve iş akışı güncellenmeli
369
+ - Yeni platform desteği (Flutter, .NET MAUI) eklenirse platform profilleri genişletilmeli
370
+ - `.figma-mappings.json` şeması değişirse çıktı formatı uyarlanmalı
@@ -0,0 +1,190 @@
1
+ ---
2
+ name: component-documentation
3
+ description: Figma bileşeni için kullanım kılavuzu oluşturur. "bileşen dokümantasyonu", "component docs", "usage guidelines", "bileşen kılavuzu" ifadeleriyle tetiklenir.
4
+ metadata:
5
+ mcp-server: user-figma-mcp-bridge
6
+ personas:
7
+ - designer
8
+ - designops
9
+ - uidev
10
+ ---
11
+
12
+ # Component Documentation
13
+
14
+ > **Design Token Kuralı:** Bu skill'deki kod örneklerinde geçen font adları, renk kodları, piksel boyutları yalnızca FORMAT gösterimidir. Çalışma anında tüm design token değerleri (font, renk, boyut, spacing, radius, gölge) kayıtlı kütüphaneden (`figma_get_variables`, `figma_get_styles`) veya kullanıcıdan okunmalıdır. Hardcoded token değeri kullanma. Detay: `project-context.md` → "Design Token Kuralı".
15
+
16
+ ## Workflow
17
+
18
+ 1. **Standart kontrolü:** `reference_industry_design_standards.md` oku. "Son güncelleme" 1 yıldan eskiyse kullanıcıya güncelleme öner (kaynak listesi aşağıda).
19
+ 2. **Bileşen analizi:** figma_get_component_for_development + figma_get_design_context (depth=3, full) + figma_get_variables
20
+
21
+ > **DERİN ANALİZ KURALI:** Sadece frame/node isimlerine bakarak sonuç çıkarma. Her node'un içindeki text content (`characters`), instance prop'ları ve child yapılarını detaylı oku. Bir şeyin "eksik" veya "yok" olduğunu iddia etmeden önce tüm child node'ların içeriğini kontrol et.
22
+
23
+ > **GÖRSEL DOĞRULAMA KURALI:** Analiz sonucunu raporlamadan önce `figma_capture_screenshot` ile ekran görüntüsü al ve görsel olarak kontrol et. Text content ile screenshot'ın tutarlı olduğunu teyit et. Çelişki varsa screenshot'ı esas al.
24
+ 3. **Bileşen description güncelleme:** Bileşenin description ve link alanlarını güncelle (bkz. "Bileşen Description Kuralları").
25
+ 4. **KULLANICIYA FORMAT SEÇ:** Aşağıdaki 2 seçeneği içerik özetiyle sun. Onay olmadan frame OLUŞTURMA.
26
+ 5. Seçime göre frame oluştur. Eski aynı isimli frame varsa sil.
27
+ 6. Height bug fix: `primaryAxisSizingMode` FIXED→AUTO toggle.
28
+ 7. Viewport'u frame'e odakla.
29
+
30
+ > **ONAY KURALI:** Bileşene herhangi bir ekleme veya değişiklik yapmadan önce (description, property, variant, child node, frame oluşturma vb.) yapılacak değişikliği açıkça belirt ve kullanıcıdan onay bekle. Sadece okuma/analiz işlemleri onaysız yapılabilir.
31
+
32
+ ---
33
+
34
+ ## Format Seçenekleri
35
+
36
+ ### Standard (~2800px, 780px geniş)
37
+
38
+ | # | Bölüm | İçerik |
39
+ |---|-------|--------|
40
+ | 1 | Intro | Başlık (26px Bold) + 2 satırlık tanıtım |
41
+ | 2 | Variantlar | Kart: gri bg, instance (130px fixed) + isim + açıklama (FILL) |
42
+ | 3 | Durumlar | Grid: Default, Hover, Active, Disabled, Loading, Error, Focus — her durum gerçek instance ile gösterilir (mevcut variant'ın farklı state'leri) |
43
+ | 4 | Kurallar | Do/Dont metin kutuları (yeşil/kırmızı, 3+3 madde) + görsel örnekler (gerçek instance'larla doğru/yanlış çift kartlar) |
44
+ | 5 | Standartlar | Kaynak chip'leri (M3, HIG, WCAG, shadcn) + info kutu (touch, kontrast, hiyerarşi, boyut, states) |
45
+ | 6 | Props | Satır bazlı: prop adı (mavi) + tip/default (gri) + açıklama (FILL) |
46
+ | 7 | Copy Spec | Text node'lar için copy kuralları: max karakter, truncation davranışı, boş durum metni, placeholder. Bkz. [ux-copy-guidance](../ux-copy-guidance/SKILL.md) |
47
+ | 8 | A11y | Info kutu: touch, focus, label, disabled |
48
+ | 9 | Tokenlar | Renk + boyut token satırları, dark mode notu |
49
+ | 10 | Kod | Tek koyu blok: React, SwiftUI, Compose |
50
+
51
+ ### Compact (~1300px, 720px geniş)
52
+
53
+ | # | Bölüm | İçerik |
54
+ |---|-------|--------|
55
+ | 1 | Başlık | 24px Bold + tek satırlık tanıtım |
56
+ | 2 | Variantlar | Satır bazlı: instance + "Name — açıklama" |
57
+ | 3 | Kurallar | Do/Dont minimal: 3+3 madde (görsel örnek yok) |
58
+ | 4 | Teknik | TEK KUTU: touch, kontrast, padding, states, props hepsi içinde |
59
+ | 5 | Tokenlar | 2 satır, bullet-separated |
60
+ | 6 | Kod | Tek koyu blok |
61
+
62
+ > **NOT:** Copy Spec ve Durumlar bölümleri Compact formatta dahil değildir. Bu bölümler yalnızca Standard formatta yer alır.
63
+
64
+ ---
65
+
66
+ ## State Machine Geçiş Diyagramı (Sadece Standard)
67
+
68
+ Etkileşimli bileşenler için durum geçiş diyagramı üretilir. Variant yapısından (`State` prop'u) otomatik çıkarılır:
69
+
70
+ ```mermaid
71
+ stateDiagram-v2
72
+ [*] --> Default
73
+ Default --> Hover : onMouseEnter
74
+ Hover --> Active : onMouseDown / onTouchStart
75
+ Active --> Default : onMouseUp / onTouchEnd
76
+ Default --> Focus : onFocus (Tab)
77
+ Focus --> Default : onBlur
78
+ Default --> Disabled : disabled=true
79
+ Hover --> Default : onMouseLeave
80
+ Active --> Loading : async action
81
+ Loading --> Default : success
82
+ Loading --> Error : failure
83
+ Error --> Default : retry / dismiss
84
+ ```
85
+
86
+ **Kurallar:**
87
+ - Her durumdan `Disabled`'a geçiş mümkün (programatik)
88
+ - `Loading` yalnızca async aksiyon tetikleyen bileşenlerde (Button, Form, Toggle)
89
+ - `Error` yalnızca başarısız olabilecek aksiyonlarda
90
+ - Geçiş tetikleyicileri (onMouseEnter, onFocus vb.) açıkça belirtilmeli
91
+ - Statik bileşenler (Card, Badge, Divider) için diyagram üretilmez
92
+
93
+ ---
94
+
95
+ ## Görsel Do/Don't Örnekleri (Sadece Standard)
96
+
97
+ Kurallar bölümüne metin kutularından SONRA eklenir. Her örnek çift kart (doğru + yanlış) yan yana:
98
+
99
+ ```
100
+ HORIZONTAL row (FILL):
101
+ ├── Doğru kart: yeşil bg + border, gerçek instance'lar, kısa açıklama
102
+ └── Yanlış kart: kırmızı bg + border, gerçek instance'lar, kısa açıklama
103
+ ```
104
+
105
+ Örnek çiftler (bileşen tipine göre adapte et):
106
+ - Hiyerarşi doğru/yanlış: Primary+Secondary vs 2x Primary
107
+ - Etiket doğru/yanlış: "Giriş Yap" vs "Tıkla"
108
+ - Variant kullanımı doğru/yanlış: Primary+Outline+Ghost vs hepsi aynı
109
+
110
+ Her kartta:
111
+ - Başlık: 13px Bold, yeşil/kırmızı
112
+ - Instance satırı: gerçek component instance'ları yan yana
113
+ - Açıklama: 12px, tek satır
114
+
115
+ ---
116
+
117
+ ## Bileşen Description Kuralları
118
+
119
+ ### Description alanı
120
+ - "Bu bileşen nedir ve ne amaçla kullanılır?" sorusuna **tek cümle** cevap ver
121
+ - State listesi, yapı detayları, teknik kurallar gibi uzun bilgileri description'a EKLEME
122
+ - Varsa bileşenin dokümantasyon sayfasını (Documentation frame) oku ve oradan özetle
123
+
124
+ ### Link alanı
125
+ - Bileşenin dokümantasyon sayfası varsa Figma linkini `documentationLinks` olarak ekle
126
+ - Format: `https://www.figma.com/design/{fileKey}/...?node-id={docNodeId}`
127
+
128
+ ### Örnek
129
+ - **Doğru:** "File Upload bileşeni, kullanıcıların belgelerini sisteme yüklemesini sağlar. Buton aracılığıyla dosya seçimi yapılır."
130
+ - **Yanlış:** "Dosya yükleme bileşeni (Mobil). States: empty, loading, loaded, disable. Yapısı: Label + Button + Belgeler listesi + Hint. Kurallar: Genişlik 358px, maks 10 dosya..."
131
+
132
+ ---
133
+
134
+ ## Ortak Kurallar
135
+
136
+ ### Dil
137
+ - Sade, junior-friendly — teknik terimlerin yanına açıklama ekle
138
+ - Her kural 1 satır — neden gerekliyse parantez içinde
139
+ - "CTA" değil "ana aksiyon butonu"
140
+
141
+ ### Türkçe Karakter Kuralı (ZORUNLU)
142
+ Tüm Türkçe metin içeriklerinde doğru Unicode karakterler kullanılmalıdır. ASCII karşılıkları YASAKTIR:
143
+ ş (s değil), ı (i değil), ö (o değil), ü (u değil), ç (c değil), ğ (g değil), İ (I değil), Ş (S değil)
144
+ Son adım: Üretilen tüm Türkçe metinleri karakter kontrolünden geçir.
145
+
146
+ ### Layout
147
+ - Ana frame: VERTICAL, genişlik FIXED, yükseklik AUTO
148
+ - Child'lar: `layoutSizingHorizontal = "FILL"`
149
+ - Metinler: `textAutoResize = "HEIGHT"` — ASLA sabit yükseklik
150
+ - Do/Dont: HORIZONTAL parent, FILL child'lar — ASLA sabit genişlik
151
+ - Font: Inter (Regular, Medium, Semi Bold, Bold)
152
+
153
+ ### Token Bağlama Kontrolü
154
+ Dokümantasyon üretirken bileşendeki bağlı olmayan değerleri tespit et ve uyar.
155
+ Token bağlama kuralları için bkz: `generate-figma-library` skill'i.
156
+
157
+ ### Standart Referansı
158
+ - Hafıza: `reference_industry_design_standards.md` (14 bölüm)
159
+ - Bileşene uygun bölümler seçilir, tamamı yazılmaz
160
+ - Chip'lerle kaynak göster: M3, HIG, WCAG 2.2, shadcn/ui
161
+
162
+ ---
163
+
164
+ ## Standart Güncelleme Kaynakları (Yıllık)
165
+
166
+ | Kaynak | URL | Kontrol |
167
+ |--------|-----|---------|
168
+ | shadcn/ui | shadcn.com | Yeni bileşenler, tema tokenları |
169
+ | Tailwind CSS | tailwindcss.com | Varsayılan değerler, breaking changes |
170
+ | Radix UI | radix-ui.com | Yeni primitive'ler, a11y kalıpları |
171
+ | Lucide Icons | lucide.dev | Grid/stroke değişiklikleri |
172
+ | Material Design 3 | m3.material.io | M3 Expressive, bileşen specleri |
173
+ | Apple HIG | developer.apple.com/design | Liquid Glass, platform kuralları |
174
+ | WCAG | w3.org/TR/WCAG22 | Yeni SC'ler, hedef boyut |
175
+ | W3C Design Tokens | designtokens.org | DTCG format, yeni tipler |
176
+ | Carbon DS | carbondesignsystem.com | Bileşen checklist |
177
+
178
+ ---
179
+
180
+ ## Marka Profili Entegrasyonu
181
+
182
+ `.fmcp-brand-profile.json` varsa:
183
+ - `voiceTone` → Bileşen açıklama ve kullanım notlarının ton kalibrasyonu
184
+ - `copyRules` → Copy Spec bölümünde CTA max karakter, kaçınılacak kelimeler referansı
185
+
186
+ ## Skill Koordinasyonu
187
+
188
+ - Öncesi: `generate-figma-library` veya `figma-canvas-ops`
189
+ - Sonrası: `ai-handoff-export`
190
+ - İlişkili: `figma-a11y-audit`, `ux-copy-guidance`, `reference_industry_design_standards.md`