cp-toolkit 2.2.2 → 2.2.4

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 (71) hide show
  1. package/package.json +1 -1
  2. package/src/commands/add.js +23 -16
  3. package/src/commands/doctor.js +15 -10
  4. package/src/commands/init.js +410 -64
  5. package/templates/AGENTS.md +47 -0
  6. package/templates/ARCHITECTURE.md +42 -0
  7. package/templates/agents/backend-specialist.md +1 -0
  8. package/templates/agents/code-archaeologist.md +116 -106
  9. package/templates/agents/database-architect.md +1 -0
  10. package/templates/agents/debugger.md +1 -0
  11. package/templates/agents/devops-engineer.md +1 -0
  12. package/templates/agents/documentation-writer.md +1 -0
  13. package/templates/agents/explorer-agent.md +83 -73
  14. package/templates/agents/frontend-specialist.md +1 -0
  15. package/templates/agents/game-developer.md +1 -0
  16. package/templates/agents/mobile-developer.md +1 -0
  17. package/templates/agents/orchestrator.md +426 -416
  18. package/templates/agents/penetration-tester.md +1 -0
  19. package/templates/agents/performance-optimizer.md +1 -0
  20. package/templates/agents/product-manager.md +122 -112
  21. package/templates/agents/product-owner.md +105 -95
  22. package/templates/agents/project-planner.md +416 -406
  23. package/templates/agents/qa-automation-engineer.md +113 -103
  24. package/templates/agents/security-auditor.md +1 -0
  25. package/templates/agents/seo-specialist.md +1 -0
  26. package/templates/agents/test-engineer.md +1 -0
  27. package/templates/skills/core/behavioral-modes/SKILL.md +244 -242
  28. package/templates/skills/core/brainstorming/SKILL.md +166 -163
  29. package/templates/skills/core/mcp-builder/SKILL.md +178 -176
  30. package/templates/skills/core/parallel-agents/SKILL.md +187 -175
  31. package/templates/skills/core/plan-writing/SKILL.md +154 -152
  32. package/templates/skills/optional/api-patterns/SKILL.md +83 -81
  33. package/templates/skills/optional/app-builder/SKILL.md +78 -75
  34. package/templates/skills/optional/app-builder/templates/SKILL.md +41 -39
  35. package/templates/skills/optional/architecture/SKILL.md +58 -55
  36. package/templates/skills/optional/bash-linux/SKILL.md +201 -199
  37. package/templates/skills/optional/code-review-checklist/SKILL.md +110 -109
  38. package/templates/skills/optional/database-design/SKILL.md +54 -52
  39. package/templates/skills/optional/deployment-procedures/SKILL.md +243 -241
  40. package/templates/skills/optional/documentation-templates/SKILL.md +196 -194
  41. package/templates/skills/optional/frontend-design/SKILL.md +421 -418
  42. package/templates/skills/optional/game-development/2d-games/SKILL.md +120 -119
  43. package/templates/skills/optional/game-development/3d-games/SKILL.md +136 -135
  44. package/templates/skills/optional/game-development/SKILL.md +169 -167
  45. package/templates/skills/optional/game-development/game-art/SKILL.md +187 -185
  46. package/templates/skills/optional/game-development/game-audio/SKILL.md +192 -190
  47. package/templates/skills/optional/game-development/game-design/SKILL.md +131 -129
  48. package/templates/skills/optional/game-development/mobile-games/SKILL.md +110 -108
  49. package/templates/skills/optional/game-development/multiplayer/SKILL.md +133 -132
  50. package/templates/skills/optional/game-development/pc-games/SKILL.md +146 -144
  51. package/templates/skills/optional/game-development/vr-ar/SKILL.md +124 -123
  52. package/templates/skills/optional/game-development/web-games/SKILL.md +152 -150
  53. package/templates/skills/optional/geo-fundamentals/SKILL.md +158 -156
  54. package/templates/skills/optional/i18n-localization/SKILL.md +156 -154
  55. package/templates/skills/optional/lint-and-validate/SKILL.md +48 -45
  56. package/templates/skills/optional/mobile-design/SKILL.md +397 -394
  57. package/templates/skills/optional/nextjs-react-expert/SKILL.md +271 -267
  58. package/templates/skills/optional/nodejs-best-practices/SKILL.md +335 -333
  59. package/templates/skills/optional/performance-profiling/SKILL.md +145 -143
  60. package/templates/skills/optional/powershell-windows/SKILL.md +169 -167
  61. package/templates/skills/optional/python-patterns/SKILL.md +443 -441
  62. package/templates/skills/optional/red-team-tactics/SKILL.md +201 -199
  63. package/templates/skills/optional/seo-fundamentals/SKILL.md +130 -129
  64. package/templates/skills/optional/server-management/SKILL.md +163 -161
  65. package/templates/skills/optional/systematic-debugging/SKILL.md +111 -109
  66. package/templates/skills/optional/tailwind-patterns/SKILL.md +271 -269
  67. package/templates/skills/optional/tdd-workflow/SKILL.md +150 -149
  68. package/templates/skills/optional/testing-patterns/SKILL.md +179 -178
  69. package/templates/skills/optional/vulnerability-scanner/SKILL.md +278 -276
  70. package/templates/skills/optional/web-design-guidelines/SKILL.md +60 -57
  71. package/templates/skills/optional/webapp-testing/SKILL.md +188 -187
