@turk.net/mui 3.0.7 → 3.0.8

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/SKILL_SETUP.md CHANGED
@@ -1,70 +1,107 @@
1
- # OpenCode Skill Setup - @turknet/onehub Material UI Theme
1
+ # OpenCode Skill & Rule Setup @turknet/onehub Design System
2
2
 
3
- Bu belge, `@turknet/onehub` tema paketini kullanan projelere OpenCode skill'ini nasıl kuracağınızı açıklar.
3
+ This document explains how to set up OpenCode skills, rules, and verification tools for projects using the `@turknet/onehub` MUI theme package.
4
4
 
5
5
  ---
6
6
 
7
- ## 🎯 Amaç
7
+ ## Purpose
8
8
 
9
- Bu skill, projelerizdeki LLM (yapay zeka modelleri) tarafından Material UI bileşenlerinin **doğru şekilde** yazılmasını sağlar:
9
+ The complete design verification system ensures AI agents (LLMs) and developers write Material UI code that complies with OneHub design rules:
10
10
 
11
- - Custom component yazmaktan caydırır
12
- - Material UI bileşenlerini zorlar
13
- - Tema paketinin kurallarını uygular
14
- - Variant/size/color kombinasyonlarını kontrol eder
15
- - ✅ Typography variant'larının doğru kullanılmasını sağlar
11
+ - **Skills** guide AI agents when generating UI code
12
+ - **Rules** automatically enforce design constraints
13
+ - **Verification script** scans code for design violations
14
+ - **Reference files** provide authoritative prop combinations
16
15
 
17
16
  ---
18
17
 
19
- ## 📦 Ön Koşullar
18
+ ## Prerequisites
20
19
 
21
- - OpenCode CLI kurulu (`opencode` komutu çalışıyor)
22
- - Proje `.opencode.json` veya `.opencode/` klasörü ile yapılandırılmış
23
- - `@turknet/onehub` paketi `package.json` dependencies'inde
20
+ - OpenCode CLI installed (`opencode` command works)
21
+ - Project configured with `.opencode.json` or `.opencode/` directory
22
+ - `@turknet/onehub` in `package.json` dependencies
24
23
 
25
24
  ---
26
25
 
27
- ## 🚀 Kurulum Adımları
26
+ ## Complete Setup (All Components)
28
27
 
29
- ### Adım 1: Skill Dosyasını Oluştur
28
+ ### Step 1: Copy Skills to Your Project
30
29
 
31
- Projenizde `.opencode/skills/` klasörünü oluşturun:
30
+ **Component Usage Skill** (forces correct MUI component usage):
32
31
 
33
32
  ```bash
33
+ # Create skill directory
34
34
  mkdir -p .opencode/skills/turknet-onehub-component-usage
35
+
36
+ # Copy skill file from theme package
37
+ cp node_modules/@turknet/onehub/.opencode/skills/turknet-onehub-component-usage/SKILL.md \
38
+ .opencode/skills/turknet-onehub-component-usage/SKILL.md
35
39
  ```
36
40
 
37
- ### Adım 2: SKILL.md Dosyasını Kopyala
41
+ **Design Verification Skill** (step-by-step validation checklist):
42
+
43
+ ```bash
44
+ # Create skill directory
45
+ mkdir -p .opencode/skills/onehub-design-verification
46
+
47
+ # Copy skill file from theme package
48
+ cp node_modules/@turknet/onehub/.opencode/skills/onehub-design-verification/SKILL.md \
49
+ .opencode/skills/onehub-design-verification/SKILL.md
50
+ ```
38
51
 
39
- Tema paketindeki SKILL.md dosyasını kopyalayın:
52
+ ### Step 2: Copy Design Compliance Rule
53
+
54
+ The design-compliance rule automatically enforces design constraints whenever AI agents write code:
40
55
 
41
56
  ```bash
42
- cp node_modules/@turknet/onehub/.opencode/skills/turknet-onehub-component-usage/SKILL.md \
43
- .opencode/skills/turknet-onehub-component-usage/SKILL.md
57
+ # Create rules directory
58
+ mkdir -p .opencode/rules
59
+
60
+ # Copy rule file from theme package
61
+ cp node_modules/@turknet/onehub/.opencode/rules/design-compliance.md \
62
+ .opencode/rules/design-compliance.md
44
63
  ```
