@buivietphi/skill-mobile-mt 1.0.0

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.
@@ -0,0 +1,343 @@
1
+ # Agent Rules Template — All Agents
2
+
3
+ > Each AI agent reads a specific project-level file automatically every session.
4
+ > Copy the relevant section below to your project root.
5
+
6
+ ---
7
+
8
+ ## Quick Reference
9
+
10
+ | Agent | File to create | Location |
11
+ |-------|---------------|----------|
12
+ | **Claude Code** | `CLAUDE.md` | Project root |
13
+ | **Cursor** | `.cursorrules` | Project root |
14
+ | **Windsurf** | `.windsurfrules` | Project root |
15
+ | **GitHub Copilot** | `.github/copilot-instructions.md` | `.github/` folder |
16
+ | **Codex (OpenAI)** | `AGENTS.md` | Project root |
17
+ | **Gemini CLI** | `GEMINI.md` | Project root |
18
+ | **Kimi** | No auto-load file — paste rules as context | — |
19
+ | **Antigravity** | Configured in Antigravity YAML `context.rules` | Agent config |
20
+
21
+ ---
22
+
23
+ ## Claude Code → `CLAUDE.md`
24
+
25
+ ```markdown
26
+ # Project: [Your App Name]
27
+
28
+ ## Stack
29
+ - Framework: [React Native CLI / Expo SDK XX / Flutter X.X / iOS / Android]
30
+ - Language: [TypeScript / JavaScript / Dart / Swift / Kotlin]
31
+ - State: [Redux Toolkit / Zustand / Riverpod / BLoC / StateFlow]
32
+ - Navigation: [React Navigation v6 / Expo Router / GoRouter / UIKit / Jetpack]
33
+ - API: [axios / fetch / Dio / Firebase / GraphQL]
34
+ - Package Manager: [yarn / npm / pnpm / bun / flutter pub]
35
+
36
+ ## Auto-Check Rules (apply after EVERY code change)
37
+
38
+ Before saying "done", verify:
39
+ - No console.log / print / NSLog in production code
40
+ - No hardcoded secrets or API keys
41
+ - All async operations wrapped in try/catch
42
+ - All 4 states handled: loading / error / empty / success
43
+ - useEffect / dispose / viewModelScope has cleanup
44
+ - FlatList (not ScrollView) for lists > 20 items
45
+ - No force unwrap (! / !! / as!) without null check
46
+ - TypeScript: no implicit 'any'
47
+ - New screens registered in navigator
48
+
49
+ If ANY check fails → fix it before marking done.
50
+
51
+ ## What NOT to do
52
+ - NEVER suggest migrating to a different framework
53
+ - NEVER change state management library
54
+ - NEVER add packages without checking SDK compatibility
55
+ - NEVER mix package managers (yarn + npm)
56
+ ```
57
+
58
+ ---
59
+
60
+ ## Cursor → `.cursorrules`
61
+
62
+ ```
63
+ # [Your App Name] — Cursor Rules
64
+
65
+ ## Project
66
+ - Framework: [React Native CLI / Expo SDK XX / Flutter X.X / iOS / Android]
67
+ - Language: [TypeScript / Dart / Swift / Kotlin]
68
+ - State: [Redux Toolkit / Zustand / Riverpod / BLoC]
69
+ - Package Manager: [yarn / npm / bun / flutter pub]
70
+
71
+ ## Code Style
72
+ - PascalCase for screens and components
73
+ - camelCase for hooks, services, utils
74
+ - Absolute imports with @/ alias (if configured)
75
+
76
+ ## Auto-Check (before every completion)
77
+ - No console.log in production code
78
+ - No hardcoded secrets or API keys
79
+ - All async wrapped in try/catch
80
+ - All 4 states: loading / error / empty / success
81
+ - useEffect has cleanup (return () => ...)
82
+ - FlatList (not ScrollView) for dynamic lists
83
+ - No implicit 'any' in TypeScript
84
+
85
+ ## Never
86
+ - Change framework or architecture
87
+ - Change state management library
88
+ - Add packages without checking SDK compatibility
89
+ - Mix package managers
90
+ ```
91
+
92
+ ---
93
+
94
+ ## Windsurf → `.windsurfrules`
95
+
96
+ ```
97
+ # [Your App Name] — Windsurf Rules
98
+
99
+ Project: [Your App Name]
100
+ Framework: [React Native CLI / Expo / Flutter / iOS / Android]
101
+ Language: [TypeScript / Dart / Swift / Kotlin]
102
+ State management: [Redux Toolkit / Zustand / Riverpod / BLoC]
103
+ Package manager: [yarn / npm / bun / flutter pub]
104
+
105
+ ## Coding Rules
106
+
107
+ Always:
108
+ - Wrap all async operations in try/catch
109
+ - Handle all 4 states: loading, error, empty, success
110
+ - Add cleanup to useEffect (return () => ...)
111
+ - Use FlatList for dynamic lists (not ScrollView)
112
+ - Use PascalCase for components and screens
113
+ - Use camelCase for hooks, services, and utilities
114
+ - No implicit 'any' in TypeScript
115
+
116
+ Never:
117
+ - Leave console.log in production code
118
+ - Hardcode secrets, tokens, or API keys
119
+ - Store tokens in AsyncStorage / SharedPreferences / UserDefaults
120
+ - Change the framework or architecture
121
+ - Add packages without verifying SDK compatibility
122
+ - Mix yarn and npm
123
+
124
+ ## Security (non-negotiable)
125
+ - Tokens → SecureStore / Keychain / EncryptedSharedPreferences
126
+ - API calls → HTTPS only
127
+ - Sensitive data → never in logs
128
+ - User input → sanitize before display
129
+ ```
130
+
131
+ ---
132
+
133
+ ## GitHub Copilot → `.github/copilot-instructions.md`
134
+
135
+ ```markdown
136
+ # Copilot Instructions — [Your App Name]
137
+
138
+ ## Project Context
139
+ - **Framework:** [React Native CLI / Expo SDK XX / Flutter X.X / iOS / Android]
140
+ - **Language:** [TypeScript / JavaScript / Dart / Swift / Kotlin]
141
+ - **State Management:** [Redux Toolkit / Zustand / Riverpod / BLoC]
142
+ - **Package Manager:** [yarn / npm / bun / flutter pub]
143
+
144
+ ## Conventions
145
+ - PascalCase: components, screens, classes
146
+ - camelCase: hooks, services, utilities, variables
147
+ - Files named same as their default export
148
+
149
+ ## Required Patterns
150
+
151
+ ### Every async function
152
+ ```typescript
153
+ try {
154
+ setLoading(true);
155
+ const result = await apiCall();
156
+ setData(result);
157
+ } catch (error) {
158
+ setError(error.message);
159
+ } finally {
160
+ setLoading(false);
161
+ }
162
+ ```
163
+
164
+ ### Every screen must handle 4 states
165
+ ```typescript
166
+ if (loading) return <LoadingScreen />;
167
+ if (error) return <ErrorScreen error={error} />;
168
+ if (!data?.length) return <EmptyScreen />;
169
+ return <DataScreen data={data} />;
170
+ ```
171
+
172
+ ### Every useEffect with subscriptions
173
+ ```typescript
174
+ useEffect(() => {
175
+ const sub = subscribe();
176
+ return () => sub.unsubscribe(); // REQUIRED
177
+ }, []);
178
+ ```
179
+
180
+ ## Rules
181
+ - No console.log in production
182
+ - No hardcoded secrets or API keys
183
+ - FlatList (not ScrollView) for dynamic lists
184
+ - Tokens in SecureStore / Keychain only
185
+ - No force unwrap without null check
186
+ - No implicit 'any' in TypeScript
187
+ ```
188
+
189
+ ---
190
+
191
+ ## Codex (OpenAI) → `AGENTS.md` (project root)
192
+
193
+ ```markdown
194
+ # [Your App Name] — Agent Rules
195
+
196
+ ## Project
197
+ - Framework: [React Native / Expo / Flutter / iOS / Android]
198
+ - Language: [TypeScript / Dart / Swift / Kotlin]
199
+ - State: [Redux Toolkit / Zustand / Riverpod / BLoC]
200
+ - Package Manager: [yarn / npm / bun / flutter pub]
201
+
202
+ ## Rules for All Tasks
203
+
204
+ ### Always
205
+ - Wrap async in try/catch
206
+ - Handle: loading / error / empty / success states
207
+ - Cleanup useEffect (return unsubscribe/cancel)
208
+ - Use FlatList for dynamic lists
209
+ - PascalCase components, camelCase hooks/services
210
+
211
+ ### Never
212
+ - console.log in production
213
+ - Hardcode secrets or API keys
214
+ - Store tokens in AsyncStorage (use SecureStore/Keychain)
215
+ - Suggest changing framework or state management
216
+ - Add packages without verifying SDK compatibility
217
+ - Mix yarn and npm
218
+
219
+ ### Security
220
+ - Tokens → SecureStore (RN) / Keychain (iOS) / EncryptedSharedPreferences (Android)
221
+ - API → HTTPS only
222
+ - Logs → never include sensitive data
223
+ - Input → sanitize before display
224
+
225
+ ## Architecture
226
+ [FILL IN: describe your feature structure]
227
+ Example: feature-based (src/features/auth/, src/features/home/)
228
+
229
+ ## Preferred Commands
230
+ - Install: [yarn install / npm install / flutter pub get]
231
+ - Run: [yarn ios / yarn android / flutter run]
232
+ - Test: [yarn test / flutter test]
233
+ ```
234
+
235
+ ---
236
+
237
+ ## Gemini CLI → `GEMINI.md`
238
+
239
+ ```markdown
240
+ # [Your App Name] — Gemini Rules
241
+
242
+ ## Project Stack
243
+ - Framework: [React Native / Expo / Flutter / iOS / Android]
244
+ - Language: [TypeScript / Dart / Swift / Kotlin]
245
+ - State: [Redux Toolkit / Zustand / Riverpod / BLoC]
246
+ - Package Manager: [yarn / npm / bun / flutter pub]
247
+
248
+ ## Code Quality Rules
249
+
250
+ Apply before every completion:
251
+
252
+ 1. No console.log / print / NSLog in production
253
+ 2. No hardcoded API keys, tokens, or secrets
254
+ 3. All async wrapped in try/catch with proper error handling
255
+ 4. All 4 states implemented: loading / error / empty / success
256
+ 5. useEffect cleanup present when using subscriptions or timers
257
+ 6. FlatList used for lists (not ScrollView with map)
258
+ 7. TypeScript: no implicit 'any'
259
+ 8. New screens registered in the navigator
260
+
261
+ ## Security Rules
262
+ - Token storage: SecureStore / Keychain / EncryptedSharedPreferences ONLY
263
+ - API calls: HTTPS only
264
+ - Logs: no sensitive data
265
+ - User input: sanitize before rendering
266
+
267
+ ## Constraints
268
+ - Do not change framework or architecture
269
+ - Do not change state management library
270
+ - Do not add packages without checking SDK compatibility
271
+ - Do not mix package managers
272
+ ```
273
+
274
+ ---
275
+
276
+ ## Kimi — No Auto-Load
277
+
278
+ Kimi does not read a project file automatically. Options:
279
+
280
+ **Option 1 — Paste at start of conversation:**
281
+ ```
282
+ Project rules:
283
+ - Framework: [React Native / Flutter / iOS / Android]
284
+ - No console.log in production
285
+ - All async in try/catch
286
+ - All 4 states: loading/error/empty/success
287
+ - Tokens in SecureStore/Keychain only
288
+ - No implicit 'any' in TypeScript
289
+ - Do not change framework or state management
290
+ ```
291
+
292
+ **Option 2 — Use skill-mobile-mt:**
293
+ Load SKILL.md as context at the start of the Kimi conversation.
294
+
295
+ ---
296
+
297
+ ## Antigravity — YAML Config
298
+
299
+ Add to your Antigravity configuration:
300
+
301
+ ```yaml
302
+ skill:
303
+ name: skill-mobile-mt
304
+ version: "1.0.0"
305
+
306
+ context:
307
+ rules:
308
+ - No console.log / print / NSLog in production code
309
+ - No hardcoded secrets or API keys
310
+ - Tokens in SecureStore / Keychain / EncryptedSharedPreferences ONLY
311
+ - All async wrapped in try/catch
312
+ - All 4 states handled: loading / error / empty / success
313
+ - useEffect / dispose / viewModelScope has cleanup
314
+ - FlatList (not ScrollView) for dynamic lists
315
+ - No implicit 'any' in TypeScript
316
+
317
+ project:
318
+ framework: "[react-native / flutter / ios / android]"
319
+ language: "[typescript / dart / swift / kotlin]"
320
+ state_management: "[redux / zustand / riverpod / bloc]"
321
+ package_manager: "[yarn / npm / bun / flutter-pub]"
322
+
323
+ constraints:
324
+ - NEVER suggest migrating to a different framework
325
+ - NEVER change state management library
326
+ - NEVER add packages without checking SDK compatibility
327
+ - NEVER mix package managers
328
+ ```
329
+
330
+ ---
331
+
332
+ ## Summary
333
+
334
+ | Agent | Auto-loaded? | File |
335
+ |-------|-------------|------|
336
+ | Claude Code | YES — every session | `CLAUDE.md` |
337
+ | Cursor | YES — every chat | `.cursorrules` |
338
+ | Windsurf | YES — every session | `.windsurfrules` |
339
+ | GitHub Copilot | YES — workspace context | `.github/copilot-instructions.md` |
340
+ | Codex | YES — when AGENTS.md exists | `AGENTS.md` |
341
+ | Gemini CLI | YES — when GEMINI.md exists | `GEMINI.md` |
342
+ | Kimi | NO — paste manually | (none) |
343
+ | Antigravity | YES — via YAML config | Antigravity config |