mobile-ai-agents 1.0.23

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 (194) hide show
  1. package/AGENTS.md +228 -0
  2. package/CLAUDE.md +236 -0
  3. package/LICENSE +21 -0
  4. package/README.md +652 -0
  5. package/agents/android/android-crash-analyzer/README.md +134 -0
  6. package/agents/android/android-crash-analyzer/agent.md +206 -0
  7. package/agents/android/android-crash-analyzer/example-input.md +138 -0
  8. package/agents/android/android-crash-analyzer/example-output.md +225 -0
  9. package/agents/android/anr-investigation/README.md +78 -0
  10. package/agents/android/anr-investigation/agent.md +117 -0
  11. package/agents/android/anr-investigation/example-input.md +62 -0
  12. package/agents/android/anr-investigation/example-output.md +103 -0
  13. package/agents/android/axiom/agent.md +197 -0
  14. package/agents/android/code-reviewer/README.md +108 -0
  15. package/agents/android/code-reviewer/agent.md +210 -0
  16. package/agents/android/code-reviewer/example-input.md +116 -0
  17. package/agents/android/code-reviewer/example-output.md +115 -0
  18. package/agents/android/compose-navigation/README.md +76 -0
  19. package/agents/android/compose-navigation/agent.md +121 -0
  20. package/agents/android/compose-navigation/example-input.md +49 -0
  21. package/agents/android/compose-navigation/example-output.md +325 -0
  22. package/agents/android/compose-screen-builder/README.md +95 -0
  23. package/agents/android/compose-screen-builder/agent.md +170 -0
  24. package/agents/android/compose-screen-builder/example-input.md +40 -0
  25. package/agents/android/compose-screen-builder/example-output.md +568 -0
  26. package/agents/android/compose-ui-reviewer/README.md +73 -0
  27. package/agents/android/compose-ui-reviewer/agent.md +253 -0
  28. package/agents/android/compose-ui-reviewer/example-input.md +84 -0
  29. package/agents/android/compose-ui-reviewer/example-output.md +102 -0
  30. package/agents/android/crash-analyzer/README.md +53 -0
  31. package/agents/android/crash-analyzer/agent.md +295 -0
  32. package/agents/android/memory-leak-analyzer/README.md +79 -0
  33. package/agents/android/memory-leak-analyzer/agent.md +116 -0
  34. package/agents/android/memory-leak-analyzer/example-input.md +78 -0
  35. package/agents/android/memory-leak-analyzer/example-output.md +128 -0
  36. package/agents/cross-platform/accessibility-auditor/README.md +47 -0
  37. package/agents/cross-platform/accessibility-auditor/agent.md +268 -0
  38. package/agents/cross-platform/accessibility-auditor/example-input.md +84 -0
  39. package/agents/cross-platform/accessibility-auditor/example-output.md +132 -0
  40. package/agents/cross-platform/appforge/agent.md +303 -0
  41. package/agents/cross-platform/ci-cd-generator/README.md +65 -0
  42. package/agents/cross-platform/ci-cd-generator/agent.md +422 -0
  43. package/agents/cross-platform/ci-cd-generator/example-input.md +69 -0
  44. package/agents/cross-platform/ci-cd-generator/example-output.md +261 -0
  45. package/agents/cross-platform/crasher/agent.md +221 -0
  46. package/agents/cross-platform/figma/agent.md +247 -0
  47. package/agents/cross-platform/launchpad/agent.md +330 -0
  48. package/agents/cross-platform/mobile-harness/agent.md +422 -0
  49. package/agents/cross-platform/mobile-memory/agent.md +429 -0
  50. package/agents/cross-platform/perf/agent.md +261 -0
  51. package/agents/cross-platform/pipeline/agent.md +288 -0
  52. package/agents/cross-platform/release-notes-generator/README.md +63 -0
  53. package/agents/cross-platform/release-notes-generator/agent.md +218 -0
  54. package/agents/cross-platform/release-notes-generator/example-input.md +71 -0
  55. package/agents/cross-platform/release-notes-generator/example-output.md +96 -0
  56. package/agents/cross-platform/scribe/agent.md +180 -0
  57. package/agents/cross-platform/security-scanner/README.md +61 -0
  58. package/agents/cross-platform/security-scanner/agent.md +287 -0
  59. package/agents/cross-platform/security-scanner/example-input.md +77 -0
  60. package/agents/cross-platform/security-scanner/example-output.md +141 -0
  61. package/agents/cross-platform/sentinel/agent.md +217 -0
  62. package/agents/cross-platform/store-listing-writer/README.md +58 -0
  63. package/agents/cross-platform/store-listing-writer/agent.md +380 -0
  64. package/agents/cross-platform/store-listing-writer/example-input.md +67 -0
  65. package/agents/cross-platform/store-listing-writer/example-output.md +131 -0
  66. package/agents/flutter/bloc-feature-builder/README.md +101 -0
  67. package/agents/flutter/bloc-feature-builder/agent.md +225 -0
  68. package/agents/flutter/bloc-feature-builder/example-input.md +47 -0
  69. package/agents/flutter/bloc-feature-builder/example-output.md +838 -0
  70. package/agents/flutter/dart/agent.md +223 -0
  71. package/agents/flutter/widget-generator/README.md +66 -0
  72. package/agents/flutter/widget-generator/agent.md +264 -0
  73. package/agents/flutter/widget-generator/example-input.md +71 -0
  74. package/agents/flutter/widget-generator/example-output.md +163 -0
  75. package/agents/gaming/forge/agent.md +197 -0
  76. package/agents/gaming/unreal/agent.md +200 -0
  77. package/agents/ios/crash-analyzer/README.md +69 -0
  78. package/agents/ios/crash-analyzer/agent.md +300 -0
  79. package/agents/ios/crash-analyzer/example-input.md +83 -0
  80. package/agents/ios/crash-analyzer/example-output.md +126 -0
  81. package/agents/ios/swift/agent.md +206 -0
  82. package/agents/ios/swift-reviewer/README.md +68 -0
  83. package/agents/ios/swift-reviewer/agent.md +231 -0
  84. package/agents/ios/swift-reviewer/example-input.md +100 -0
  85. package/agents/ios/swift-reviewer/example-output.md +127 -0
  86. package/agents/react-native/bridge/agent.md +212 -0
  87. package/agents/react-native/performance-optimizer/README.md +81 -0
  88. package/agents/react-native/performance-optimizer/agent.md +284 -0
  89. package/agents/react-native/performance-optimizer/example-input.md +104 -0
  90. package/agents/react-native/performance-optimizer/example-output.md +132 -0
  91. package/agents/unity/shader-generator/README.md +77 -0
  92. package/agents/unity/shader-generator/agent.md +270 -0
  93. package/agents/unity/shader-generator/example-input.md +70 -0
  94. package/agents/unity/shader-generator/example-output.md +160 -0
  95. package/agents/unreal/blueprint-advisor/README.md +71 -0
  96. package/agents/unreal/blueprint-advisor/agent.md +311 -0
  97. package/agents/unreal/blueprint-advisor/example-input.md +73 -0
  98. package/agents/unreal/blueprint-advisor/example-output.md +217 -0
  99. package/cli/index.js +1091 -0
  100. package/docs/agent-guide.md +138 -0
  101. package/docs/chatgpt-integration.md +219 -0
  102. package/docs/core-loops.md +143 -0
  103. package/docs/cursor-integration.md +143 -0
  104. package/docs/getting-started.md +132 -0
  105. package/docs/index.html +711 -0
  106. package/docs/installation.md +271 -0
  107. package/docs/mobile-harness.md +160 -0
  108. package/docs/mobile-mcp.md +172 -0
  109. package/docs/mobile-memory.md +349 -0
  110. package/docs/release-process.md +85 -0
  111. package/docs/releases/release-v1.0.0.md +165 -0
  112. package/docs/roadmap/github-issues.md +239 -0
  113. package/docs/skill-categories.md +125 -0
  114. package/docs/vscode-copilot-integration.md +104 -0
  115. package/docs/wiki.md +615 -0
  116. package/install.sh +507 -0
  117. package/mobile-karpathy.md +79 -0
  118. package/package.json +57 -0
  119. package/skills/android/README.md +31 -0
  120. package/skills/android/android-tdd.md +89 -0
  121. package/skills/android/anr-investigation.md +251 -0
  122. package/skills/android/code-review.md +98 -0
  123. package/skills/android/compose-migration.md +48 -0
  124. package/skills/android/compose-review.md +78 -0
  125. package/skills/android/kotlin-modernize.md +51 -0
  126. package/skills/android/memory-leak-investigation.md +256 -0
  127. package/skills/android/proguard-rules.md +48 -0
  128. package/skills/cross-platform/accessibility-audit.md +63 -0
  129. package/skills/cross-platform/api-versioning.md +59 -0
  130. package/skills/cross-platform/clean-code-audit.md +239 -0
  131. package/skills/cross-platform/crash-triage.md +53 -0
  132. package/skills/cross-platform/deeplink-debug.md +57 -0
  133. package/skills/cross-platform/feature-slice.md +48 -0
  134. package/skills/cross-platform/grill-mobile.md +64 -0
  135. package/skills/cross-platform/mobile-mcp-qa.md +193 -0
  136. package/skills/cross-platform/mobile-memory-graph.md +179 -0
  137. package/skills/cross-platform/mobile-memory-save.md +210 -0
  138. package/skills/cross-platform/mobile-memory-search.md +154 -0
  139. package/skills/cross-platform/perf-audit.md +61 -0
  140. package/skills/cross-platform/prd-verification.md +324 -0
  141. package/skills/cross-platform/release-prep.md +64 -0
  142. package/skills/cross-platform/security-audit.md +281 -0
  143. package/skills/cross-platform/store-listing.md +75 -0
  144. package/skills/flutter/README.md +32 -0
  145. package/skills/flutter/dart-modernize.md +47 -0
  146. package/skills/flutter/flutter-review.md +59 -0
  147. package/skills/flutter/flutter-tdd.md +73 -0
  148. package/skills/flutter/widget-extract.md +41 -0
  149. package/skills/flutter/widget-gen.md +131 -0
  150. package/skills/gaming/blueprint-to-cpp.md +51 -0
  151. package/skills/gaming/game-perf.md +54 -0
  152. package/skills/gaming/shader-gen.md +44 -0
  153. package/skills/gaming/unity-tdd.md +85 -0
  154. package/skills/ios/README.md +45 -0
  155. package/skills/ios/data-persistence.md +151 -0
  156. package/skills/ios/ios-tdd.md +90 -0
  157. package/skills/ios/networking.md +139 -0
  158. package/skills/ios/performance.md +122 -0
  159. package/skills/ios/swift-concurrency.md +57 -0
  160. package/skills/ios/swift-review.md +124 -0
  161. package/skills/ios/swiftui-review.md +49 -0
  162. package/skills/ios/swiftui-state.md +122 -0
  163. package/skills/ios/unit-testing.md +144 -0
  164. package/skills/ios/xcode-warnings.md +37 -0
  165. package/skills/react-native/README.md +42 -0
  166. package/skills/react-native/bridge-audit.md +104 -0
  167. package/skills/react-native/expo-optimize.md +55 -0
  168. package/skills/react-native/new-arch-migrate.md +53 -0
  169. package/skills/react-native/performance.md +124 -0
  170. package/skills/react-native/rn-review.md +53 -0
  171. package/skills/react-native/rn-tdd.md +76 -0
  172. package/skills/shared/README.md +46 -0
  173. package/skills/shared/accessibility-audit.md +132 -0
  174. package/skills/shared/crash-analysis.md +110 -0
  175. package/skills/shared/security-scan.md +149 -0
  176. package/skills/unity/README.md +31 -0
  177. package/skills/unity/shader-review.md +110 -0
  178. package/templates/agent-template.md +88 -0
  179. package/templates/prompt-template.md +50 -0
  180. package/templates/skill-template.md +64 -0
  181. package/templates/workflow-template.md +48 -0
  182. package/workflows/app-launch.md +66 -0
  183. package/workflows/appforge-workflow.md +232 -0
  184. package/workflows/ci-setup.md +77 -0
  185. package/workflows/crash-to-fix.md +71 -0
  186. package/workflows/feature-ship.md +61 -0
  187. package/workflows/game-level.md +72 -0
  188. package/workflows/mobile-harness.md +319 -0
  189. package/workflows/mobile-mcp-qa.md +228 -0
  190. package/workflows/mobile-memory-workflow.md +243 -0
  191. package/workflows/new-project-setup.md +93 -0
  192. package/workflows/new-screen.md +68 -0
  193. package/workflows/perf-sprint.md +78 -0
  194. package/workflows/release-cycle.md +71 -0