45
64
 
46
- **VEYA** manuel olarak oluşturun:
65
+ ### Step 3: Copy Verification Script
47
66
 
48
67
  ```bash
49
- cat > .opencode/skills/turknet-onehub-component-usage/SKILL.md << 'EOF'
50
- # Skill içeriği buraya yapıştırılır
51
- EOF
68
+ # Create scripts directory if it doesn't exist
69
+ mkdir -p scripts
70
+
71
+ # Copy verification script
72
+ cp node_modules/@turknet/onehub/scripts/verify-design.js \
73
+ scripts/verify-design.js
52
74
  ```
53
75
 
54
- ### Adım 3: OpenCode Config'i Güncelle
76
+ ### Step 4: Add Verify Script to package.json
55
77
 
56
- Proje kökünüzde `.opencode.json` dosyasını açın (veya oluşturun):
78
+ Add this to your `package.json` scripts:
79
+
80
+ ```json
81
+ {
82
+ "scripts": {
83
+ "verify-design": "node scripts/verify-design.js src/"
84
+ }
85
+ }
86
+ ```
87
+
88
+ ### Step 5: Configure OpenCode
89
+
90
+ In your project's `.opencode.json` (create if it doesn't exist):
57
91
 
58
92
  ```json
59
93
  {
60
94
  "$schema": "https://opencode.ai/config.json",
61
95
  "skills": {
62
96
  "paths": [".opencode/skills"]
97
+ },
98
+ "rules": {
99
+ "paths": [".opencode/rules"]
63
100
  }
64
101
  }
65
102
  ```
66
103
 
67
- Eğer zaten `.opencode.json` varsa, `skills.paths` bölümünü ekleyin:
104
+ If you already have `.opencode.json`, add the `skills` and `rules` sections:
68
105
 
69
106
  ```json
70
107
  {
@@ -72,278 +109,278 @@ Eğer zaten `.opencode.json` varsa, `skills.paths` bölümünü ekleyin:
72
109
  "skills": {
73
110
  "paths": [".opencode/skills"]
74
111
  },
75
- // ... diğer config'ler
112
+ "rules": {
113
+ "paths": [".opencode/rules"]
114
+ }
76
115
  }
77
116
  ```
78
117
 
79
- ### Adım 4: OpenCode'u Yeniden Başlat
118
+ ### Step 6: Restart OpenCode
80
119
 
81
- Skill dosyalarını yüklemek için OpenCode'u kapatıp tekrar açın:
120
+ Close and reopen OpenCode to load the new skills and rules:
82
121
 
83
122
  ```bash
84
- # Eski session kapat
85
- # Ctrl+C or quit command
86
-
87
- # Yeni session açın
123
+ # Close current OpenCode session (Ctrl+C or /quit)
124
+ # Then open a new session:
88
125
  opencode
89
126
  ```
90
127
 
91
128
  ---
92
129
 
93
- ## Kurulumu Doğrula
130
+ ## Verify Installation
94
131
 
95
- ### Test 1: Skill Yüklenmiş Mi?
132
+ ### Test 1: Skills Loaded?
96
133
 
97
- OpenCode'da `ctrl+p` tuşlarına basın ve şunu yazın:
134
+ In OpenCode, press `Ctrl+P` and type:
98
135
 
99
136
  ```
100
- /skill turknet-onehub
137
+ /skill onehub
101
138
  ```
102
139
 
103
- Eğer skill listesinde görülürse, kurulum başarılıdır!
104
-
105
- ### Test 2: Skill'i Tetikle
140
+ Both skills should appear in the list:
141
+ - `turknet-onehub-component-usage`
142
+ - `onehub-design-verification`
106
143
 
107
- Bir komponenti yazmanız istendiğinde, LLM model şu mesajı görmelidir:
144
+ ### Test 2: Rules Active
108
145
 
109
- > "Using skill: turknet-onehub-component-usage"
146
+ When you write UI code, the AI agent should automatically reference design rules (typography, colors, spacing).
110
147
 
111
- veya skill'in `description` alanında tanımlanan mesaj.
148
+ ### Test 3: Verification Script Works
112
149
 
