@musashishao/agent-kit 1.8.2 → 1.9.1

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 (176) hide show
  1. package/.agent/agents/ai-architect.md +39 -0
  2. package/.agent/agents/ai-asset-factory.md +700 -0
  3. package/.agent/agents/ai-audio-factory.md +503 -0
  4. package/.agent/agents/cloud-engineer.md +39 -0
  5. package/.agent/agents/game-developer.md +190 -89
  6. package/.agent/agents/marketing-specialist.md +41 -0
  7. package/.agent/agents/orchestrator.md +113 -3
  8. package/.agent/agents/penetration-tester.md +15 -1
  9. package/.agent/agents/project-planner.md +67 -0
  10. package/.agent/agents/unity-mobile-master.md +949 -0
  11. package/.agent/mcp/config/registry.json +65 -51
  12. package/.agent/mcp/servers/notebooklm/README.md +114 -0
  13. package/.agent/mcp/servers/notebooklm/package.json +35 -0
  14. package/.agent/mcp/servers/notebooklm/src/auth/chrome.ts +225 -0
  15. package/.agent/mcp/servers/notebooklm/src/auth/index.ts +1 -0
  16. package/.agent/mcp/servers/notebooklm/src/index.ts +516 -0
  17. package/.agent/mcp/servers/notebooklm/src/services/index.ts +3 -0
  18. package/.agent/mcp/servers/notebooklm/src/services/library.ts +217 -0
  19. package/.agent/mcp/servers/notebooklm/src/services/notebooklm.ts +380 -0
  20. package/.agent/mcp/servers/notebooklm/tsconfig.json +15 -0
  21. package/.agent/mcp-gateway/README.md +169 -20
  22. package/.agent/mcp-gateway/package.json +22 -7
  23. package/.agent/mcp-gateway/src/auth/index.ts +55 -0
  24. package/.agent/mcp-gateway/src/auth/middleware.ts +242 -0
  25. package/.agent/mcp-gateway/src/auth/oauth.ts +462 -0
  26. package/.agent/mcp-gateway/src/auth/scopes.ts +227 -0
  27. package/.agent/mcp-gateway/src/index.ts +252 -105
  28. package/.agent/mcp-gateway/src/observability/index.ts +5 -0
  29. package/.agent/mcp-gateway/src/observability/otel.ts +405 -0
  30. package/.agent/mcp-gateway/src/transports/index.ts +5 -0
  31. package/.agent/mcp-gateway/src/transports/streamableHttp.ts +235 -0
  32. package/.agent/rules/CODEX.md +115 -2
  33. package/.agent/rules/CODE_RULES.md +73 -0
  34. package/.agent/rules/GEMINI.md +26 -1
  35. package/.agent/rules/MEMORY_STATE.md +110 -0
  36. package/.agent/rules/REFERENCE.md +40 -58
  37. package/.agent/rules/REF_SKILLS.md +116 -0
  38. package/.agent/rules/REF_WORKFLOWS.md +81 -0
  39. package/.agent/scripts/ak_cli.py +106 -5
  40. package/.agent/scripts/memory_manager.py +48 -9
  41. package/.agent/skills/3d-web-experience/SKILL.md +386 -0
  42. package/.agent/skills/DEPENDENCIES.md +54 -0
  43. package/.agent/skills/ab-test-setup/SKILL.md +77 -0
  44. package/.agent/skills/active-directory-attacks/SKILL.md +59 -0
  45. package/.agent/skills/agent-evaluation/SKILL.md +430 -0
  46. package/.agent/skills/agent-memory-systems/SKILL.md +426 -0
  47. package/.agent/skills/agent-tool-builder/SKILL.md +139 -0
  48. package/.agent/skills/ai-agents-architect/SKILL.md +115 -0
  49. package/.agent/skills/ai-product/SKILL.md +86 -0
  50. package/.agent/skills/ai-wrapper-product/SKILL.md +90 -0
  51. package/.agent/skills/analytics-tracking/SKILL.md +88 -0
  52. package/.agent/skills/anti-hallucination/SKILL.md +295 -0
  53. package/.agent/skills/anti-hallucination/scripts/check_hallucination.py +299 -0
  54. package/.agent/skills/api-fuzzing-bug-bounty/SKILL.md +66 -0
  55. package/.agent/skills/app-store-optimization/SKILL.md +66 -0
  56. package/.agent/skills/autonomous-agent-patterns/SKILL.md +414 -0
  57. package/.agent/skills/aws-penetration-testing/SKILL.md +50 -0
  58. package/.agent/skills/aws-serverless/SKILL.md +327 -0
  59. package/.agent/skills/azure-functions/SKILL.md +340 -0
  60. package/.agent/skills/bifurcation-analysis/SKILL.md +56 -0
  61. package/.agent/skills/brainstorming/SKILL.md +80 -6
  62. package/.agent/skills/broken-authentication/SKILL.md +53 -0
  63. package/.agent/skills/browser-automation/SKILL.md +408 -0
  64. package/.agent/skills/browser-extension-builder/SKILL.md +422 -0
  65. package/.agent/skills/bullmq-specialist/SKILL.md +424 -0
  66. package/.agent/skills/bun-development/SKILL.md +386 -0
  67. package/.agent/skills/burp-suite-testing/SKILL.md +60 -0
  68. package/.agent/skills/clerk-auth/SKILL.md +432 -0
  69. package/.agent/skills/cloud-penetration-testing/SKILL.md +51 -0
  70. package/.agent/skills/copywriting/SKILL.md +66 -0
  71. package/.agent/skills/crewai/SKILL.md +470 -0
  72. package/.agent/skills/decision-memory/SKILL.md +317 -0
  73. package/.agent/skills/discord-bot-architect/SKILL.md +447 -0
  74. package/.agent/skills/email-sequence/SKILL.md +73 -0
  75. package/.agent/skills/emergence-detector/SKILL.md +230 -0
  76. package/.agent/skills/emergence-detector/scripts/check_emergence.py +265 -0
  77. package/.agent/skills/ethical-hacking-methodology/SKILL.md +67 -0
  78. package/.agent/skills/explained-qa/SKILL.md +142 -0
  79. package/.agent/skills/explained-qa/game-terminology.md +214 -0
  80. package/.agent/skills/firebase/SKILL.md +377 -0
  81. package/.agent/skills/game-development/ai-dialogue-engine/SKILL.md +442 -0
  82. package/.agent/skills/game-development/ai-graphics-generator/SKILL.md +463 -0
  83. package/.agent/skills/game-development/ai-playtest-framework/SKILL.md +570 -0
  84. package/.agent/skills/game-development/camera-systems/SKILL.md +607 -0
  85. package/.agent/skills/game-development/card-battle-engine/SKILL.md +618 -0
  86. package/.agent/skills/game-development/character-controller-3d/SKILL.md +908 -0
  87. package/.agent/skills/game-development/cloud-save-sync/SKILL.md +527 -0
  88. package/.agent/skills/game-development/combat-system/SKILL.md +748 -0
  89. package/.agent/skills/game-development/compliance-rating/SKILL.md +277 -0
  90. package/.agent/skills/game-development/crossplatform-build/SKILL.md +386 -0
  91. package/.agent/skills/game-development/cultivation-progression/SKILL.md +520 -0
  92. package/.agent/skills/game-development/data-driven-balance/SKILL.md +535 -0
  93. package/.agent/skills/game-development/game-analytics-integrator/SKILL.md +410 -0
  94. package/.agent/skills/game-development/game-audio-advanced/SKILL.md +646 -0
  95. package/.agent/skills/game-development/game-economy-designer/SKILL.md +375 -0
  96. package/.agent/skills/game-development/game-marketing/SKILL.md +85 -0
  97. package/.agent/skills/game-development/game-state-manager/SKILL.md +883 -0
  98. package/.agent/skills/game-development/godot-expert/SKILL.md +462 -0
  99. package/.agent/skills/game-development/hybrid-game-spec/SKILL.md +220 -0
  100. package/.agent/skills/game-development/inventory-quest/SKILL.md +747 -0
  101. package/.agent/skills/game-development/liveops/SKILL.md +308 -0
  102. package/.agent/skills/game-development/localization/SKILL.md +286 -0
  103. package/.agent/skills/game-development/mobile-input-patterns/SKILL.md +343 -0
  104. package/.agent/skills/game-development/monetization-strategy/SKILL.md +94 -0
  105. package/.agent/skills/game-development/multiplayer-master/SKILL.md +727 -0
  106. package/.agent/skills/game-development/narrative-branching/SKILL.md +593 -0
  107. package/.agent/skills/game-development/npc-ai-integration/SKILL.md +110 -0
  108. package/.agent/skills/game-development/procedural-generation/SKILL.md +168 -0
  109. package/.agent/skills/game-development/procedural-level-ai/SKILL.md +367 -0
  110. package/.agent/skills/game-development/prototyping-rapid/SKILL.md +205 -0
  111. package/.agent/skills/game-development/spec-ecosystem/SKILL.md +155 -0
  112. package/.agent/skills/game-development/spec-ecosystem/decision-log-format.md +129 -0
  113. package/.agent/skills/game-development/spec-ecosystem/templates/PLAN-template.md +178 -0
  114. package/.agent/skills/game-development/spec-ecosystem/templates/SPEC-template.md +110 -0
  115. package/.agent/skills/game-development/spec-ecosystem/templates/TASKS-template.md +156 -0
  116. package/.agent/skills/game-development/survival-systems/SKILL.md +493 -0
  117. package/.agent/skills/game-development/testing-qa/SKILL.md +270 -0
  118. package/.agent/skills/game-development/unity-integration/SKILL.md +358 -0
  119. package/.agent/skills/game-development/unity-mobile-optimization/SKILL.md +271 -0
  120. package/.agent/skills/game-development/webgpu-shading/SKILL.md +209 -0
  121. package/.agent/skills/gcp-cloud-run/SKILL.md +358 -0
  122. package/.agent/skills/graphql/SKILL.md +492 -0
  123. package/.agent/skills/idor-testing/SKILL.md +64 -0
  124. package/.agent/skills/inngest/SKILL.md +128 -0
  125. package/.agent/skills/intent-capture/SKILL.md +65 -0
  126. package/.agent/skills/langfuse/SKILL.md +415 -0
  127. package/.agent/skills/langgraph/SKILL.md +360 -0
  128. package/.agent/skills/launch-strategy/SKILL.md +68 -0
  129. package/.agent/skills/linux-privilege-escalation/SKILL.md +62 -0
  130. package/.agent/skills/llm-app-patterns/SKILL.md +367 -0
  131. package/.agent/skills/marketing-ideas/SKILL.md +66 -0
  132. package/.agent/skills/mcp-composition/SKILL.md +362 -0
  133. package/.agent/skills/mcp-observability/SKILL.md +323 -0
  134. package/.agent/skills/mcp-security/SKILL.md +314 -0
  135. package/.agent/skills/metasploit-framework/SKILL.md +60 -0
  136. package/.agent/skills/micro-saas-launcher/SKILL.md +93 -0
  137. package/.agent/skills/neon-postgres/SKILL.md +339 -0
  138. package/.agent/skills/paid-ads/SKILL.md +64 -0
  139. package/.agent/skills/supabase-integration/SKILL.md +411 -0
  140. package/.agent/skills/trust-spectrum/SKILL.md +291 -0
  141. package/.agent/skills/vibe-coding-guard/SKILL.md +328 -0
  142. package/.agent/templates/AGENTS.game.md +63 -0
  143. package/.agent/templates/docs/WORKFLOW_GUIDE.en.md +100 -0
  144. package/.agent/templates/docs/WORKFLOW_GUIDE.vi.md +100 -0
  145. package/.agent/workflows/ai-agent.md +38 -0
  146. package/.agent/workflows/autofix.md +1 -0
  147. package/.agent/workflows/brainstorm.md +1 -0
  148. package/.agent/workflows/context.md +1 -0
  149. package/.agent/workflows/create.md +39 -8
  150. package/.agent/workflows/dashboard.md +1 -0
  151. package/.agent/workflows/debug.md +14 -0
  152. package/.agent/workflows/deploy.md +14 -0
  153. package/.agent/workflows/enhance.md +44 -0
  154. package/.agent/workflows/gamekit-init.md +177 -0
  155. package/.agent/workflows/gamekit-launch.md +338 -0
  156. package/.agent/workflows/gamekit-plan.md +204 -0
  157. package/.agent/workflows/gamekit-qa.md +153 -0
  158. package/.agent/workflows/gamekit-spec.md +243 -0
  159. package/.agent/workflows/gamekit-tasks.md +208 -0
  160. package/.agent/workflows/marketing.md +39 -0
  161. package/.agent/workflows/next.md +1 -0
  162. package/.agent/workflows/orchestrate.md +12 -0
  163. package/.agent/workflows/pentest.md +39 -0
  164. package/.agent/workflows/plan.md +42 -0
  165. package/.agent/workflows/preview.md +1 -0
  166. package/.agent/workflows/quality.md +1 -0
  167. package/.agent/workflows/saas.md +38 -0
  168. package/.agent/workflows/spec.md +42 -0
  169. package/.agent/workflows/status.md +1 -0
  170. package/.agent/workflows/test.md +14 -0
  171. package/.agent/workflows/ui-ux-pro-max.md +1 -0
  172. package/README.md +4 -4
  173. package/bin/cli.js +411 -111
  174. package/package.json +1 -2
  175. package/docs/AI_DATA_INFRASTRUCTURE.md +0 -288
  176. package/docs/CHANGELOG_AI_INFRA.md +0 -111
