@aqian0/dsh-unity 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/LICENSE-UNITY-COMPANION.md +122 -0
  3. package/LICENSE.md +31 -0
  4. package/NOTICE.md +90 -0
  5. package/README.md +273 -2
  6. package/cordis.patch.yml +22 -0
  7. package/docs/design.md +297 -0
  8. package/icon.svg +16 -0
  9. package/lib/frontmatter.js +392 -0
  10. package/lib/gating.js +105 -0
  11. package/lib/harness.js +16 -0
  12. package/lib/index.js +171 -0
  13. package/lib/project.js +210 -0
  14. package/lib/registry.js +268 -0
  15. package/lib/requirements.js +214 -0
  16. package/lib/skills.js +191 -0
  17. package/lib/types/frontmatter.d.ts +84 -0
  18. package/lib/types/gating.d.ts +80 -0
  19. package/lib/types/harness.d.ts +152 -0
  20. package/lib/types/index.d.ts +75 -0
  21. package/lib/types/project.d.ts +93 -0
  22. package/lib/types/registry.d.ts +96 -0
  23. package/lib/types/requirements.d.ts +67 -0
  24. package/lib/types/skills.d.ts +54 -0
  25. package/lib/types/watch.d.ts +34 -0
  26. package/lib/watch.js +84 -0
  27. package/locale/en.json +6 -0
  28. package/locale/zh.json +6 -0
  29. package/package.json +70 -4
  30. package/skills/2d-pixel-perfect/SKILL.md +208 -0
  31. package/skills/2d-pixel-perfect/references/api-reference.md +81 -0
  32. package/skills/2d-pixel-perfect/references/camera-setup-builtin.cs +40 -0
  33. package/skills/2d-pixel-perfect/references/camera-setup-urp.cs +49 -0
  34. package/skills/2d-pixel-perfect/references/pipeline-detection.cs +50 -0
  35. package/skills/2d-pixel-perfect/references/sprite-settings.cs +37 -0
  36. package/skills/asset-transformer-toolkit/SECURITY.md +15 -0
  37. package/skills/asset-transformer-toolkit/SKILL.md +39 -0
  38. package/skills/asset-transformer-toolkit/references/create-importer.md +121 -0
  39. package/skills/asset-transformer-toolkit/references/lods.md +61 -0
  40. package/skills/asset-transformer-toolkit/references/rule-api.md +154 -0
  41. package/skills/asset-transformer-toolkit/references/ruleblock-api.md +37 -0
  42. package/skills/asset-transformer-toolkit/references/ruleset-api.md +138 -0
  43. package/skills/asset-transformer-toolkit/references/rulesets-and-actions.md +227 -0
  44. package/skills/audio-setup-mixers/SECURITY.md +16 -0
  45. package/skills/audio-setup-mixers/SKILL.md +127 -0
  46. package/skills/audio-setup-mixers/references/api.md +162 -0
  47. package/skills/build-gtk/SECURITY.md +16 -0
  48. package/skills/build-gtk/SKILL.md +200 -0
  49. package/skills/build-gtk/references/api-reference.md +33 -0
  50. package/skills/build-gtk/references/graph-api-gaps.md +96 -0
  51. package/skills/build-gtk/references/runtime-and-visualization.md +191 -0
  52. package/skills/build-gtk/references/state-machine-api.md +270 -0
  53. package/skills/build-gtk/references/where-the-docs-stop.md +49 -0
  54. package/skills/build-live-game/SKILL.md +159 -0
  55. package/skills/build-live-game/references/achievements.md +757 -0
  56. package/skills/build-live-game/references/apis.md +271 -0
  57. package/skills/build-live-game/references/authentication.md +431 -0
  58. package/skills/build-live-game/references/battlepass.md +904 -0
  59. package/skills/build-live-game/references/blueprints-and-samples.md +75 -0
  60. package/skills/build-live-game/references/cloud-code-cloudbehaviours.md +1111 -0
  61. package/skills/build-live-game/references/cloud-code-modules.md +1276 -0
  62. package/skills/build-live-game/references/cloud-code.md +58 -0
  63. package/skills/build-live-game/references/cloud-save.md +464 -0
  64. package/skills/build-live-game/references/deployment.md +231 -0
  65. package/skills/build-live-game/references/orientation.md +30 -0
  66. package/skills/build-live-game/references/player-account.md +821 -0
  67. package/skills/build-live-game/references/remote-config.md +96 -0
  68. package/skills/build-live-game/references/services-overview.md +76 -0
  69. package/skills/build-live-game/references/tooling.md +375 -0
  70. package/skills/build-live-game/references/ugs-cli.md +86 -0
  71. package/skills/craft-game-floors/SECURITY.md +23 -0
  72. package/skills/craft-game-floors/SKILL.md +134 -0
  73. package/skills/craft-game-floors/references/art-direction.md +85 -0
  74. package/skills/craft-game-floors/references/camera-rigs.md +51 -0
  75. package/skills/craft-game-floors/references/character-motion.md +35 -0
  76. package/skills/craft-game-floors/references/game-audio.md +47 -0
  77. package/skills/craft-game-floors/references/game-feel.md +68 -0
  78. package/skills/craft-game-floors/references/game-shell.md +45 -0
  79. package/skills/craft-game-floors/references/live-floor.md +35 -0
  80. package/skills/craft-game-floors/references/placeholder-assets.md +35 -0
  81. package/skills/craft-game-floors/references/scene-lighting.md +52 -0
  82. package/skills/craft-game-floors/references/toon-shading.md +34 -0
  83. package/skills/craft-game-floors/references/vfx.md +40 -0
  84. package/skills/craft-game-floors/references/visual-scorecard.md +43 -0
  85. package/skills/create-2d-physics/SECURITY.md +16 -0
  86. package/skills/create-2d-physics/SKILL.md +128 -0
  87. package/skills/create-2d-physics/references/2d-physics-core.md +155 -0
  88. package/skills/create-2d-physics/references/legacy-2d-physics.md +45 -0
  89. package/skills/create-tile-palette-or-rule-tiles/SKILL.md +95 -0
  90. package/skills/create-tile-palette-or-rule-tiles/references/hexagonalruletile.md +71 -0
  91. package/skills/create-tile-palette-or-rule-tiles/references/palette-create.md +38 -0
  92. package/skills/create-tile-palette-or-rule-tiles/references/ruletile-createempty.md +37 -0
  93. package/skills/create-tile-palette-or-rule-tiles/references/ruletile-createfromsegment.md +219 -0
  94. package/skills/create-tile-palette-or-rule-tiles/references/ruletile.md +95 -0
  95. package/skills/create-tile-palette-or-rule-tiles/scripts/CreatePaletteTemplate.cs +148 -0
  96. package/skills/create-tile-palette-or-rule-tiles/scripts/ManualWorkflowExample.cs +63 -0
  97. package/skills/create-tile-palette-or-rule-tiles/scripts/RuleTileGenerator.cs +61 -0
  98. package/skills/create-tile-palette-or-rule-tiles/scripts/TilemapRuleTileCreateFromSegment.cs +225 -0
  99. package/skills/fix-3d-physics-collisions/SECURITY.md +17 -0
  100. package/skills/fix-3d-physics-collisions/SKILL.md +139 -0
  101. package/skills/fix-3d-physics-collisions/references/collision-checklist.md +80 -0
  102. package/skills/fix-3d-physics-collisions/references/collision-debugger.md +18 -0
  103. package/skills/fix-3d-physics-collisions/references/console-errors-table.md +9 -0
  104. package/skills/fix-3d-physics-collisions/references/kinematic-trigger-facts.md +18 -0
  105. package/skills/fix-3d-physics-collisions/references/other-symptoms.md +29 -0
  106. package/skills/fix-3d-physics-collisions/references/raycast-checklist.md +8 -0
  107. package/skills/fix-3d-physics-collisions/references/topic-map.md +42 -0
  108. package/skills/fix-3d-physics-collisions/references/trigger-checklist.md +9 -0
  109. package/skills/fix-3d-physics-collisions/scripts/CollisionDebugger.cs +561 -0
  110. package/skills/generate-editor-search-query/SECURITY.md +17 -0
  111. package/skills/generate-editor-search-query/SKILL.md +117 -0
  112. package/skills/generate-editor-search-query/references/open-search-window.md +70 -0
  113. package/skills/generate-editor-search-query/references/query-patterns.md +124 -0
  114. package/skills/implement-in-app-purchases/SKILL.md +82 -0
  115. package/skills/implement-in-app-purchases/references/api-details.md +41 -0
  116. package/skills/implement-in-app-purchases/references/api-notes.md +105 -0
  117. package/skills/implement-in-app-purchases/references/codeless-catalog.md +197 -0
  118. package/skills/implement-in-app-purchases/references/convert-adapty.md +270 -0
  119. package/skills/implement-in-app-purchases/references/convert-essentialkit.md +239 -0
  120. package/skills/implement-in-app-purchases/references/convert-revenuecat.md +277 -0
  121. package/skills/implement-in-app-purchases/references/convert-unipay.md +145 -0
  122. package/skills/implement-in-app-purchases/references/migration-v4-to-v5.md +46 -0
  123. package/skills/implement-in-app-purchases/references/path-add-iap-to-new-project.md +197 -0
  124. package/skills/implement-in-app-purchases/references/path-convert-native-google-billing.md +302 -0
  125. package/skills/implement-in-app-purchases/references/path-convert-native-storekit.md +357 -0
  126. package/skills/implement-in-app-purchases/references/path-implement-iap-d2c.md +253 -0
  127. package/skills/implement-in-app-purchases/references/platform-notes.md +55 -0
  128. package/skills/implement-in-app-purchases/references/pre-check.md +207 -0
  129. package/skills/implement-in-app-purchases/references/topic-map.md +46 -0
  130. package/skills/initialize-ai-navigation/SKILL.md +109 -0
  131. package/skills/initialize-ai-navigation/references/navigation-system.md +793 -0
  132. package/skills/initialize-ai-navigation/references/topic-map.md +66 -0
  133. package/skills/levelplay-unity-integration/SKILL.md +122 -0
  134. package/skills/levelplay-unity-integration/references/adding-more-ad-formats.md +15 -0
  135. package/skills/levelplay-unity-integration/references/banner-api.md +927 -0
  136. package/skills/levelplay-unity-integration/references/best-practices.md +604 -0
  137. package/skills/levelplay-unity-integration/references/dependency-resolution.md +94 -0
  138. package/skills/levelplay-unity-integration/references/examples.md +10 -0
  139. package/skills/levelplay-unity-integration/references/ilrd-api.md +337 -0
  140. package/skills/levelplay-unity-integration/references/initialization-api.md +851 -0
  141. package/skills/levelplay-unity-integration/references/interstitial-api.md +907 -0
  142. package/skills/levelplay-unity-integration/references/ios-setup.md +463 -0
  143. package/skills/levelplay-unity-integration/references/migration-sdk-9.md +666 -0
  144. package/skills/levelplay-unity-integration/references/privacy-settings.md +593 -0
  145. package/skills/levelplay-unity-integration/references/production-release-checklist.md +22 -0
  146. package/skills/levelplay-unity-integration/references/rewarded-api.md +918 -0
  147. package/skills/levelplay-unity-integration/references/step-0-new-or-migration.md +8 -0
  148. package/skills/levelplay-unity-integration/references/step-1-verify-environment.md +4 -0
  149. package/skills/levelplay-unity-integration/references/step-10-testing.md +15 -0
  150. package/skills/levelplay-unity-integration/references/step-2-business-goals.md +12 -0
  151. package/skills/levelplay-unity-integration/references/step-3-install-sdk.md +55 -0
  152. package/skills/levelplay-unity-integration/references/step-4-native-dependencies.md +22 -0
  153. package/skills/levelplay-unity-integration/references/step-5-app-key-and-ad-units.md +18 -0
  154. package/skills/levelplay-unity-integration/references/step-6-5-privacy-and-regulation.md +51 -0
  155. package/skills/levelplay-unity-integration/references/step-6-admob-keys.md +16 -0
  156. package/skills/levelplay-unity-integration/references/step-7-initialize.md +50 -0
  157. package/skills/levelplay-unity-integration/references/step-8-ad-unit-strategy.md +16 -0
  158. package/skills/levelplay-unity-integration/references/step-9-implement-ad-units.md +66 -0
  159. package/skills/levelplay-unity-integration/references/testing-and-validation.md +222 -0
  160. package/skills/levelplay-unity-integration/references/troubleshooting.md +99 -0
  161. package/skills/localize-unity-project/SKILL.md +159 -0
  162. package/skills/localize-unity-project/references/api-notes.md +15 -0
  163. package/skills/localize-unity-project/references/cjk-fonts.md +83 -0
  164. package/skills/localize-unity-project/references/docs-map.md +42 -0
  165. package/skills/localize-unity-project/references/documentation-lookup.md +33 -0
  166. package/skills/localize-unity-project/references/locale-switching.md +17 -0
  167. package/skills/localize-unity-project/references/table-completeness-check.md +47 -0
  168. package/skills/localize-unity-project/references/translating-existing-project.md +47 -0
  169. package/skills/localize-unity-project/references/translation-strategy.md +41 -0
  170. package/skills/localize-unity-project/references/troubleshooting.md +12 -0
  171. package/skills/localize-unity-project/scripts/L10nBatchProcessor.cs +191 -0
  172. package/skills/localize-unity-project/scripts/LocalizedFontAsset.cs +18 -0
  173. package/skills/manage-sprite-atlas/SKILL.md +202 -0
  174. package/skills/manage-sprite-atlas/references/addressables-delivery.md +58 -0
  175. package/skills/manage-sprite-atlas/references/advanced-manual-authoring.md +19 -0
  176. package/skills/manage-sprite-atlas/references/api.md +382 -0
  177. package/skills/manage-sprite-atlas/references/best-practices.md +183 -0
  178. package/skills/manage-sprite-atlas/references/common-errors.md +123 -0
  179. package/skills/manage-sprite-atlas/references/complete-workflow.md +61 -0
  180. package/skills/manage-sprite-atlas/references/custom-packing.md +147 -0
  181. package/skills/manage-sprite-atlas/references/delivery-mechanism.md +30 -0
  182. package/skills/manage-sprite-atlas/references/key-requirements.md +21 -0
  183. package/skills/manage-sprite-atlas/references/manual-authoring.md +39 -0
  184. package/skills/manage-sprite-atlas/references/namespaces.md +15 -0
  185. package/skills/manage-sprite-atlas/references/v2-architecture.md +21 -0
  186. package/skills/manage-sprite-atlas/resources/authoringvsruntime.cs +176 -0
  187. package/skills/manage-sprite-atlas/resources/buildaddressablespostprocess.cs +59 -0
  188. package/skills/manage-sprite-atlas/resources/cacheloadedatlases.cs +145 -0
  189. package/skills/manage-sprite-atlas/resources/cleanupbatchoperations.cs +119 -0
  190. package/skills/manage-sprite-atlas/resources/createandconfiguremasteratlas.cs +57 -0
  191. package/skills/manage-sprite-atlas/resources/custompackersetup.cs +88 -0
  192. package/skills/manage-sprite-atlas/resources/deprecatedmethods.cs +142 -0
  193. package/skills/manage-sprite-atlas/resources/dontmodifywithoutsaving.cs +120 -0
  194. package/skills/manage-sprite-atlas/resources/dontpackinruntimebuilds.cs +190 -0
  195. package/skills/manage-sprite-atlas/resources/dontscriptspriteatlasineditor.cs +114 -0
  196. package/skills/manage-sprite-atlas/resources/editorconfiguration.cs +95 -0
  197. package/skills/manage-sprite-atlas/resources/enablespritepacking.cs +172 -0
  198. package/skills/manage-sprite-atlas/resources/gridspritepacker.cs +50 -0
  199. package/skills/manage-sprite-atlas/resources/handlelatebinding.cs +147 -0
  200. package/skills/manage-sprite-atlas/resources/handlenullcases.cs +141 -0
  201. package/skills/manage-sprite-atlas/resources/migratev1tov2.cs +335 -0
  202. package/skills/manage-sprite-atlas/resources/multipagepacker.cs +80 -0
  203. package/skills/manage-sprite-atlas/resources/optimizetexturesettings.cs +191 -0
  204. package/skills/manage-sprite-atlas/resources/packerdebugging.cs +158 -0
  205. package/skills/manage-sprite-atlas/resources/packtransform.cs +51 -0
  206. package/skills/manage-sprite-atlas/resources/platformnames.cs +127 -0
  207. package/skills/manage-sprite-atlas/resources/queryspritesefficiently.cs +222 -0
  208. package/skills/manage-sprite-atlas/resources/registercallbacks.cs +152 -0
  209. package/skills/manage-sprite-atlas/resources/runtimeatlasloader.cs +15 -0
  210. package/skills/manage-sprite-atlas/resources/runtimespriteaccess.cs +19 -0
  211. package/skills/manage-sprite-atlas/resources/savespriteatlasasset.cs +107 -0
  212. package/skills/manage-sprite-atlas/resources/scriptablepacker.cs +81 -0
  213. package/skills/manage-sprite-atlas/resources/setincludeinbuild.cs +164 -0
  214. package/skills/manage-sprite-atlas/resources/sizeoptimizedpacker.cs +88 -0
  215. package/skills/manage-sprite-atlas/resources/spriteatlaslatebinding.cs +123 -0
  216. package/skills/manage-sprite-atlas/resources/spriteatlasprebuildgenerator.cs +219 -0
  217. package/skills/manage-sprite-atlas/resources/spritedata.cs +35 -0
  218. package/skills/manage-sprite-atlas/resources/spritepack.cs +39 -0
  219. package/skills/manage-sprite-atlas/resources/texturedata.cs +15 -0
  220. package/skills/manage-sprite-atlas/resources/updatebuildscripts.cs +357 -0
  221. package/skills/manage-sprite-atlas/resources/updatesettingsconfiguration.cs +135 -0
  222. package/skills/manage-sprite-atlas/resources/usevariantswisely.cs +179 -0
  223. package/skills/manage-sprite-atlas/resources/variantatlas.cs +39 -0
  224. package/skills/migrate-birp-to-urp/SECURITY.md +16 -0
  225. package/skills/migrate-birp-to-urp/SKILL.md +167 -0
  226. package/skills/migrate-birp-to-urp/references/capturing-the-editor.md +66 -0
  227. package/skills/migrate-birp-to-urp/references/complex-shader-situations.md +272 -0
  228. package/skills/migrate-birp-to-urp/references/conversion-and-rendering-triage.md +113 -0
  229. package/skills/migrate-birp-to-urp/references/custom-shader-triage.md +123 -0
  230. package/skills/migrate-birp-to-urp/references/implementation-patterns.md +529 -0
  231. package/skills/migrate-birp-to-urp/references/migration-workflow.md +265 -0
  232. package/skills/migrate-birp-to-urp/references/parity-validation-and-troubleshooting.md +114 -0
  233. package/skills/migrate-birp-to-urp/references/preflight-and-urp-setup.md +195 -0
  234. package/skills/migrate-birp-to-urp/references/quality-settings-map.md +69 -0
  235. package/skills/new-unity-project/SECURITY.md +26 -0
  236. package/skills/new-unity-project/SKILL.md +171 -0
  237. package/skills/new-unity-project/references/checklist.md +18 -0
  238. package/skills/new-unity-project/references/common-mistakes.md +15 -0
  239. package/skills/new-unity-project/references/skill-setup.md +66 -0
  240. package/skills/new-unity-project/references/step-1-concept.md +13 -0
  241. package/skills/new-unity-project/references/step-2-platforms-and-create.md +31 -0
  242. package/skills/new-unity-project/references/step-3-join-and-reconcile.md +16 -0
  243. package/skills/new-unity-project/references/step-4-source-control.md +9 -0
  244. package/skills/new-unity-project/references/step-5-packages.md +18 -0
  245. package/skills/new-unity-project/references/step-6-identity-and-floors.md +20 -0
  246. package/skills/new-unity-project/references/step-7-visual-baseline.md +75 -0
  247. package/skills/new-unity-project/references/step-8-first-commit.md +21 -0
  248. package/skills/new-unity-project/references/step-9-handoff.md +23 -0
  249. package/skills/optimize-audio/SECURITY.md +16 -0
  250. package/skills/optimize-audio/SKILL.md +120 -0
  251. package/skills/optimize-audio/references/diagnostics.md +42 -0
  252. package/skills/optimize-audio/references/troubleshooting.md +41 -0
  253. package/skills/optimize-audio/resources/audio-import-api.md +149 -0
  254. package/skills/optimize-audio/resources/platform-settings.md +48 -0
  255. package/skills/optimize-text-mesh-pro/SKILL.md +181 -0
  256. package/skills/optimize-text-mesh-pro/references/dynamic-atlas-and-profiling.md +28 -0
  257. package/skills/optimize-text-mesh-pro/references/topic-map.md +36 -0
  258. package/skills/optimize-web/SECURITY.md +16 -0
  259. package/skills/optimize-web/SKILL.md +157 -0
  260. package/skills/optimize-web/references/editor-csharp.md +120 -0
  261. package/skills/optimize-web/references/topic-map.md +49 -0
  262. package/skills/optimize-web/references/troubleshooting.md +45 -0
  263. package/skills/optimize-web/references/understand-request.md +19 -0
  264. package/skills/optimize-web/references/web-assets-quality.md +59 -0
  265. package/skills/optimize-web/references/web-player-settings.md +39 -0
  266. package/skills/optimize-web/references/web-profiling-memory.md +71 -0
  267. package/skills/optimize-web/scripts/WebOptimizer.cs +46 -0
  268. package/skills/optimize-web/scripts/toktx-examples.sh +11 -0
  269. package/skills/setup-multiplayer-services/SKILL.md +36 -0
  270. package/skills/setup-multiplayer-services/references/dgs-entrypoint.md +79 -0
  271. package/skills/setup-multiplayer-services/references/entrypoints.md +213 -0
  272. package/skills/setup-multiplayer-services/references/examples.md +33 -0
  273. package/skills/setup-multiplayer-services/references/implementation-fit.md +30 -0
  274. package/skills/setup-multiplayer-services/references/underlying-services.md +11 -0
  275. package/skills/setup-multiplayer-services/references/workflows-prerequisites.md +17 -0
  276. package/skills/setup-vivox-voice-chat/SECURITY.md +16 -0
  277. package/skills/setup-vivox-voice-chat/SKILL.md +166 -0
  278. package/skills/setup-vivox-voice-chat/references/api-reference-lookup.md +28 -0
  279. package/skills/setup-vivox-voice-chat/references/docs-topic-map.md +13 -0
  280. package/skills/setup-vivox-voice-chat/references/events-and-participants.md +79 -0
  281. package/skills/setup-vivox-voice-chat/references/init-and-login.md +92 -0
  282. package/skills/setup-vivox-voice-chat/references/text-chat.md +93 -0
  283. package/skills/setup-vivox-voice-chat/references/troubleshooting.md +47 -0
  284. package/skills/setup-vivox-voice-chat/references/voice-channels.md +92 -0
  285. package/skills/shader-graph-create-custom-node/SKILL.md +25 -0
  286. package/skills/shader-graph-create-custom-node/resources/all_hints.hlsl +182 -0
  287. package/skills/sprite-editor/SECURITY.md +16 -0
  288. package/skills/sprite-editor/SKILL.md +66 -0
  289. package/skills/sprite-editor/references/api_reference.md +151 -0
  290. package/skills/sprite-editor/references/background.md +112 -0
  291. package/skills/sprite-editor/references/templates.md +72 -0
  292. package/skills/sprite-editor/scripts/AutomaticSliceTexture.cs +40 -0
  293. package/skills/sprite-editor/scripts/GenerateNewSpriteRects.cs +200 -0
  294. package/skills/sprite-editor/scripts/GetTextureSourceImageSize.cs +32 -0
  295. package/skills/sprite-editor/scripts/GetTextureToSlice.cs +55 -0
  296. package/skills/sprite-editor/scripts/GridSliceTexture.cs +40 -0
  297. package/skills/sprite-editor/scripts/IsometricSliceTexture.cs +141 -0
  298. package/skills/sprite-editor/scripts/README.md +134 -0
  299. package/skills/sprite-editor/scripts/SetPivotExample.cs +58 -0
  300. package/skills/sprite-editor/scripts/SpriteToPng.cs +88 -0
  301. package/skills/sprite-segment-3x3grid/SKILL.md +177 -0
  302. package/skills/sprite-segment-3x3grid/references/topic-map.md +37 -0
  303. package/skills/sprite-segment-3x3grid/scripts/SpriteGridAnalysis.cs +119 -0
  304. package/skills/ui/SKILL.md +142 -0
  305. package/skills/ui-imgui/SKILL.md +180 -0
  306. package/skills/ui-imgui/references/gui-elements.md +156 -0
  307. package/skills/ui-imgui/references/templates.md +141 -0
  308. package/skills/ui-ugui/SKILL.md +217 -0
  309. package/skills/ui-ugui/references/layout-and-anchors.md +61 -0
  310. package/skills/ui-ugui/references/scrollview-setup.md +29 -0
  311. package/skills/ui-uitk/SKILL.md +229 -0
  312. package/skills/ui-uitk/references/common-issues.md +74 -0
  313. package/skills/ui-uitk/references/custom-elements.md +241 -0
  314. package/skills/ui-uitk/references/painter2d.md +282 -0
  315. package/skills/ui-uitk/references/pointermanipulator-guide.md +94 -0
  316. package/skills/ui-uitk/references/svg-icons.md +136 -0
  317. package/skills/ui-uitk/references/ui-runtime-binding.md +234 -0
  318. package/skills/ui-uitk/references/uss-guide.md +138 -0
  319. package/skills/unity-cli/CHANGELOG.md +524 -0
  320. package/skills/unity-cli/SECURITY.md +68 -0
  321. package/skills/unity-cli/SKILL.md +160 -0
  322. package/skills/unity-cli/references/auth-license-cloud.md +318 -0
  323. package/skills/unity-cli/references/bootstrap-project.md +177 -0
  324. package/skills/unity-cli/references/build-run-test.md +555 -0
  325. package/skills/unity-cli/references/catalog-plugins.md +86 -0
  326. package/skills/unity-cli/references/ci-recipes.md +76 -0
  327. package/skills/unity-cli/references/cloud-automation.md +819 -0
  328. package/skills/unity-cli/references/cloud-workflows.md +19 -0
  329. package/skills/unity-cli/references/collaboration.md +533 -0
  330. package/skills/unity-cli/references/config-hub.md +239 -0
  331. package/skills/unity-cli/references/diagnostics-maintenance.md +718 -0
  332. package/skills/unity-cli/references/docs-workflow.md +179 -0
  333. package/skills/unity-cli/references/editor-targeting.md +29 -0
  334. package/skills/unity-cli/references/editors-install.md +490 -0
  335. package/skills/unity-cli/references/environment-variables.md +42 -0
  336. package/skills/unity-cli/references/exit-codes.md +47 -0
  337. package/skills/unity-cli/references/global-flags.md +32 -0
  338. package/skills/unity-cli/references/integration-advanced.md +1130 -0
  339. package/skills/unity-cli/references/notes.md +20 -0
  340. package/skills/unity-cli/references/notifications.md +39 -0
  341. package/skills/unity-cli/references/playmode-verification-loop.md +279 -0
  342. package/skills/unity-cli/references/projects-templates.md +997 -0
  343. package/skills/unity-cli/references/scene-editing-preflight.md +25 -0
  344. package/skills/unity-cli/references/setup-and-help.md +54 -0
  345. package/skills/unity-cli/references/version-control.md +612 -0
  346. package/skills/unity-package-management/SKILL.md +169 -0
  347. package/skills/unity-package-management/references/discovering-packages.md +66 -0
  348. package/skills/unity-package-management/references/headless-run.md +31 -0
  349. package/skills/unity-package-management/references/installer-script.md +92 -0
  350. package/skills/unity-package-management/references/select-packages.md +126 -0
  351. package/skills/unity-pipeline/SECURITY.md +17 -0
  352. package/skills/unity-pipeline/SKILL.md +205 -0
  353. package/skills/unity-pipeline/references/csharp-eval.md +23 -0
  354. package/skills/unity-pipeline/references/multiplayer-play-mode.md +103 -0
  355. package/skills/urp-postprocessing/SECURITY.md +16 -0
  356. package/skills/urp-postprocessing/SKILL.md +188 -0
  357. package/skills/urp-postprocessing/references/code-templates.md +150 -0
  358. package/skills/urp-postprocessing/references/effect-reference.md +86 -0
  359. package/skills/validate-urp-render-graph-renderer-feature/SKILL.md +92 -0
  360. package/skills/validate-urp-render-graph-renderer-feature/references/validation-checklist.md +179 -0