113
- ---
150
+ ```bash
151
+ node scripts/verify-design.js src/
114
152
 
115
- ## 📋 Seçenek: Manuel Skill Yönetimi
153
+ # Exit code: 0 = clean, 1 = violations found
154
+ echo $?
155
+ ```
116
156
 
117
- Eğer otomatik yüklemeyi tercih etmezseniz, inline config kullanabilirsiniz:
157
+ ---
118
158
 
119
- ### opencode.json İçinde
159
+ ## File Structure After Setup
120
160
 
121
- ```json
122
- {
123
- "$schema": "https://opencode.ai/config.json",
124
- "skills": {
125
- "paths": [".opencode/skills"],
126
- "urls": [
127
- "https://raw.githubusercontent.com/turknet-it/tn.onehub.lib.mui/main/.opencode/skills/"
128
- ]
129
- }
130
- }
131
161
  ```
132
-
133
- Bu şekilde skill'i internetten otomatik olarak yükler.
162
+ your-project/
163
+ ├── .opencode/
164
+ │ ├── rules/
165
+ │ │ └── design-compliance.md # Always-apply design rule
166
+ │ └── skills/
167
+ │ ├── turknet-onehub-component-usage/
168
+ │ │ └── SKILL.md # Component usage skill
169
+ │ └── onehub-design-verification/
170
+ │ └── SKILL.md # Design verification skill
171
+ ├── scripts/
172
+ │ └── verify-design.js # Automated verification script
173
+ ├── node_modules/
174
+ │ └── @turknet/onehub/
175
+ │ ├── DESIGN_RULES.md # Mandatory design rules
176
+ │ ├── COMPONENT_MAP.md # Figma → MUI component mapping
177
+ │ ├── COMPONENT_GLOSSARY.md # Valid component prop combinations
178
+ │ ├── DESIGN_TOKENS_MAP.md # Color, spacing, typography tokens
179
+ │ ├── DESIGN_SOURCES.md # Figma design file references
180
+ │ ├── PAGE_PATTERNS.md # Standard page layout patterns
181
+ │ ├── LLM_GUIDELINES.md # Component usage guide
182
+ │ ├── LLM_EXAMPLES.md # Usage examples
183
+ │ └── ESLINT_DESIGN_RULES.md # Future ESLint plugin spec
184
+ ├── package.json # Includes "verify-design" script
185
+ └── src/
186
+ └── components/
187
+ ```
134
188
 
135
189
  ---
136
190
 
137
- ## 🔧 Skill Kustomizasyonu
191
+ ## Available Commands
138
192
 
139
- Eğer projenizin ihtiyaçlarına göre skill'i kustomize etmek istiyorsanız:
193
+ ### Design Verification
140
194
 
141
- 1. `.opencode/skills/turknet-onehub-component-usage/SKILL.md` dosyasını düzenleyin
142
- 2. OpenCode'u yeniden başlatın
143
- 3. Değişiklikler aktif olacaktır
144
-
145
- ### Kustomizasyon Örnekleri
146
-
147
- #### Örnek 1: Ek Typography Variant'ı Ekle
195
+ ```bash
196
+ # Scan entire src/ directory
197
+ yarn verify-design
148
198
 
149
- ```markdown
150
- ### Custom Typography Variant (Proje Özel)
199
+ # Scan specific directory
200
+ node scripts/verify-design.js src/components/pages/
151
201
 
152
- ```tsx
153
- // Proje ihtiyacı varsa
154
- <Typography variant="display.xl2.extra-bold">
155
- Özel başlık
156
- </Typography>
157
- ```
202
+ # Exit code for CI
203
+ node scripts/verify-design.js src/ && echo "PASS" || echo "FAIL"
158
204
  ```
159
205
 
160
- #### Örnek 2: Proje Spesifik Kurallar
206
+ ### OpenCode Skills
161
207
 
162
- ```markdown
163
- ## Proje Spesifik Kurallar
208
+ In OpenCode, available via `Ctrl+P`:
164
209
 
165
- ### Renk Kullanımı
210
+ - `/skill turknet-onehub-component-usage` — Load component usage rules
211
+ - `/skill onehub-design-verification` — Load design verification checklist
166
212
 
167
- Bu projede:
168
- - Tüm primary butonlar `primary` color kullanır
169
- - Secondary butonlar sadece form'larda `secondary` kullanır
170
- - Error butonları sadece delete işlemleri için `error` kullanır
171
- ```
213
+ ### Reference Files (in node_modules)
172
214
 