@@ -0,0 +1,277 @@
1
+ ---
2
+ name: compliance-rating
3
+ description: Age rating, legal compliance, and store policies for game publishing. IARC, ESRB, PEGI, COPPA, GDPR, and platform-specific requirements for iOS and Android.
4
+ ---
5
+
6
+ # Game Compliance & Rating Skill
7
+
8
+ > **Purpose**: Navigate legal requirements and store policies for game publishing.
9
+
10
+ ## When to Use
11
+ - Preparing for store submission
12
+ - Implementing age-appropriate content
13
+ - Handling player data
14
+ - Disclosing monetization practices
15
+
16
+ ---
17
+
18
+ ## 1. Age Rating Systems
19
+
20
+ ### Major Rating Bodies
21
+ | System | Region | Ages |
22
+ |--------|--------|------|
23
+ | **IARC** | Global (Mobile) | 3, 7, 12, 16, 18 |
24
+ | **ESRB** | North America | E, E10+, T, M, AO |
25
+ | **PEGI** | Europe | 3, 7, 12, 16, 18 |
26
+ | **CERO** | Japan | A, B, C, D, Z |
27
+ | **ACB** | Australia | G, PG, M, MA15+ |
28
+
29
+ ### IARC Questionnaire Topics
30
+ 1. **Violence** - Type and intensity
31
+ 2. **Fear** - Scary content
32
+ 3. **Sexuality** - Sexual content/themes
33
+ 4. **Language** - Profanity
34
+ 5. **Drugs** - Drug/alcohol references
35
+ 6. **Gambling** - Real/simulated gambling
36
+ 7. **User Interaction** - Online features
37
+ 8. **In-App Purchases** - Monetization
38
+
39
+ ### Rating Questionnaire Tips
40
+ - Answer based on **all possible content**
41
+ - Include user-generated content if applicable
42
+ - Consider worst-case scenarios
43
+ - Re-rate when adding mature content
44
+
45
+ ---
46
+
47
+ ## 2. COPPA Compliance (Kids' Games)
48
+
49
+ ### What is COPPA?
50
+ > Children's Online Privacy Protection Act (USA)
51
+ > Applies to games targeting children under 13
52
+
53
+ ### COPPA Requirements
54
+ | Requirement | Implementation |
55
+ |-------------|----------------|
56
+ | **Parental Consent** | Before collecting any data |
57
+ | **Data Minimization** | Collect only what's necessary |
58
+ | **No Behavioral Ads** | Use contextual ads only |
59
+ | **Delete on Request** | Provide data deletion |
60
+
61
+ ### COPPA Checklist
62
+ - [ ] No personal data collection without consent
63
+ - [ ] Age gate at app start
64
+ - [ ] No targeted advertising
65
+ - [ ] No social features without parental approval
66
+ - [ ] Privacy policy for children
67
+ - [ ] COPPA-approved ad networks only
68
+
69
+ ### COPPA-Safe Analytics
70
+ ```csharp
71
+ // Firebase Analytics for kids apps
72
+ FirebaseAnalytics.SetAnalyticsCollectionEnabled(false);
73
+ // Use aggregate analytics only
74
+ ```
75
+
76
+ ---
77
+
78
+ ## 3. GDPR Compliance (EU)
79
+
80
+ ### GDPR Requirements
81
+ | Right | Implementation |
82
+ |-------|----------------|
83
+ | **Right to Access** | Export player data |
84
+ | **Right to Deletion** | Delete all player data |
85
+ | **Right to Consent** | Clear opt-in for data |
86
+ | **Right to Portability** | Data in readable format |
87
+
88
+ ### Consent Flow
89
+ ```csharp
90
+ public class GDPRConsentManager : MonoBehaviour
91
+ {
92
+ public void ShowConsentDialog()
93
+ {
94
+ // Show UI with:
95
+ // - What data is collected
96
+ // - Why it's collected
97
+ // - Who receives it
98
+ // - How to withdraw consent
99
+ }
100
+
101
+ public void SetConsent(bool analytics, bool ads, bool crashReporting)
102
+ {
103
+ PlayerPrefs.SetInt("consent_analytics", analytics ? 1 : 0);
104
+ PlayerPrefs.SetInt("consent_ads", ads ? 1 : 0);
105
+ PlayerPrefs.SetInt("consent_crash", crashReporting ? 1 : 0);
106
+
107
+ // Apply settings
108
+ FirebaseAnalytics.SetAnalyticsCollectionEnabled(analytics);
109
+ }
110
+ }
111
+ ```
112
+
113
+ ### Privacy Policy Requirements
114
+ - [ ] What data is collected
115
+ - [ ] Purpose of collection
116
+ - [ ] Third parties receiving data
117
+ - [ ] Data retention period
118
+ - [ ] Contact for data requests
119
+ - [ ] Last updated date
120
+
121
+ ---
122
+
123
+ ## 4. Loot Box / Gacha Disclosure
124
+
125
+ ### Disclosure Requirements by Region
126
+ | Region | Requirement |
127
+ |--------|-------------|
128
+ | **China** | Publish exact drop rates |
129
+ | **Japan** | Publish rates + no kompu gacha |
130
+ | **Belgium** | Banned (considered gambling) |
131
+ | **Netherlands** | Banned in some cases |
132
+ | **Apple (Global)** | Disclose rates before purchase |
133
+ | **Google (Global)** | Disclose rates before purchase |
134
+
135
+ ### Implementation
136
+ ```csharp
137
+ // Display before purchase
138
+ public class GachaDisclosure : MonoBehaviour
139
+ {
140
+ [System.Serializable]
141
+ public struct DropRate
142
+ {
143
+ public string itemName;
144
+ public float percentage;
145
+ }
146
+
147
+ [SerializeField] private DropRate[] _rates;
148
+
149
+ public void ShowDropRates()
150
+ {
151
+ // Display UI with all rates
152
+ // Total must equal 100%
153
+ // Show before ANY purchase
154
+ }
155
+ }
156
+ ```
157
+
158
+ ### Gacha Compliance Checklist
159
+ - [ ] Display drop rates before purchase
160
+ - [ ] Rates are accurate and complete
161
+ - [ ] No psychological manipulation (pity timers must be disclosed)
162
+ - [ ] Minors cannot purchase without parental consent
163
+
164
+ ---
165
+
166
+ ## 5. Apple App Store Policies
167
+
168
+ ### Key Requirements
169
+ | Policy | Detail |
170
+ |--------|--------|
171
+ | **IAP Requirement** | All digital purchases via Apple IAP |
172
+ | **Subscription Disclosure** | Clear pricing and renewal terms |
173
+ | **Privacy Labels** | App Store privacy questionnaire |
174
+ | **Sign in with Apple** | Required if social login exists |
175
+ | **Health Claims** | No unverified health claims |
176
+
177
+ ### Apple Rejection Reasons (Games)
178
+ 1. **Incomplete metadata** - Missing screenshots/descriptions
179
+ 2. **Placeholder content** - Lorem ipsum, "coming soon"
180
+ 3. **Crashes** - Crashes during review
181
+ 4. **Broken functionality** - Features don't work
182
+ 5. **Privacy violations** - Undisclosed data collection
183
+
184
+ ---
185
+
186
+ ## 6. Google Play Policies
187
+
188
+ ### Key Requirements
189
+ | Policy | Detail |
190
+ |--------|--------|
191
+ | **Target API Level** | Must meet current requirements |
192
+ | **Data Safety Section** | Declare all data collection |
193
+ | **Family Policy** | Extra requirements for kids apps |
194
+ | **Real Money Gambling** | Restricted by region |
195
+ | **Subscription Transparency** | Clear cancellation flow |
196
+
197
+ ### Google Play Data Safety Questionnaire
198
+ - [ ] Data collected (location, contacts, etc.)
199
+ - [ ] Data shared with third parties
200
+ - [ ] Data encryption in transit
201
+ - [ ] Data deletion available
202
+ - [ ] Independent security review (optional)
203
+
204
+ ---
205
+
206
+ ## 7. Mobile Ads Compliance
207
+
208
+ ### Ad Content Guidelines
209
+ | Allowed | Prohibited |
210
+ |---------|------------|
211
+ | Interstitial with clear X | Auto-click ads |
212
+ | Rewarded video | Deceptive close buttons |
213
+ | Banner (non-obstructive) | Inappropriate for rating |
214
+ | Skip after 5s | Unskippable >30s |
215
+
216
+ ### Ad Implementation Checklist
217
+ - [ ] Clear close button (not hidden)
218
+ - [ ] No ads during gameplay without pause
219
+ - [ ] No incentivized installs
220
+ - [ ] No adult ads in kids games
221
+ - [ ] Frequency caps respected
222
+
223
+ ---
224
+
225
+ ## Compliance Checklist Template
226
+
227
+ ```markdown
228
+ ## Pre-Submission Compliance: [Game Name]
229
+
230
+ ### Age Rating
231
+ - [ ] IARC questionnaire completed
232
+ - [ ] Content descriptors accurate
233
+ - [ ] Rating displayed in-game
234
+
235
+ ### Privacy
236
+ - [ ] Privacy policy URL in store listing
237
+ - [ ] Privacy policy URL in-game settings
238
+ - [ ] GDPR consent dialog (EU)
239
+ - [ ] Data deletion request method
240
+
241
+ ### Monetization
242
+ - [ ] IAP through official store
243
+ - [ ] Drop rates disclosed (gacha)
244
+ - [ ] Subscription terms clear
245
+
246
+ ### Platform-Specific
247
+ - [ ] Apple: Privacy labels complete
248
+ - [ ] Apple: Sign in with Apple (if social login)
249
+ - [ ] Google: Data safety section complete
250
+ - [ ] Google: Target API level met
251
+
252
+ ### Child Safety (if applicable)
253
+ - [ ] COPPA compliant
254
+ - [ ] Age gate implemented
255
+ - [ ] No targeted ads
256
+ ```
257
+
258
+ ---
259
+
260
+ ## Anti-Patterns
261
+
262
+ | ❌ Don't | ✅ Do |
263
+ |----------|-------|
264
+ | Hide drop rates | Disclose before purchase |
265
+ | Collect data without consent | Ask permission first |
266
+ | Ignore regional laws | Research per market |
267
+ | Use deceptive ads | Clear close buttons |
268
+ | Skip privacy policy | Maintain up-to-date policy |
269
+
270
+ ---
271
+
272
+ ## Related Skills
273
+ - `game-development/game-economy-designer`
274
+ - `game-development/liveops`
275
+
276
+ ## Related Workflows
277
+ - `/game-launch` - Phase 1 includes compliance review
@@ -0,0 +1,386 @@
1
+ ---
2
+ name: crossplatform-build
3
+ description: Multi-platform build management for games. Unity Addressables, platform-specific code, CI/CD pipelines, build size optimization, and conditional compilation patterns.
4
+ ---
5
+
6
+ # Cross-Platform Build Skill
7
+
8
+ > **Purpose**: Ship your game to multiple platforms efficiently.
9
+
10
+ ## When to Use
11
+ - Setting up multi-platform project
12
+ - Optimizing platform-specific builds
13
+ - Configuring CI/CD for game builds
14
+ - Managing platform-specific code
15
+
16
+ ---
17
+
18
+ ## 1. Platform-Specific Code Patterns
19
+
20
+ ### Preprocessor Directives
21
+ ```csharp
22
+ public class PlatformManager : MonoBehaviour
23
+ {
24
+ public void Initialize()
25
+ {
26
+ #if UNITY_IOS
27
+ InitializeIOS();
28
+ #elif UNITY_ANDROID
29
+ InitializeAndroid();
30
+ #elif UNITY_WEBGL
31
+ InitializeWebGL();
32
+ #elif UNITY_STANDALONE_WIN
33
+ InitializeWindows();
34
+ #elif UNITY_STANDALONE_OSX
35
+ InitializeMac();
36
+ #else
37
+ InitializeDefault();
38
+ #endif
39
+ }
40
+
41
+ #if UNITY_IOS
42
+ private void InitializeIOS()
43
+ {
44
+ // iOS-specific: Haptics, Game Center, etc.
45
+ Application.targetFrameRate = 60;
46
+ }
47
+ #endif
48
+
49
+ #if UNITY_ANDROID
50
+ private void InitializeAndroid()
51
+ {
52
+ // Android-specific: Vibration, Play Games, etc.
53
+ Screen.sleepTimeout = SleepTimeout.NeverSleep;
54
+ }
55
+ #endif
56
+ }
57
+ ```
58
+
59
+ ### Available Platform Defines
60
+ | Define | Platform |
61
+ |--------|----------|
62
+ | `UNITY_IOS` | iOS |
63
+ | `UNITY_ANDROID` | Android |
64
+ | `UNITY_WEBGL` | WebGL |
65
+ | `UNITY_STANDALONE_WIN` | Windows |
66
+ | `UNITY_STANDALONE_OSX` | macOS |
67
+ | `UNITY_STANDALONE_LINUX` | Linux |
68
+ | `UNITY_EDITOR` | Unity Editor |
69
+
70
+ ---
71
+
72
+ ## 2. Addressables for Platform Assets
73
+
74
+ ### Why Addressables?
75
+ | Without Addressables | With Addressables |
76
+ |---------------------|-------------------|
77
+ | All assets in build | Load on demand |
78
+ | Large initial download | Smaller install size |
79
+ | Same assets all platforms | Platform-specific variants |
80
+
81
+ ### Platform-Specific Asset Labels
82
+ ```csharp
83
+ // In Addressables Groups settings
84
+ // Label assets: "ios", "android", "hd", "sd"
85
+
86
+ public class AssetLoader : MonoBehaviour
87
+ {
88
+ public async void LoadPlatformAsset(string key)
89
+ {
90
+ string label = GetPlatformLabel();
91
+
92
+ var handle = Addressables.LoadAssetAsync<GameObject>(key, label);
93
+ var asset = await handle.Task;
94
+ Instantiate(asset);
95
+ }
96
+
97
+ private string GetPlatformLabel()
98
+ {
99
+ #if UNITY_IOS
100
+ return "ios";
101
+ #elif UNITY_ANDROID
102
+ return "android";
103
+ #else
104
+ return "default";
105
+ #endif
106
+ }
107
+ }
108
+ ```
109
+
110
+ ### Addressables Group Strategy
111
+ ```
112
+ Groups/
113
+ ├── Core/ # Always included in build
114
+ │ ├── Player.prefab
115
+ │ ├── UI.prefab
116
+ │ └── Audio.bundle
117
+ ├── Levels/ # Loaded per level
118
+ │ ├── Level_01.bundle
119
+ │ └── Level_02.bundle
120
+ ├── HD-Assets/ # Label: "hd" (tablets, high-end)
121
+ │ └── Textures_HD.bundle
122
+ └── SD-Assets/ # Label: "sd" (phones, low-end)
123
+ └── Textures_SD.bundle
124
+ ```
125
+
126
+ ---
127
+
128
+ ## 3. Build Size Optimization
129
+
130
+ ### Size Reduction Strategies
131
+ | Strategy | Savings |
132
+ |----------|---------|
133
+ | **Strip Unused Code** | 20-40% |
134
+ | **Compress Textures** | 50-70% |
135
+ | **Use Addressables** | 30-50% initial |
136
+ | **Audio Compression** | 60-80% |
137
+ | **Font Subsetting** | 80-90% |
138
+
139
+ ### Texture Settings by Platform
140
+ ```csharp
141
+ // Editor/PlatformTextureSettings.cs
142
+ using UnityEditor;
143
+
144
+ public class PlatformTextureSettings : AssetPostprocessor
145
+ {
146
+ void OnPreprocessTexture()
147
+ {
148
+ TextureImporter importer = (TextureImporter)assetImporter;
149
+
150
+ // iOS: ASTC
151
+ var iosSettings = new TextureImporterPlatformSettings
152
+ {
153
+ name = "iPhone",
154
+ overridden = true,
155
+ format = TextureImporterFormat.ASTC_6x6,
156
+ maxTextureSize = 1024
157
+ };
158
+ importer.SetPlatformTextureSettings(iosSettings);
159
+
160
+ // Android: ETC2
161
+ var androidSettings = new TextureImporterPlatformSettings
162
+ {
163
+ name = "Android",
164
+ overridden = true,
165
+ format = TextureImporterFormat.ETC2_RGBA8,
166
+ maxTextureSize = 1024
167
+ };
168
+ importer.SetPlatformTextureSettings(androidSettings);
169
+ }
170
+ }
171
+ ```
172
+
173
+ ### Build Report Analysis
174
+ ```csharp
175
+ // After build, check Editor.log for:
176
+ // "Used Assets and files from the Resources folder"
177
+ // Sort by size to identify optimization targets
178
+ ```
179
+
180
+ ---
181
+
182
+ ## 4. CI/CD Pipeline
183
+
184
+ ### GitHub Actions for Unity
185
+ ```yaml
186
+ # .github/workflows/build.yml
187
+ name: Build Game
188
+
189
+ on:
190
+ push:
191
+ branches: [main]
192
+ pull_request:
193
+ branches: [main]
194
+
195
+ jobs:
196
+ build-android:
197
+ runs-on: ubuntu-latest
198
+ steps:
199
+ - uses: actions/checkout@v4
200
+ with:
201
+ lfs: true
202
+
203
+ - uses: game-ci/unity-builder@v4
204
+ env:
205
+ UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
206
+ with:
207
+ targetPlatform: Android
208
+ androidAppBundle: true
209
+ androidKeystoreName: release.keystore
210
+ androidKeystoreBase64: ${{ secrets.KEYSTORE_BASE64 }}
211
+ androidKeystorePass: ${{ secrets.KEYSTORE_PASS }}
212
+ androidKeyaliasName: ${{ secrets.KEY_ALIAS }}
213
+ androidKeyaliasPass: ${{ secrets.KEY_ALIAS_PASS }}
214
+
215
+ - uses: actions/upload-artifact@v4
216
+ with:
217
+ name: android-build
218
+ path: build/Android
219
+
220
+ build-ios:
221
+ runs-on: macos-latest
222
+ steps:
223
+ - uses: actions/checkout@v4
224
+ with:
225
+ lfs: true
226
+
227
+ - uses: game-ci/unity-builder@v4
228
+ env:
229
+ UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
230
+ with:
231
+ targetPlatform: iOS
232
+
233
+ - uses: actions/upload-artifact@v4
234
+ with:
235
+ name: ios-build
236
+ path: build/iOS
237
+ ```
238
+
239
+ ### Codemagic for Mobile Games
240
+ ```yaml
241
+ # codemagic.yaml
242
+ workflows:
243
+ unity-android:
244
+ name: Android Build
245
+ environment:
246
+ unity: 2022.3.x
247
+ groups:
248
+ - unity_credentials
249
+ - android_signing
250
+ scripts:
251
+ - name: Build Android
252
+ script: |
253
+ $UNITY_HOME/Contents/MacOS/Unity -batchmode -quit \
254
+ -projectPath . \
255
+ -executeMethod BuildPipeline.BuildAndroidProd \
256
+ -buildTarget Android
257
+ artifacts:
258
+ - build/**/*.aab
259
+ publishing:
260
+ google_play:
261
+ credentials: $GPLAY_CREDENTIALS
262
+ track: internal
263
+ ```
264
+
265
+ ---
266
+
267
+ ## 5. Platform-Specific Plugins
268
+
269
+ ### Plugin Organization
270
+ ```
271
+ Assets/Plugins/
272
+ ├── iOS/
273
+ │ ├── GameCenter.framework
274
+ │ └── Haptics.mm
275
+ ├── Android/
276
+ │ ├── libs/
277
+ │ └── AndroidManifest.xml
278
+ └── Shared/
279
+ └── NativePlugin.cs
280
+ ```
281
+
282
+ ### Native Plugin Bridge
283
+ ```csharp
284
+ public static class NativeHaptics
285
+ {
286
+ public static void Vibrate(float intensity)
287
+ {
288
+ #if UNITY_IOS && !UNITY_EDITOR
289
+ iOSVibrate(intensity);
290
+ #elif UNITY_ANDROID && !UNITY_EDITOR
291
+ AndroidVibrate(intensity);
292
+ #endif
293
+ }
294
+
295
+ #if UNITY_IOS
296
+ [DllImport("__Internal")]
297
+ private static extern void iOSVibrate(float intensity);
298
+ #endif
299
+
300
+ #if UNITY_ANDROID
301
+ private static void AndroidVibrate(float intensity)
302
+ {
303
+ using var vibrator = new AndroidJavaObject("android.os.Vibrator");
304
+ // Android vibration logic
305
+ }
306
+ #endif
307
+ }
308
+ ```
309
+
310
+ ---
311
+
312
+ ## 6. Build Configuration Matrix
313
+
314
+ ### Per-Platform Settings
315
+ | Setting | iOS | Android | WebGL |
316
+ |---------|-----|---------|-------|
317
+ | **Scripting Backend** | IL2CPP | IL2CPP | IL2CPP |
318
+ | **Architecture** | ARM64 | ARM64 | WASM |
319
+ | **API Level** | Latest | API 24+ | N/A |
320
+ | **Stripping** | High | Medium | Low |
321
+ | **Compression** | LZ4HC | LZ4 | Brotli |
322
+
323
+ ### Player Settings Script
324
+ ```csharp
325
+ // Editor/BuildConfiguration.cs
326
+ public static class BuildConfiguration
327
+ {
328
+ [MenuItem("Build/Configure Android")]
329
+ public static void ConfigureAndroid()
330
+ {
331
+ PlayerSettings.Android.minSdkVersion = AndroidSdkVersions.AndroidApiLevel24;
332
+ PlayerSettings.Android.targetSdkVersion = AndroidSdkVersions.AndroidApiLevel34;
333
+ PlayerSettings.SetScriptingBackend(BuildTargetGroup.Android, ScriptingImplementation.IL2CPP);
334
+ PlayerSettings.Android.targetArchitectures = AndroidArchitecture.ARM64;
335
+ EditorUserBuildSettings.androidBuildType = AndroidBuildType.Release;
336
+ }
337
+
338
+ [MenuItem("Build/Configure iOS")]
339
+ public static void ConfigureiOS()
340
+ {
341
+ PlayerSettings.iOS.targetOSVersionString = "13.0";
342
+ PlayerSettings.SetScriptingBackend(BuildTargetGroup.iOS, ScriptingImplementation.IL2CPP);
343
+ PlayerSettings.iOS.appleEnableAutomaticSigning = true;
344
+ }
345
+ }
346
+ ```
347
+
348
+ ---
349
+
350
+ ## 7. Testing Across Platforms
351
+
352
+ ### Test Matrix
353
+ | Test | Editor | Device | Cloud |
354
+ |------|--------|--------|-------|
355
+ | **Unit Tests** | ✅ | ❌ | ✅ |
356
+ | **Play Mode** | ✅ | ❌ | ✅ |
357
+ | **Performance** | ⚠️ | ✅ | ❌ |
358
+ | **Touch Input** | ⚠️ | ✅ | ❌ |
359
+ | **Crash** | ❌ | ✅ | ❌ |
360
+
361
+ ### Device Farm Services
362
+ - **Firebase Test Lab** (Android)
363
+ - **AWS Device Farm** (iOS/Android)
364
+ - **BrowserStack** (Multiple platforms)
365
+
366
+ ---
367
+
368
+ ## Anti-Patterns
369
+
370
+ | ❌ Don't | ✅ Do |
371
+ |----------|-------|
372
+ | Same assets all platforms | Platform-specific variants |
373
+ | Build manually | CI/CD automation |
374
+ | Ignore build size | Monitor and optimize |
375
+ | Platform code in main logic | Isolate platform code |
376
+ | Skip device testing | Test on real devices |
377
+
378
+ ---
379
+
380
+ ## Related Skills
381
+ - `game-development/unity-mobile-optimization`
382
+ - `game-development/unity-integration`
383
+ - `devops-engineer`
384
+
385
+ ## Related Workflows
386
+ - `/game-launch` - Phase 3 is Build & Sign