mobile-best-practices 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.
- package/README.md +64 -0
- package/assets/data/anti-patterns.csv +114 -0
- package/assets/data/architectures.csv +50 -0
- package/assets/data/code-snippets.csv +80 -0
- package/assets/data/gradle-deps.csv +79 -0
- package/assets/data/libraries.csv +102 -0
- package/assets/data/performance.csv +229 -0
- package/assets/data/platforms/android.csv +247 -0
- package/assets/data/platforms/flutter.csv +55 -0
- package/assets/data/platforms/ios.csv +61 -0
- package/assets/data/platforms/react-native.csv +56 -0
- package/assets/data/project-templates.csv +19 -0
- package/assets/data/reasoning-rules.csv +57 -0
- package/assets/data/security.csv +438 -0
- package/assets/data/testing.csv +74 -0
- package/assets/data/ui-patterns.csv +92 -0
- package/assets/references/CHECKLIST.md +49 -0
- package/assets/references/CODE-RULES.md +123 -0
- package/assets/scripts/__pycache__/core.cpython-314.pyc +0 -0
- package/assets/scripts/core.py +432 -0
- package/assets/scripts/search.py +104 -0
- package/assets/skills/all.md +245 -0
- package/assets/skills/android.md +168 -0
- package/assets/skills/flutter.md +153 -0
- package/assets/skills/ios.md +149 -0
- package/assets/skills/react-native.md +154 -0
- package/assets/templates/base/quick-reference.md +41 -0
- package/assets/templates/base/skill-content.md +60 -0
- package/assets/templates/platforms/agent.json +11 -0
- package/assets/templates/platforms/antigravity.json +13 -0
- package/assets/templates/platforms/claude.json +27 -0
- package/assets/templates/platforms/codebuddy.json +11 -0
- package/assets/templates/platforms/codex.json +11 -0
- package/assets/templates/platforms/continue.json +11 -0
- package/assets/templates/platforms/copilot.json +11 -0
- package/assets/templates/platforms/cursor.json +11 -0
- package/assets/templates/platforms/gemini.json +11 -0
- package/assets/templates/platforms/kiro.json +11 -0
- package/assets/templates/platforms/opencode.json +11 -0
- package/assets/templates/platforms/qoder.json +11 -0
- package/assets/templates/platforms/roocode.json +11 -0
- package/assets/templates/platforms/trae.json +11 -0
- package/assets/templates/platforms/windsurf.json +11 -0
- package/dist/commands/init.d.ts +6 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +94 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/update.d.ts +2 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +28 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/versions.d.ts +2 -0
- package/dist/commands/versions.d.ts.map +1 -0
- package/dist/commands/versions.js +30 -0
- package/dist/commands/versions.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +24 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +103 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mobile-best-practices
|
|
3
|
+
description: "iOS development intelligence with SwiftUI. 1,738 searchable entries including 60 iOS-specific guidelines. Default stack: MVVM + SwiftUI + Combine + async/await + SwiftData + URLSession + Kingfisher + NavigationStack. Use when building, reviewing, fixing, or optimizing iOS apps. Covers architecture patterns, UI components, anti-patterns, performance, security, and testing."
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires Python 3.x for BM25 search. Works with Claude Code and other skills-compatible agents.
|
|
6
|
+
metadata:
|
|
7
|
+
author: tungnk123
|
|
8
|
+
version: "1.0"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# iOS Best Practices - SwiftUI Development Intelligence
|
|
12
|
+
|
|
13
|
+
Searchable database of **1,738 mobile best practices**, **optimized for iOS with SwiftUI**. All searches default to iOS platform. Covers architecture, UI patterns, security, performance, and testing for Apple platforms.
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
python3 --version || python --version
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If not installed: `brew install python3` (macOS) | `sudo apt install python3` (Linux) | `winget install Python.Python.3.12` (Windows)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## How to Use This Skill
|
|
26
|
+
|
|
27
|
+
When user requests iOS development work (build, create, architect, review, fix, optimize), follow this workflow:
|
|
28
|
+
|
|
29
|
+
### Step 1: Extract Requirements
|
|
30
|
+
|
|
31
|
+
No need to detect platform - **always iOS with SwiftUI**. Extract:
|
|
32
|
+
- **Product type**: E-commerce, Banking, Social Media, Healthcare, Delivery, Fitness, Education, Chat
|
|
33
|
+
- **Scope**: New project, new feature, code review, refactor, fix bug, optimize
|
|
34
|
+
|
|
35
|
+
### Step 2: Search the Database
|
|
36
|
+
|
|
37
|
+
Use `search.py` with `--platform ios` or `--stack swiftui` for focused results.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# iOS platform guidelines (ALWAYS search this first)
|
|
41
|
+
python3 {SKILL_PATH}/scripts/search.py "<keyword>" --platform ios -n 5
|
|
42
|
+
|
|
43
|
+
# Stack-specific search
|
|
44
|
+
python3 {SKILL_PATH}/scripts/search.py "<keyword>" --stack swiftui
|
|
45
|
+
|
|
46
|
+
# Architecture patterns
|
|
47
|
+
python3 {SKILL_PATH}/scripts/search.py "<keyword>" --domain architecture
|
|
48
|
+
|
|
49
|
+
# Anti-patterns filtered for iOS
|
|
50
|
+
python3 {SKILL_PATH}/scripts/search.py "<keyword>" --domain antipattern --filter-platform ios
|
|
51
|
+
|
|
52
|
+
# Performance rules filtered for iOS
|
|
53
|
+
python3 {SKILL_PATH}/scripts/search.py "<keyword>" --domain performance --filter-platform ios
|
|
54
|
+
|
|
55
|
+
# Libraries for iOS
|
|
56
|
+
python3 {SKILL_PATH}/scripts/search.py "<keyword>" --domain library --filter-platform ios
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Step 3: Recommended Search Order for iOS
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# 1. Get iOS-specific best practices
|
|
63
|
+
python3 {SKILL_PATH}/scripts/search.py "swiftui state navigation" --platform ios -n 5
|
|
64
|
+
|
|
65
|
+
# 2. Get architecture guidance
|
|
66
|
+
python3 {SKILL_PATH}/scripts/search.py "mvvm tca viper ios" --domain architecture
|
|
67
|
+
|
|
68
|
+
# 3. Get iOS libraries
|
|
69
|
+
python3 {SKILL_PATH}/scripts/search.py "networking image database" --domain library --filter-platform ios
|
|
70
|
+
|
|
71
|
+
# 4. Check anti-patterns to avoid
|
|
72
|
+
python3 {SKILL_PATH}/scripts/search.py "ios swiftui" --domain antipattern --filter-platform ios
|
|
73
|
+
|
|
74
|
+
# 5. Check performance rules
|
|
75
|
+
python3 {SKILL_PATH}/scripts/search.py "swiftui list image startup" --domain performance --filter-platform ios
|
|
76
|
+
|
|
77
|
+
# 6. Check security
|
|
78
|
+
python3 {SKILL_PATH}/scripts/search.py "keychain biometric encryption" --domain security --filter-platform ios
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Search Reference
|
|
84
|
+
|
|
85
|
+
### Available Domains (11 total)
|
|
86
|
+
|
|
87
|
+
| Domain | Use For | Example Keywords |
|
|
88
|
+
|--------|---------|------------------|
|
|
89
|
+
| `reasoning` | Product type recommendations | e-commerce, banking, social media, healthcare |
|
|
90
|
+
| `architecture` | Architecture patterns | mvvm, tca, viper, clean architecture |
|
|
91
|
+
| `library` | Libraries & dependencies | alamofire, kingfisher, realm, swiftdata |
|
|
92
|
+
| `ui` | UI patterns & components | navigation, list, sheet, tab bar, search |
|
|
93
|
+
| `antipattern` | Common mistakes | force unwrap, retain cycle, @ObservedObject |
|
|
94
|
+
| `performance` | Performance optimization | startup, list, memory, image, animation |
|
|
95
|
+
| `security` | Security best practices | keychain, biometric, ssl pinning, encryption |
|
|
96
|
+
| `testing` | Testing patterns | xctest, swift testing, snapshot, ui test |
|
|
97
|
+
| `template` | Project templates/starters | banking ios, social media ios |
|
|
98
|
+
| `snippet` | Code templates | (primarily Android, but cross-platform patterns available) |
|
|
99
|
+
| `gradle` | Gradle dependencies | (Android only - use for cross-reference) |
|
|
100
|
+
|
|
101
|
+
### Flags
|
|
102
|
+
|
|
103
|
+
| Flag | Description | Example |
|
|
104
|
+
|------|-------------|---------|
|
|
105
|
+
| `--platform` / `-p` | Platform guidelines | `--platform ios` |
|
|
106
|
+
| `--stack` / `-s` | Stack-specific search | `--stack swiftui` |
|
|
107
|
+
| `--domain` / `-d` | Search a specific domain | `--domain architecture` |
|
|
108
|
+
| `--filter-platform` / `-fp` | Filter results by platform | `--domain library --filter-platform ios` |
|
|
109
|
+
| `--max-results` / `-n` | Number of results (default: 3) | `-n 5` |
|
|
110
|
+
| `--json` | Output as JSON | `--json` |
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Example Workflows
|
|
115
|
+
|
|
116
|
+
### New Feature: "Add a settings screen"
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
python3 {SKILL_PATH}/scripts/search.py "settings form navigation" --platform ios -n 5
|
|
120
|
+
python3 {SKILL_PATH}/scripts/search.py "form list settings" --domain ui --filter-platform ios
|
|
121
|
+
python3 {SKILL_PATH}/scripts/search.py "ios navigation state" --domain antipattern --filter-platform ios
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### New Project: "Build a banking app"
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
python3 {SKILL_PATH}/scripts/search.py "banking" --domain reasoning
|
|
128
|
+
python3 {SKILL_PATH}/scripts/search.py "tca viper mvvm ios" --domain architecture
|
|
129
|
+
python3 {SKILL_PATH}/scripts/search.py "keychain biometric encryption certificate" --domain security --filter-platform ios
|
|
130
|
+
python3 {SKILL_PATH}/scripts/search.py "banking security authentication" --platform ios -n 5
|
|
131
|
+
python3 {SKILL_PATH}/scripts/search.py "networking database" --domain library --filter-platform ios
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Code Review: "Review my iOS code"
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
python3 {SKILL_PATH}/scripts/search.py "ios swiftui retain cycle" --domain antipattern --filter-platform ios -n 5
|
|
138
|
+
python3 {SKILL_PATH}/scripts/search.py "state navigation lifecycle" --platform ios -n 5
|
|
139
|
+
python3 {SKILL_PATH}/scripts/search.py "swiftui list image memory" --domain performance --filter-platform ios
|
|
140
|
+
python3 {SKILL_PATH}/scripts/search.py "keychain encryption storage" --domain security --filter-platform ios
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Code Generation & Quality
|
|
146
|
+
|
|
147
|
+
Before generating code, read the [code generation rules](references/CODE-RULES.md) for platform-specific conventions, required patterns, and anti-patterns to avoid.
|
|
148
|
+
|
|
149
|
+
Before delivering code, verify against the [pre-delivery checklist](references/CHECKLIST.md) covering architecture, SwiftUI, performance, security, testing, and accessibility.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mobile-best-practices
|
|
3
|
+
description: "React Native development intelligence with TypeScript. 1,738 searchable entries including 55 React Native-specific guidelines. Default stack: Redux Toolkit/Zustand + Axios + React Navigation + MMKV + FastImage + React Native Reanimated. Use when building, reviewing, fixing, or optimizing React Native apps. Covers architecture patterns, UI components, anti-patterns, performance, security, and testing."
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires Python 3.x for BM25 search. Works with Claude Code and other skills-compatible agents.
|
|
6
|
+
metadata:
|
|
7
|
+
author: tungnk123
|
|
8
|
+
version: "1.0"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# React Native Best Practices - TypeScript Development Intelligence
|
|
12
|
+
|
|
13
|
+
Searchable database of **1,738 mobile best practices**, **optimized for React Native with TypeScript**. All searches default to React Native platform. Covers architecture, hooks, navigation, performance, and testing for cross-platform RN apps.
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
python3 --version || python --version
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If not installed: `brew install python3` (macOS) | `sudo apt install python3` (Linux) | `winget install Python.Python.3.12` (Windows)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## How to Use This Skill
|
|
26
|
+
|
|
27
|
+
When user requests React Native development work (build, create, architect, review, fix, optimize), follow this workflow:
|
|
28
|
+
|
|
29
|
+
### Step 1: Extract Requirements
|
|
30
|
+
|
|
31
|
+
No need to detect platform - **always React Native with TypeScript**. Extract:
|
|
32
|
+
- **Product type**: E-commerce, Banking, Social Media, Healthcare, Delivery, Fitness, Education, Chat
|
|
33
|
+
- **State management**: Redux Toolkit (default), Zustand, MobX
|
|
34
|
+
- **Scope**: New project, new feature, code review, refactor, fix bug, optimize
|
|
35
|
+
|
|
36
|
+
### Step 2: Search the Database
|
|
37
|
+
|
|
38
|
+
Use `search.py` with `--platform react-native` or `--stack react-native` for focused results.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# React Native platform guidelines (ALWAYS search this first)
|
|
42
|
+
python3 {SKILL_PATH}/scripts/search.py "<keyword>" --platform react-native -n 5
|
|
43
|
+
|
|
44
|
+
# Stack-specific search
|
|
45
|
+
python3 {SKILL_PATH}/scripts/search.py "<keyword>" --stack react-native
|
|
46
|
+
python3 {SKILL_PATH}/scripts/search.py "<keyword>" --stack hooks
|
|
47
|
+
python3 {SKILL_PATH}/scripts/search.py "<keyword>" --stack redux
|
|
48
|
+
|
|
49
|
+
# Architecture patterns
|
|
50
|
+
python3 {SKILL_PATH}/scripts/search.py "<keyword>" --domain architecture
|
|
51
|
+
|
|
52
|
+
# Anti-patterns filtered for React Native
|
|
53
|
+
python3 {SKILL_PATH}/scripts/search.py "<keyword>" --domain antipattern --filter-platform react-native
|
|
54
|
+
|
|
55
|
+
# Performance rules filtered for React Native
|
|
56
|
+
python3 {SKILL_PATH}/scripts/search.py "<keyword>" --domain performance --filter-platform react-native
|
|
57
|
+
|
|
58
|
+
# Libraries for React Native
|
|
59
|
+
python3 {SKILL_PATH}/scripts/search.py "<keyword>" --domain library --filter-platform react-native
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Step 3: Recommended Search Order for React Native
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# 1. Get React Native-specific best practices
|
|
66
|
+
python3 {SKILL_PATH}/scripts/search.py "hooks navigation state" --platform react-native -n 5
|
|
67
|
+
|
|
68
|
+
# 2. Get architecture guidance
|
|
69
|
+
python3 {SKILL_PATH}/scripts/search.py "redux clean architecture react native" --domain architecture
|
|
70
|
+
|
|
71
|
+
# 3. Get React Native libraries
|
|
72
|
+
python3 {SKILL_PATH}/scripts/search.py "navigation state image" --domain library --filter-platform react-native
|
|
73
|
+
|
|
74
|
+
# 4. Check anti-patterns to avoid
|
|
75
|
+
python3 {SKILL_PATH}/scripts/search.py "react native hooks effect" --domain antipattern --filter-platform react-native
|
|
76
|
+
|
|
77
|
+
# 5. Check performance rules
|
|
78
|
+
python3 {SKILL_PATH}/scripts/search.py "flatlist image bridge" --domain performance --filter-platform react-native
|
|
79
|
+
|
|
80
|
+
# 6. Check security
|
|
81
|
+
python3 {SKILL_PATH}/scripts/search.py "react native storage encryption" --domain security --filter-platform react-native
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Search Reference
|
|
87
|
+
|
|
88
|
+
### Available Domains (11 total)
|
|
89
|
+
|
|
90
|
+
| Domain | Use For | Example Keywords |
|
|
91
|
+
|--------|---------|------------------|
|
|
92
|
+
| `reasoning` | Product type recommendations | e-commerce, banking, social media, healthcare |
|
|
93
|
+
| `architecture` | Architecture patterns | redux, clean architecture, feature-sliced, zustand |
|
|
94
|
+
| `library` | Libraries & dependencies | react-navigation, zustand, mmkv, flashlist, axios |
|
|
95
|
+
| `ui` | UI patterns & components | bottom tab, list, sheet, drawer, modal |
|
|
96
|
+
| `antipattern` | Common mistakes | prop drilling, useEffect, inline styles, ScrollView |
|
|
97
|
+
| `performance` | Performance optimization | FlatList, bridge, image, bundle, hermes |
|
|
98
|
+
| `security` | Security best practices | mmkv, encryption, ssl pinning, keychain |
|
|
99
|
+
| `testing` | Testing patterns | jest, react-native-testing-library, detox, e2e |
|
|
100
|
+
| `template` | Project templates/starters | e-commerce react-native, social react-native |
|
|
101
|
+
| `snippet` | Code templates | (cross-platform patterns available) |
|
|
102
|
+
| `gradle` | Gradle dependencies | (useful for Android module in RN project) |
|
|
103
|
+
|
|
104
|
+
### Flags
|
|
105
|
+
|
|
106
|
+
| Flag | Description | Example |
|
|
107
|
+
|------|-------------|---------|
|
|
108
|
+
| `--platform` / `-p` | Platform guidelines | `--platform react-native` |
|
|
109
|
+
| `--stack` / `-s` | Stack-specific search | `--stack react-native` or `--stack hooks` |
|
|
110
|
+
| `--domain` / `-d` | Search a specific domain | `--domain architecture` |
|
|
111
|
+
| `--filter-platform` / `-fp` | Filter results by platform | `--domain library --filter-platform react-native` |
|
|
112
|
+
| `--max-results` / `-n` | Number of results (default: 3) | `-n 5` |
|
|
113
|
+
| `--json` | Output as JSON | `--json` |
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Example Workflows
|
|
118
|
+
|
|
119
|
+
### New Feature: "Add a product list screen"
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
python3 {SKILL_PATH}/scripts/search.py "list flatlist hooks state" --platform react-native -n 5
|
|
123
|
+
python3 {SKILL_PATH}/scripts/search.py "list card image" --domain ui --filter-platform react-native
|
|
124
|
+
python3 {SKILL_PATH}/scripts/search.py "axios flashlist mmkv" --domain library --filter-platform react-native
|
|
125
|
+
python3 {SKILL_PATH}/scripts/search.py "flatlist image render" --domain performance --filter-platform react-native
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### New Project: "Build an e-commerce app"
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
python3 {SKILL_PATH}/scripts/search.py "e-commerce" --domain reasoning
|
|
132
|
+
python3 {SKILL_PATH}/scripts/search.py "redux clean architecture react native" --domain architecture
|
|
133
|
+
python3 {SKILL_PATH}/scripts/search.py "navigation zustand axios mmkv" --domain library --filter-platform react-native
|
|
134
|
+
python3 {SKILL_PATH}/scripts/search.py "react native hooks prop drilling" --domain antipattern --filter-platform react-native
|
|
135
|
+
python3 {SKILL_PATH}/scripts/search.py "flatlist startup image bundle" --domain performance --filter-platform react-native
|
|
136
|
+
python3 {SKILL_PATH}/scripts/search.py "react native storage ssl encryption" --domain security --filter-platform react-native
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Code Review: "Review my React Native code"
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
python3 {SKILL_PATH}/scripts/search.py "react native hooks effect prop" --domain antipattern --filter-platform react-native -n 5
|
|
143
|
+
python3 {SKILL_PATH}/scripts/search.py "hooks navigation state" --platform react-native -n 5
|
|
144
|
+
python3 {SKILL_PATH}/scripts/search.py "flatlist image memory bridge" --domain performance --filter-platform react-native
|
|
145
|
+
python3 {SKILL_PATH}/scripts/search.py "react native storage encryption api key" --domain security --filter-platform react-native
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Code Generation & Quality
|
|
151
|
+
|
|
152
|
+
Before generating code, read the [code generation rules](references/CODE-RULES.md) for platform-specific conventions, required patterns, and anti-patterns to avoid.
|
|
153
|
+
|
|
154
|
+
Before delivering code, verify against the [pre-delivery checklist](references/CHECKLIST.md) covering architecture, components, performance, security, testing, and accessibility.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Quick Reference
|
|
2
|
+
|
|
3
|
+
## Search Examples
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
# Code snippets (Android)
|
|
7
|
+
python3 {SKILL_PATH}/scripts/search.py "viewmodel hilt" --domain snippet
|
|
8
|
+
|
|
9
|
+
# Gradle dependencies
|
|
10
|
+
python3 {SKILL_PATH}/scripts/search.py "compose room hilt" --domain gradle -n 5
|
|
11
|
+
|
|
12
|
+
# Architecture
|
|
13
|
+
python3 {SKILL_PATH}/scripts/search.py "mvvm clean architecture" --domain architecture
|
|
14
|
+
|
|
15
|
+
# Platform guidelines
|
|
16
|
+
python3 {SKILL_PATH}/scripts/search.py "compose state" --platform android
|
|
17
|
+
|
|
18
|
+
# Anti-patterns
|
|
19
|
+
python3 {SKILL_PATH}/scripts/search.py "android compose" --domain antipattern
|
|
20
|
+
|
|
21
|
+
# Performance
|
|
22
|
+
python3 {SKILL_PATH}/scripts/search.py "startup recomposition" --domain performance
|
|
23
|
+
|
|
24
|
+
# Security
|
|
25
|
+
python3 {SKILL_PATH}/scripts/search.py "encryption token storage" --domain security
|
|
26
|
+
|
|
27
|
+
# Product recommendation
|
|
28
|
+
python3 {SKILL_PATH}/scripts/search.py "e-commerce" --domain reasoning
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Anti-Patterns to ALWAYS Avoid
|
|
32
|
+
|
|
33
|
+
**All Platforms:** God classes, hardcoded strings/colors, no error handling, memory leaks, blocking main thread, hardcoded API keys, no tests.
|
|
34
|
+
|
|
35
|
+
**Android:** Business logic in Activities, GlobalScope, collectAsState (use collectAsStateWithLifecycle), KAPT (use KSP), Toast (use Snackbar).
|
|
36
|
+
|
|
37
|
+
**iOS:** Force unwrapping (!!), retain cycles ([weak self]), @ObservedObject for creation (use @StateObject).
|
|
38
|
+
|
|
39
|
+
**Flutter:** setState for complex state, logic in build(), not disposing controllers, non-const constructors.
|
|
40
|
+
|
|
41
|
+
**React Native:** Prop drilling, missing useEffect cleanup/deps, ScrollView for long lists.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Mobile Best Practices - Development Intelligence
|
|
2
|
+
|
|
3
|
+
Searchable database of **1,738 mobile development best practices** covering architecture patterns, UI components, anti-patterns, libraries, performance rules, security practices, testing patterns, code snippets, Gradle dependencies, and platform-specific guidelines for Android, iOS, Flutter, and React Native.
|
|
4
|
+
|
|
5
|
+
**Android-first**: Optimized for Android/Jetpack Compose with full copy-paste code snippets and ready-to-use Gradle declarations.
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
Python 3.x required for the search engine.
|
|
10
|
+
|
|
11
|
+
## How to Use
|
|
12
|
+
|
|
13
|
+
When the user requests mobile development work (build, create, architect, review, fix, optimize), search the database for relevant best practices:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
python3 {SKILL_PATH}/scripts/search.py "<query>" --domain <domain> [-n <max_results>]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Available Domains (11 total)
|
|
20
|
+
|
|
21
|
+
| Domain | Use For |
|
|
22
|
+
|--------|---------|
|
|
23
|
+
| `snippet` | Copy-paste code templates (Android) |
|
|
24
|
+
| `gradle` | Gradle dependency declarations |
|
|
25
|
+
| `reasoning` | Product type recommendations |
|
|
26
|
+
| `architecture` | Architecture patterns |
|
|
27
|
+
| `library` | Libraries and dependencies |
|
|
28
|
+
| `ui` | UI patterns and components |
|
|
29
|
+
| `antipattern` | Common mistakes |
|
|
30
|
+
| `performance` | Performance optimization |
|
|
31
|
+
| `security` | Security best practices |
|
|
32
|
+
| `testing` | Testing patterns |
|
|
33
|
+
| `template` | Project starters |
|
|
34
|
+
|
|
35
|
+
### Flags
|
|
36
|
+
|
|
37
|
+
| Flag | Description |
|
|
38
|
+
|------|-------------|
|
|
39
|
+
| `--domain` / `-d` | Search specific domain |
|
|
40
|
+
| `--platform` / `-p` | Platform-specific search (android, ios, flutter, react-native) |
|
|
41
|
+
| `--filter-platform` / `-fp` | Filter results by platform |
|
|
42
|
+
| `--stack` / `-s` | Filter by tech stack |
|
|
43
|
+
| `--persist` | Save architecture blueprint |
|
|
44
|
+
| `--max-results` / `-n` | Number of results (default: 3) |
|
|
45
|
+
| `--json` | Output as JSON |
|
|
46
|
+
|
|
47
|
+
### Android Default Stack
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
Architecture: MVVM + Clean Architecture + Repository Pattern
|
|
51
|
+
DI: Hilt (@HiltViewModel, @Inject, @Module)
|
|
52
|
+
UI: Jetpack Compose + Material3
|
|
53
|
+
State: StateFlow + sealed interface UiState
|
|
54
|
+
Navigation: Navigation Compose with @Serializable type-safe routes
|
|
55
|
+
Network: Retrofit + Moshi + OkHttp
|
|
56
|
+
Database: Room + KSP
|
|
57
|
+
Image: Coil (AsyncImage)
|
|
58
|
+
Testing: JUnit5 + MockK + Turbine + Compose Test
|
|
59
|
+
Build: Version Catalog (libs.versions.toml) + KSP
|
|
60
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "antigravity",
|
|
3
|
+
"displayName": "Antigravity",
|
|
4
|
+
"type": "skills",
|
|
5
|
+
"installPath": ".antigravity/skills/mobile-best-practices",
|
|
6
|
+
"files": {
|
|
7
|
+
"skill": "SKILL.md",
|
|
8
|
+
"data": "data/",
|
|
9
|
+
"scripts": "scripts/"
|
|
10
|
+
},
|
|
11
|
+
"ruleFormat": "skill",
|
|
12
|
+
"skillPath": ".antigravity/skills/mobile-best-practices"
|
|
13
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "claude",
|
|
3
|
+
"displayName": "Claude Code",
|
|
4
|
+
"type": "skill",
|
|
5
|
+
"installPath": ".claude/skills/mobile-best-practices",
|
|
6
|
+
"files": {
|
|
7
|
+
"skill": "SKILL.md",
|
|
8
|
+
"data": "data/",
|
|
9
|
+
"scripts": "scripts/"
|
|
10
|
+
},
|
|
11
|
+
"settings": {
|
|
12
|
+
"file": ".claude/settings.local.json",
|
|
13
|
+
"permissions": [
|
|
14
|
+
"Bash(python3:*)",
|
|
15
|
+
"Bash(python:*)",
|
|
16
|
+
"Bash(gradle:*)",
|
|
17
|
+
"Bash(./gradlew:*)",
|
|
18
|
+
"Bash(flutter:*)",
|
|
19
|
+
"Bash(npx react-native:*)",
|
|
20
|
+
"Bash(npm install:*)",
|
|
21
|
+
"Bash(pod install:*)",
|
|
22
|
+
"Skill(mobile-best-practices)",
|
|
23
|
+
"Skill(mobile-best-practices:*)"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"skillPath": ".claude/skills/mobile-best-practices"
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAMA,wBAAsB,WAAW,CAAC,OAAO,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAyF/G"}
|