173
- #### Örnek 3: Disabled Kurallar
215
+ ```bash
216
+ # Read design rules
217
+ cat node_modules/@turknet/onehub/DESIGN_RULES.md
174
218
 
175
- Eğer projeniz Material UI v6 kullanıyorsa:
219
+ # Check component prop validity
220
+ cat node_modules/@turknet/onehub/COMPONENT_GLOSSARY.md
176
221
 
177
- ```markdown
178
- ---
179
- compatibility: React 16.8+, Next.js 12+
180
- ---
222
+ # Find the right component for a Figma pattern
223
+ cat node_modules/@turknet/onehub/COMPONENT_MAP.md
181
224
  ```
182
225
 
183
226
  ---
184
227
 
185
- ## 📂 Dosya Yapısı
228
+ ## CI Integration
186
229
 
187
- Kurulum tamamlandıktan sonra proje yapınız şu şekilde görünmelidir:
230
+ ### Bitbucket Pipelines
188
231
 
232
+ ```yaml
233
+ pipelines:
234
+ default:
235
+ - step:
236
+ name: Design Compliance Check
237
+ script:
238
+ - yarn install
239
+ - node scripts/verify-design.js src/
189
240
  ```
190
- your-project/
191
- ├── .opencode/
192
- │ ├── opencode.json (ya da projeKökü opencode.json)
193
- │ └── skills/
194
- │ └── turknet-onehub-component-usage/
195
- │ └── SKILL.md
196
- ├── node_modules/
197
- │ └── @turknet/onehub/
198
- │ ├── LLM_GUIDELINES.md
199
- │ ├── LLM_EXAMPLES.md
200
- │ └── .opencode/
201
- │ └── skills/ (template buradan kopyalanır)
202
- ├── package.json
203
- └── src/
204
- └── components/
205
- ```
206
-
207
- ---
208
-
209
- ## 🔗 İlişkili Belgeler
210
241
 
211
- Bu skill ile birlikte kullan:
242
+ ### GitHub Actions
212
243
 
213
- 1. **[LLM_GUIDELINES.md](./LLM_GUIDELINES.md)** - Tema paketinde
214
- - Material UI component kullanım rehberi
215
- - Renk sistem açıklaması
216
- - Typography variant'ları
217
- - 35+ component referansı
244
+ ```yaml
245
+ name: Design Compliance
246
+ on: [push, pull_request]
247
+ jobs:
248
+ design-check:
249
+ runs-on: ubuntu-latest
250
+ steps:
251
+ - uses: actions/checkout@v4
252
+ - uses: actions/setup-node@v4
253
+ with:
254
+ node-version: 18
255
+ - run: node scripts/verify-design.js src/
256
+ ```
218
257
 
219
- 2. **[LLM_EXAMPLES.md](./LLM_EXAMPLES.md)** - Tema paketinde
220
- - 88 doğru kullanım örneği
221
- - 49 yanlış kullanım örneği
222
- - Component kategorilerine göre örnekler
258
+ ### Pre-commit Hook (Husky)
223
259
 
224
- 3. **Bu skill** - Proje .opencode/ klasöründe
225
- - Yoğunlaştırılmış rehber
226
- - Component checklist'i
227
- - Kurulum talimatları
260
+ ```bash
261
+ # .husky/pre-commit
262
+ node scripts/verify-design.js src/
263
+ ```
228
264
 
229
265
  ---
230
266
 
231
- ## 🚨 Sorun Giderme
267
+ ## Quick Start for New Modules
232
268
 
233
- ### Sorun 1: Skill Gösterilmiyor
269
+ If you're creating a new OneHub module, add this to your setup:
234
270
 