@@ -0,0 +1,46 @@
1
+ # Unity IAP v4 to v5 Migration Guide
2
+
3
+ ## Table of Contents
4
+
5
+ - [Trigger Phrases](#trigger-phrases)
6
+ - [Procedure](#procedure)
7
+ - [Migration gotchas](#migration-gotchas)
8
+
9
+ ## Trigger Phrases
10
+
11
+ - "Migrate from Unity IAP v4 to v5"
12
+ - "Upgrade Unity IAP to v5"
13
+ - "Update IAP from v4"
14
+ - "Migrate IStoreListener to StoreController"
15
+ - "Replace ConfigurationBuilder with v5 IAP"
16
+ - "Update UnityPurchasing.Initialize to v5"
17
+
18
+ ## Procedure
19
+
20
+ Unity IAP v5 replaces the listener-based `IStoreListener` pattern with `StoreController` events, so every IAP call site changes.
21
+
22
+ 1. Read [Upgrade from IAP v4 to v5](https://docs.unity.com/en-us/iap/upgrade-to-iap-v5.md) in full before changing code. It holds the official v4-to-v5 mapping for initialization, the purchase flow, `ConfigurationBuilder`, entitlement checks, `SubscriptionManager`, receipt validation, platform extensions and Codeless IAP. Reread the matching section whenever a migrated call fails to compile.
23
+ 2. List every v4 call site in the project (`IStoreListener`, `IDetailedStoreListener`, `UnityPurchasing.Initialize`, `ConfigurationBuilder`, `GetExtension<`, `SubscriptionManager`, `product.receipt`, `product.hasReceipt`).
24
+ 3. Migrate each call site using the docs mapping, then check it against the [gotchas](#migration-gotchas) below, because they are the mistakes agents make most often in this migration.
25
+ 4. For a type or member the upgrade page doesn't cover, look it up in the package's `xrefmap.yml` for the installed version.
26
+
27
+ ## Migration gotchas
28
+
29
+ - **Subscribe before `Connect()`.** Pending purchases from a previous session can fire as soon as the store connects. A handler registered later misses them. Initialize in `Awake()` so IAP is ready before other `Start()` methods.
30
+ - **`ProcessPurchase` logic goes in two places.** Put it in `OnPurchasePending` (new purchases) and in `OnPurchasesFetched` (restored and existing purchases), because v4 delivered both through `ProcessPurchase`.
31
+ - **Returning `PurchaseProcessingResult.Pending`** becomes: keep the `PendingOrder` and don't call `ConfirmPurchase` until ready. There is no equivalent of returning `Complete`.
32
+ - **`ConfirmPurchase` takes the `PendingOrder`, not the `Product`.**
33
+ - **`OnPurchaseConfirmed` receives the `Order` base type.** Pattern-match `ConfirmedOrder` against `FailedOrder`, because confirmation can fail.
34
+ - **Ownership checks.** Replace `product.hasReceipt` and `product.receipt == null` with `store.CheckEntitlement(product)` and `OnCheckEntitlement`, because it handles refunds and expiry across platforms. Use a manual `bool` flag only if the user's design needs it.
35
+ - **Subscribe to every failure event and to `OnPurchaseDeferred`.** Missing failure events cause runtime warnings, and missing `OnPurchaseDeferred` silently drops Ask-to-Buy and Google deferred purchases.
36
+ - **Failure property names.** `StoreConnectionFailureDescription` has `.Message`, not `.reason`. `ProductFetchFailed` has `.FailureReason`, not `.Message`.
37
+ - **Platform config moves after `Connect()`.** `SetAppAccountToken`, `SetObfuscatedAccountId`, `SetObfuscatedProfileId` and `canMakePayments` used to be set on `ConfigurationBuilder` before initialization. In v5 they are on the extended services, which exist only after `await store.Connect()`.
38
+ - **`SetApplicationUsername(hash)` becomes `SetAppAccountToken(Guid)`.** It takes a `Guid` that identifies the user's account, not a hash.
39
+ - **Platform events are on the extended services, not `StoreController`.** `OnPromotionalPurchaseIntercepted` and `OnEntitlementRevoked` are on `AppleStoreExtendedPurchaseService`. `OnDeferredPaymentUntilRenewalDate` is on `GooglePlayStoreExtendedPurchaseService` and receives a `DeferredPaymentUntilRenewalDateOrder`, not a `Product`. Null-check the service with `if`, because `?.` doesn't work with `+=`.
40
+ - **`OnEntitlementRevoked` receives one product ID `string`**, not `List<Product>`.
41
+ - **`UpgradeDowngradeSubscription` takes `Order` and `Product` objects** instead of string IDs, and a `GooglePlayReplacementMode`, not the deprecated `GooglePlayProrationMode`.
42
+ - **Apple promotion and intro-price APIs moved, not removed.** `GetIntroductoryPriceDictionary`, `GetProductDetails` and the `StorePromotion` methods are on `AppleStoreExtendedProductService`. `AppleProductMetadata` has no intro-price properties, so use the `SubscriptionInfo` methods instead.
43
+ - **`SubscriptionManager` is replaced** by `order.Info.PurchasedProductInfo`. Subscription info is NOT on `CartItem`. Methods are PascalCase (`IsSubscribed()`) and still return `Result`, so compare with `== Result.True`, not `?? false`.
44
+ - **Receipt validation.** Under StoreKit 2, Apple local validation returns an empty array. Use the Google-only `CrossPlatformValidator(GooglePlayTangle.Data(), Application.identifier)` constructor, and send `order.Info.Apple?.jwsRepresentation` to a server for Apple.
45
+ - **Don't recommend `ProcessPendingOrdersOnPurchasesFetched(false)`.** It restores v4 behavior but loses the v5 re-delivery of unconfirmed purchases.
46
+ - **Codeless:** `CodelessIAPStoreListener.initializationComplete` becomes `CodelessIAPStoreListener.IsInitialized()`.
@@ -0,0 +1,197 @@
1
+ # Add Unity IAP 5 to a Project With No IAP
2
+
3
+ ## Table of Contents
4
+
5
+ - [Step 1 — Package Installation](#step-1--package-installation)
6
+ - [Step 2 — Project Scan](#step-2--project-scan)
7
+ - [Step 3 — Product Discovery](#step-3--product-discovery)
8
+ - [Step 4 — IAPManager Architecture](#step-4--iapmanager-architecture)
9
+ - [Step 5 — Purchase Handling Contract](#step-5--purchase-handling-contract)
10
+ - [Step 6 — Product Type Behavior Rules](#step-6--product-type-behavior-rules)
11
+ - [Step 7 — Cloud Save Integration](#step-7--cloud-save-integration)
12
+ - [Step 8 — UI Integration](#step-8--ui-integration)
13
+ - [Step 9 — Verification Report](#step-9--verification-report)
14
+
15
+ Use this reference when the project has no existing in-app purchase implementation and needs Unity IAP 5 added from scratch.
16
+
17
+ ## Step 1 — Package Installation
18
+
19
+ Check `Packages/manifest.json` for `com.unity.purchasing`:
20
+
21
+ - **If absent:** Install via **Window > Package Manager > Unity Registry > In App Purchasing**. Do not edit `manifest.json` directly unless the user explicitly allows it. Confirm installation before proceeding.
22
+ - **If present but below v5.0:** Instruct the user to upgrade via Package Manager to the latest stable v5 release. Do not proceed until the upgrade is confirmed.
23
+ - **If v5.0+ is already present:** Note the exact version and proceed.
24
+
25
+ Always use the latest stable v5 release unless the user specifies a version. Never downgrade an existing package.
26
+
27
+ ## Step 2 — Project Scan
28
+
29
+ ### 2a — Code scan
30
+
31
+ Search `Assets/**/*.cs` for any existing IAP signals:
32
+
33
+ ```
34
+ ProductType|ProductDefinition|StoreController|IAPButton|CodelessIAP
35
+ ProcessPurchase|PendingOrder|DeferredOrder|ConfirmPurchase|FetchPurchases
36
+ IStoreListener|UnityPurchasing\.Initialize|ConfigurationBuilder
37
+ ```
38
+
39
+ ### 2b — Inventory and economy scan
40
+
41
+ Search `Assets/**/*.cs` for terms that indicate what needs to be credited after purchase:
42
+
43
+ ```
44
+ \bcoins\b|\bgems\b|\blives\b|\binventory\b|\bcurrency\b
45
+ PlayerData|SaveAsync|CloudSave|SaveDataAsync|SaveGame
46
+ Economy
47
+ ```
48
+
49
+ ### 2c — Shop UI scan
50
+
51
+ Search `Assets/**/*.unity`, `*.prefab`, `*.asset` for shop-related GameObjects and scripts:
52
+ ```
53
+ Shop|Store|Purchase|Buy|IAP|Product|Monetiz
54
+ ```
55
+
56
+ Collect: scene names, prefab paths, button component names, and any serialized product ID strings.
57
+
58
+ ## Step 3 — Product Discovery
59
+
60
+ ### If product definitions are already found (from Step 2a/2b/2c)
61
+
62
+ Use them. Confirm types with the user if ambiguous.
63
+
64
+ ### If no product definitions exist
65
+
66
+ **Stop and ask:**
67
+
68
+ > "Please provide the first IAP product ID and type — for example `com.mygame.coins100` as Consumable — and tell me which inventory field, currency, or item should be credited after purchase."
69
+
70
+ - If the user provides only a product ID with no type, **default to Consumable** but state the assumption explicitly before proceeding.
71
+ - Collect all products before writing any code. For each product record: `productId`, `ProductType`, reward target (field name / method name / amount).
72
+
73
+ ## Step 4 — IAPManager Architecture
74
+
75
+ ### Match the project's existing patterns
76
+
77
+ Before generating code:
78
+ - Check whether the project uses MonoBehaviour singletons, ScriptableObject services, or dependency injection.
79
+ - Check the namespace convention used in `Assets/Scripts/`.
80
+ - Prefer the pattern already in use rather than introducing a new one.
81
+
82
+ ### IAPManager responsibilities
83
+
84
+ Create a single `IAPManager` (MonoBehaviour singleton or service, matching project pattern) that:
85
+
86
+ - Holds the `StoreController` instance.
87
+ - Exposes `Buy(string productId)`.
88
+ - Exposes `RestorePurchases()` — **only** if the product list contains `NonConsumable` or `Subscription` types.
89
+ - Fires UI-friendly events or callbacks for: `OnInitialized`, `OnProductsLoaded`, `OnPurchaseSuccess`, `OnPurchaseFailed`, `OnPurchaseDeferred`.
90
+ - Initializes once in `Awake()` — see **Core rules > Initialization** in the parent skill file for the event subscription and `Connect()` ordering rules.
91
+ - Registers all products from a single authoritative product list (not scattered across UI handlers).
92
+
93
+ ### Product catalog
94
+
95
+ Define products in one place, never inside button click handlers, so IDs can't drift between the shop UI and the store. By default, use a static class that holds the product ID constants and builds the `List<ProductDefinition>` passed to `FetchProducts()`. Use a `ScriptableObject` instead only if the project already configures game data through ScriptableObjects, or the user wants designers to edit products in the Inspector. Wire button click handlers to `IAPManager.Buy(productId)` using those constants, not hardcoded strings.
96
+
97
+ ## Step 5 — Purchase Handling Contract
98
+
99
+ For API mechanics (two-step flow, event names, `ConfirmPurchase` signature) read the [Purchases](https://docs.unity.com/en-us/iap/purchases.md) page and **Core rules > Purchases** in the parent skill file. This section covers only the grant-and-save contract that is specific to this path.
100
+
101
+ ### PendingOrder — the save-before-confirm rule
102
+
103
+ ```
104
+ OnPurchasePending fires
105
+ → grant reward to inventory / currency / entitlement
106
+ → save player data (see Cloud Save Integration below)
107
+ → ONLY IF save succeeds: call ConfirmPurchase(pendingOrder)
108
+ → IF save fails: do NOT confirm — store will re-deliver on next launch
109
+ ```
110
+
111
+ Never call `ConfirmPurchase` before the save completes. An unconfirmed purchase is safe — it re-delivers. A confirmed purchase that was never saved is a lost reward.
112
+
113
+ ### Duplicate grant prevention
114
+
115
+ `OnPurchasePending` may fire more than once for the same purchase (app restart before confirmation). Track processed order IDs (e.g., in Cloud Save or a local ledger) and skip grant if the order ID was already processed.
116
+
117
+ ### DeferredOrder
118
+
119
+ Do not grant anything. Fire `OnPurchaseDeferred` event to update UI ("Purchase pending approval"). Wait for `OnPurchasePending` when the purchase is approved.
120
+
121
+ ### FailedOrder
122
+
123
+ Do not grant anything. Fire `OnPurchaseFailed` with the reason. See **Core rules > Compile errors** in the parent skill file for the correct property names per type.
124
+
125
+ ## Step 6 — Product Type Behavior Rules
126
+
127
+ ### Consumable
128
+
129
+ - Credit inventory or currency after purchase.
130
+ - Persist the credited state in save data before confirming.
131
+ - **Do not restore** old consumable orders — confirmed consumables are not returned by `FetchPurchases` and must not be re-granted.
132
+ - Track consumable grants yourself (order ID ledger in Cloud Save or local save).
133
+
134
+ ### NonConsumable
135
+
136
+ - Unlock a durable entitlement (feature flag, item ownership).
137
+ - Include `RestorePurchases()` — required on iOS, good practice on Android.
138
+ - Re-apply the entitlement on app startup: call `store.FetchPurchases()` and re-check ownership in `OnPurchasesFetched`, or use `store.CheckEntitlement(product)`. See **Core rules > Ownership and subscriptions** in the parent skill file.
139
+
140
+ ### Subscription
141
+
142
+ - Restore or check subscription state on app startup, not only at purchase time. Subscriptions can expire or be cancelled externally.
143
+ - Use `store.CheckEntitlement(product)` or inspect `OnPurchasesFetched` results to update active/expired/unknown state.
144
+ - See **Core rules > Ownership and subscriptions** in the parent skill file for the correct access path (`order.Info.PurchasedProductInfo`, `IsSubscribed() == Result.True`).
145
+
146
+ ## Step 7 — Cloud Save Integration
147
+
148
+ ### Detect the existing save system first
149
+
150
+ Search for any of these patterns before writing save code:
151
+
152
+ ```
153
+ \.SaveAsync\(\)|CloudSaveService\.Instance
154
+ SaveGame\(|SaveDataAsync\(|PlayerPrefs\.SetInt|JsonUtility\.ToJson|JsonConvert\.Serialize
155
+ ```
156
+
157
+ ### Rules
158
+
159
+ - **Use the existing save abstraction** — do not create a new save system. If the project has more than one, use the one that already stores the currency or inventory the purchase credits, so the grant and the balance are saved together.
160
+ - If no save system exists, use `PlayerPrefs` as the fallback, because it needs no new package or backend, and list it as a follow-up in the report, since `PlayerPrefs` is local to the device and not safe against tampering.
161
+ - Save **must complete before `ConfirmPurchase`** is called (see Step 5).
162
+
163
+ ## Step 8 — UI Integration
164
+
165
+ ### Wiring
166
+
167
+ - Wire existing shop buttons to `IAPManager.Buy(productId)` — do not embed product IDs in button click handlers directly.
168
+ - Subscribe to `IAPManager` events in the shop UI script to drive state changes.
169
+
170
+ ### States to handle in UI
171
+
172
+ | State | Trigger | UI action |
173
+ |---|---|---|
174
+ | Initializing | Before `OnInitialized` | Disable buy buttons or show spinner |
175
+ | Products loaded | `OnProductsLoaded` | Display localized price from `product.metadata.localizedPriceString` |
176
+ | Product unavailable | Product missing from `OnProductsFetched` result | Hide or grey out the button |
177
+ | Purchase pending | `PurchaseProduct()` called | Disable button, show loading state |
178
+ | Purchase deferred | `OnPurchaseDeferred` | Show "pending approval" message |
179
+ | Purchase success | `OnPurchaseSuccess` | Show confirmation, update inventory display |
180
+ | Purchase failed | `OnPurchaseFailed` | Show error message, re-enable button |
181
+
182
+ ### Restore button
183
+
184
+ Add a "Restore Purchases" button **only** if the product list contains `NonConsumable` or `Subscription` products. Required on iOS. Wire to `IAPManager.RestorePurchases()`.
185
+
186
+ ## Step 9 — Verification Report
187
+
188
+ After applying changes, produce a report with these sections:
189
+
190
+ 1. **Files changed** — list with nature of each change
191
+ 2. **Product IDs and types** — final catalog
192
+ 3. **Reward mapping** — product ID → field/method credited
193
+ 4. **Save behavior** — which save method is called, when
194
+ 5. **Restore behavior** — which products are restorable, how
195
+ 6. **Pending / deferred handling** — confirmation of save-before-confirm and deferred UI
196
+ 7. **Duplicate grant prevention** — how order IDs are tracked
197
+ 8. **Manual steps still required** — Unity Editor steps (Receipt Validation Obfuscator if using local Google Play validation), App Store Connect / Play Console product setup, sandbox testing accounts
@@ -0,0 +1,302 @@
1
+ # Convert Native Google Billing to Unity IAP 5
2
+
3
+ Links to other reference files point to files in this `references/` folder. Any other relative paths resolve to the skill directory.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Trigger Phrases](#trigger-phrases)
8
+ - [Important Constraints](#important-constraints)
9
+ - [Step 1 — Pre-Conversion Scan](#step-1--pre-conversion-scan)
10
+ - [Step 2 — Product Classification](#step-2--product-classification)
11
+ - [Step 3 — Migration Report (produce before any edits)](#step-3--migration-report-produce-before-any-edits)
12
+ - [Step 4 — Blocker Detection](#step-4--blocker-detection)
13
+ - [Step 5 — Target Architecture](#step-5--target-architecture)
14
+ - [Step 6 — Migration Phases](#step-6--migration-phases)
15
+ - [Step 7 — Behavior Change Rules](#step-7--behavior-change-rules)
16
+ - [Step 8 — Native → Unity IAP Concept Mapping](#step-8--native--unity-iap-concept-mapping)
17
+ - [Step 9 — Rollback Plan](#step-9--rollback-plan)
18
+ - [Step 10 — Test Checklist](#step-10--test-checklist)
19
+ - [Step 11 — Questions to Ask (only when required)](#step-11--questions-to-ask-only-when-required)
20
+
21
+ Use this reference when the project uses C# → Java/Kotlin AndroidJavaObject calls to Google Play BillingClient and needs to be migrated to `com.unity.purchasing`. Always install the latest stable version.
22
+
23
+ ## Trigger Phrases
24
+
25
+ - "Convert native Google Billing to the latest Unity IAP"
26
+ - "Migrate BillingClient integration to Unity IAP"
27
+ - "Replace AndroidJavaObject Google billing bridge with Unity IAP"
28
+ - "Upgrade custom Google Play Billing to the latest stable version of com.unity.purchasing"
29
+ - "Remove native BillingClient and use Unity IAP"
30
+
31
+ ## Important Constraints
32
+
33
+ - **Do not delete existing native billing files unless explicitly requested.** Always preserve with `#if !USE_UNITY_IAP_V5` guards.
34
+ - **Create the new Unity IAP adapter first**, then mark the old native adapter as deprecated.
35
+ - **Preserve public game-facing APIs** via a compatibility facade so gameplay code does not need large rewrites.
36
+ - **Do not change product IDs.**
37
+ - **Do not change backend validation endpoints** unless the receipt format change makes it unavoidable — document any backend change required.
38
+ - **Do not grant purchases on the client** if the existing project uses server-side validation.
39
+ - **Do not assume all products are consumables.** Detect and classify each product.
40
+ - **Do not assume subscriptions are simple.** Detect base plans, offer tokens, pricing phases, and `SubscriptionOfferDetails`. If found, surface as a migration blocker and let the user choose a path (see Subscription Blocker Options below).
41
+ - **If the project contains RevenueCat, Adapty, or Essential Kit**, stop and notify the user — this skill does not support converting those packages.
42
+ - **If Google-specific features are not cleanly expressible in Unity IAP**, report them as migration blockers rather than silently removing them.
43
+
44
+ ## Step 1 — Pre-Conversion Scan
45
+
46
+ Scan before making any changes. Do not edit files until the migration report is accepted.
47
+
48
+ ### 1a — Unity C# Bridge Patterns
49
+
50
+ Search `Assets/**/*.cs`:
51
+
52
+ ```
53
+ AndroidJavaObject|AndroidJavaClass|UnityPlayer\.currentActivity
54
+ UnitySendMessage
55
+ GoogleBilling|BillingManager|BillingClient|BillingBridge|AndroidBillingBridge|PlayBilling
56
+ purchaseToken|originalJson|signature|productId|orderId
57
+ \backnowledge\b|\bconsume\b
58
+ restore.?purchases|query.?products|query.?purchases
59
+ subscription.?status|receipt.?valid|entitlement.?grant
60
+ ```
61
+
62
+ ### 1b — Android Java/Kotlin Patterns
63
+
64
+ Search `Assets/Plugins/Android/**/*.java`, `*.kt`:
65
+
66
+ ```
67
+ com\.android\.billingclient\.api\.BillingClient
68
+ PurchasesUpdatedListener|BillingClientStateListener
69
+ ProductDetails|ProductDetails\.SubscriptionOfferDetails
70
+ QueryProductDetailsParams|BillingFlowParams
71
+ AcknowledgePurchaseParams|ConsumeParams|QueryPurchasesParams
72
+ launchBillingFlow|acknowledgePurchase|consumeAsync
73
+ queryProductDetailsAsync|queryPurchasesAsync|enablePendingPurchases
74
+ offerToken|basePlanId|offerId|pricingPhases
75
+ ```
76
+
77
+ ### 1c — Gradle / Manifest Patterns
78
+
79
+ Search `mainTemplate.gradle`, `launcherTemplate.gradle`, `baseProjectTemplate.gradle`, `AndroidManifest.xml`:
80
+
81
+ ```
82
+ com\.android\.billingclient:billing
83
+ com\.android\.billingclient:billing-ktx
84
+ ```
85
+
86
+ Also list all `.jar`/`.aar` files under `Assets/Plugins/Android/` — these may contain pre-compiled billing code.
87
+
88
+ ### 1d — Scene / Prefab / Asset Scan
89
+
90
+ Search `.unity`, `.prefab`, `.asset` files for references to billing-related MonoBehaviour names found in 1a.
91
+
92
+ ## Step 2 — Product Classification
93
+
94
+ Classify every detected product into one of: **Consumable**, **NonConsumable**, **Subscription**, **Unknown**.
95
+
96
+ Infer from (in priority order):
97
+ 1. `BillingClient.ProductType.INAPP` (consumable or non-consumable) / `BillingClient.ProductType.SUBS`
98
+ 2. `consumeAsync` calls → Consumable; `acknowledgePurchase` without consume → NonConsumable
99
+ 3. Product ID naming conventions (e.g., `coins`, `gems`, `pack` → Consumable; `remove_ads`, `unlock` → NonConsumable; `monthly`, `annual`, `sub` → Subscription)
100
+ 4. Entitlement / backend grant code
101
+ 5. Comments or config files
102
+
103
+ If type cannot be confidently inferred, mark as **Unknown** and add to the blocker question list.
104
+
105
+ ## Step 3 — Migration Report (produce before any edits)
106
+
107
+ Generate all 18 sections. Do not skip any.
108
+
109
+ 1. **Current native billing architecture** — describe the bridge pattern (C# wrapper → JNI → BillingClient)
110
+ 2. **Files using native Google Billing** — full list with role of each file
111
+ 3. **Product catalog discovered** — all product IDs found
112
+ 4. **Product type mapping** — inferred type + confidence + source of inference for each product
113
+ 5. **Purchase flow mapping** — native → Unity IAP step-by-step
114
+ 6. **Restore purchase flow mapping** — `queryPurchasesAsync` → `FetchPurchases` + `RestoreTransactions`
115
+ 7. **Backend validation mapping** — what data the old flow sent (`purchaseToken`, `originalJson`, `signature`, `packageName`) vs what Unity IAP provides (`order.Info.Receipt`, `order.Info.Apple?.jwsRepresentation`)
116
+ 8. **Consumable consume behavior mapping** — native `consumeAsync` → Unity IAP `ConfirmPurchase` (only after grant)
117
+ 9. **Non-consumable acknowledgement behavior mapping** — native `acknowledgePurchase` → Unity IAP `ConfirmPurchase` (only after grant)
118
+ 10. **Subscription behavior mapping** — detected subscription products, restore path, renewal handling
119
+ 11. **Google-specific features detected** — list each (see Blocker Detection below)
120
+ 12. **Unity IAP 5.x migration blockers** — features that cannot be cleanly mapped
121
+ 13. **Proposed new Unity IAP architecture** — new files and their roles
122
+ 14. **Code files to create** — with paths
123
+ 15. **Code files to modify** — with nature of each change
124
+ 16. **Manual Play Console checks** — product IDs, base plan compatibility, billing permissions
125
+ 17. **Test plan** — from the checklist in this document
126
+ 18. **Rollback plan** — from the rollback plan section in this document
127
+
128
+ ## Step 4 — Blocker Detection
129
+
130
+ Report these as migration blockers if detected. Do not silently remove them.
131
+
132
+ | Feature | Detection Signal | Blocker Level |
133
+ |---|---|---|
134
+ | Multiple subscription base plans | `basePlanId` usage, multiple `SubscriptionOfferDetails` per product | **Hard** — ask user to choose option A/B/C (see below) |
135
+ | Explicit offer token selection | `offerToken` set on `BillingFlowParams` | **Hard** |
136
+ | Introductory offer selection by `offerId` | `offerId` in offer params | **Hard** |
137
+ | Offer tags | `offerTags` access on `SubscriptionOfferDetails` | **Soft** — document loss |
138
+ | Pricing phase inspection | `pricingPhases` / `PricingPhase` fields read | **Soft** — document loss |
139
+ | Multi-quantity purchases | `quantity` > 1 in `BillingFlowParams` | **Hard** |
140
+ | Alternative billing / external offers | `setExternalOfferToken` or alternative billing config | **Hard** |
141
+ | Personalized price disclosure | `setIsPersonalizedPrice(true)` | **Hard** |
142
+ | Obfuscated account / profile IDs | `setObfuscatedAccountId`, `setObfuscatedProfileId` | **Soft** — Unity IAP exposes `SetObfuscatedAccountId/ProfileId` post-`Connect()` on `GooglePlayStoreExtendedService` |
143
+ | Custom `BillingFlowParams` fields | Any `BillingFlowParams.Builder` method not listed above | **Soft** — document loss |
144
+ | Direct `ProductDetails` metadata | Reading `ProductDetails` fields not available on `Product.metadata` | **Soft** — document loss |
145
+
146
+ ### Subscription Blocker Options (present to user when hard subscription blockers found)
147
+
148
+ **A mixed Unity IAP + native BillingClient architecture is not recommended and must not be offered as an option.** Both systems compete for the same `PurchasesUpdatedListener` slot on the device — only one receives purchase callbacks, the other silently drops purchases. This risks lost purchases, double grants, and unacknowledged tokens. If the user asks about a mixed approach, explain this risk and redirect to Option A or B.
149
+
150
+ **Option A — Simplify Play Console setup for Unity IAP compatibility**
151
+ Remove extra base plans/offers in Play Console so one product has one base plan. Unity IAP then handles all products including subscriptions. This is the recommended path — single system, no coexistence risk.
152
+
153
+ **Option B — Stay on native Google Billing for all products**
154
+ Do not migrate at this time. Keep the native BillingClient implementation as-is until the Play Console subscription configuration can be simplified or Unity IAP exposes the required subscription features. Stop the conversion and document the blocker and this decision in `IapMigrationNotes.md`.
155
+
156
+ ## Step 5 — Target Architecture
157
+
158
+ Create under `Assets/Scripts/IAP/`:
159
+
160
+ | File | Purpose |
161
+ |---|---|
162
+ | `IStorePurchaseService.cs` | Game-facing interface (stable public API) |
163
+ | `UnityIapStorePurchaseService.cs` | Unity IAP 5.x implementation |
164
+ | `ProductCatalogDefinition.cs` | ScriptableObject or plain class holding all `ProductDefinitionEntry` |
165
+ | `ProductDefinitionEntry.cs` | Per-product data: ID, type, store-specific IDs |
166
+ | `PurchaseEntitlementMapper.cs` | Maps Unity IAP order data → game grant calls |
167
+ | `PurchaseValidationRequest.cs` | DTO sent to backend |
168
+ | `PurchaseValidationResult.cs` | DTO received from backend |
169
+ | `PurchaseRestoreResult.cs` | Result of restore operation |
170
+ | `LegacyGoogleBillingAdapterDeprecated.cs` | Compatibility facade (only if game code calls old billing API) |
171
+ | `IapMigrationNotes.md` | Human-readable notes on what changed, blockers found, manual steps |
172
+
173
+ ### Game-Facing Interface (preserve or adapt from existing API surface)
174
+
175
+ ```csharp
176
+ public interface IStorePurchaseService
177
+ {
178
+ Task InitializeAsync();
179
+ Task FetchProductsAsync();
180
+ IReadOnlyList<StoreProductInfo> GetProducts();
181
+ Task PurchaseAsync(string productId);
182
+ Task RestorePurchasesAsync();
183
+ bool IsInitialized { get; }
184
+ }
185
+ ```
186
+
187
+ ## Step 6 — Migration Phases
188
+
189
+ ### Phase 1 — Package Check
190
+
191
+ - Verify `com.unity.purchasing` exists in `Packages/manifest.json`.
192
+ - If `com.unity.purchasing` is absent or outdated, install the latest stable version via Package Manager.
193
+ - If missing or outdated, provide Package Manager instructions. Do not auto-edit `manifest.json` unless the user explicitly allows it.
194
+
195
+ ### Phase 2 — Product Catalog Extraction
196
+
197
+ - Extract all product IDs and inferred types from the scan.
198
+ - Generate `ProductCatalogDefinition.cs` / `ProductDefinitionEntry.cs`.
199
+ - Each entry: `productId`, `ProductType`, optional `storeSpecificIds`, `notes`.
200
+
201
+ ### Phase 3 — New Unity IAP Service
202
+
203
+ Create `UnityIapStorePurchaseService`:
204
+
205
+ 1. **Initialization** — `UnityIAPServices.StoreController()`, subscribe all events **before** `Connect()`.
206
+ 2. **Product fetching** — build `List<ProductDefinition>` from catalog, call `store.FetchProducts()`, handle `OnProductsFetched` / `OnProductsFetchFailed`.
207
+ 3. **Purchase initiation** — `store.PurchaseProduct(product)`.
208
+ 4. **Purchase callback** — `OnPurchasePending`: validate receipt → grant entitlement → `ConfirmPurchase(pendingOrder)`. **Never confirm before grant.**
209
+ 5. **Deferred purchases** — `OnPurchaseDeferred`: show pending UI, do not grant.
210
+ 6. **Failed purchases** — `OnPurchaseFailed`: map `FailureReason` to user-facing error.
211
+ 7. **Restore / fetch** — `store.FetchPurchases()` (re-delivers unconfirmed via `OnPurchasePending`) + `store.RestoreTransactions(callback)` for explicit iOS restore button.
212
+ 8. **Validation handoff** — send `order.Info.Receipt` (and `order.Info.Apple?.jwsRepresentation` on Apple) to backend in place of legacy `purchaseToken` + `originalJson` + `signature`. Document any backend change required.
213
+
214
+ ### Phase 4 — Compatibility Facade
215
+
216
+ If game code calls the old billing API directly (e.g., `GoogleBillingManager.Purchase(id)`):
217
+
218
+ - Create `LegacyGoogleBillingAdapterDeprecated.cs` that implements the same method signatures.
219
+ - Delegate all calls to `UnityIapStorePurchaseService`.
220
+ - Mark all methods `[Obsolete("Use IStorePurchaseService — remove after migration validation")]`.
221
+
222
+ ### Phase 5 — Remove Native Dependency from Active Path
223
+
224
+ - Stop calling `AndroidJavaObject` bridge for migrated products.
225
+ - Wrap native calls in `#if !USE_UNITY_IAP_V5` — do not delete them.
226
+ - Leave Gradle billing dependencies unless user explicitly requests removal.
227
+
228
+ ### Phase 6 — Test Scaffolding
229
+
230
+ - Add editor stubs for sandbox testing.
231
+ - Add the QA checklist from the test plan below to `IapMigrationNotes.md`.
232
+
233
+ ## Step 7 — Behavior Change Rules
234
+
235
+ These are the changes that break games or backends after the switch. For the Unity IAP side of each call, read the docs page named in the Full topic map of the parent skill file.
236
+
237
+ - **One call replaces acknowledge and consume.** `ConfirmPurchase(pendingOrder)` replaces both `acknowledgePurchase` and `consumeAsync`. Call it only after the entitlement is granted and saved, because a confirmed purchase is never re-delivered.
238
+ - **The receipt format changes for the backend.** `purchaseToken`, `originalJson` and `signature` are no longer separate values; they are embedded in `order.Info.Receipt`. If the backend reads them directly, list the receipt format change as a required backend update in `IapMigrationNotes.md`.
239
+ - **Obfuscated IDs move after `Connect()`.** Native code sets them on `BillingFlowParams` per purchase. In Unity IAP, set them once on `GooglePlayStoreExtendedService` after `await store.Connect()`, and read them back per order from `GooglePlayStoreExtendedPurchaseService`. See the Google Play notes in [platform-notes.md](platform-notes.md).
240
+ - **Pending purchases become deferred orders.** Native `PENDING` purchase state maps to `store.OnPurchaseDeferred`. Show a pending state and don't grant; the approved purchase arrives later through `OnPurchasePending`.
241
+ - **Subscription changes take objects, not IDs.** `launchBillingFlow` with `subscriptionUpdateParams` maps to `UpgradeDowngradeSubscription(currentOrder, newProduct, mode)`. Choose the mode as the Google Play notes in [platform-notes.md](platform-notes.md) describe.
242
+
243
+ ## Step 8 — Native → Unity IAP Concept Mapping
244
+
245
+ Only the mappings that aren't one-to-one renames, or that agents commonly get wrong:
246
+
247
+ | Native Google Billing | Unity IAP 5.x |
248
+ |---|---|
249
+ | `ProductDetails` | `Product`, from `store.GetProductById` after `OnProductsFetched` |
250
+ | `Purchase` | `PendingOrder`, from `OnPurchasePending` |
251
+ | `queryPurchasesAsync` | `store.FetchPurchases()` → `OnPurchasesFetched` |
252
+ | `BillingResult` / `BillingResponseCode` | `FailedOrder.FailureReason` / `StoreConnectionFailureDescription` |
253
+ | `ProductType.INAPP` | `ProductType.Consumable` or `ProductType.NonConsumable`, decided by whether the native code consumes it |
254
+ | `ProductType.SUBS` | `ProductType.Subscription` |
255
+ | `offerToken` / `basePlanId` / `pricingPhases` | **Not exposed** — report as a blocker (Step 4) |
256
+
257
+ ## Step 9 — Rollback Plan
258
+
259
+ - Wrap all new IAP code in `#if USE_UNITY_IAP_V5`.
260
+ - Wrap all replaced native bridge calls in `#if !USE_UNITY_IAP_V5`.
261
+ - To revert: remove `USE_UNITY_IAP_V5` from **Edit > Project Settings > Player > Scripting Define Symbols**. The native billing path is restored without any code changes.
262
+ - Never activate both purchase systems for the same product simultaneously.
263
+ - Document the rollback steps in `IapMigrationNotes.md`.
264
+
265
+ ## Step 10 — Test Checklist
266
+
267
+ Include this in `IapMigrationNotes.md` after migration:
268
+
269
+ - [ ] Fresh install — products load and display prices
270
+ - [ ] Upgrade from old app version to migrated version — no duplicate entitlements
271
+ - [ ] Consumable purchase — content granted
272
+ - [ ] Repeat consumable purchase — repeatable, no block
273
+ - [ ] Non-consumable purchase — content granted once
274
+ - [ ] Non-consumable restore — content restored on reinstall
275
+ - [ ] Subscription purchase — subscription active
276
+ - [ ] Subscription restore — status refreshed on launch
277
+ - [ ] Pending purchase (if applicable) — deferred UI shown, no premature grant
278
+ - [ ] Interrupted purchase flow — re-delivered on next launch via `OnPurchasePending`
279
+ - [ ] Backend validation success — entitlement granted
280
+ - [ ] Backend validation failure — entitlement NOT granted, purchase not confirmed
281
+ - [ ] Network failure during validation — purchase left pending, re-delivered on next launch
282
+ - [ ] App killed during purchase — pending order re-delivered on next launch
283
+ - [ ] App resumed after Google purchase UI — `OnPurchasePending` fires correctly
284
+ - [ ] Sandbox tester account — no real charges
285
+ - [ ] Internal testing track build
286
+ - [ ] Play Console product ID match — all IDs match exactly
287
+ - [ ] Play Console base plan compatibility — no advanced offer config that Unity IAP cannot reach
288
+ - [ ] No duplicate entitlement grant
289
+ - [ ] No unacknowledged purchases remaining
290
+ - [ ] No double consumption of consumables
291
+
292
+ ## Step 11 — Questions to Ask (only when required)
293
+
294
+ Ask only when the information cannot be inferred:
295
+
296
+ 1. Which product IDs are consumable, non-consumable, or subscription?
297
+ 2. Does the backend currently validate Google purchase tokens directly (raw `purchaseToken` field)?
298
+ 3. Are any subscriptions using multiple base plans or offer tokens?
299
+ 4. Should the skill preserve the old public C# billing API as a compatibility facade?
300
+ 5. Should native billing files be kept, disabled, or removed?
301
+
302
+ If enough information can be inferred, proceed with a best-effort plan and mark uncertain items as **TODO**.