@@ -1,394 +1,397 @@
1
- ---
2
- name: mobile-design
3
- description: Mobile-first design thinking and decision-making for iOS and Android apps. Touch interaction, performance patterns, platform conventions. Teaches principles, not fixed values. Use when building React Native, Flutter, or native mobile apps.
4
- allowed-tools: Read, Glob, Grep, Bash
5
- ---
6
-
7
- # Mobile Design System
8
-
9
- > **Philosophy:** Touch-first. Battery-conscious. Platform-respectful. Offline-capable.
10
- > **Core Principle:** Mobile is NOT a small desktop. THINK mobile constraints, ASK platform choice.
11
-
12
- ---
13
-
14
- ## 🔧 Runtime Scripts
15
-
16
- **Execute these for validation (don't read, just run):**
17
-
18
- | Script | Purpose | Usage |
19
- |--------|---------|-------|
20
- | `scripts/mobile_audit.py` | Mobile UX & Touch Audit | `python scripts/mobile_audit.py <project_path>` |
21
-
22
- ---
23
-
24
- ## 🔴 MANDATORY: Read Reference Files Before Working!
25
-
26
- **⛔ DO NOT start development until you read the relevant files:**
27
-
28
- ### Universal (Always Read)
29
-
30
- | File | Content | Status |
31
- |------|---------|--------|
32
- | **[mobile-design-thinking.md](mobile-design-thinking.md)** | **⚠️ ANTI-MEMORIZATION: Forces thinking, prevents AI defaults** | **⬜ CRITICAL FIRST** |
33
- | **[touch-psychology.md](touch-psychology.md)** | **Fitts' Law, gestures, haptics, thumb zone** | **⬜ CRITICAL** |
34
- | **[mobile-performance.md](mobile-performance.md)** | **RN/Flutter performance, 60fps, memory** | **⬜ CRITICAL** |
35
- | **[mobile-backend.md](mobile-backend.md)** | **Push notifications, offline sync, mobile API** | **⬜ CRITICAL** |
36
- | **[mobile-testing.md](mobile-testing.md)** | **Testing pyramid, E2E, platform-specific** | **⬜ CRITICAL** |
37
- | **[mobile-debugging.md](mobile-debugging.md)** | **Native vs JS debugging, Flipper, Logcat** | **⬜ CRITICAL** |
38
- | [mobile-navigation.md](mobile-navigation.md) | Tab/Stack/Drawer, deep linking | Read |
39
- | [mobile-typography.md](mobile-typography.md) | System fonts, Dynamic Type, a11y | Read |
40
- | [mobile-color-system.md](mobile-color-system.md) | OLED, dark mode, battery-aware | Read |
41
- | [decision-trees.md](decision-trees.md) | Framework/state/storage selection | ⬜ Read |
42
-
43
- > 🧠 **mobile-design-thinking.md is PRIORITY!** This file ensures AI thinks instead of using memorized patterns.
44
-
45
- ### Platform-Specific (Read Based on Target)
46
-
47
- | Platform | File | Content | When to Read |
48
- |----------|------|---------|--------------|
49
- | **iOS** | [platform-ios.md](platform-ios.md) | Human Interface Guidelines, SF Pro, SwiftUI patterns | Building for iPhone/iPad |
50
- | **Android** | [platform-android.md](platform-android.md) | Material Design 3, Roboto, Compose patterns | Building for Android |
51
- | **Cross-Platform** | Both above | Platform divergence points | React Native / Flutter |
52
-
53
- > 🔴 **If building for iOS → Read platform-ios.md FIRST!**
54
- > 🔴 **If building for Android Read platform-android.md FIRST!**
55
- > 🔴 **If cross-platform → Read BOTH and apply conditional platform logic!**
56
-
57
- ---
58
-
59
- ## ⚠️ CRITICAL: ASK BEFORE ASSUMING (MANDATORY)
60
-
61
- > **STOP! If the user's request is open-ended, DO NOT default to your favorites.**
62
-
63
- ### You MUST Ask If Not Specified:
64
-
65
- | Aspect | Ask | Why |
66
- |--------|-----|-----|
67
- | **Platform** | "iOS, Android, or both?" | Affects EVERY design decision |
68
- | **Framework** | "React Native, Flutter, or native?" | Determines patterns and tools |
69
- | **Navigation** | "Tab bar, drawer, or stack-based?" | Core UX decision |
70
- | **State** | "What state management? (Zustand/Redux/Riverpod/BLoC?)" | Architecture foundation |
71
- | **Offline** | "Does this need to work offline?" | Affects data strategy |
72
- | **Target devices** | "Phone only, or tablet support?" | Layout complexity |
73
-
74
- ### AI MOBILE ANTI-PATTERNS (YASAK LİSTESİ)
75
-
76
- > 🚫 **These are AI default tendencies that MUST be avoided!**
77
-
78
- #### Performance Sins
79
-
80
- | ❌ NEVER DO | Why It's Wrong | ✅ ALWAYS DO |
81
- |-------------|----------------|--------------|
82
- | **ScrollView for long lists** | Renders ALL items, memory explodes | Use `FlatList` / `FlashList` / `ListView.builder` |
83
- | **Inline renderItem function** | New function every render, all items re-render | `useCallback` + `React.memo` |
84
- | **Missing keyExtractor** | Index-based keys cause bugs on reorder | Unique, stable ID from data |
85
- | **Skip getItemLayout** | Async layout = janky scroll | Provide when items have fixed height |
86
- | **setState() everywhere** | Unnecessary widget rebuilds | Targeted state, `const` constructors |
87
- | **Native driver: false** | Animations blocked by JS thread | `useNativeDriver: true` always |
88
- | **console.log in production** | Blocks JS thread severely | Remove before release build |
89
- | **Skip React.memo/const** | Every item re-renders on any change | Memoize list items ALWAYS |
90
-
91
- #### Touch/UX Sins
92
-
93
- | ❌ NEVER DO | Why It's Wrong | ✅ ALWAYS DO |
94
- |-------------|----------------|--------------|
95
- | **Touch target < 44px** | Impossible to tap accurately, frustrating | Minimum 44pt (iOS) / 48dp (Android) |
96
- | **Spacing < 8px between targets** | Accidental taps on neighbors | Minimum 8-12px gap |
97
- | **Gesture-only interactions** | Motor impaired users excluded | Always provide button alternative |
98
- | **No loading state** | User thinks app crashed | ALWAYS show loading feedback |
99
- | **No error state** | User stuck, no recovery path | Show error with retry option |
100
- | **No offline handling** | Crash/block when network lost | Graceful degradation, cached data |
101
- | **Ignore platform conventions** | Users confused, muscle memory broken | iOS feels iOS, Android feels Android |
102
-
103
- #### Security Sins
104
-
105
- | ❌ NEVER DO | Why It's Wrong | ✅ ALWAYS DO |
106
- |-------------|----------------|--------------|
107
- | **Token in AsyncStorage** | Easily accessible, stolen on rooted device | `SecureStore` / `Keychain` / `EncryptedSharedPreferences` |
108
- | **Hardcode API keys** | Reverse engineered from APK/IPA | Environment variables, secure storage |
109
- | **Skip SSL pinning** | MITM attacks possible | Pin certificates in production |
110
- | **Log sensitive data** | Logs can be extracted | Never log tokens, passwords, PII |
111
-
112
- #### Architecture Sins
113
-
114
- | ❌ NEVER DO | Why It's Wrong | ✅ ALWAYS DO |
115
- |-------------|----------------|--------------|
116
- | **Business logic in UI** | Untestable, unmaintainable | Service layer separation |
117
- | **Global state for everything** | Unnecessary re-renders, complexity | Local state default, lift when needed |
118
- | **Deep linking as afterthought** | Notifications, shares broken | Plan deep links from day one |
119
- | **Skip dispose/cleanup** | Memory leaks, zombie listeners | Clean up subscriptions, timers |
120
-
121
- ---
122
-
123
- ## 📱 Platform Decision Matrix
124
-
125
- ### When to Unify vs Diverge
126
-
127
- ```
128
- UNIFY (same on both) DIVERGE (platform-specific)
129
- ─────────────────── ──────────────────────────
130
- Business Logic ✅ Always -
131
- Data Layer Always -
132
- Core Features ✅ Always -
133
-
134
- Navigation - iOS: edge swipe, Android: back button
135
- Gestures - Platform-native feel
136
- Icons - ✅ SF Symbols vs Material Icons
137
- Date Pickers - ✅ Native pickers feel right
138
- Modals/Sheets - ✅ iOS: bottom sheet vs Android: dialog
139
- Typography - ✅ SF Pro vs Roboto (or custom)
140
- Error Dialogs - ✅ Platform conventions for alerts
141
- ```
142
-
143
- ### Quick Reference: Platform Defaults
144
-
145
- | Element | iOS | Android |
146
- |---------|-----|---------|
147
- | **Primary Font** | SF Pro / SF Compact | Roboto |
148
- | **Min Touch Target** | 44pt × 44pt | 48dp × 48dp |
149
- | **Back Navigation** | Edge swipe left | System back button/gesture |
150
- | **Bottom Tab Icons** | SF Symbols | Material Symbols |
151
- | **Action Sheet** | UIActionSheet from bottom | Bottom Sheet / Dialog |
152
- | **Progress** | Spinner | Linear progress (Material) |
153
- | **Pull to Refresh** | Native UIRefreshControl | SwipeRefreshLayout |
154
-
155
- ---
156
-
157
- ## 🧠 Mobile UX Psychology (Quick Reference)
158
-
159
- ### Fitts' Law for Touch
160
-
161
- ```
162
- Desktop: Cursor is precise (1px)
163
- Mobile: Finger is imprecise (~7mm contact area)
164
-
165
- Touch targets MUST be 44-48px minimum
166
- Important actions in THUMB ZONE (bottom of screen)
167
- → Destructive actions AWAY from easy reach
168
- ```
169
-
170
- ### Thumb Zone (One-Handed Usage)
171
-
172
- ```
173
- ┌─────────────────────────────┐
174
- │ HARD TO REACH │ ← Navigation, menu, back
175
- │ (stretch) │
176
- ├─────────────────────────────┤
177
- OK TO REACH │ ← Secondary actions
178
- (natural)
179
- ├─────────────────────────────┤
180
- EASY TO REACH │ ← PRIMARY CTAs, tab bar
181
- (thumb's natural arc) ← Main content interaction
182
- └─────────────────────────────┘
183
- [ HOME ]
184
- ```
185
-
186
- ### Mobile-Specific Cognitive Load
187
-
188
- | Desktop | Mobile Difference |
189
- |---------|-------------------|
190
- | Multiple windows | ONE task at a time |
191
- | Keyboard shortcuts | Touch gestures |
192
- | Hover states | NO hover (tap or nothing) |
193
- | Large viewport | Limited space, scroll vertical |
194
- | Stable attention | Interrupted constantly |
195
-
196
- For deep dive: [touch-psychology.md](touch-psychology.md)
197
-
198
- ---
199
-
200
- ## ⚡ Performance Principles (Quick Reference)
201
-
202
- ### React Native Critical Rules
203
-
204
- ```typescript
205
- // CORRECT: Memoized renderItem + React.memo wrapper
206
- const ListItem = React.memo(({ item }: { item: Item }) => (
207
- <View style={styles.item}>
208
- <Text>{item.title}</Text>
209
- </View>
210
- ));
211
-
212
- const renderItem = useCallback(
213
- ({ item }: { item: Item }) => <ListItem item={item} />,
214
- []
215
- );
216
-
217
- // ✅ CORRECT: FlatList with all optimizations
218
- <FlatList
219
- data={items}
220
- renderItem={renderItem}
221
- keyExtractor={(item) => item.id} // Stable ID, NOT index
222
- getItemLayout={(data, index) => ({
223
- length: ITEM_HEIGHT,
224
- offset: ITEM_HEIGHT * index,
225
- index,
226
- })}
227
- removeClippedSubviews={true}
228
- maxToRenderPerBatch={10}
229
- windowSize={5}
230
- />
231
- ```
232
-
233
- ### Flutter Critical Rules
234
-
235
- ```dart
236
- // CORRECT: const constructors prevent rebuilds
237
- class MyWidget extends StatelessWidget {
238
- const MyWidget({super.key}); // CONST!
239
-
240
- @override
241
- Widget build(BuildContext context) {
242
- return const Column( // CONST!
243
- children: [
244
- Text('Static content'),
245
- MyConstantWidget(),
246
- ],
247
- );
248
- }
249
- }
250
-
251
- // ✅ CORRECT: Targeted state with ValueListenableBuilder
252
- ValueListenableBuilder<int>(
253
- valueListenable: counter,
254
- builder: (context, value, child) => Text('$value'),
255
- child: const ExpensiveWidget(), // Won't rebuild!
256
- )
257
- ```
258
-
259
- ### Animation Performance
260
-
261
- ```
262
- GPU-accelerated (FAST): CPU-bound (SLOW):
263
- ├── transform ├── width, height
264
- ├── opacity ├── top, left, right, bottom
265
- └── (use these ONLY) ├── margin, padding
266
- └── (AVOID animating these)
267
- ```
268
-
269
- For complete guide: [mobile-performance.md](mobile-performance.md)
270
-
271
- ---
272
-
273
- ## 📝 CHECKPOINT (MANDATORY Before Any Mobile Work)
274
-
275
- > **Before writing ANY mobile code, you MUST complete this checkpoint:**
276
-
277
- ```
278
- 🧠 CHECKPOINT:
279
-
280
- Platform: [ iOS / Android / Both ]
281
- Framework: [ React Native / Flutter / SwiftUI / Kotlin ]
282
- Files Read: [ List the skill files you've read ]
283
-
284
- 3 Principles I Will Apply:
285
- 1. _______________
286
- 2. _______________
287
- 3. _______________
288
-
289
- Anti-Patterns I Will Avoid:
290
- 1. _______________
291
- 2. _______________
292
- ```
293
-
294
- **Example:**
295
- ```
296
- 🧠 CHECKPOINT:
297
-
298
- Platform: iOS + Android (Cross-platform)
299
- Framework: React Native + Expo
300
- Files Read: touch-psychology.md, mobile-performance.md, platform-ios.md, platform-android.md
301
-
302
- 3 Principles I Will Apply:
303
- 1. FlatList with React.memo + useCallback for all lists
304
- 2. 48px touch targets, thumb zone for primary CTAs
305
- 3. Platform-specific navigation (edge swipe iOS, back button Android)
306
-
307
- Anti-Patterns I Will Avoid:
308
- 1. ScrollView for lists FlatList
309
- 2. Inline renderItem → Memoized
310
- 3. AsyncStorage for tokens → SecureStore
311
- ```
312
-
313
- > 🔴 **Can't fill the checkpoint? GO BACK AND READ THE SKILL FILES.**
314
-
315
- ---
316
-
317
- ## 🔧 Framework Decision Tree
318
-
319
- ```
320
- WHAT ARE YOU BUILDING?
321
-
322
- ├── Need OTA updates + rapid iteration + web team
323
- │ └── React Native + Expo
324
-
325
- ├── Need pixel-perfect custom UI + performance critical
326
- │ └── ✅ Flutter
327
-
328
- ├── Deep native features + single platform focus
329
- ├── iOS only → SwiftUI
330
- └── Android only → Kotlin + Jetpack Compose
331
-
332
- ├── Existing RN codebase + new features
333
- │ └── React Native (bare workflow)
334
-
335
- └── Enterprise + existing Flutter codebase
336
- └── ✅ Flutter
337
- ```
338
-
339
- For complete decision trees: [decision-trees.md](decision-trees.md)
340
-
341
- ---
342
-
343
- ## 📋 Pre-Development Checklist
344
-
345
- ### Before Starting ANY Mobile Project
346
-
347
- - [ ] **Platform confirmed?** (iOS / Android / Both)
348
- - [ ] **Framework chosen?** (RN / Flutter / Native)
349
- - [ ] **Navigation pattern decided?** (Tabs / Stack / Drawer)
350
- - [ ] **State management selected?** (Zustand / Redux / Riverpod / BLoC)
351
- - [ ] **Offline requirements known?**
352
- - [ ] **Deep linking planned from day one?**
353
- - [ ] **Target devices defined?** (Phone / Tablet / Both)
354
-
355
- ### Before Every Screen
356
-
357
- - [ ] **Touch targets ≥ 44-48px?**
358
- - [ ] **Primary CTA in thumb zone?**
359
- - [ ] **Loading state exists?**
360
- - [ ] **Error state with retry exists?**
361
- - [ ] **Offline handling considered?**
362
- - [ ] **Platform conventions followed?**
363
-
364
- ### Before Release
365
-
366
- - [ ] **console.log removed?**
367
- - [ ] **SecureStore for sensitive data?**
368
- - [ ] **SSL pinning enabled?**
369
- - [ ] **Lists optimized (memo, keyExtractor)?**
370
- - [ ] **Memory cleanup on unmount?**
371
- - [ ] **Tested on low-end devices?**
372
- - [ ] **Accessibility labels on all interactive elements?**
373
-
374
- ---
375
-
376
- ## 📚 Reference Files
377
-
378
- For deeper guidance on specific areas:
379
-
380
- | File | When to Use |
381
- |------|-------------|
382
- | [mobile-design-thinking.md](mobile-design-thinking.md) | **FIRST! Anti-memorization, forces context-based thinking** |
383
- | [touch-psychology.md](touch-psychology.md) | Understanding touch interaction, Fitts' Law, gesture design |
384
- | [mobile-performance.md](mobile-performance.md) | Optimizing RN/Flutter, 60fps, memory/battery |
385
- | [platform-ios.md](platform-ios.md) | iOS-specific design, HIG compliance |
386
- | [platform-android.md](platform-android.md) | Android-specific design, Material Design 3 |
387
- | [mobile-navigation.md](mobile-navigation.md) | Navigation patterns, deep linking |
388
- | [mobile-typography.md](mobile-typography.md) | Type scale, system fonts, accessibility |
389
- | [mobile-color-system.md](mobile-color-system.md) | OLED optimization, dark mode, battery |
390
- | [decision-trees.md](decision-trees.md) | Framework, state, storage decisions |
391
-
392
- ---
393
-
394
- > **Remember:** Mobile users are impatient, interrupted, and using imprecise fingers on small screens. Design for the WORST conditions: bad network, one hand, bright sun, low battery. If it works there, it works everywhere.
1
+ ---
2
+ name: mobile-design
3
+ description: Mobile-first design thinking and decision-making for iOS and Android
4
+ apps. Touch interaction, performance patterns, platform conventions. Teaches principles,
5
+ not fixed values. Use when building React Native, Flutter, or native mobile apps.
6
+ allowed-tools: Read, Glob, Grep, Bash
7
+ version: '1.0'
8
+ ---
9
+
10
+ # Mobile Design System
11
+
12
+ > **Philosophy:** Touch-first. Battery-conscious. Platform-respectful. Offline-capable.
13
+ > **Core Principle:** Mobile is NOT a small desktop. THINK mobile constraints, ASK platform choice.
14
+
15
+ ---
16
+
17
+ ## 🔧 Runtime Scripts
18
+
19
+ **Execute these for validation (don't read, just run):**
20
+
21
+ | Script | Purpose | Usage |
22
+ |--------|---------|-------|
23
+ | `scripts/mobile_audit.py` | Mobile UX & Touch Audit | `python scripts/mobile_audit.py <project_path>` |
24
+
25
+ ---
26
+
27
+ ## 🔴 MANDATORY: Read Reference Files Before Working!
28
+
29
+ **⛔ DO NOT start development until you read the relevant files:**
30
+
31
+ ### Universal (Always Read)
32
+
33
+ | File | Content | Status |
34
+ |------|---------|--------|
35
+ | **[mobile-design-thinking.md](mobile-design-thinking.md)** | **⚠️ ANTI-MEMORIZATION: Forces thinking, prevents AI defaults** | **⬜ CRITICAL FIRST** |
36
+ | **[touch-psychology.md](touch-psychology.md)** | **Fitts' Law, gestures, haptics, thumb zone** | **⬜ CRITICAL** |
37
+ | **[mobile-performance.md](mobile-performance.md)** | **RN/Flutter performance, 60fps, memory** | **⬜ CRITICAL** |
38
+ | **[mobile-backend.md](mobile-backend.md)** | **Push notifications, offline sync, mobile API** | **⬜ CRITICAL** |
39
+ | **[mobile-testing.md](mobile-testing.md)** | **Testing pyramid, E2E, platform-specific** | **⬜ CRITICAL** |
40
+ | **[mobile-debugging.md](mobile-debugging.md)** | **Native vs JS debugging, Flipper, Logcat** | **⬜ CRITICAL** |
41
+ | [mobile-navigation.md](mobile-navigation.md) | Tab/Stack/Drawer, deep linking | ⬜ Read |
42
+ | [mobile-typography.md](mobile-typography.md) | System fonts, Dynamic Type, a11y | ⬜ Read |
43
+ | [mobile-color-system.md](mobile-color-system.md) | OLED, dark mode, battery-aware | Read |
44
+ | [decision-trees.md](decision-trees.md) | Framework/state/storage selection | ⬜ Read |
45
+
46
+ > 🧠 **mobile-design-thinking.md is PRIORITY!** This file ensures AI thinks instead of using memorized patterns.
47
+
48
+ ### Platform-Specific (Read Based on Target)
49
+
50
+ | Platform | File | Content | When to Read |
51
+ |----------|------|---------|--------------|
52
+ | **iOS** | [platform-ios.md](platform-ios.md) | Human Interface Guidelines, SF Pro, SwiftUI patterns | Building for iPhone/iPad |
53
+ | **Android** | [platform-android.md](platform-android.md) | Material Design 3, Roboto, Compose patterns | Building for Android |
54
+ | **Cross-Platform** | Both above | Platform divergence points | React Native / Flutter |
55
+
56
+ > 🔴 **If building for iOS → Read platform-ios.md FIRST!**
57
+ > 🔴 **If building for Android → Read platform-android.md FIRST!**
58
+ > 🔴 **If cross-platform → Read BOTH and apply conditional platform logic!**
59
+
60
+ ---
61
+
62
+ ## ⚠️ CRITICAL: ASK BEFORE ASSUMING (MANDATORY)
63
+
64
+ > **STOP! If the user's request is open-ended, DO NOT default to your favorites.**
65
+
66
+ ### You MUST Ask If Not Specified:
67
+
68
+ | Aspect | Ask | Why |
69
+ |--------|-----|-----|
70
+ | **Platform** | "iOS, Android, or both?" | Affects EVERY design decision |
71
+ | **Framework** | "React Native, Flutter, or native?" | Determines patterns and tools |
72
+ | **Navigation** | "Tab bar, drawer, or stack-based?" | Core UX decision |
73
+ | **State** | "What state management? (Zustand/Redux/Riverpod/BLoC?)" | Architecture foundation |
74
+ | **Offline** | "Does this need to work offline?" | Affects data strategy |
75
+ | **Target devices** | "Phone only, or tablet support?" | Layout complexity |
76
+
77
+ ### ⛔ AI MOBILE ANTI-PATTERNS (YASAK LİSTESİ)
78
+
79
+ > 🚫 **These are AI default tendencies that MUST be avoided!**
80
+
81
+ #### Performance Sins
82
+
83
+ | NEVER DO | Why It's Wrong | ALWAYS DO |
84
+ |-------------|----------------|--------------|
85
+ | **ScrollView for long lists** | Renders ALL items, memory explodes | Use `FlatList` / `FlashList` / `ListView.builder` |
86
+ | **Inline renderItem function** | New function every render, all items re-render | `useCallback` + `React.memo` |
87
+ | **Missing keyExtractor** | Index-based keys cause bugs on reorder | Unique, stable ID from data |
88
+ | **Skip getItemLayout** | Async layout = janky scroll | Provide when items have fixed height |
89
+ | **setState() everywhere** | Unnecessary widget rebuilds | Targeted state, `const` constructors |
90
+ | **Native driver: false** | Animations blocked by JS thread | `useNativeDriver: true` always |
91
+ | **console.log in production** | Blocks JS thread severely | Remove before release build |
92
+ | **Skip React.memo/const** | Every item re-renders on any change | Memoize list items ALWAYS |
93
+
94
+ #### Touch/UX Sins
95
+
96
+ | NEVER DO | Why It's Wrong | ALWAYS DO |
97
+ |-------------|----------------|--------------|
98
+ | **Touch target < 44px** | Impossible to tap accurately, frustrating | Minimum 44pt (iOS) / 48dp (Android) |
99
+ | **Spacing < 8px between targets** | Accidental taps on neighbors | Minimum 8-12px gap |
100
+ | **Gesture-only interactions** | Motor impaired users excluded | Always provide button alternative |
101
+ | **No loading state** | User thinks app crashed | ALWAYS show loading feedback |
102
+ | **No error state** | User stuck, no recovery path | Show error with retry option |
103
+ | **No offline handling** | Crash/block when network lost | Graceful degradation, cached data |
104
+ | **Ignore platform conventions** | Users confused, muscle memory broken | iOS feels iOS, Android feels Android |
105
+
106
+ #### Security Sins
107
+
108
+ | NEVER DO | Why It's Wrong | ALWAYS DO |
109
+ |-------------|----------------|--------------|
110
+ | **Token in AsyncStorage** | Easily accessible, stolen on rooted device | `SecureStore` / `Keychain` / `EncryptedSharedPreferences` |
111
+ | **Hardcode API keys** | Reverse engineered from APK/IPA | Environment variables, secure storage |
112
+ | **Skip SSL pinning** | MITM attacks possible | Pin certificates in production |
113
+ | **Log sensitive data** | Logs can be extracted | Never log tokens, passwords, PII |
114
+
115
+ #### Architecture Sins
116
+
117
+ | NEVER DO | Why It's Wrong | ALWAYS DO |
118
+ |-------------|----------------|--------------|
119
+ | **Business logic in UI** | Untestable, unmaintainable | Service layer separation |
120
+ | **Global state for everything** | Unnecessary re-renders, complexity | Local state default, lift when needed |
121
+ | **Deep linking as afterthought** | Notifications, shares broken | Plan deep links from day one |
122
+ | **Skip dispose/cleanup** | Memory leaks, zombie listeners | Clean up subscriptions, timers |
123
+
124
+ ---
125
+
126
+ ## 📱 Platform Decision Matrix
127
+
128
+ ### When to Unify vs Diverge
129
+
130
+ ```
131
+ UNIFY (same on both) DIVERGE (platform-specific)
132
+ ─────────────────── ──────────────────────────
133
+ Business Logic ✅ Always -
134
+ Data LayerAlways -
135
+ Core Features Always -
136
+
137
+ Navigation - ✅ iOS: edge swipe, Android: back button
138
+ Gestures - ✅ Platform-native feel
139
+ Icons - ✅ SF Symbols vs Material Icons
140
+ Date Pickers - ✅ Native pickers feel right
141
+ Modals/Sheets - ✅ iOS: bottom sheet vs Android: dialog
142
+ Typography - ✅ SF Pro vs Roboto (or custom)
143
+ Error Dialogs - ✅ Platform conventions for alerts
144
+ ```
145
+
146
+ ### Quick Reference: Platform Defaults
147
+
148
+ | Element | iOS | Android |
149
+ |---------|-----|---------|
150
+ | **Primary Font** | SF Pro / SF Compact | Roboto |
151
+ | **Min Touch Target** | 44pt × 44pt | 48dp × 48dp |
152
+ | **Back Navigation** | Edge swipe left | System back button/gesture |
153
+ | **Bottom Tab Icons** | SF Symbols | Material Symbols |
154
+ | **Action Sheet** | UIActionSheet from bottom | Bottom Sheet / Dialog |
155
+ | **Progress** | Spinner | Linear progress (Material) |
156
+ | **Pull to Refresh** | Native UIRefreshControl | SwipeRefreshLayout |
157
+
158
+ ---
159
+
160
+ ## 🧠 Mobile UX Psychology (Quick Reference)
161
+
162
+ ### Fitts' Law for Touch
163
+
164
+ ```
165
+ Desktop: Cursor is precise (1px)
166
+ Mobile: Finger is imprecise (~7mm contact area)
167
+
168
+ → Touch targets MUST be 44-48px minimum
169
+ → Important actions in THUMB ZONE (bottom of screen)
170
+ Destructive actions AWAY from easy reach
171
+ ```
172
+
173
+ ### Thumb Zone (One-Handed Usage)
174
+
175
+ ```
176
+ ┌─────────────────────────────┐
177
+ HARD TO REACH │ ← Navigation, menu, back
178
+ (stretch)
179
+ ├─────────────────────────────┤
180
+ OK TO REACH │ ← Secondary actions
181
+ (natural)
182
+ ├─────────────────────────────┤
183
+ │ EASY TO REACH │ ← PRIMARY CTAs, tab bar
184
+ │ (thumb's natural arc) │ ← Main content interaction
185
+ └─────────────────────────────┘
186
+ [ HOME ]
187
+ ```
188
+
189
+ ### Mobile-Specific Cognitive Load
190
+
191
+ | Desktop | Mobile Difference |
192
+ |---------|-------------------|
193
+ | Multiple windows | ONE task at a time |
194
+ | Keyboard shortcuts | Touch gestures |
195
+ | Hover states | NO hover (tap or nothing) |
196
+ | Large viewport | Limited space, scroll vertical |
197
+ | Stable attention | Interrupted constantly |
198
+
199
+ For deep dive: [touch-psychology.md](touch-psychology.md)
200
+
201
+ ---
202
+
203
+ ## ⚡ Performance Principles (Quick Reference)
204
+
205
+ ### React Native Critical Rules
206
+
207
+ ```typescript
208
+ // ✅ CORRECT: Memoized renderItem + React.memo wrapper
209
+ const ListItem = React.memo(({ item }: { item: Item }) => (
210
+ <View style={styles.item}>
211
+ <Text>{item.title}</Text>
212
+ </View>
213
+ ));
214
+
215
+ const renderItem = useCallback(
216
+ ({ item }: { item: Item }) => <ListItem item={item} />,
217
+ []
218
+ );
219
+
220
+ // ✅ CORRECT: FlatList with all optimizations
221
+ <FlatList
222
+ data={items}
223
+ renderItem={renderItem}
224
+ keyExtractor={(item) => item.id} // Stable ID, NOT index
225
+ getItemLayout={(data, index) => ({
226
+ length: ITEM_HEIGHT,
227
+ offset: ITEM_HEIGHT * index,
228
+ index,
229
+ })}
230
+ removeClippedSubviews={true}
231
+ maxToRenderPerBatch={10}
232
+ windowSize={5}
233
+ />
234
+ ```
235
+
236
+ ### Flutter Critical Rules
237
+
238
+ ```dart
239
+ // ✅ CORRECT: const constructors prevent rebuilds
240
+ class MyWidget extends StatelessWidget {
241
+ const MyWidget({super.key}); // CONST!
242
+
243
+ @override
244
+ Widget build(BuildContext context) {
245
+ return const Column( // CONST!
246
+ children: [
247
+ Text('Static content'),
248
+ MyConstantWidget(),
249
+ ],
250
+ );
251
+ }
252
+ }
253
+
254
+ // ✅ CORRECT: Targeted state with ValueListenableBuilder
255
+ ValueListenableBuilder<int>(
256
+ valueListenable: counter,
257
+ builder: (context, value, child) => Text('$value'),
258
+ child: const ExpensiveWidget(), // Won't rebuild!
259
+ )
260
+ ```
261
+
262
+ ### Animation Performance
263
+
264
+ ```
265
+ GPU-accelerated (FAST): CPU-bound (SLOW):
266
+ ├── transform ├── width, height
267
+ ├── opacity ├── top, left, right, bottom
268
+ └── (use these ONLY) ├── margin, padding
269
+ └── (AVOID animating these)
270
+ ```
271
+
272
+ For complete guide: [mobile-performance.md](mobile-performance.md)
273
+
274
+ ---
275
+
276
+ ## 📝 CHECKPOINT (MANDATORY Before Any Mobile Work)
277
+
278
+ > **Before writing ANY mobile code, you MUST complete this checkpoint:**
279
+
280
+ ```
281
+ 🧠 CHECKPOINT:
282
+
283
+ Platform: [ iOS / Android / Both ]
284
+ Framework: [ React Native / Flutter / SwiftUI / Kotlin ]
285
+ Files Read: [ List the skill files you've read ]
286
+
287
+ 3 Principles I Will Apply:
288
+ 1. _______________
289
+ 2. _______________
290
+ 3. _______________
291
+
292
+ Anti-Patterns I Will Avoid:
293
+ 1. _______________
294
+ 2. _______________
295
+ ```
296
+
297
+ **Example:**
298
+ ```
299
+ 🧠 CHECKPOINT:
300
+
301
+ Platform: iOS + Android (Cross-platform)
302
+ Framework: React Native + Expo
303
+ Files Read: touch-psychology.md, mobile-performance.md, platform-ios.md, platform-android.md
304
+
305
+ 3 Principles I Will Apply:
306
+ 1. FlatList with React.memo + useCallback for all lists
307
+ 2. 48px touch targets, thumb zone for primary CTAs
308
+ 3. Platform-specific navigation (edge swipe iOS, back button Android)
309
+
310
+ Anti-Patterns I Will Avoid:
311
+ 1. ScrollView for lists → FlatList
312
+ 2. Inline renderItem → Memoized
313
+ 3. AsyncStorage for tokensSecureStore
314
+ ```
315
+
316
+ > 🔴 **Can't fill the checkpoint? → GO BACK AND READ THE SKILL FILES.**
317
+
318
+ ---
319
+
320
+ ## 🔧 Framework Decision Tree
321
+
322
+ ```
323
+ WHAT ARE YOU BUILDING?
324
+
325
+ ├── Need OTA updates + rapid iteration + web team
326
+ │ └── ✅ React Native + Expo
327
+
328
+ ├── Need pixel-perfect custom UI + performance critical
329
+ └── Flutter
330
+
331
+ ├── Deep native features + single platform focus
332
+ ├── iOS only SwiftUI
333
+ │ └── Android only Kotlin + Jetpack Compose
334
+
335
+ ├── Existing RN codebase + new features
336
+ └── ✅ React Native (bare workflow)
337
+
338
+ └── Enterprise + existing Flutter codebase
339
+ └── Flutter
340
+ ```
341
+
342
+ For complete decision trees: [decision-trees.md](decision-trees.md)
343
+
344
+ ---
345
+
346
+ ## 📋 Pre-Development Checklist
347
+
348
+ ### Before Starting ANY Mobile Project
349
+
350
+ - [ ] **Platform confirmed?** (iOS / Android / Both)
351
+ - [ ] **Framework chosen?** (RN / Flutter / Native)
352
+ - [ ] **Navigation pattern decided?** (Tabs / Stack / Drawer)
353
+ - [ ] **State management selected?** (Zustand / Redux / Riverpod / BLoC)
354
+ - [ ] **Offline requirements known?**
355
+ - [ ] **Deep linking planned from day one?**
356
+ - [ ] **Target devices defined?** (Phone / Tablet / Both)
357
+
358
+ ### Before Every Screen
359
+
360
+ - [ ] **Touch targets 44-48px?**
361
+ - [ ] **Primary CTA in thumb zone?**
362
+ - [ ] **Loading state exists?**
363
+ - [ ] **Error state with retry exists?**
364
+ - [ ] **Offline handling considered?**
365
+ - [ ] **Platform conventions followed?**
366
+
367
+ ### Before Release
368
+
369
+ - [ ] **console.log removed?**
370
+ - [ ] **SecureStore for sensitive data?**
371
+ - [ ] **SSL pinning enabled?**
372
+ - [ ] **Lists optimized (memo, keyExtractor)?**
373
+ - [ ] **Memory cleanup on unmount?**
374
+ - [ ] **Tested on low-end devices?**
375
+ - [ ] **Accessibility labels on all interactive elements?**
376
+
377
+ ---
378
+
379
+ ## 📚 Reference Files
380
+
381
+ For deeper guidance on specific areas:
382
+
383
+ | File | When to Use |
384
+ |------|-------------|
385
+ | [mobile-design-thinking.md](mobile-design-thinking.md) | **FIRST! Anti-memorization, forces context-based thinking** |
386
+ | [touch-psychology.md](touch-psychology.md) | Understanding touch interaction, Fitts' Law, gesture design |
387
+ | [mobile-performance.md](mobile-performance.md) | Optimizing RN/Flutter, 60fps, memory/battery |
388
+ | [platform-ios.md](platform-ios.md) | iOS-specific design, HIG compliance |
389
+ | [platform-android.md](platform-android.md) | Android-specific design, Material Design 3 |
390
+ | [mobile-navigation.md](mobile-navigation.md) | Navigation patterns, deep linking |
391
+ | [mobile-typography.md](mobile-typography.md) | Type scale, system fonts, accessibility |
392
+ | [mobile-color-system.md](mobile-color-system.md) | OLED optimization, dark mode, battery |
393
+ | [decision-trees.md](decision-trees.md) | Framework, state, storage decisions |
394
+
395
+ ---
396
+
397
+ > **Remember:** Mobile users are impatient, interrupted, and using imprecise fingers on small screens. Design for the WORST conditions: bad network, one hand, bright sun, low battery. If it works there, it works everywhere.