235
- **Çözüm:**
236
271
  ```bash
237
- # 1. Dosyaların doğru konumda olup olmadığını kontrol et
238
- ls -la .opencode/skills/turknet-onehub-component-usage/SKILL.md
272
+ # In your new module directory:
273
+ mkdir -p .opencode/skills .opencode/rules scripts
239
274
 
240
- # 2. opencode.json'daki skills.paths kontrol et
241
- cat .opencode.json | grep -A 2 '"skills"'
275
+ # Copy from boilerplate or theme package:
276
+ cp -r /path/to/tn.onehub.lib.mui/.opencode/skills/* .opencode/skills/
277
+ cp /path/to/tn.onehub.lib.mui/.opencode/rules/design-compliance.md .opencode/rules/
278
+ cp /path/to/tn.onehub.lib.mui/scripts/verify-design.js scripts/
242
279
 
243
- # 3. OpenCode'u temiz başlat
244
- rm -rf ~/.opencode/cache/ # Cache'i temizle
245
- opencode # Yeniden başla
280
+ # Add to package.json scripts:
281
+ # "verify-design": "node scripts/verify-design.js src/"
246
282
  ```
247
283
 
248
- ### Sorun 2: SKILL.md Formatı Hatalı
284
+ ---
249
285
 
250
- **Çözüm:**
251
- - Frontmatter (---) bölümünün en başta olup olmadığını kontrol et
252
- - `name:` alanı klasör ismiyle eşleşiyor mu?
253
- - `description:` alanı boş değil mi?
286
+ ## Skill Customization
254
287
 
255
- ```yaml
256
- ---
257
- name: turknet-onehub-component-usage
258
- description: Use ONLY when... (açıklamaya bakın)
259
- ---
260
- ```
288
+ If your project needs custom rules beyond the theme defaults:
261
289
 
262
- ### Sorun 3: OpenCode Config Hatası
290
+ ### Add Custom Typography Variant (if needed)
263
291
 
264
- **Çözüm:**
265
- ```bash
266
- # JSON syntax'ı kontrol et
267
- python -m json.tool .opencode.json
292
+ ```markdown
293
+ <!-- In .opencode/skills/turknet-onehub-component-usage/SKILL.md -->
294
+
295
+ ### Custom Typography Variant (Project-Specific)
268
296
 
269
- # Hata varsa, resmi açıklamaya bakın
270
- # https://opencode.ai/docs
297
+ ...
271
298
  ```
272
299
 
273
- ---
300
+ ### Add Project-Specific Rules
274
301
 
275
- ## 📝 Best Practices
302
+ Create an additional rule file in `.opencode/rules/`:
276
303
 
277
- ### 1. Skill'i Projenizde Saklayın
304
+ ```markdown
305
+ # project-specific-rules.md
278
306
 
279
- Skill'i version control'de commit edin:
307
+ > **alwaysApply: true**
280
308
 
281
- ```bash
282
- git add .opencode/skills/turknet-onehub-component-usage/
283
- git commit -m "feat: @turknet/onehub Material UI component usage skill ekle"
309
+ ## Project Rules
310
+ - All save buttons must be color="primary"
311
+ - All cancel actions must be color="secondary"
312
+ - Delete confirmations must use color="error"
284
313
  ```
285
314
 
286
- ### 2. Takım İçin Döküment Ekleyin
315
+ ---
287
316
 
288
- `DEVELOPMENT.md` veya `CONTRIBUTING.md` dosyasında skill'den bahsedin:
317
+ ## Troubleshooting
289
318
 
290
- ```markdown
291
- ## Component Yazımı
319
+ ### Skills Not Showing
320
+
321
+ ```bash
322
+ # Check file locations
323
+ ls -la .opencode/skills/turknet-onehub-component-usage/SKILL.md
324
+ ls -la .opencode/skills/onehub-design-verification/SKILL.md
292
325
 
293
- OpenCode kullandığınızda, `turknet-onehub-component-usage` skill'i otomatik olarak yüklenir
294
- ve Material UI bileşenlerini doğru şekilde yazmanıza yardımcı olur.
326
+ # Check config
327
+ cat .opencode.json | python3 -m json.tool
295
328
 
296
- Eğer kurulmadıysa: `SKILL_SETUP.md` dosyasını okuyun.
329
+ # Clear cache and restart
330
+ rm -rf ~/.opencode/cache/
297
331
  ```
298
332
 
299
- ### 3. Skill'i Güncelleyin
300
-
301
- Yeni Material UI versiyonları veya tema paketi güncellemeleri sonrası skill'i güncelleyin:
333
+ ### Rules Not Applied
302
334
 
303
335
  ```bash