@@ -0,0 +1,256 @@
1
+ # Skill — /memory-leak-investigation
2
+
3
+ **Platform:** Android
4
+ **Slash Command:** `/memory-leak-investigation`
5
+ **Composable With:** Android Code Reviewer, AXIOM, PERF, MOBILE-HARNESS
6
+
7
+ ---
8
+
9
+ ## Purpose
10
+
11
+ Investigate Android memory leaks from LeakCanary traces, heap summaries, retained-object reports, or related Kotlin code. Trace the strong-reference path from a GC root to the retained object, identify the reference that outlives its intended lifecycle, propose the smallest ownership fix, and define repeatable verification.
12
+
13
+ This skill is evidence-first. A retained object is not automatically the source of the leak, and replacing strong references with weak references is not a valid default fix.
14
+
15
+ ---
16
+
17
+ ## Input Format
18
+
19
+ ```text
20
+ COMMAND: /memory-leak-investigation
21
+ APP_VERSION: <version/build>
22
+ ANDROID_VERSION: <version or unknown>
23
+ DEVICE: <model or unknown>
24
+ REPORT_SOURCE: <LeakCanary | heap dump | profiler | test | other>
25
+ EXPECTED_LIFECYCLE:
26
+ <when the retained object should become unreachable>
27
+ REPRODUCTION:
28
+ <steps that increase retained objects or memory>
29
+ LEAK_TRACE:
30
+ <complete GC-root-to-retained-object path or available heap summary>
31
+ RELATED_CODE:
32
+ <Activity, Fragment, ViewModel, adapter, callback, coroutine, observer, singleton, or SDK code>
33
+ ```
34
+
35
+ ---
36
+
37
+ ## Skill Prompt
38
+
39
+ ````text
40
+ Investigate the Android memory leak using the supplied evidence.
41
+
42
+ STEP 1 — VERIFY EVIDENCE
43
+ - Confirm that the retained object, expected lifecycle, and strongest available reference path are present.
44
+ - Distinguish a confirmed leak from temporary retention, cache behavior, or high allocation pressure.
45
+ - If the trace is truncated or lacks the GC root/reference chain, mark confidence LOW and list the missing evidence.
46
+ - Do not invent fields, object ownership, retained sizes, or lifecycle events.
47
+
48
+ STEP 2 — READ THE REFERENCE PATH
49
+ - Start at the GC root and follow every strong reference to the retained object.
50
+ - Separate framework and collection implementation details from references controlled by app code.
51
+ - Use LeakCanary's Leaking: YES/NO/UNKNOWN evidence to narrow suspect references.
52
+ - Identify the first app-controlled reference that should have been cleared, replaced, unregistered, or scoped differently.
53
+ - Explain why the retaining object outlives the retained object.
54
+
55
+ STEP 3 — CLASSIFY THE LEAK
56
+ Classify as one of:
57
+ - Activity or Fragment instance
58
+ - Fragment view or ViewBinding
59
+ - RecyclerView adapter/listener
60
+ - Context held by singleton/static object
61
+ - Observer, callback, listener, or broadcast registration
62
+ - Coroutine, Flow, Rx, executor, or delayed task
63
+ - ViewModel or SavedState ownership
64
+ - Dialog, Window, animation, drawable, or WebView
65
+ - Service, receiver, worker, or SDK lifecycle
66
+ - Native/JNI resource
67
+ - Cache or collection without eviction
68
+ - Unknown
69
+
70
+ STEP 4 — CORRELATE WITH CODE
71
+ Check for:
72
+ - Fragment bindings or adapters surviving onDestroyView.
73
+ - Anonymous callbacks, listeners, observers, or receivers that are never removed.
74
+ - Singleton/static fields retaining Activity, Fragment, View, adapter, or callback instances.
75
+ - applicationScope, GlobalScope, custom scopes, handlers, runnables, timers, or executors retaining UI owners.
76
+ - Flow/Rx collection not bound to the correct lifecycle.
77
+ - ViewModel retaining Views, Activities, Fragments, adapters, or short-lived Context objects.
78
+ - Long-lived caches or maps without bounded eviction.
79
+ - WebView, Dialog, Window, animation, drawable callback, or third-party SDK cleanup requirements.
80
+ - Native resources that require close, release, recycle, unregister, or destroy.
81
+
82
+ STEP 5 — PROPOSE THE SMALLEST OWNERSHIP FIX
83
+ - Remove the proven strong-reference path or scope it to the correct lifecycle.
84
+ - Prefer lifecycle-aware collection, explicit unregister/cleanup, bounded ownership, and application Context only when semantically correct.
85
+ - Do not recommend WeakReference as a generic repair.
86
+ - Do not clear unrelated state or add onDestroy cleanup without proving that lifecycle owns the reference.
87
+ - Provide before/after Kotlin when source is available.
88
+
89
+ STEP 6 — VERIFY
90
+ Include:
91
+ - Deterministic reproduction with repeated create/destroy cycles.
92
+ - LeakCanary or heap-dump confirmation that the object becomes collectible.
93
+ - Retained-object and memory trend checks after forced GC/idle periods.
94
+ - Lifecycle regression tests or instrumentation where practical.
95
+ - Rotation, back-stack, navigation, and process-recreation checks where relevant.
96
+
97
+ Output normal Markdown. Do not wrap the full report in a code block.
98
+
99
+ ANDROID MEMORY LEAK INVESTIGATION
100
+ =================================
101
+ Result: CONFIRMED | LIKELY | INCONCLUSIVE
102
+ Confidence: HIGH | MEDIUM | LOW
103
+ Leak Type:
104
+ Retained Object:
105
+ Expected Collection Point:
106
+
107
+ Evidence Summary:
108
+ | Evidence | Observation |
109
+ |---|---|
110
+
111
+ Reference Path:
112
+ | From | Reference | To | Assessment |
113
+ |---|---|---|---|
114
+
115
+ Root Cause:
116
+ <proven ownership/lifecycle chain, or what remains unknown>
117
+
118
+ Fix:
119
+ <smallest ownership fix>
120
+
121
+ Updated Code:
122
+ ```kotlin
123
+ <corrected code, or "Not available without related source">
124
+ ```
125
+
126
+ Verification:
127
+ - <step>
128
+
129
+ Missing Evidence:
130
+ - <item or "None">
131
+
132
+ Next Action:
133
+ <one concrete action>
134
+ ````
135
+
136
+ ---
137
+
138
+ ## Example
139
+
140
+ ### Input
141
+
142
+ ```text
143
+ COMMAND: /memory-leak-investigation
144
+ APP_VERSION: 3.2.0 (320)
145
+ ANDROID_VERSION: 15
146
+ DEVICE: Pixel 7
147
+ REPORT_SOURCE: LeakCanary
148
+ EXPECTED_LIFECYCLE:
149
+ ProfileFragment view should be collectible after onDestroyView.
150
+ REPRODUCTION:
151
+ Open Profile, navigate back, repeat five times.
152
+ LEAK_TRACE:
153
+ ┬───
154
+ │ GC Root: System class
155
+ ├─ com.example.App instance
156
+ │ ↓ App.profileAdapters
157
+ ├─ java.util.ArrayList instance
158
+ │ ↓ ArrayList.elementData
159
+ ├─ com.example.profile.ProfileAdapter instance
160
+ │ ↓ ProfileAdapter.onAvatarClick
161
+ ├─ com.example.profile.ProfileFragment$onViewCreated$1 instance
162
+ │ ↓ ProfileFragment$onViewCreated$1.this$0
163
+ ╰→ com.example.profile.ProfileFragment instance
164
+ Leaking: YES
165
+ RELATED_CODE:
166
+ class App : Application() {
167
+ val profileAdapters = mutableListOf<ProfileAdapter>()
168
+ }
169
+
170
+ class ProfileFragment : Fragment(R.layout.profile) {
171
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
172
+ val adapter = ProfileAdapter { openAvatar() }
173
+ recyclerView.adapter = adapter
174
+ (requireContext().applicationContext as App).profileAdapters += adapter
175
+ }
176
+ }
177
+ ```
178
+
179
+ ### Output
180
+
181
+ ````markdown
182
+ ANDROID MEMORY LEAK INVESTIGATION
183
+ =================================
184
+ Result: CONFIRMED
185
+ Confidence: HIGH
186
+ Leak Type: Fragment retained by application-owned collection
187
+ Retained Object: `ProfileFragment`
188
+ Expected Collection Point: After `onDestroyView()` and Fragment removal
189
+
190
+ Evidence Summary:
191
+ | Evidence | Observation |
192
+ |---|---|
193
+ | GC root | Application-reachable system class path |
194
+ | Long-lived owner | `App.profileAdapters` |
195
+ | Callback | Adapter lambda captures `ProfileFragment` |
196
+ | Retained object | LeakCanary marks `ProfileFragment` as leaking |
197
+
198
+ Reference Path:
199
+ | From | Reference | To | Assessment |
200
+ |---|---|---|---|
201
+ | `App` | `profileAdapters` | `ArrayList` | App-controlled, process-long ownership |
202
+ | `ArrayList` | element | `ProfileAdapter` | Adapter survives Fragment lifecycle |
203
+ | `ProfileAdapter` | `onAvatarClick` | Fragment lambda | Captures Fragment instance |
204
+ | Lambda | `this$0` | `ProfileFragment` | Direct retaining reference |
205
+
206
+ Root Cause:
207
+ `App.profileAdapters` gives each adapter process-long lifetime. The adapter's click lambda captures `ProfileFragment`, so navigating away cannot make the Fragment unreachable.
208
+
209
+ Fix:
210
+ Do not store screen adapters in the Application. Keep the adapter owned by the Fragment view lifecycle and detach it in `onDestroyView()`.
211
+
212
+ Updated Code:
213
+ ```kotlin
214
+ class ProfileFragment : Fragment(R.layout.profile) {
215
+ private var adapter: ProfileAdapter? = null
216
+
217
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
218
+ adapter = ProfileAdapter { openAvatar() }
219
+ recyclerView.adapter = adapter
220
+ }
221
+
222
+ override fun onDestroyView() {
223
+ recyclerView.adapter = null
224
+ adapter = null
225
+ super.onDestroyView()
226
+ }
227
+ }
228
+ ```
229
+
230
+ Verification:
231
+ - Open and close Profile ten times with LeakCanary enabled.
232
+ - Confirm destroyed `ProfileFragment` instances are no longer retained.
233
+ - Capture a heap dump after idle/GC and verify no path through `App.profileAdapters`.
234
+ - Rotate and navigate rapidly to exercise view recreation.
235
+ - Add a FragmentScenario test that destroys the Fragment view and checks adapter detachment.
236
+
237
+ Missing Evidence:
238
+ - None
239
+
240
+ Next Action:
241
+ Remove `App.profileAdapters`, detach the RecyclerView adapter in `onDestroyView()`, then repeat the LeakCanary reproduction.
242
+ ````
243
+
244
+ ---
245
+
246
+ ## Usage Notes
247
+
248
+ - A leak trace is a strong-reference path, not a stack trace. Diagnose ownership from the GC root toward the retained object.
249
+ - The leaking object is often the victim; the actionable defect is usually an earlier app-controlled reference in the path.
250
+ - Pair with PERF when the symptom is memory growth without a confirmed retention path.
251
+ - This skill supports issue #1; a dedicated memory leak agent can embed it and add heap-dump and LeakCanary examples.
252
+
253
+ ## Official References
254
+
255
+ - [LeakCanary: Fixing a memory leak](https://square.github.io/leakcanary/fundamentals-fixing-a-memory-leak/)
256
+ - [Android Developers: Memory management overview](https://developer.android.com/topic/performance/memory-overview)
@@ -0,0 +1,48 @@
1
+ # Skill — /proguard-rules
2
+
3
+ **Platform:** Android
4
+ **Slash Command:** `/proguard-rules`
5
+
6
+ ---
7
+
8
+ ## Purpose
9
+
10
+ Generates correct R8/ProGuard rules from a project's dependency list and code patterns. Eliminates the "copy from StackOverflow" anti-pattern. Explains why each rule is needed.
11
+
12
+ ---
13
+
14
+ ## Skill Prompt
15
+
16
+ ```
17
+ Generate R8/ProGuard rules for the provided dependencies and code patterns.
18
+
19
+ For each dependency or pattern listed, generate the minimal rules needed and explain why:
20
+
21
+ COMMON DEPENDENCIES AND THEIR RULES:
22
+ - Retrofit + Gson/Moshi: keep data classes used as JSON models
23
+ - Room: keep entities, DAOs, and database class
24
+ - Hilt/Dagger: keep @HiltAndroidApp, @AndroidEntryPoint, @Inject annotated classes
25
+ - Kotlin serialization: keep @Serializable annotated classes
26
+ - OkHttp: keep interceptors and custom authenticators
27
+ - Firebase: usually handled by firebase-android-sdk aar — note which rules come from the AAR
28
+ - Glide/Coil: custom transformations and targets
29
+ - Reflection usage: any class loaded by Class.forName()
30
+ - Sealed classes/interfaces used in when() expressions
31
+ - Parcelable implementations
32
+
33
+ RULE FORMAT:
34
+ For each rule, output:
35
+ ```proguard
36
+ # Reason: <why this rule is needed>
37
+ -keep class <pattern> { <members>; }
38
+ ```
39
+
40
+ VALIDATION CHECKLIST:
41
+ After generating rules, check for:
42
+ - [ ] No overly broad -keep class * rules
43
+ - [ ] Data classes for network/database are explicitly kept
44
+ - [ ] Enum classes used in serialization are kept
45
+ - [ ] No rules that disable R8's full-mode optimizations unnecessarily
46
+
47
+ Also note which dependencies already ship their own consumer ProGuard rules (via .pro files in the AAR) — those don't need manual rules.
48
+ ```
@@ -0,0 +1,63 @@
1
+ # Skill — /accessibility-audit
2
+
3
+ **Platform:** Cross-Platform
4
+ **Slash Command:** `/accessibility-audit`
5
+
6
+ ---
7
+
8
+ ## Purpose
9
+
10
+ Reviews any mobile screen for WCAG 2.1 AA compliance and platform accessibility standards. Increasingly required by law (EU Accessibility Act 2025, ADA).
11
+
12
+ ---
13
+
14
+ ## Skill Prompt
15
+
16
+ ```
17
+ Audit the provided mobile screen or component for accessibility:
18
+
19
+ WCAG 2.1 AA REQUIREMENTS:
20
+ 1. PERCEIVABLE
21
+ - 1.1.1 Non-text content: all images, icons, and decorative elements have alt text
22
+ or are marked as decorative.
23
+ - 1.3.1 Info and relationships: screen reader can determine the purpose of all UI elements.
24
+ - 1.4.3 Contrast (minimum): text contrast ratio ≥ 4.5:1 (normal), ≥ 3:1 (large 18pt+).
25
+ - 1.4.11 Non-text contrast: interactive components have ≥ 3:1 against adjacent color.
26
+
27
+ 2. OPERABLE
28
+ - 2.1.1 Keyboard: all functionality available without pointing device (hardware keyboard on iPad/Android).
29
+ - 2.4.3 Focus order: focus sequence is logical and meaningful.
30
+ - 2.5.3 Label in name: visible label text included in accessible name.
31
+ - 2.5.5 Target size: interactive targets ≥ 44×44pt (iOS) or 48×48dp (Android).
32
+
33
+ 3. UNDERSTANDABLE
34
+ - 3.3.1 Error identification: form errors identified in text, not color alone.
35
+ - 3.3.2 Labels or instructions: form inputs have visible labels.
36
+
37
+ 4. ROBUST
38
+ - 4.1.2 Name, role, value: all components have correct accessibility roles.
39
+
40
+ PLATFORM CHECKS:
41
+ Android:
42
+ - contentDescription on all ImageView and IconButton elements.
43
+ - importantForAccessibility="no" on decorative elements.
44
+ - TalkBack focus order matches visual order.
45
+ - Custom view provides AccessibilityNodeInfoCompat.
46
+
47
+ iOS:
48
+ - accessibilityLabel on all images and icon buttons.
49
+ - accessibilityTraits correct (.button, .header, .link, .selected).
50
+ - accessibilityHint for non-obvious actions.
51
+ - isAccessibilityElement = false for decorative views.
52
+
53
+ Flutter:
54
+ - Semantics widget with label, button, and excludeSemantics for decorative.
55
+ - SemanticsHint for non-obvious interactions.
56
+
57
+ React Native:
58
+ - accessibilityLabel and accessibilityRole on all interactive elements.
59
+ - accessibilityHint for non-obvious actions.
60
+ - accessible={false} for decorative elements.
61
+
62
+ For each issue: element, requirement violated, WCAG criterion, and concrete fix.
63
+ ```
@@ -0,0 +1,59 @@
1
+ # Skill — /api-versioning
2
+
3
+ **Platform:** Cross-Platform
4
+ **Slash Command:** `/api-versioning`
5
+
6
+ ---
7
+
8
+ ## Purpose
9
+
10
+ API deprecation strategy and migration plan for mobile clients. Handles the "we have users on v1.2 who won't update" reality that backend engineers underestimate.
11
+
12
+ ---
13
+
14
+ ## Skill Prompt
15
+
16
+ ```
17
+ Create an API versioning and deprecation strategy for the described API change:
18
+
19
+ MOBILE CLIENT REALITY:
20
+ Mobile clients cannot be force-updated. Users on old versions may remain on them for
21
+ 12–24 months. Any breaking API change must have a graceful degradation path.
22
+
23
+ BREAKING vs NON-BREAKING CHANGES:
24
+ Non-breaking (safe to ship):
25
+ - Adding new optional fields to responses
26
+ - Adding new optional request parameters
27
+ - Adding new endpoints
28
+ - Expanding enum values (with unknown value handling)
29
+
30
+ Breaking (requires versioning):
31
+ - Removing fields from responses
32
+ - Changing field types
33
+ - Renaming fields
34
+ - Changing endpoint URLs
35
+ - Making optional fields required
36
+ - Removing enum values
37
+
38
+ VERSIONING STRATEGIES:
39
+ 1. URL versioning: /v1/users, /v2/users — simple, explicit, but multiplies maintenance.
40
+ 2. Header versioning: API-Version: 2 — cleaner URLs, harder to test in browser.
41
+ 3. Query param: /users?version=2 — easy to test, pollutes URLs.
42
+ 4. Content negotiation: Accept: application/vnd.myapp.v2+json — RESTfully correct.
43
+
44
+ MIGRATION PLAN FOR MOBILE:
45
+ For each breaking change, provide:
46
+ 1. Transition period: run v1 and v2 in parallel for N months.
47
+ 2. Client detection: identify client version from User-Agent or app header.
48
+ 3. Feature flag: gate new behavior on client version ≥ X.
49
+ 4. Sunset date: minimum 6 months notice for mobile, 12 months recommended.
50
+ 5. Monitoring: track request distribution by client version before sunset.
51
+
52
+ MOBILE CLIENT IMPLEMENTATION:
53
+ - Handle unknown enum values gracefully (don't crash — use UNKNOWN sentinel).
54
+ - Handle missing optional fields (use defaults, not force-unwrap).
55
+ - Version the local data model separately from the API model.
56
+ Map API v1 and v2 responses to the same domain model in the repository layer.
57
+
58
+ Output a complete migration plan with timeline and client-side implementation guide.
59
+ ```
@@ -0,0 +1,239 @@
1
+ # Skill — /clean-code-audit
2
+
3
+ **Platform:** Android / iOS / Flutter / React Native
4
+ **Slash Command:** `/clean-code-audit`
5
+ **Composable With:** AXIOM, SWIFT, DART, BRIDGE, MOBILE-HARNESS, APPFORGE
6
+
7
+ ---
8
+
9
+ ## Purpose
10
+
11
+ Audit a mobile app or feature for clean code, maintainable architecture, file organization, naming, dependency boundaries, and model separation. Use this before merge, during refactors, or inside MOBILE-HARNESS after implementation.
12
+
13
+ This skill is stricter than a normal code review. It looks for structural problems that make the app hard to scale, test, or hand off.
14
+
15
+ ---
16
+
17
+ ## Input Format
18
+
19
+ ```text
20
+ COMMAND: /clean-code-audit
21
+ PLATFORM: <Android | iOS | Flutter | React Native>
22
+ ARCHITECTURE: <MVVM | MVI | Clean Architecture | BLoC | Redux | other>
23
+ SCOPE:
24
+ <files, folders, feature name, or pasted tree>
25
+ CODE:
26
+ <paste code or provide file list>
27
+ RULES:
28
+ <optional project-specific rules>
29
+ ```
30
+
31
+ ---
32
+
33
+ ## Skill Prompt
34
+
35
+ ```text
36
+ Run a strict clean-code and architecture audit for the provided mobile app scope.
37
+
38
+ Check these areas:
39
+
40
+ 1. MODEL AND TYPE ORGANIZATION
41
+ - Data models, DTOs, entities, UI models, state classes, events, and navigation models must be in separate files when reused or non-trivial.
42
+ - Do not define reusable data classes, sealed classes, enums, DTOs, or interfaces inside ViewModels, Activities, Fragments, Composables, SwiftUI Views, React components, or BLoCs.
43
+ - Nested types are allowed only when they are private, tiny, and used exclusively by the enclosing type.
44
+ - API response models must not be reused directly as domain models or UI models.
45
+ - Domain entities must not import platform UI, networking, database, or serialization frameworks.
46
+
47
+ 2. LAYER BOUNDARIES
48
+ - Presentation depends on domain abstractions, not concrete data sources.
49
+ - ViewModels/BLoCs/controllers must not construct repositories, Retrofit/Dio/URLSession clients, Room/CoreData databases, SQLite handles, or HTTP clients directly.
50
+ - Domain/use-case layer must not import Android Context, SwiftUI/UIKit, Flutter widgets, React Native APIs, database annotations, or JSON serializers.
51
+ - Data layer may depend on API/database models and maps them to domain models.
52
+ - UI layer may map domain models to UI models, but formatting logic should live in mappers or presentation models, not scattered through views.
53
+
54
+ 3. FILE AND PACKAGE STRUCTURE
55
+ - One primary production type per file unless the extra types are private implementation details.
56
+ - Feature files should be grouped by layer or clear feature slice.
57
+ - File names must match the main type or responsibility.
58
+ - Avoid dumping unrelated classes into `Utils`, `Helpers`, `Common`, `Extensions`, or `Manager` files.
59
+ - Generated files, platform config, and test fixtures must not be mixed with production logic.
60
+
61
+ 4. NAMING AND RESPONSIBILITY
62
+ - Names must reveal role: `UserDto`, `UserEntity`, `UserUiModel`, `UserRepository`, `FetchUserUseCase`.
63
+ - Avoid ambiguous suffixes: `Data`, `Info`, `Manager`, `Helper`, `Util`, `Handler` unless the responsibility is narrow and clear.
64
+ - Classes should have one reason to change.
65
+ - Functions should do one thing and stay readable without excessive comments.
66
+
67
+ 5. STATE AND MUTABILITY
68
+ - Expose immutable state to UI.
69
+ - Keep mutable collections and mutable state private.
70
+ - Avoid global mutable singletons for app state.
71
+ - Prefer explicit state models over loose booleans and nullable fields.
72
+ - UI state, events, and side effects should be clearly separated.
73
+
74
+ 6. DEPENDENCY INJECTION AND TESTABILITY
75
+ - Constructor inject dependencies where possible.
76
+ - Avoid service locators in business logic.
77
+ - Avoid static/global calls for time, UUID, dispatchers, schedulers, analytics, storage, or networking; wrap them behind interfaces when needed.
78
+ - Use interfaces/protocols/abstract classes at boundaries that need tests or replacement.
79
+ - Business logic should be testable without launching UI or real network/database.
80
+
81
+ 7. PLATFORM-SPECIFIC CHECKS
82
+ - Android/Kotlin: no repository creation in ViewModel; no Context in domain; DTOs/entities/UI models split; no large Composable with embedded business logic; no public MutableStateFlow.
83
+ - iOS/Swift: no networking/storage inside SwiftUI View; no ObservableObject doing everything; DTOs/domain/view models split; no force unwraps in model mapping.
84
+ - Flutter/Dart: no API model inside Widget/BLoC file when reused; no BuildContext in domain/repository; no large widget with business logic; separate entity/model/state/event files for non-trivial features.
85
+ - React Native/TypeScript: no API DTOs reused as component props when UI model differs; no fetch/storage directly inside render components; no large component containing reducers, API code, and presentation together.
86
+
87
+ 8. DEAD CODE AND DUPLICATION
88
+ - Flag duplicate models, duplicate mappers, unused abstractions, stale TODOs, unreachable branches, and copied validation rules.
89
+ - Flag premature abstractions that hide simple logic without reducing real duplication.
90
+
91
+ Severity:
92
+ - CRITICAL: boundary violation that blocks testing, risks data corruption, or creates hidden runtime coupling.
93
+ - WARNING: maintainability, scaling, or readability issue likely to cause future defects.
94
+ - INFO: small cleanup or naming improvement.
95
+
96
+ Output exactly:
97
+
98
+ Table formatting rules:
99
+ - Output normal Markdown. Do not wrap the final report in a fenced code block.
100
+ - Keep every table cell short, ideally under 8 words.
101
+ - Do not put full paragraphs, stack traces, code blocks, or multi-sentence fixes inside table cells.
102
+ - Put long evidence, explanation, and fixes in `Finding Details`.
103
+ - Use stable IDs (`CCA-001`, `CCA-002`) to connect summary rows to detail sections.
104
+
105
+ CLEAN CODE AUDIT REPORT
106
+ =======================
107
+ Platform:
108
+ Scope:
109
+ Architecture:
110
+ Result: PASS | FAIL
111
+
112
+ Summary:
113
+ - <short summary>
114
+
115
+ Findings Summary:
116
+ | ID | Severity | Area | File | Issue | Fix Summary |
117
+ |---|---|---|---|---|---|
118
+
119
+ Finding Details:
120
+ ### CCA-001 — <short title>
121
+ - Severity:
122
+ - Rule:
123
+ - Location:
124
+ - Problem:
125
+ - Why it matters:
126
+ - Fix:
127
+ - Suggested file move, if any:
128
+
129
+ Model Separation:
130
+ | Type | Current Location | Expected Location | Result |
131
+ |---|---|---|---|
132
+
133
+ Layer Boundary Check:
134
+ | Layer | Violation | Result |
135
+ |---|---|---|
136
+
137
+ Refactor Plan:
138
+ 1. <highest impact fix>
139
+ 2. <next fix>
140
+ 3. <next fix>
141
+
142
+ Merge Gate:
143
+ PASS only if no CRITICAL findings remain.
144
+ ```
145
+
146
+ ---
147
+
148
+ ## Example
149
+
150
+ ### Input
151
+
152
+ ```kotlin
153
+ @HiltViewModel
154
+ class ProfileViewModel @Inject constructor() : ViewModel() {
155
+ data class ProfileResponse(val id: String, val name: String)
156
+
157
+ private val api = Retrofit.Builder()
158
+ .baseUrl("https://api.example.com")
159
+ .build()
160
+ .create(ProfileApi::class.java)
161
+
162
+ val state = MutableStateFlow(ProfileResponse("", ""))
163
+ }
164
+ ```
165
+
166
+ ### Output
167
+
168
+ ```text
169
+ CLEAN CODE AUDIT REPORT
170
+ =======================
171
+ Platform: Android
172
+ Scope: ProfileViewModel
173
+ Architecture: MVVM + Clean Architecture
174
+ Result: FAIL
175
+
176
+ Summary:
177
+ - ProfileViewModel owns API construction, exposes mutable state, and defines a reusable DTO inside the ViewModel.
178
+
179
+ Findings Summary:
180
+ | ID | Severity | Area | File | Issue | Fix Summary |
181
+ |---|---|---|---|---|---|
182
+ | CCA-001 | CRITICAL | Layer Boundaries | ProfileViewModel | Constructs Retrofit directly | Inject repository/use case |
183
+ | CCA-002 | WARNING | Model Organization | ProfileViewModel | Nested reusable DTO | Move DTO to data model file |
184
+ | CCA-003 | CRITICAL | State | ProfileViewModel | Public MutableStateFlow | Expose immutable StateFlow |
185
+
186
+ Finding Details:
187
+ ### CCA-001 — ViewModel constructs networking dependency
188
+ - Severity: CRITICAL
189
+ - Rule: Layer Boundaries
190
+ - Location: ProfileViewModel
191
+ - Problem: The ViewModel constructs Retrofit and creates ProfileApi directly.
192
+ - Why it matters: Presentation is coupled to networking and cannot be tested without real infrastructure.
193
+ - Fix: Inject a ProfileRepository or FetchProfileUseCase through Hilt.
194
+ - Suggested file move, if any: None.
195
+
196
+ ### CCA-002 — Reusable DTO is nested inside ViewModel
197
+ - Severity: WARNING
198
+ - Rule: Model Organization
199
+ - Location: ProfileViewModel.ProfileResponse
200
+ - Problem: ProfileResponse is an API/data model but lives inside a presentation class.
201
+ - Why it matters: The DTO cannot be reused cleanly and mixes API contract with UI state.
202
+ - Fix: Move it to `data/remote/model/ProfileResponse.kt` and map it to a domain `Profile`.
203
+ - Suggested file move, if any: `ProfileViewModel` → `data/remote/model/ProfileResponse.kt`.
204
+
205
+ ### CCA-003 — Mutable state exposed publicly
206
+ - Severity: CRITICAL
207
+ - Rule: State and Mutability
208
+ - Location: ProfileViewModel.state
209
+ - Problem: UI callers can mutate ViewModel state directly.
210
+ - Why it matters: External mutation breaks unidirectional data flow and makes bugs hard to trace.
211
+ - Fix: Keep `MutableStateFlow` private and expose `StateFlow`.
212
+ - Suggested file move, if any: None.
213
+
214
+ Model Separation:
215
+ | Type | Current Location | Expected Location | Result |
216
+ |---|---|---|---|
217
+ | ProfileResponse | ProfileViewModel | data/remote/model/ProfileResponse.kt | FAIL |
218
+
219
+ Layer Boundary Check:
220
+ | Layer | Violation | Result |
221
+ |---|---|---|
222
+ | Presentation | Constructs Retrofit/API client | FAIL |
223
+
224
+ Refactor Plan:
225
+ 1. Move ProfileResponse into the data remote model package.
226
+ 2. Add ProfileRepository and inject it into ProfileViewModel.
227
+ 3. Expose immutable StateFlow from the ViewModel.
228
+
229
+ Merge Gate:
230
+ PASS only if no CRITICAL findings remain.
231
+ ```
232
+
233
+ ---
234
+
235
+ ## Usage Notes
236
+
237
+ - Pair with `/security-audit` for pre-release quality gates.
238
+ - Pair with platform reviewers when code is platform-specific: AXIOM, SWIFT, DART, or BRIDGE.
239
+ - Inside MOBILE-HARNESS, run this after implementation and before marking a task complete.