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,104 @@
1
+ # Example Input — RN Performance Optimizer
2
+
3
+ The `FeedScreen` below contains four intentional performance issues.
4
+
5
+ ---
6
+
7
+ ```
8
+ RN_VERSION: 0.76
9
+ ARCH: new
10
+ FILE_PATH: src/screens/FeedScreen.tsx
11
+ CODE:
12
+ import React, { useState, useEffect, useContext } from 'react';
13
+ import { FlatList, View, Text, TouchableOpacity, StyleSheet } from 'react-native';
14
+
15
+ interface Post { id: string; title: string; body: string; liked: boolean; }
16
+ const ThemeContext = React.createContext({ colors: { background: '#ffffff' } });
17
+
18
+ const PostCard = ({ post, onLike, style }: { post: Post; onLike: () => void; style: object }) => (
19
+ <View style={[styles.card, style]}>
20
+ <Text style={styles.title}>{post.title}</Text>
21
+ <Text style={styles.body}>{post.body}</Text>
22
+ <TouchableOpacity onPress={onLike}>
23
+ <Text>{post.liked ? '❤️' : '🤍'} Like</Text>
24
+ </TouchableOpacity>
25
+ </View>
26
+ );
27
+
28
+ const fetchPosts = async (): Promise<Post[]> => [
29
+ { id: '1', title: 'Hello', body: 'First post', liked: false },
30
+ { id: '2', title: 'Second', body: 'Second post', liked: false },
31
+ ];
32
+ const handleLike = (id: string) => console.log('Liked:', id);
33
+
34
+ const FeedScreen = () => {
35
+ const [posts, setPosts] = useState<Post[]>([]);
36
+ const theme = useContext(ThemeContext);
37
+
38
+ useEffect(() => { fetchPosts().then(setPosts); }, []);
39
+
40
+ const renderItem = ({ item }: { item: Post }) => (
41
+ <PostCard
42
+ post={item}
43
+ onLike={() => handleLike(item.id)}
44
+ style={{ backgroundColor: theme.colors.background }}
45
+ />
46
+ );
47
+
48
+ return (
49
+ <FlatList
50
+ data={posts}
51
+ renderItem={renderItem}
52
+ keyExtractor={(item) => item.id}
53
+ />
54
+ );
55
+ };
56
+
57
+ const styles = StyleSheet.create({
58
+ card: { padding: 16, marginVertical: 8, borderRadius: 8 },
59
+ title: { fontSize: 16, fontWeight: 'bold' },
60
+ body: { fontSize: 14, color: '#666' },
61
+ });
62
+ export default FeedScreen;
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Issue Map
68
+
69
+ 1. `renderItem` is an inline function — recreated every `FeedScreen` re-render (HIGH)
70
+ 2. `{ backgroundColor: theme.colors.background }` is a new object every `renderItem` call (HIGH)
71
+ 3. `onLike={() => handleLike(item.id)}` inline per cell — breaks `PostCard` memoization (MEDIUM)
72
+ 4. `FlatList` missing `getItemLayout` — extra layout pass on every scroll (LOW)
73
+
74
+ ---
75
+
76
+ ## Variations
77
+
78
+ ### With Profiler Data
79
+ ```
80
+ RN_VERSION: 0.74
81
+ ARCH: old
82
+ FILE_PATH: src/screens/ProductListScreen.tsx
83
+ PROFILER_DATA:
84
+ Component "ProductListScreen" rendered 24 times in 3 seconds.
85
+ Component "ProductCard" rendered 480 times — 20 per ProductListScreen render.
86
+ Longest render: 18ms (exceeded 16.6ms frame budget).
87
+ CODE:
88
+ [paste component]
89
+ ```
90
+
91
+ ### FlatList with Pagination
92
+ ```
93
+ RN_VERSION: 0.76
94
+ ARCH: new
95
+ FILE_PATH: src/screens/OrderHistoryScreen.tsx
96
+ CODE:
97
+ <FlatList
98
+ data={orders}
99
+ renderItem={({ item }) => <OrderCard key={item.id} order={item} onPress={() => navigate(item.id)} />}
100
+ onEndReached={() => loadMore()}
101
+ onEndReachedThreshold={0.5}
102
+ />
103
+ ```
104
+ Issues: `renderItem` inline, `onPress` inline per card, missing `keyExtractor`, missing `getItemLayout`, `onEndReached` threshold too aggressive for a paginated list.
@@ -0,0 +1,132 @@
1
+ # Example Output — RN Performance Optimizer
2
+
3
+ Full agent response to the input in [`example-input.md`](example-input.md).
4
+
5
+ ---
6
+
7
+ ```
8
+ PERFORMANCE AUDIT
9
+ =================
10
+ File: src/screens/FeedScreen.tsx
11
+ Component: FeedScreen
12
+ Architecture: New Architecture (JSI/Fabric)
13
+ Issues Found: 4
14
+ High Impact: 2 Medium Impact: 1 Low Impact: 1
15
+
16
+ FINDINGS (ranked by impact)
17
+ ---------------------------
18
+
19
+ [HIGH] renderItem recreated on every parent render
20
+ Impact : Every state change in FeedScreen recreates renderItem, which gives FlatList
21
+ a new function reference. FlatList uses referential equality to bail out of
22
+ re-renders. A new reference on every render forces ALL visible PostCards
23
+ (typically 10–20 on screen) to re-render — even when the posts data hasn't changed.
24
+ Problem : renderItem is an arrow function defined in the component body.
25
+ Arrow functions are never referentially stable across renders.
26
+ Refactored :
27
+ ```tsx
28
+ const cardStyle = useMemo(
29
+ () => ({ backgroundColor: theme.colors.background }),
30
+ [theme.colors.background]
31
+ );
32
+
33
+ const renderItem = useCallback(
34
+ ({ item }: { item: Post }) => (
35
+ <PostCard
36
+ post={item}
37
+ onLike={() => handleLike(item.id)} // see MEDIUM finding below
38
+ style={cardStyle}
39
+ />
40
+ ),
41
+ [cardStyle]
42
+ );
43
+ ```
44
+
45
+ [HIGH] Inline style object — new object reference every renderItem call
46
+ Impact : { backgroundColor: theme.colors.background } is a new object on every call.
47
+ Even with renderItem memoized, if cardStyle is inline, PostCard's style prop
48
+ changes on every render — defeating React.memo on PostCard (if applied).
49
+ Problem : Objects created in JSX are never referentially equal between renders.
50
+ Refactored :
51
+ ```tsx
52
+ const cardStyle = useMemo(
53
+ () => ({ backgroundColor: theme.colors.background }),
54
+ [theme.colors.background]
55
+ );
56
+ // Pass cardStyle (stable reference) to renderItem above
57
+ ```
58
+
59
+ [MEDIUM] onLike inline closure captures item.id per cell
60
+ Impact : () => handleLike(item.id) is a new function per item per render.
61
+ If PostCard is wrapped in React.memo, it still re-renders when its onLike
62
+ prop changes reference. With 20 items, that's 20 new function references
63
+ on every FeedScreen render.
64
+ Problem : The item.id needs to reach handleLike, but the way to do it matters.
65
+ Refactored :
66
+ ```tsx
67
+ // Pattern A: pass id as a stable prop, call handleLike inside PostCard
68
+ // PostCard receives: onLike: (id: string) => void; id: string
69
+ // Inside PostCard: <TouchableOpacity onPress={() => onLike(id)}>
70
+ // In FeedScreen: pass onLike={handleLike} — same stable reference every render
71
+
72
+ // Pattern B (simpler): wrap handleLike in useCallback
73
+ const stableHandleLike = useCallback((id: string) => handleLike(id), []);
74
+ // Then each cell still creates () => stableHandleLike(item.id), but the outer
75
+ // reference is stable — combine with Pattern A for best results.
76
+ ```
77
+
78
+ [LOW] FlatList missing getItemLayout
79
+ Impact : Without getItemLayout, FlatList cannot pre-calculate item positions.
80
+ This causes extra layout measurements on initial mount and when
81
+ scrollToIndex is called. With variable-height items it is unavoidable,
82
+ but if PostCard has a fixed height, this is a free optimization.
83
+ Problem : FlatList must measure every rendered item to know total scroll height.
84
+ Refactored :
85
+ ```tsx
86
+ const ITEM_HEIGHT = 88; // measure your PostCard — padding 16 + title 24 + body 20 + like 20 + margin 8
87
+ <FlatList
88
+ data={posts}
89
+ renderItem={renderItem}
90
+ keyExtractor={(item) => item.id}
91
+ getItemLayout={(_, index) => ({
92
+ length: ITEM_HEIGHT,
93
+ offset: ITEM_HEIGHT * index,
94
+ index,
95
+ })}
96
+ />
97
+ ```
98
+
99
+ BRIDGE / JSI OVERHEAD
100
+ ---------------------
101
+ Synchronous bridge calls detected: No
102
+ → No NativeModules calls detected in the render or event paths.
103
+
104
+ ANIMATION SAFETY
105
+ ----------------
106
+ Animations running on JS thread: No
107
+ → No Animated API usage detected in this file.
108
+
109
+ FLATLIST / FLASHLIST AUDIT
110
+ --------------------------
111
+ Issues found: 2
112
+ → keyExtractor returns item.id — correct and stable. ✓
113
+ → getItemLayout missing — see LOW finding above.
114
+ → Consider FlashList (Shopify) for lists with 50+ posts — better recycling
115
+ and memory usage on New Architecture.
116
+
117
+ ESTIMATED IMPROVEMENT
118
+ ---------------------
119
+ Before: ~10–20 PostCard re-renders per FeedScreen state change
120
+ After : ~0 PostCard re-renders for unrelated FeedScreen state changes
121
+ Expected FPS gain: Sustained 60 FPS during scroll on mid-range devices (vs. potential
122
+ drops on lower-end Android without the fixes).
123
+
124
+ RECOMMENDED PROFILING STEPS
125
+ ----------------------------
126
+ 1. Open React DevTools → Profiler → Enable "Record why each component rendered"
127
+ 2. Scroll the feed, toggle a like — record 5 seconds
128
+ 3. Look for "Props changed" on PostCard — confirm it stops appearing for items
129
+ that weren't liked after applying useCallback + useMemo
130
+ 4. Enable "Highlight updates" in React DevTools to visually confirm only
131
+ newly loaded or liked posts cause a highlight during scroll
132
+ ```
@@ -0,0 +1,77 @@
1
+ # Unity Shader Generator Agent
2
+
3
+ > Describe a visual effect in plain English. Get a complete, compilable Unity `.shader` file — for URP, HDRP, or Built-in — with a Properties block, vertex/fragment stages, and a material setup guide.
4
+
5
+ ---
6
+
7
+ ## What This Agent Does
8
+
9
+ Generates a complete Unity ShaderLab `.shader` file from a visual description:
10
+
11
+ - Selects the correct render pipeline (URP: `HLSLPROGRAM` + URP includes; Built-in: `CGPROGRAM` + `UnityCG.cginc`; HDRP: HDRP ShaderLibrary)
12
+ - Exposes all tweakable values as Material `Properties`
13
+ - Applies mobile optimization rules when `TARGET: mobile` is specified (≤2 texture samples per fragment, `half` precision, no dynamic branching)
14
+ - Uses `_Time.y` for time-based animation — never C# `Time.deltaTime`
15
+ - Provides a step-by-step **Material Setup** guide for the Inspector
16
+
17
+ ---
18
+
19
+ ## Files
20
+
21
+ | File | Purpose |
22
+ |---|---|
23
+ | [`agent.md`](agent.md) | Input format, output format, full system prompt |
24
+ | [`example-input.md`](example-input.md) | Holographic scanline effect description |
25
+ | [`example-output.md`](example-output.md) | Complete URP `.shader` file |
26
+
27
+ ---
28
+
29
+ ## Quick Start
30
+
31
+ ```
32
+ UNITY_VERSION: 6000.0
33
+ RENDER_PIPELINE: urp
34
+ SHADER_TYPE: unlit
35
+ TARGET_PLATFORM: mobile
36
+ DESCRIPTION:
37
+ [describe the visual effect]
38
+ ```
39
+
40
+ ---
41
+
42
+ ## Output Format
43
+
44
+ ````
45
+ SHADER: <Name>
46
+ FILE: <Shaders/Name.shader>
47
+ RENDER_PIPELINE: <pipeline>
48
+ MOBILE_FRIENDLY: Yes / No
49
+
50
+ ```hlsl
51
+ <full .shader file>
52
+ ```
53
+
54
+ PROPERTIES REFERENCE:
55
+ MATERIAL SETUP:
56
+ PERFORMANCE NOTES:
57
+ KNOWN LIMITATIONS:
58
+ ````
59
+
60
+ ---
61
+
62
+ ## Supported Shader Types
63
+
64
+ | Type | When to Use |
65
+ |---|---|
66
+ | `unlit` | UI effects, holograms, VFX, any effect that doesn't need lighting |
67
+ | `lit` | PBR surfaces, characters, props that respond to scene lighting |
68
+ | `surface` | Built-in pipeline only; abstracts lighting boilerplate |
69
+ | `post-process` | Screen-space effects (bloom, color grade, dissolve) |
70
+
71
+ ---
72
+
73
+ ## Related Agents
74
+
75
+ - [`agents/unreal/blueprint-advisor`](../../unreal/blueprint-advisor/) — UE equivalent for materials and Blueprint logic
76
+ - `skills/unity/shader-review.md` — review an existing shader for mobile budget issues
77
+ - `prompts/game-dev/shader-from-reference.md` — quick one-shot shader from a visual reference
@@ -0,0 +1,270 @@
1
+ # Agent 06 — Unity Shader Generator
2
+
3
+ **Platform:** Unity (HLSL / ShaderLab / URP / HDRP)
4
+ **Category:** Game Development / UI & Design
5
+ **Complexity:** High
6
+
7
+ ---
8
+
9
+ ## Purpose
10
+
11
+ Generates Unity-compatible HLSL shader code from a plain-English visual description. Supports the Built-in Render Pipeline, Universal Render Pipeline (URP), and High Definition Render Pipeline (HDRP). Produces a complete `.shader` file with vertex and fragment stages, property declarations, and a usage example.
12
+
13
+ ---
14
+
15
+ ## Input Format
16
+
17
+ ```
18
+ UNITY_VERSION: <e.g. 6000.0 (Unity 6)>
19
+ RENDER_PIPELINE: <builtin | urp | hdrp>
20
+ SHADER_TYPE: <surface | unlit | lit | post-process>
21
+ TARGET_PLATFORM: <mobile | desktop | console | all>
22
+ DESCRIPTION:
23
+ <Plain-English description of the visual effect. Include:
24
+ - Colors, gradients, or texture inputs
25
+ - Transparency / blend mode
26
+ - Animation or time-based effects
27
+ - Lighting requirements
28
+ - Performance constraints (mobile-friendly?)>
29
+ ```
30
+
31
+ **Fields:**
32
+
33
+ | Field | Required | Description |
34
+ |---|---|---|
35
+ | `UNITY_VERSION` | Yes | Determines URP/HDRP API version |
36
+ | `RENDER_PIPELINE` | Yes | `builtin`, `urp`, or `hdrp` |
37
+ | `SHADER_TYPE` | Yes | `surface`, `unlit`, `lit`, or `post-process` |
38
+ | `TARGET_PLATFORM` | Yes | Affects complexity and instruction count |
39
+ | `DESCRIPTION` | Yes | Natural language visual spec |
40
+
41
+ ---
42
+
43
+ ## Output Format
44
+
45
+ ````
46
+ SHADER: <ShaderName>
47
+ FILE: <Shaders/ShaderName.shader>
48
+ RENDER_PIPELINE: <pipeline>
49
+ MOBILE_FRIENDLY: Yes / No
50
+
51
+ ```hlsl
52
+ <full ShaderLab .shader file content>
53
+ ```
54
+
55
+ PROPERTIES REFERENCE:
56
+ | Property | Type | Description |
57
+ |---|---|---|
58
+ | <_PropertyName> | <type> | <what it controls> |
59
+
60
+ MATERIAL SETUP:
61
+ <Step-by-step instructions for creating and assigning the material in Unity>
62
+
63
+ PERFORMANCE NOTES:
64
+ - <Instruction count estimate>
65
+ - <Texture samples per fragment>
66
+ - <Recommended LOD level>
67
+
68
+ KNOWN LIMITATIONS:
69
+ - <Edge cases, unsupported platforms, etc.>
70
+ ````
71
+
72
+ ---
73
+
74
+ ## System Prompt
75
+
76
+ ```
77
+ You are a senior Unity graphics engineer with deep expertise in HLSL, ShaderLab, URP, HDRP, and the Built-in Render Pipeline. Your job is to generate a complete, working Unity shader from a plain-English description.
78
+
79
+ Rules:
80
+ 1. Output a complete `.shader` file — including Shader name, Properties block, SubShader, Pass, vertex program, and fragment program. Do not output partial snippets.
81
+ 2. Match the specified render pipeline exactly:
82
+ - Built-in: use `CGPROGRAM` / `#include "UnityCG.cginc"`.
83
+ - URP: use `HLSLPROGRAM` / `#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"`.
84
+ - HDRP: use `HLSLPROGRAM` / `#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"`.
85
+ 3. For mobile target: keep texture samples ≤ 2, avoid dynamic branching, use `half` precision where possible.
86
+ 4. Include `_MainTex` as the primary texture property unless the shader is texture-free by design.
87
+ 5. Expose meaningful, tweakable properties in the Properties block.
88
+ 6. Add a `Fallback "Diffuse"` for Built-in shaders unless the effect requires no fallback.
89
+ 7. For animated effects, use `_Time.y` (seconds since startup) for time input — do not rely on `Time.deltaTime` from scripts.
90
+ 8. Comment non-obvious math in the shader code.
91
+ 9. Provide a material setup guide (which properties to set in the Inspector).
92
+ 10. Note mobile-friendliness and estimated instruction count.
93
+
94
+ Output MUST follow the exact format specified.
95
+ ```
96
+
97
+ ---
98
+
99
+ ## Example
100
+
101
+ ### Input
102
+
103
+ ```
104
+ UNITY_VERSION: 6000.0
105
+ RENDER_PIPELINE: urp
106
+ SHADER_TYPE: unlit
107
+ TARGET_PLATFORM: mobile
108
+ DESCRIPTION:
109
+ A holographic scanline effect for a UI panel. The panel should have a semi-transparent
110
+ dark blue tint with horizontal scanlines scrolling upward over time. The scanline
111
+ frequency and speed should be tweakable. A subtle edge glow (fresnel-like brightness
112
+ at the top and bottom edges of the mesh) should be included. No lighting needed.
113
+ ```
114
+
115
+ ### Output
116
+
117
+ ````
118
+ SHADER: HolographicScanline
119
+ FILE: Shaders/HolographicScanline.shader
120
+ RENDER_PIPELINE: URP
121
+ MOBILE_FRIENDLY: Yes
122
+
123
+ ```hlsl
124
+ Shader "Custom/HolographicScanline"
125
+ {
126
+ Properties
127
+ {
128
+ _MainTex ("Base Texture (optional)", 2D) = "white" {}
129
+ _TintColor ("Tint Color", Color) = (0.05, 0.15, 0.4, 0.75)
130
+ _ScanlineFreq ("Scanline Frequency", Range(10, 200)) = 60
131
+ _ScanlineSpeed ("Scanline Scroll Speed", Range(0, 5)) = 1.2
132
+ _ScanlineBright ("Scanline Brightness", Range(0, 1)) = 0.15
133
+ _EdgeGlow ("Edge Glow Intensity", Range(0, 2)) = 0.6
134
+ _EdgeFalloff ("Edge Glow Falloff", Range(1, 10)) = 3.0
135
+ }
136
+
137
+ SubShader
138
+ {
139
+ Tags
140
+ {
141
+ "RenderType" = "Transparent"
142
+ "Queue" = "Transparent"
143
+ "RenderPipeline" = "UniversalPipeline"
144
+ }
145
+
146
+ Blend SrcAlpha OneMinusSrcAlpha
147
+ ZWrite Off
148
+ Cull Back
149
+
150
+ Pass
151
+ {
152
+ Name "HolographicScanlinePass"
153
+
154
+ HLSLPROGRAM
155
+ #pragma vertex vert
156
+ #pragma fragment frag
157
+ #pragma prefer_hlslcc gles
158
+ #pragma exclude_renderers d3d11_9x
159
+
160
+ #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
161
+
162
+ struct Attributes
163
+ {
164
+ float4 positionOS : POSITION;
165
+ float2 uv : TEXCOORD0;
166
+ };
167
+
168
+ struct Varyings
169
+ {
170
+ float4 positionHCS : SV_POSITION;
171
+ float2 uv : TEXCOORD0;
172
+ // y in object space, normalized 0..1 top-to-bottom for edge glow
173
+ float normalizedY : TEXCOORD1;
174
+ };
175
+
176
+ TEXTURE2D(_MainTex);
177
+ SAMPLER(sampler_MainTex);
178
+
179
+ CBUFFER_START(UnityPerMaterial)
180
+ float4 _MainTex_ST;
181
+ half4 _TintColor;
182
+ half _ScanlineFreq;
183
+ half _ScanlineSpeed;
184
+ half _ScanlineBright;
185
+ half _EdgeGlow;
186
+ half _EdgeFalloff;
187
+ CBUFFER_END
188
+
189
+ Varyings vert(Attributes IN)
190
+ {
191
+ Varyings OUT;
192
+ OUT.positionHCS = TransformObjectToHClip(IN.positionOS.xyz);
193
+ OUT.uv = TRANSFORM_TEX(IN.uv, _MainTex);
194
+ // Remap object-space y (-0.5..0.5) to 0..1
195
+ OUT.normalizedY = IN.positionOS.y + 0.5;
196
+ return OUT;
197
+ }
198
+
199
+ half4 frag(Varyings IN) : SV_Target
200
+ {
201
+ // Base texture (usually white / unused)
202
+ half4 texColor = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, IN.uv);
203
+
204
+ // Scrolling scanlines: sine wave over UV.y + time
205
+ float scanlinePhase = IN.uv.y * _ScanlineFreq
206
+ - _Time.y * _ScanlineSpeed;
207
+ half scanline = sin(scanlinePhase * 3.14159) * 0.5 + 0.5;
208
+ scanline = pow(scanline, 4.0); // sharpen the line
209
+ scanline *= _ScanlineBright;
210
+
211
+ // Edge glow: bright at y=0 and y=1, dark in the middle
212
+ half edgeMask = 1.0 - abs(IN.normalizedY * 2.0 - 1.0);
213
+ edgeMask = 1.0 - pow(edgeMask, _EdgeFalloff);
214
+ half edgeGlow = edgeMask * _EdgeGlow;
215
+
216
+ // Combine
217
+ half4 col = _TintColor;
218
+ col.rgb += scanline + edgeGlow;
219
+ col.rgb *= texColor.rgb;
220
+ col.a = _TintColor.a * texColor.a;
221
+
222
+ return col;
223
+ }
224
+ ENDHLSL
225
+ }
226
+ }
227
+ FallBack Off
228
+ }
229
+ ```
230
+
231
+ PROPERTIES REFERENCE:
232
+ | Property | Type | Description |
233
+ |---|---|---|
234
+ | _MainTex | Texture2D | Optional base texture; leave white for pure color effect |
235
+ | _TintColor | Color (RGBA) | Base holographic tint; alpha controls overall transparency |
236
+ | _ScanlineFreq | Float (10–200) | Number of scanlines visible across the mesh height |
237
+ | _ScanlineSpeed | Float (0–5) | How fast scanlines scroll upward in units/second |
238
+ | _ScanlineBright | Float (0–1) | Brightness contribution of the scanline highlight |
239
+ | _EdgeGlow | Float (0–2) | Intensity of the top/bottom edge glow |
240
+ | _EdgeFalloff | Float (1–10) | How quickly the edge glow falls off toward the center |
241
+
242
+ MATERIAL SETUP:
243
+ 1. In the Project window, right-click → Create → Material.
244
+ 2. In the Inspector, set Shader to "Custom/HolographicScanline".
245
+ 3. Set _TintColor to (R:0.05, G:0.15, B:0.4, A:0.75) for the default blue holographic look.
246
+ 4. Set _ScanlineFreq to 80, _ScanlineSpeed to 1.5 for a readable scrolling effect.
247
+ 5. Apply the material to a UI RawImage or a world-space Quad mesh.
248
+ 6. Ensure the Canvas or MeshRenderer has "Allow HDR" disabled on mobile.
249
+
250
+ PERFORMANCE NOTES:
251
+ - Instruction count: ~18 ALU, 1 texture sample — well within mobile budget.
252
+ - No dynamic branching; sin() is approximated by GPU hardware.
253
+ - Uses `half` precision throughout — safe on Mali/Adreno GPUs.
254
+ - Recommended LOD: 100 (default).
255
+
256
+ KNOWN LIMITATIONS:
257
+ - Edge glow assumes the mesh pivot is centered (positionOS.y ranges -0.5..0.5).
258
+ For non-centered meshes, adjust the normalizedY calculation.
259
+ - No support for UI Stencil masking (requires additional Pass with Stencil block).
260
+ - Scanlines are UV-based, not screen-space — they will stretch on non-square meshes.
261
+ ````
262
+
263
+ ---
264
+
265
+ ## Notes
266
+
267
+ - For HDRP post-process effects, provide `SHADER_TYPE: post-process` and describe the screen-space effect.
268
+ - Shader Graph alternative: the agent can describe the equivalent Shader Graph node setup if you prefer a visual editor — add `OUTPUT: shader-graph-nodes` to your input.
269
+ - Tested with Unity 6, URP 17.x, HDRP 17.x.
270
+ - Tested with: Claude Sonnet 4.6, GPT-4o.
@@ -0,0 +1,70 @@
1
+ # Example Input — Unity Shader Generator
2
+
3
+ ---
4
+
5
+ ```
6
+ UNITY_VERSION: 6000.0
7
+ RENDER_PIPELINE: urp
8
+ SHADER_TYPE: unlit
9
+ TARGET_PLATFORM: mobile
10
+ DESCRIPTION:
11
+ A holographic scanline effect for a UI panel. The panel should have a semi-transparent
12
+ dark blue tint with horizontal scanlines scrolling upward over time. The scanline
13
+ frequency and scroll speed should be tweakable. A subtle edge glow (brighter at the
14
+ top and bottom edges of the mesh) should be included. No lighting needed.
15
+ Mobile-friendly: ≤2 texture samples, half precision throughout.
16
+ ```
17
+
18
+ ---
19
+
20
+ ## What to Expect
21
+
22
+ The agent produces a complete URP unlit `.shader` file. See [`example-output.md`](example-output.md).
23
+
24
+ Generated file includes:
25
+ - `_TintColor`, `_ScanlineFreq`, `_ScanlineSpeed`, `_ScanlineBright`, `_EdgeGlow`, `_EdgeFalloff` properties
26
+ - URP `HLSLPROGRAM` with correct includes
27
+ - `sin(_Time.y)` for the scanline scroll — no C# scripts needed
28
+ - `half` precision throughout for mobile GPU compatibility
29
+ - Blend mode: `SrcAlpha OneMinusSrcAlpha` for transparency
30
+ - Material setup guide
31
+
32
+ ---
33
+
34
+ ## Variations
35
+
36
+ ### Rim / Fresnel glow (character outline)
37
+ ```
38
+ UNITY_VERSION: 6000.0
39
+ RENDER_PIPELINE: urp
40
+ SHADER_TYPE: lit
41
+ TARGET_PLATFORM: desktop
42
+ DESCRIPTION:
43
+ A rim light / Fresnel glow for a sci-fi character. The character glows at silhouette edges
44
+ where the surface normal faces away from the camera. The glow color and sharpness should
45
+ be tweakable. The base albedo texture should show through. Needs to respond to scene lighting.
46
+ ```
47
+
48
+ ### Dissolve effect
49
+ ```
50
+ UNITY_VERSION: 6000.0
51
+ RENDER_PIPELINE: urp
52
+ SHADER_TYPE: unlit
53
+ TARGET_PLATFORM: mobile
54
+ DESCRIPTION:
55
+ A dissolve effect using a noise texture. A threshold property controls how much of the
56
+ surface is dissolved. Edges of the dissolve should glow with a configurable color and width.
57
+ Uses clip() to discard dissolved fragments. One texture sample for the noise.
58
+ ```
59
+
60
+ ### Water surface
61
+ ```
62
+ UNITY_VERSION: 6000.0
63
+ RENDER_PIPELINE: urp
64
+ SHADER_TYPE: lit
65
+ TARGET_PLATFORM: desktop
66
+ DESCRIPTION:
67
+ A stylized water surface with two scrolling normal maps for wave detail, Fresnel reflection
68
+ at grazing angles, foam at the shoreline (using a depth texture), and an adjustable water
69
+ color. Should respond to directional light.
70
+ ```