304
- # Tema paketini güncelleyin
305
- yarn upgrade @turknet/onehub
306
-
307
- # Skill dosyasını yeniden kopyalayın
308
- cp node_modules/@turknet/onehub/.opencode/skills/turknet-onehub-component-usage/SKILL.md \
309
- .opencode/skills/turknet-onehub-component-usage/SKILL.md
336
+ # Check rules directory
337
+ ls -la .opencode/rules/design-compliance.md
310
338
 
311
- # Değişiklikleri commit edin
312
- git add .opencode/skills/
313
- git commit -m "feat: @turknet/onehub skill'i güncelle"
339
+ # Verify config has rules.paths
340
+ cat .opencode.json | grep -A 3 '"rules"'
314
341
  ```
315
342
 
316
- ---
343
+ ### Verification Script Too Strict
317
344
 
318
- ## 🎓 Kullanım Örneği
345
+ Edit `scripts/verify-design.js` to adjust rule severity or add exceptions. The script is plain Node.js with no dependencies.
319
346
 
320
- Skill kurulduktan sonra:
347
+ ### verify-design.js: No Such File
321
348
 
349
+ Make sure you copied the script:
350
+ ```bash
351
+ cp node_modules/@turknet/onehub/scripts/verify-design.js scripts/
322
352
  ```
323
- User: "Bir login formu yaz"
324
353
 
325
- OpenCode: "I'll create a login form using @turknet/onehub Material UI theme."
326
- "Loading skill: turknet-onehub-component-usage..."
354
+ ---
355
+
356
+ ## Design Reference Files
327
357
 
328
- // OpenCode, Material UI'ı doğru kullanır:
329
- // - Variant/size/color kombinasyonları kontrol eder
330
- // - Typography variant'larını seçer
331
- // - Custom component yazmaktan kaçınır
332
- // - Tema renk paletini kullanır
333
- ```
358
+ All files are available in `node_modules/@turknet/onehub/` after installing:
359
+
360
+ | File | What It Provides |
361
+ |------|-----------------|
362
+ | `DESIGN_RULES.md` | Mandatory design constraints (RFC 2119) |
363
+ | `COMPONENT_MAP.md` | Figma UI pattern → MUI component with exact props |
364
+ | `COMPONENT_GLOSSARY.md` | Every usable component with all valid prop combinations |
365
+ | `DESIGN_TOKENS_MAP.md` | Color palette, spacing grid, typography tokens |
366
+ | `DESIGN_SOURCES.md` | Figma file references for all modules |
367
+ | `PAGE_PATTERNS.md` | Standard page template patterns |
368
+ | `LLM_GUIDELINES.md` | Component usage rules for AI agents |
369
+ | `LLM_EXAMPLES.md` | Correct/incorrect usage examples |
370
+ | `ESLINT_DESIGN_RULES.md` | Spec for future custom ESLint plugin |
334
371
 
335
372
  ---
336
373
 
337
- ## 📞 Destek
374
+ ## Support
338
375
 
339
- Sorun veya önerileriniz varsa:
376
+ For issues or suggestions:
340
377
 
341
- - **@turknet/onehub Repository**: [GitHub Link]
378
+ - **@turknet/onehub Repository**: Internal Git repository
342
379
  - **OpenCode Docs**: https://opencode.ai
343
380
  - **Material UI Docs**: https://mui.com
344
381
 
345
382
  ---
346
383
 
347
- **Last Updated**: May 2026
348
- **Skill Version**: 1.0
349
- **Theme Version**: 2.0+
384
+ **Last Updated**: June 2026
385
+ **Skill Version**: 2.0
386
+ **Theme Version**: 3.0+
package/dist/index.js CHANGED
@@ -1760,6 +1760,7 @@ function createButton() {
1760
1760
  return {
1761
1761
  lineHeight: "1",
1762
1762
  padding: "var(--padding-y) var(--padding-x)",
1763
+ textTransform: "unset",
1763
1764
  "&:focus": {
1764
1765
  outline: `2px solid ${neutral?.stroke.focus[2]}`,
1765
1766
  outlineOffset: "2px"