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,53 @@
1
+ # Skill — /new-arch-migrate
2
+
3
+ **Platform:** React Native
4
+ **Slash Command:** `/new-arch-migrate`
5
+
6
+ ---
7
+
8
+ ## Purpose
9
+
10
+ Step-by-step React Native New Architecture (JSI / Fabric / TurboModules) migration guide for an existing module or component.
11
+
12
+ ---
13
+
14
+ ## Skill Prompt
15
+
16
+ ```
17
+ Migrate the provided React Native module or component to the New Architecture:
18
+
19
+ DETECT WHAT NEEDS MIGRATION:
20
+ 1. NativeModule (RCTBridgeModule) → TurboModule
21
+ 2. Native UI Component (RCTViewManager) → Fabric Component
22
+ 3. Animated bridge calls → Reanimated 2 / useNativeDriver
23
+
24
+ TURBOMODULE MIGRATION:
25
+ Old Architecture:
26
+ - JS side: NativeModules.MyModule.doSomething()
27
+ - Native side: @ReactMethod doSomething() in Java/Kotlin/ObjC/Swift
28
+
29
+ New Architecture (TurboModule):
30
+ 1. Create TypeScript spec file (NativeMyModule.ts):
31
+ import type { TurboModule } from 'react-native';
32
+ import { TurboModuleRegistry } from 'react-native';
33
+ export interface Spec extends TurboModule {
34
+ doSomething(param: string): Promise<string>;
35
+ }
36
+ export default TurboModuleRegistry.getEnforcing<Spec>('MyModule');
37
+
38
+ 2. Android: implement ReactPackageTurboModuleManagerDelegate
39
+ 3. iOS: implement RCTTurboModule protocol
40
+
41
+ FABRIC COMPONENT MIGRATION:
42
+ 1. Create ComponentSpec.js with codegenNativeComponent
43
+ 2. Register with RCTFabricComponentsPlugins
44
+ 3. Update native implementation to use Fabric API
45
+
46
+ REANIMATED 2 MIGRATION:
47
+ - Replace Animated.Value with useSharedValue
48
+ - Replace Animated.timing/spring with withTiming/withSpring
49
+ - Replace Animated.event with useAnimatedScrollHandler/useAnimatedGestureHandler
50
+
51
+ Provide the complete before/after code for each migration step.
52
+ Flag any migration blocker (3rd party library not yet New Architecture compatible).
53
+ ```
@@ -0,0 +1,124 @@
1
+ # Skill — React Native Performance
2
+
3
+ **Platform:** React Native (TypeScript)
4
+ **Category:** Performance & Optimization
5
+ **Composable With:** agents/react-native/performance-optimizer/agent.md
6
+
7
+ ---
8
+
9
+ ## Purpose
10
+
11
+ A focused skill module covering the most common React Native performance pitfalls. Use as a quick primer before reviewing any RN component for re-render issues, FlatList problems, and animation overhead.
12
+
13
+ ## When to Use
14
+
15
+ - Before reviewing any React Native component file
16
+ - When a screen feels janky or sluggish and you need a checklist
17
+ - When composing into a larger multi-file performance review
18
+
19
+ ---
20
+
21
+ ## Skill Prompt
22
+
23
+ ```
24
+ When reviewing React Native TypeScript components for performance, check for:
25
+
26
+ RE-RENDER PREVENTION
27
+ - useCallback: every function passed as a prop to a child component (especially list items)
28
+ must be wrapped in useCallback. Inline () => fn(id) creates a new reference every render.
29
+ - useMemo: every object or array created in the component body and passed as a prop must be
30
+ wrapped in useMemo. Inline style={{ backgroundColor: color }} creates a new object every render.
31
+ - React.memo: components that receive stable props and render frequently (e.g., list cells)
32
+ should be wrapped in React.memo to skip re-renders when props haven't changed.
33
+ - Context: components consuming a large Context object re-render on ANY context value change.
34
+ Split Context into smaller focused contexts or use a state manager (Zustand, Jotai, Redux).
35
+
36
+ FLATLIST / FLASHLIST
37
+ - keyExtractor must return a stable, unique string per item. Using index as the key causes
38
+ full re-renders on list changes.
39
+ - getItemLayout: provide this if list items have a fixed height. Without it, FlatList cannot
40
+ pre-calculate positions, causing extra layout work on every scroll.
41
+ - removeClippedSubviews: set to true for long lists to unmount off-screen items.
42
+ - windowSize: default is 21 (viewports). For complex items, reduce to 7–11 to lower memory.
43
+ - initialNumToRender: set to the count visible above the fold to avoid over-rendering on mount.
44
+ - Consider migrating large lists (50+ items) to FlashList (Shopify) — better recycling,
45
+ significantly lower memory on New Architecture.
46
+
47
+ ANIMATIONS
48
+ - Every Animated.Value animation must use useNativeDriver: true where possible.
49
+ Animations without useNativeDriver run on the JS thread and drop frames under load.
50
+ - useNativeDriver: true is compatible with: opacity, transform (scale, translate, rotate).
51
+ It is NOT compatible with: layout properties (width, height, margin, padding).
52
+ - For layout animations, use Reanimated v3 with useAnimatedStyle — runs on the UI thread.
53
+ - Avoid animating properties inside a FlatList renderItem — each frame update causes item re-renders.
54
+
55
+ INLINE OBJECTS AND FUNCTIONS IN JSX
56
+ - <Component style={{ flex: 1 }} /> — new object every render.
57
+ Fix: extract to StyleSheet.create or useMemo.
58
+ - <Component onPress={() => doSomething(item.id)} /> — new function every render.
59
+ Fix: extract with useCallback or pass item.id as a prop and let the component call a stable handler.
60
+ - <Component data={items.filter(i => i.active)} /> — new array every render.
61
+ Fix: memoize with useMemo.
62
+
63
+ BRIDGE OVERHEAD (Old Architecture)
64
+ - NativeModules calls in the render path or in a tight loop are expensive — they cross the bridge synchronously.
65
+ - Prefer batch native calls or migrate to JSI (New Architecture) where native calls are synchronous and cheap.
66
+ - AsyncStorage, FileSystem, and similar modules in hot render paths should use caching.
67
+
68
+ For each issue found: state the component/line, what is wrong (with an impact estimate), and provide the corrected code snippet.
69
+ ```
70
+
71
+ ---
72
+
73
+ ## Example
74
+
75
+ **Input:**
76
+ ```
77
+ const CartItem = ({ item, onRemove }) => (
78
+ <TouchableOpacity
79
+ onPress={() => onRemove(item.id)}
80
+ style={{ padding: 12, backgroundColor: '#fff' }}
81
+ >
82
+ <Text>{item.name}</Text>
83
+ </TouchableOpacity>
84
+ );
85
+ ```
86
+
87
+ **Output:**
88
+ ```
89
+ Inline onPress function — HIGH impact in lists
90
+ Problem: () => onRemove(item.id) is a new function reference every render. If CartItem
91
+ is inside a FlatList and the parent re-renders, every visible CartItem re-renders.
92
+ Fix:
93
+ const CartItem = React.memo(({ item, onRemoveId }) => (
94
+ <TouchableOpacity onPress={onRemoveId} style={styles.item}>
95
+ <Text>{item.name}</Text>
96
+ </TouchableOpacity>
97
+ ));
98
+ // In parent: const handleRemove = useCallback((id) => { ... }, []);
99
+ // Pass: onRemoveId={() => handleRemove(item.id)} is still inline — instead:
100
+ // Pass: item.id as a prop and call handleRemove(item.id) inside CartItem
101
+
102
+ Inline style object — MEDIUM impact
103
+ Problem: { padding: 12, backgroundColor: '#fff' } is a new object every render.
104
+ Fix: const styles = StyleSheet.create({ item: { padding: 12, backgroundColor: '#fff' } });
105
+ ```
106
+
107
+ ---
108
+
109
+ ## Composition Example
110
+
111
+ ```
112
+ Use before the RN Performance Optimizer agent for a quick triage:
113
+ paste this skill → paste component → get a ranked list of issues.
114
+
115
+ For the full structured report with ESTIMATED IMPROVEMENT and PROFILING STEPS,
116
+ run agents/react-native/performance-optimizer/agent.md instead.
117
+ ```
118
+
119
+ ---
120
+
121
+ ## Notes
122
+
123
+ - New Architecture (JSI/Fabric, RN 0.74+) eliminates bridge overhead. Bridge-specific checks still apply to Old Architecture apps.
124
+ - React DevTools Profiler and Flipper are the ground-truth tools — use this skill for pre-profiling code review, not as a replacement for measuring.
@@ -0,0 +1,53 @@
1
+ # Skill — /rn-review
2
+
3
+ **Platform:** React Native
4
+ **Slash Command:** `/rn-review`
5
+ **Composable With:** agents/react-native/bridge/agent.md
6
+
7
+ ---
8
+
9
+ ## Purpose
10
+
11
+ React Native component audit covering bridge calls, re-renders, New Architecture readiness, and FlatList performance.
12
+
13
+ ---
14
+
15
+ ## Skill Prompt
16
+
17
+ ```
18
+ Review the provided React Native component for these issues:
19
+
20
+ BRIDGE PERFORMANCE
21
+ - NativeModule calls in render or event handlers that fire frequently.
22
+ Fix: move to useEffect, debounce, or replace with JSI-based alternatives.
23
+ - AsyncStorage for synchronous-feeling reads: replace with MMKV.
24
+ - Animated.Value without useNativeDriver: true — runs on JS thread, causes jank.
25
+ Fix: add useNativeDriver: true (only for transform and opacity properties).
26
+
27
+ RE-RENDERS
28
+ - Missing React.memo on child components that receive stable props.
29
+ - Missing useCallback on functions passed as props.
30
+ - Missing useMemo on expensive computations or derived arrays.
31
+ - useSelector without equality function (Redux) — re-renders on any store change.
32
+ Fix: use shallowEqual or select specific slice.
33
+ - Context consumers re-rendering on every context value change.
34
+ Fix: split context or use useMemo on context value.
35
+
36
+ FLATLIST OPTIMIZATION
37
+ - Missing keyExtractor → React can't diff efficiently.
38
+ - Missing getItemLayout for fixed-height rows → scrollToIndex doesn't work.
39
+ - Missing removeClippedSubviews (Android) for long lists.
40
+ - initialNumToRender not set — defaults to 10, adjust for screen height.
41
+ - renderItem not memoized with useCallback.
42
+
43
+ NEW ARCHITECTURE
44
+ - NativeModule using RCTBridgeModule → migrate to TurboModule.
45
+ - ViewManager using RCTViewManager → migrate to Fabric component.
46
+ - Animated.event bridge calls → useNativeDriver or Reanimated 2.
47
+
48
+ TYPESCRIPT
49
+ - any type on props or return values.
50
+ - Missing null checks on optional props.
51
+
52
+ For each issue: component name, line/hook, what causes it, and the fix.
53
+ ```
@@ -0,0 +1,76 @@
1
+ # Skill — /rn-tdd
2
+
3
+ **Platform:** React Native
4
+ **Slash Command:** `/rn-tdd`
5
+ **Composable With:** agents/react-native/bridge/agent.md
6
+
7
+ ---
8
+
9
+ ## Purpose
10
+
11
+ Runs the red-green-refactor TDD loop for React Native using Jest and React Native Testing Library. Generates failing tests first, then the minimal implementation.
12
+
13
+ ---
14
+
15
+ ## Skill Prompt
16
+
17
+ ```
18
+ Run the React Native TDD loop for the described component or function:
19
+
20
+ STEP 1 — RED: Write a failing test using Jest + @testing-library/react-native.
21
+ - Render the component with renderHook() or render().
22
+ - Use userEvent for interactions (preferred over fireEvent for accuracy).
23
+ - For custom hooks: use renderHook() with act() for state updates.
24
+ - For Redux/Zustand: wrap in provider or use store.dispatch in test.
25
+ - Test must fail for the right reason (expect failure, not crash).
26
+
27
+ STEP 2 — GREEN: Minimal implementation to pass the test.
28
+ STEP 3 — REFACTOR: Apply hooks, memoization, proper types.
29
+
30
+ Format:
31
+ --- RED ---
32
+ <Jest test>
33
+
34
+ --- GREEN ---
35
+ <minimal component/function>
36
+
37
+ --- REFACTOR ---
38
+ <final implementation>
39
+ ```
40
+
41
+ ---
42
+
43
+ ## Example
44
+
45
+ **Input:** "TDD a useDebounce hook that delays a value by N ms"
46
+
47
+ **Output:**
48
+ ```typescript
49
+ --- RED ---
50
+ import { renderHook, act } from '@testing-library/react-native';
51
+ import { useDebounce } from './useDebounce';
52
+
53
+ jest.useFakeTimers();
54
+
55
+ test('returns debounced value after delay', () => {
56
+ const { result, rerender } = renderHook(
57
+ ({ value }) => useDebounce(value, 300),
58
+ { initialProps: { value: 'a' } }
59
+ );
60
+ expect(result.current).toBe('a');
61
+ rerender({ value: 'ab' });
62
+ expect(result.current).toBe('a'); // still old value
63
+ act(() => jest.advanceTimersByTime(300));
64
+ expect(result.current).toBe('ab');
65
+ });
66
+
67
+ --- GREEN ---
68
+ export function useDebounce<T>(value: T, delay: number): T {
69
+ const [debounced, setDebounced] = React.useState(value);
70
+ React.useEffect(() => {
71
+ const timer = setTimeout(() => setDebounced(value), delay);
72
+ return () => clearTimeout(timer);
73
+ }, [value, delay]);
74
+ return debounced;
75
+ }
76
+ ```
@@ -0,0 +1,46 @@
1
+ # Shared / Cross-Platform Skills
2
+
3
+ Reusable skill prompt modules that apply across Android, iOS, Flutter, and React Native. These are platform-agnostic and can be composed with any agent or used standalone.
4
+
5
+ ## Index
6
+
7
+ | Skill | File | Platforms | When to Use |
8
+ |---|---|---|---|
9
+ | Crash Log Analysis | [crash-analysis.md](crash-analysis.md) | Android, iOS | Quick crash triage — identify crash type, first app frame, root cause pattern |
10
+ | Accessibility Audit | [accessibility-audit.md](accessibility-audit.md) | All | WCAG 2.2 mobile checklist — labels, touch targets, roles, focus order, announcements |
11
+ | Security Scan | [security-scan.md](security-scan.md) | All | OWASP Mobile Top 10 — secrets, insecure storage, WebView, permissions, cryptography |
12
+
13
+ ## Usage
14
+
15
+ ```
16
+ # Quick security gate before code review
17
+ [paste skill prompt from security-scan.md]
18
+
19
+ Scan this file for security issues: [paste code]
20
+ ```
21
+
22
+ ## Composable Pattern — Full Pre-Release Audit
23
+
24
+ ```
25
+ # Run all three shared skills in one session for a comprehensive pre-release check
26
+ [paste security-scan.md skill]
27
+ [paste accessibility-audit.md skill]
28
+
29
+ Review this screen for both security and accessibility issues: [paste code]
30
+ ```
31
+
32
+ ## Composable With
33
+
34
+ - [`agents/cross-platform/security-scanner`](../../agents/cross-platform/security-scanner/) — full OWASP report with exploitability analysis
35
+ - [`agents/cross-platform/accessibility-auditor`](../../agents/cross-platform/accessibility-auditor/) — full WCAG report with platform-specific fixes
36
+ - [`agents/android/android-crash-analyzer`](../../agents/android/android-crash-analyzer/) — 9-section crash analysis
37
+ - [`agents/ios/crash-analyzer`](../../agents/ios/crash-analyzer/) — iOS crash analysis
38
+
39
+ ## Contributing
40
+
41
+ Ideas for new shared skills:
42
+ - `api-contract-review.md` — REST API design patterns, versioning, error response shapes
43
+ - `localization-audit.md` — flag hardcoded strings, RTL layout issues, date/number formatting
44
+ - `code-documentation.md` — generate KDoc, DocC, or DartDoc comments
45
+
46
+ Copy `templates/skill-template.md` and open a PR.
@@ -0,0 +1,132 @@
1
+ # Skill — Mobile Accessibility Audit
2
+
3
+ **Platform:** Cross-Platform (Android / iOS / Flutter / React Native)
4
+ **Category:** Code Quality / Accessibility
5
+ **Composable With:** agents/cross-platform/accessibility-auditor/agent.md
6
+
7
+ ---
8
+
9
+ ## Purpose
10
+
11
+ Reviews mobile UI code against WCAG 2.2 mobile guidelines and platform-specific accessibility APIs. Covers content descriptions, touch targets, screen reader behavior, focus order, and contrast. Use as a pre-release accessibility gate.
12
+
13
+ ## When to Use
14
+
15
+ - Before releasing any screen that has new interactive elements
16
+ - When QA or a user reports a TalkBack/VoiceOver issue
17
+ - As a composable check inside a larger UI review
18
+
19
+ ---
20
+
21
+ ## Skill Prompt
22
+
23
+ ```
24
+ When auditing mobile UI code for accessibility, check for:
25
+
26
+ CONTENT DESCRIPTIONS & LABELS
27
+ Android (Compose/XML):
28
+ - Every Image, Icon, or decorative element needs contentDescription.
29
+ If purely decorative: contentDescription = null (Compose) or android:contentDescription=""
30
+ and importantForAccessibility="no" (XML).
31
+ - Icon-only buttons: contentDescription must describe the ACTION, not the icon.
32
+ "Back" not "Left arrow". "Delete task" not "Trash icon".
33
+ - Checkboxes and toggles: the label must be associated (Modifier.toggleable with semantics,
34
+ or labelFor in XML).
35
+
36
+ iOS (SwiftUI/UIKit):
37
+ - Images used as buttons or conveyors of meaning need .accessibilityLabel("description").
38
+ - Decorative images: .accessibilityHidden(true).
39
+ - Custom controls: set accessibilityTraits (.button, .selected, .adjustable) to tell
40
+ VoiceOver the element's role.
41
+ - accessibilityValue for sliders, toggles, and steppers: VoiceOver reads both label + value.
42
+
43
+ Flutter:
44
+ - Semantics widget required for custom interactive widgets. Set label, hint, and button: true/false.
45
+ - Exclude decorative elements: ExcludeSemantics or Semantics(excludeSemantics: true).
46
+ - MergeSemantics: merge related child semantics into one accessible node for compound widgets.
47
+
48
+ React Native:
49
+ - accessibilityLabel on all touchable elements that don't have descriptive text children.
50
+ - accessibilityRole: 'button', 'link', 'checkbox', 'header', etc.
51
+ - accessibilityState for interactive state: {checked: bool, disabled: bool, selected: bool}.
52
+ - accessibilityHint for actions whose purpose isn't obvious from the label alone.
53
+
54
+ TOUCH TARGET SIZE
55
+ - Minimum 48×48 dp (Android) / 44×44 pt (iOS) for all interactive elements.
56
+ - Flag any button, icon button, or tap area smaller than this minimum.
57
+ - Use padding to expand the touch area without changing visual size:
58
+ Android Compose: Modifier.minimumInteractiveComponentSize() or padding
59
+ iOS: contentEdgeInsets or .contentShape(Rectangle().inset(by: -8))
60
+ Flutter: Padding or SizedBox wrapping the widget
61
+ React Native: padding or hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}
62
+
63
+ FOCUS ORDER & KEYBOARD NAVIGATION
64
+ - Logical reading order: screen readers read in the order elements appear in the view hierarchy.
65
+ Flag any absolute-positioned or z-index-manipulated elements where visual order ≠ DOM/hierarchy order.
66
+ - Android: use android:accessibilityTraversalAfter/Before or Modifier.semantics { traversalIndex } in Compose.
67
+ - iOS: accessibilityElements array on the parent to define custom order.
68
+ - React Native: accessible={true} with accessibilityViewIsModal for modals (traps focus inside).
69
+
70
+ DYNAMIC CONTENT ANNOUNCEMENTS
71
+ - When content changes dynamically (success toast, error message, loading complete), announce it:
72
+ Android: View.announceForAccessibility("Upload complete") or AccessibilityEvent.TYPE_ANNOUNCEMENT
73
+ iOS: UIAccessibility.post(notification: .announcement, argument: "Upload complete")
74
+ Flutter: SemanticsService.announce("Upload complete", TextDirection.ltr)
75
+ React Native: AccessibilityInfo.announceForAccessibility("Upload complete")
76
+ - Flag any dynamic UI state change (snackbar, badge update, count change) that has no announcement.
77
+
78
+ COLOR & CONTRAST
79
+ - The code cannot prove contrast ratios, but flag:
80
+ Any hardcoded color that is not from the theme/design system (cannot be verified for contrast).
81
+ Any text rendered over an image without a scrim/overlay (contrast is unpredictable).
82
+ Any disabled state that uses only color to convey disabled-ness (should also use reduced opacity + non-interactive).
83
+
84
+ Severity:
85
+ - CRITICAL: blocks screen reader users entirely (no label on interactive element, focus trap outside modal)
86
+ - HIGH: degrades usability significantly (touch target too small, wrong role, no dynamic announcement)
87
+ - MEDIUM: impacts some users (missing hint, suboptimal reading order)
88
+ - LOW: minor improvement (redundant label, overly verbose hint)
89
+ ```
90
+
91
+ ---
92
+
93
+ ## Example
94
+
95
+ **Input:**
96
+ ```kotlin
97
+ // Compose
98
+ IconButton(onClick = { onDelete(item.id) }) {
99
+ Icon(Icons.Default.Delete, contentDescription = null)
100
+ }
101
+ ```
102
+
103
+ **Output:**
104
+ ```
105
+ CRITICAL — Icon button has no accessibility label
106
+ Problem: contentDescription = null on the Icon means TalkBack announces this as an
107
+ unlabeled button. Screen reader users cannot know what tapping it does.
108
+ Fix:
109
+ IconButton(onClick = { onDelete(item.id) }) {
110
+ Icon(
111
+ imageVector = Icons.Default.Delete,
112
+ contentDescription = "Delete ${item.name}" // action-oriented, item-specific
113
+ )
114
+ }
115
+ ```
116
+
117
+ ---
118
+
119
+ ## Composition Example
120
+
121
+ ```
122
+ Prepend this skill to any UI component review for a quick accessibility gate.
123
+ For a full structured accessibility audit with severity counts and a platform-specific
124
+ remediation guide, run agents/cross-platform/accessibility-auditor/agent.md.
125
+ ```
126
+
127
+ ---
128
+
129
+ ## Notes
130
+
131
+ - Automated accessibility checkers (Accessibility Scanner on Android, Xcode Accessibility Inspector) catch some issues but miss semantic meaning, logical reading order, and dynamic announcement gaps.
132
+ - Always test with TalkBack (Android) and VoiceOver (iOS) on a real device — emulator behavior differs.
@@ -0,0 +1,110 @@
1
+ # Skill — Crash Log Analysis
2
+
3
+ **Platform:** Cross-Platform (Android / iOS)
4
+ **Category:** Debugging & Crash Analysis
5
+ **Composable With:** agents/android/crash-analyzer/agent.md
6
+
7
+ ---
8
+
9
+ ## Purpose
10
+
11
+ Teaches an LLM how to read and triage mobile crash logs. Useful as a standalone skill for quick triage or as a module inside a larger debugging workflow.
12
+
13
+ ## When to Use
14
+
15
+ - When you paste a crash log into a chat and want a quick explanation
16
+ - When composing a workflow that processes multiple crash logs in bulk
17
+ - When onboarding a junior developer on how to read stack traces
18
+
19
+ ---
20
+
21
+ ## Skill Prompt
22
+
23
+ ```
24
+ When analyzing a mobile crash log (Android logcat / iOS .crash file), follow this process:
25
+
26
+ 1. IDENTIFY THE CRASH TYPE
27
+ - Exception class (Java/Kotlin): NullPointerException, IllegalStateException,
28
+ IndexOutOfBoundsException, OutOfMemoryError, etc.
29
+ - Signal (native/NDK): SIGSEGV (null dereference), SIGABRT (assertion/abort),
30
+ SIGBUS (unaligned memory access)
31
+ - ANR: Look for "ANR in" at the top. Check the main thread stack for blocking calls.
32
+ - OOM: "java.lang.OutOfMemoryError" — look at heap allocation chain.
33
+
34
+ 2. FIND THE FIRST APPLICATION FRAME
35
+ - Skip system frames: android.*, java.*, kotlin.*, kotlinx.*, com.google.*, androidx.*
36
+ - The first frame with YOUR package name is where the crash originated in your code.
37
+ - That frame is the starting point for root-cause analysis — not just the exception site.
38
+
39
+ 3. TRACE THE CALL CHAIN
40
+ - Read the stack trace bottom-to-top (entry point → crash site).
41
+ - Identify the user action or lifecycle event that triggered the chain.
42
+ - Note thread name (main thread crash vs. background thread crash).
43
+
44
+ 4. STATE THE ROOT CAUSE
45
+ - Do not just say "null pointer at line 42." Explain WHY the value was null,
46
+ or WHY the index was out of bounds, given the code path.
47
+ - Common root causes by exception type:
48
+ NPE: async result used before completion; activity/fragment reference held after destroy
49
+ IOOB: list modified during iteration; off-by-one in manual index calculation
50
+ ISE: Fragment transaction after onSaveInstanceState
51
+ OOM: bitmap not recycled; memory leak accumulating over time
52
+ ANR: network/disk I/O on main thread; lock contention
53
+
54
+ 5. REMEDIATION
55
+ - State a concrete code fix, not "add null check."
56
+ - If the fix involves async timing, explain the correct lifecycle hook to use.
57
+ - Suggest a test case that would have caught this crash.
58
+ ```
59
+
60
+ ---
61
+
62
+ ## Example
63
+
64
+ **Input:**
65
+ ```
66
+ Fatal Exception: java.lang.IllegalStateException: Fragment ProfileFragment not attached to a context.
67
+ at androidx.fragment.app.Fragment.requireContext(Fragment.java:947)
68
+ at com.example.app.ProfileFragment.updateUI(ProfileFragment.kt:88)
69
+ at com.example.app.ProfileViewModel$loadProfile$1.invokeSuspend(ProfileViewModel.kt:41)
70
+ ```
71
+
72
+ **Output:**
73
+ ```
74
+ Crash Type: IllegalStateException — Fragment not attached to context
75
+ First App Frame: ProfileFragment.updateUI (line 88)
76
+
77
+ Root Cause:
78
+ The ViewModel's coroutine completes and calls back into the Fragment after the Fragment
79
+ has been detached (e.g., user navigated away). requireContext() throws if the Fragment
80
+ is not currently attached to an Activity.
81
+
82
+ Fix:
83
+ In ProfileFragment.updateUI, guard with `if (!isAdded) return` before calling
84
+ requireContext(). Better: collect the ViewModel's StateFlow in onViewCreated using
85
+ `viewLifecycleOwner.lifecycleScope`, which automatically cancels when the view is destroyed,
86
+ preventing the callback from reaching the Fragment at all.
87
+
88
+ Test Case:
89
+ Navigate to Profile screen → trigger a slow network call → immediately navigate back →
90
+ confirm no crash in Crashlytics within 5 minutes of the scenario.
91
+ ```
92
+
93
+ ---
94
+
95
+ ## Composition Example
96
+
97
+ ```
98
+ Use this skill as a lightweight triage step before running the full Crash Log Analyzer agent.
99
+ Paste the skill prompt, then paste the crash log for a quick 3-sentence explanation.
100
+ For full structured output (root cause + AFFECTED SURFACE + REMEDIATION steps),
101
+ run agents/android/crash-analyzer/agent.md instead.
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Notes
107
+
108
+ - Works for both Android and iOS crash reports.
109
+ - For symbolicated iOS crashes, the skill assumes the crash file has already been symbolicated via `symbolicatecrash` or Xcode Organizer.
110
+ - ANR analysis requires the full `traces.txt` dump from `/data/anr/` — a single-thread excerpt is insufficient.