nccgs 1.0.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 (278) hide show
  1. package/.claude/agents/nccgs-accessibility-specialist.md +26 -0
  2. package/.claude/agents/nccgs-adversarial-reviewer.md +26 -0
  3. package/.claude/agents/nccgs-ai-programmer.md +26 -0
  4. package/.claude/agents/nccgs-analytics-engineer.md +26 -0
  5. package/.claude/agents/nccgs-art-direction-lead.md +26 -0
  6. package/.claude/agents/nccgs-audio-direction-lead.md +26 -0
  7. package/.claude/agents/nccgs-creative-director.md +26 -0
  8. package/.claude/agents/nccgs-documentation-manager.md +26 -0
  9. package/.claude/agents/nccgs-economy-designer.md +26 -0
  10. package/.claude/agents/nccgs-engine-programmer.md +26 -0
  11. package/.claude/agents/nccgs-game-design-lead.md +26 -0
  12. package/.claude/agents/nccgs-game-designer.md +26 -0
  13. package/.claude/agents/nccgs-gameplay-programmer.md +26 -0
  14. package/.claude/agents/nccgs-level-designer.md +26 -0
  15. package/.claude/agents/nccgs-live-ops-designer.md +26 -0
  16. package/.claude/agents/nccgs-localization-lead.md +26 -0
  17. package/.claude/agents/nccgs-narrative-lead.md +26 -0
  18. package/.claude/agents/nccgs-network-programmer.md +26 -0
  19. package/.claude/agents/nccgs-performance-analyst.md +26 -0
  20. package/.claude/agents/nccgs-producer.md +26 -0
  21. package/.claude/agents/nccgs-production-coordinator.md +23 -0
  22. package/.claude/agents/nccgs-programming-lead.md +26 -0
  23. package/.claude/agents/nccgs-prototyper.md +26 -0
  24. package/.claude/agents/nccgs-qa-engineer.md +26 -0
  25. package/.claude/agents/nccgs-qa-lead.md +26 -0
  26. package/.claude/agents/nccgs-release-engineer.md +26 -0
  27. package/.claude/agents/nccgs-release-lead.md +26 -0
  28. package/.claude/agents/nccgs-security-engineer.md +26 -0
  29. package/.claude/agents/nccgs-sound-designer.md +26 -0
  30. package/.claude/agents/nccgs-systems-designer.md +26 -0
  31. package/.claude/agents/nccgs-technical-architect.md +26 -0
  32. package/.claude/agents/nccgs-technical-artist.md +26 -0
  33. package/.claude/agents/nccgs-technical-director.md +26 -0
  34. package/.claude/agents/nccgs-tools-programmer.md +26 -0
  35. package/.claude/agents/nccgs-ui-programmer.md +26 -0
  36. package/.claude/agents/nccgs-unity-build-specialist.md +26 -0
  37. package/.claude/agents/nccgs-unity-content-specialist.md +26 -0
  38. package/.claude/agents/nccgs-unity-implementer.md +26 -0
  39. package/.claude/agents/nccgs-unity-rendering-specialist.md +26 -0
  40. package/.claude/agents/nccgs-unity-systems-specialist.md +26 -0
  41. package/.claude/agents/nccgs-unity-ui-specialist.md +26 -0
  42. package/.claude/agents/nccgs-ux-designer.md +26 -0
  43. package/.claude/agents/nccgs-verification-engineer.md +26 -0
  44. package/.claude/agents/nccgs-world-builder.md +26 -0
  45. package/.claude/agents/nccgs-writer.md +26 -0
  46. package/.claude/nccgs/THIRD_PARTY_NOTICES.md +13 -0
  47. package/.claude/nccgs/VERSION +1 -0
  48. package/.claude/nccgs/constitution.md +131 -0
  49. package/.claude/nccgs/hooks/agent-audit.mjs +10 -0
  50. package/.claude/nccgs/hooks/common.mjs +41 -0
  51. package/.claude/nccgs/hooks/post-compact.mjs +1 -0
  52. package/.claude/nccgs/hooks/pre-compact.mjs +8 -0
  53. package/.claude/nccgs/hooks/protect-git.mjs +22 -0
  54. package/.claude/nccgs/hooks/protect-write.mjs +17 -0
  55. package/.claude/nccgs/hooks/session-start.mjs +15 -0
  56. package/.claude/nccgs/hooks/session-stop.mjs +7 -0
  57. package/.claude/nccgs/protocols/agent-contract.md +34 -0
  58. package/.claude/nccgs/protocols/context-packets.md +13 -0
  59. package/.claude/nccgs/protocols/evidence.md +15 -0
  60. package/.claude/nccgs/protocols/model-routing.md +22 -0
  61. package/.claude/nccgs/protocols/orchestration.md +26 -0
  62. package/.claude/nccgs/protocols/unity-boundary.md +11 -0
  63. package/.claude/nccgs/settings.fragment.json +77 -0
  64. package/.claude/nccgs/studio.json +347 -0
  65. package/.claude/nccgs/tools/configure-models.mjs +39 -0
  66. package/.claude/nccgs/unity-skills-manifest.json +727 -0
  67. package/.claude/nccgs/workflow-catalog.json +317 -0
  68. package/.claude/rules/nccgs-canonical-docs.md +19 -0
  69. package/.claude/rules/nccgs-editor-tools.md +12 -0
  70. package/.claude/rules/nccgs-localization.md +12 -0
  71. package/.claude/rules/nccgs-networking.md +13 -0
  72. package/.claude/rules/nccgs-performance.md +14 -0
  73. package/.claude/rules/nccgs-rendering.md +16 -0
  74. package/.claude/rules/nccgs-security.md +13 -0
  75. package/.claude/rules/nccgs-tests.md +18 -0
  76. package/.claude/rules/nccgs-ui.md +14 -0
  77. package/.claude/rules/nccgs-unity-assets.md +21 -0
  78. package/.claude/rules/nccgs-unity-code.md +22 -0
  79. package/.claude/skills/accessibility-review/SKILL.md +14 -0
  80. package/.claude/skills/architecture-decision/SKILL.md +14 -0
  81. package/.claude/skills/asset-audit/SKILL.md +14 -0
  82. package/.claude/skills/audit/SKILL.md +16 -0
  83. package/.claude/skills/audit/references/dimensions.md +46 -0
  84. package/.claude/skills/balance-review/SKILL.md +14 -0
  85. package/.claude/skills/bug-triage/SKILL.md +14 -0
  86. package/.claude/skills/build-live-game/SKILL.md +317 -0
  87. package/.claude/skills/build-live-game/references/achievements.md +779 -0
  88. package/.claude/skills/build-live-game/references/apis.md +280 -0
  89. package/.claude/skills/build-live-game/references/authentication.md +437 -0
  90. package/.claude/skills/build-live-game/references/battlepass.md +860 -0
  91. package/.claude/skills/build-live-game/references/cloud-code.md +563 -0
  92. package/.claude/skills/build-live-game/references/cloud-save.md +474 -0
  93. package/.claude/skills/build-live-game/references/deployment.md +216 -0
  94. package/.claude/skills/build-live-game/references/player-account.md +813 -0
  95. package/.claude/skills/build-live-game/references/remote-config.md +96 -0
  96. package/.claude/skills/build-live-game/references/tooling.md +431 -0
  97. package/.claude/skills/closure/SKILL.md +14 -0
  98. package/.claude/skills/code-review/SKILL.md +14 -0
  99. package/.claude/skills/compatibility-review/SKILL.md +14 -0
  100. package/.claude/skills/context-pack/SKILL.md +14 -0
  101. package/.claude/skills/dependency-review/SKILL.md +14 -0
  102. package/.claude/skills/design/SKILL.md +20 -0
  103. package/.claude/skills/design-review/SKILL.md +14 -0
  104. package/.claude/skills/evidence-review/SKILL.md +14 -0
  105. package/.claude/skills/hotfix/SKILL.md +14 -0
  106. package/.claude/skills/implement-in-app-purchases/README.md +233 -0
  107. package/.claude/skills/implement-in-app-purchases/SKILL.md +158 -0
  108. package/.claude/skills/implement-in-app-purchases/references/api-notes.md +562 -0
  109. package/.claude/skills/implement-in-app-purchases/references/codeless-catalog.md +331 -0
  110. package/.claude/skills/implement-in-app-purchases/references/convert-adapty.md +268 -0
  111. package/.claude/skills/implement-in-app-purchases/references/convert-essentialkit.md +239 -0
  112. package/.claude/skills/implement-in-app-purchases/references/convert-revenuecat.md +275 -0
  113. package/.claude/skills/implement-in-app-purchases/references/convert-unipay.md +145 -0
  114. package/.claude/skills/implement-in-app-purchases/references/migration-v4-to-v5.md +204 -0
  115. package/.claude/skills/implement-in-app-purchases/references/path-add-iap-to-new-project.md +198 -0
  116. package/.claude/skills/implement-in-app-purchases/references/path-convert-native-google-billing.md +356 -0
  117. package/.claude/skills/implement-in-app-purchases/references/path-convert-native-storekit.md +446 -0
  118. package/.claude/skills/implement-in-app-purchases/references/path-implement-iap-d2c.md +680 -0
  119. package/.claude/skills/implement-in-app-purchases/references/platform-notes.md +204 -0
  120. package/.claude/skills/implement-in-app-purchases/references/pre-check.md +205 -0
  121. package/.claude/skills/incident-recovery/SKILL.md +14 -0
  122. package/.claude/skills/initialize-ai-navigation/SKILL.md +95 -0
  123. package/.claude/skills/initialize-ai-navigation/references/navigation-system.md +794 -0
  124. package/.claude/skills/levelplay-unity-integration/CHANGELOG.md +57 -0
  125. package/.claude/skills/levelplay-unity-integration/README.md +74 -0
  126. package/.claude/skills/levelplay-unity-integration/SKILL.md +1126 -0
  127. package/.claude/skills/levelplay-unity-integration/references/banner-api.md +920 -0
  128. package/.claude/skills/levelplay-unity-integration/references/best-practices.md +536 -0
  129. package/.claude/skills/levelplay-unity-integration/references/ilrd-api.md +337 -0
  130. package/.claude/skills/levelplay-unity-integration/references/initialization-api.md +630 -0
  131. package/.claude/skills/levelplay-unity-integration/references/interstitial-api.md +899 -0
  132. package/.claude/skills/levelplay-unity-integration/references/ios-setup.md +491 -0
  133. package/.claude/skills/levelplay-unity-integration/references/migration-sdk-9.md +666 -0
  134. package/.claude/skills/levelplay-unity-integration/references/privacy-settings.md +608 -0
  135. package/.claude/skills/levelplay-unity-integration/references/rewarded-api.md +902 -0
  136. package/.claude/skills/localization/SKILL.md +135 -0
  137. package/.claude/skills/localization/references/api-notes.md +76 -0
  138. package/.claude/skills/localization/resources/L10nBatchProcessor.cs +69 -0
  139. package/.claude/skills/localization/resources/LocalizedFontAsset.cs +18 -0
  140. package/.claude/skills/localize-game/SKILL.md +14 -0
  141. package/.claude/skills/migrate-project/SKILL.md +21 -0
  142. package/.claude/skills/migrate-project/references/procedure.md +63 -0
  143. package/.claude/skills/milestone-review/SKILL.md +14 -0
  144. package/.claude/skills/new-unity-project/SKILL.md +179 -0
  145. package/.claude/skills/optimize-audio/SKILL.md +199 -0
  146. package/.claude/skills/optimize-audio/resources/audio-import-api.md +146 -0
  147. package/.claude/skills/optimize-audio/resources/platform-settings.md +48 -0
  148. package/.claude/skills/optimize-text-mesh-pro/SKILL.md +182 -0
  149. package/.claude/skills/optimize-web/SKILL.md +393 -0
  150. package/.claude/skills/optimize-web/resources/WebOptimizer.cs +21 -0
  151. package/.claude/skills/optimize-web/resources/toktx-examples.sh +11 -0
  152. package/.claude/skills/performance-audit/SKILL.md +14 -0
  153. package/.claude/skills/physics-3d-collision/SKILL.md +442 -0
  154. package/.claude/skills/physics-3d-collision/references/troubleshooting.md +41 -0
  155. package/.claude/skills/physics-3d-collision/resources/CollisionDebugger.cs +33 -0
  156. package/.claude/skills/plan-feature/SKILL.md +14 -0
  157. package/.claude/skills/playtest/SKILL.md +14 -0
  158. package/.claude/skills/project-stage/SKILL.md +14 -0
  159. package/.claude/skills/prototype-feature/SKILL.md +14 -0
  160. package/.claude/skills/qa-plan/SKILL.md +14 -0
  161. package/.claude/skills/release/SKILL.md +18 -0
  162. package/.claude/skills/release-readiness/SKILL.md +14 -0
  163. package/.claude/skills/retrospective/SKILL.md +14 -0
  164. package/.claude/skills/review/SKILL.md +16 -0
  165. package/.claude/skills/security-audit/SKILL.md +14 -0
  166. package/.claude/skills/setup-multiplayer-services/SKILL.md +39 -0
  167. package/.claude/skills/setup-multiplayer-services/references/dgs-entrypoint.md +79 -0
  168. package/.claude/skills/setup-multiplayer-services/references/entrypoints.md +213 -0
  169. package/.claude/skills/setup-multiplayer-services/references/examples.md +33 -0
  170. package/.claude/skills/setup-multiplayer-services/references/implementation-fit.md +30 -0
  171. package/.claude/skills/setup-multiplayer-services/references/underlying-services.md +11 -0
  172. package/.claude/skills/setup-multiplayer-services/references/workflows-prerequisites.md +17 -0
  173. package/.claude/skills/setup-vivox-voice-chat/SKILL.md +118 -0
  174. package/.claude/skills/setup-vivox-voice-chat/evals/.env.example +6 -0
  175. package/.claude/skills/setup-vivox-voice-chat/evals/README.md +101 -0
  176. package/.claude/skills/setup-vivox-voice-chat/evals/promptfooconfig.yaml +32 -0
  177. package/.claude/skills/setup-vivox-voice-chat/evals/tests/init-and-login.yaml +76 -0
  178. package/.claude/skills/setup-vivox-voice-chat/evals/tests/text-chat.yaml +65 -0
  179. package/.claude/skills/setup-vivox-voice-chat/evals/tests/voice-channels.yaml +74 -0
  180. package/.claude/skills/setup-vivox-voice-chat/references/events-and-participants.md +79 -0
  181. package/.claude/skills/setup-vivox-voice-chat/references/init-and-login.md +92 -0
  182. package/.claude/skills/setup-vivox-voice-chat/references/text-chat.md +93 -0
  183. package/.claude/skills/setup-vivox-voice-chat/references/troubleshooting.md +47 -0
  184. package/.claude/skills/setup-vivox-voice-chat/references/voice-channels.md +90 -0
  185. package/.claude/skills/shader-graph-create-custom-node/SKILL.md +25 -0
  186. package/.claude/skills/shader-graph-create-custom-node/resources/all_hints.hlsl +182 -0
  187. package/.claude/skills/sprint-plan/SKILL.md +14 -0
  188. package/.claude/skills/sprite-editor/SKILL.md +66 -0
  189. package/.claude/skills/sprite-editor/references/api_reference.md +151 -0
  190. package/.claude/skills/sprite-editor/references/background.md +112 -0
  191. package/.claude/skills/sprite-editor/references/templates.md +72 -0
  192. package/.claude/skills/sprite-editor/scripts/AutomaticSliceTexture.cs +40 -0
  193. package/.claude/skills/sprite-editor/scripts/GenerateNewSpriteRects.cs +200 -0
  194. package/.claude/skills/sprite-editor/scripts/GetTextureSourceImageSize.cs +32 -0
  195. package/.claude/skills/sprite-editor/scripts/GetTextureToSlice.cs +55 -0
  196. package/.claude/skills/sprite-editor/scripts/GridSliceTexture.cs +40 -0
  197. package/.claude/skills/sprite-editor/scripts/IsometricSliceTexture.cs +141 -0
  198. package/.claude/skills/sprite-editor/scripts/README.md +134 -0
  199. package/.claude/skills/sprite-editor/scripts/SetPivotExample.cs +58 -0
  200. package/.claude/skills/sprite-editor/scripts/SpriteToPng.cs +88 -0
  201. package/.claude/skills/status/SKILL.md +16 -0
  202. package/.claude/skills/story-readiness/SKILL.md +14 -0
  203. package/.claude/skills/test/SKILL.md +16 -0
  204. package/.claude/skills/ui/SKILL.md +142 -0
  205. package/.claude/skills/ui-imgui/SKILL.md +186 -0
  206. package/.claude/skills/ui-imgui/references/gui-elements.md +156 -0
  207. package/.claude/skills/ui-imgui/references/templates.md +141 -0
  208. package/.claude/skills/ui-review/SKILL.md +14 -0
  209. package/.claude/skills/ui-ugui/SKILL.md +282 -0
  210. package/.claude/skills/ui-ugui/references/scrollview-setup.md +29 -0
  211. package/.claude/skills/ui-uitk/SKILL.md +235 -0
  212. package/.claude/skills/ui-uitk/references/common-issues.md +74 -0
  213. package/.claude/skills/ui-uitk/references/custom-elements.md +241 -0
  214. package/.claude/skills/ui-uitk/references/painter2d.md +282 -0
  215. package/.claude/skills/ui-uitk/references/pointermanipulator-guide.md +94 -0
  216. package/.claude/skills/ui-uitk/references/svg-icons.md +136 -0
  217. package/.claude/skills/ui-uitk/references/ui-runtime-binding.md +234 -0
  218. package/.claude/skills/ui-uitk/references/uss-guide.md +138 -0
  219. package/.claude/skills/unity-cli/CHANGELOG.md +233 -0
  220. package/.claude/skills/unity-cli/SECURITY.md +22 -0
  221. package/.claude/skills/unity-cli/SKILL.md +414 -0
  222. package/.claude/skills/unity-cli/references/auth-license-cloud.md +146 -0
  223. package/.claude/skills/unity-cli/references/build-run-test.md +349 -0
  224. package/.claude/skills/unity-cli/references/collaboration.md +472 -0
  225. package/.claude/skills/unity-cli/references/config-hub.md +103 -0
  226. package/.claude/skills/unity-cli/references/diagnostics-maintenance.md +326 -0
  227. package/.claude/skills/unity-cli/references/editors-install.md +327 -0
  228. package/.claude/skills/unity-cli/references/integration-advanced.md +472 -0
  229. package/.claude/skills/unity-cli/references/projects-templates.md +574 -0
  230. package/.claude/skills/unity-package-management/SKILL.md +304 -0
  231. package/.claude/skills/unity-package-management/references/select-packages.md +108 -0
  232. package/.claude/skills/urp-postprocessing/SKILL.md +188 -0
  233. package/.claude/skills/urp-postprocessing/references/code-templates.md +119 -0
  234. package/.claude/skills/urp-postprocessing/references/effect-reference.md +86 -0
  235. package/.claude/skills/validate-urp-render-graph-renderer-feature/SKILL.md +269 -0
  236. package/.claude/skills/work/SKILL.md +36 -0
  237. package/.claude/skills/work/references/classification.md +41 -0
  238. package/.claude/skills/work/references/closure.md +50 -0
  239. package/.claude/skills/work/references/feature-contracts.md +32 -0
  240. package/.claude/skills/work/references/verification.md +26 -0
  241. package/CLAUDE.md +6 -0
  242. package/LICENSE +21 -0
  243. package/README.md +162 -0
  244. package/THIRD_PARTY_NOTICES.md +23 -0
  245. package/UPGRADING.md +32 -0
  246. package/VERSION +1 -0
  247. package/docs/ARCHITECTURE.md +73 -0
  248. package/docs/HUONG-DAN-MIGRATE-VA-SU-DUNG.md +324 -0
  249. package/docs/MIGRATION-MATRIX.md +23 -0
  250. package/docs/PROJECT-POLICY.md +67 -0
  251. package/docs/WORKFLOWS.md +61 -0
  252. package/package-assets/setup-vivox-voice-chat-evals.gitignore +7 -0
  253. package/package.json +41 -0
  254. package/scaffold/.nccgs/bugs/.gitkeep +1 -0
  255. package/scaffold/.nccgs/closures/.gitkeep +1 -0
  256. package/scaffold/.nccgs/context/.gitkeep +1 -0
  257. package/scaffold/.nccgs/decisions/.gitkeep +1 -0
  258. package/scaffold/.nccgs/evidence/.gitkeep +1 -0
  259. package/scaffold/.nccgs/features/.gitkeep +1 -0
  260. package/scaffold/.nccgs/migrations/.gitkeep +1 -0
  261. package/scaffold/.nccgs/playtests/.gitkeep +1 -0
  262. package/scaffold/.nccgs/project.yaml +103 -0
  263. package/scaffold/.nccgs/requirements.yaml +10 -0
  264. package/scaffold/.nccgs/reviews/.gitkeep +1 -0
  265. package/scaffold/.nccgs/state.md +40 -0
  266. package/scaffold/.nccgs/templates/agent-handoff.md +25 -0
  267. package/scaffold/.nccgs/templates/architecture-decision.md +27 -0
  268. package/scaffold/.nccgs/templates/closure-record.md +51 -0
  269. package/scaffold/.nccgs/templates/context-packet.yaml +17 -0
  270. package/scaffold/.nccgs/templates/evidence-record.md +23 -0
  271. package/scaffold/.nccgs/templates/feature-contract.md +35 -0
  272. package/scaffold/.nccgs/templates/migration-plan.md +40 -0
  273. package/scaffold/.nccgs/templates/waiver.md +11 -0
  274. package/scripts/cli.mjs +56 -0
  275. package/scripts/install.mjs +267 -0
  276. package/scripts/sync-unity-skills.mjs +126 -0
  277. package/scripts/validate.mjs +205 -0
  278. package/tests/framework.test.mjs +121 -0
@@ -0,0 +1,204 @@
1
+ # Unity IAP Platform-Specific Notes
2
+
3
+ ## Table of Contents
4
+
5
+ - [Apple App Store Extensions](#apple-app-store-extensions)
6
+ - [Google Play Store Extensions](#google-play-store-extensions)
7
+ - [Apple JWS Representation (Server-Side Validation)](#apple-jws-representation-server-side-validation)
8
+ - [SubscriptionInfo Platform Nuances](#subscriptioninfo-platform-nuances)
9
+ - [Cross-Platform Best Practices](#cross-platform-best-practices)
10
+ - [Platform Extension Availability](#platform-extension-availability)
11
+
12
+ ## Apple App Store Extensions
13
+
14
+ Access via `store.AppleStoreExtendedPurchaseService` (for purchase features) and `store.AppleStoreExtendedService` (for store features).
15
+
16
+ ### Promotional Purchases
17
+
18
+ Apple can present purchases from the App Store product page. Intercept and handle them:
19
+
20
+ ```csharp
21
+ if (store.AppleStoreExtendedPurchaseService != null)
22
+ {
23
+ store.AppleStoreExtendedPurchaseService.OnPromotionalPurchaseIntercepted += (product) =>
24
+ {
25
+ // Player tapped "Buy" on App Store product page
26
+ // You can delay the purchase (e.g., show a loading screen first)
27
+ Debug.Log($"Promotional purchase intercepted: {product.definition.id}");
28
+
29
+ // When ready, continue the purchase
30
+ store.AppleStoreExtendedPurchaseService.ContinuePromotionalPurchases();
31
+ };
32
+ }
33
+ ```
34
+
35
+ **CRITICAL:** If you subscribe to `OnPromotionalPurchaseIntercepted`, you MUST eventually call `ContinuePromotionalPurchases()` or the purchase will hang indefinitely.
36
+
37
+ ### Ask-to-Buy (Parental Approval)
38
+
39
+ On devices with Family Sharing and a child account, purchases may require parental approval:
40
+
41
+ ```csharp
42
+ store.OnPurchaseDeferred += (deferredOrder) =>
43
+ {
44
+ // Purchase is waiting for parental approval
45
+ // Show UI: "Purchase pending approval"
46
+ // Do NOT grant content yet
47
+ Debug.Log("Purchase deferred - awaiting approval");
48
+ };
49
+ ```
50
+
51
+ The purchase will complete later (triggering `OnPurchasePending`) when approved, or fail when rejected.
52
+
53
+ For testing in sandbox:
54
+
55
+ ```csharp
56
+ // Simulate Ask-to-Buy in the editor/sandbox
57
+ store.AppleStoreExtendedPurchaseService.simulateAskToBuy = true;
58
+ ```
59
+
60
+ ### Offer Code Redemption
61
+
62
+ Present the Apple offer code redemption sheet:
63
+
64
+ ```csharp
65
+ store.AppleStoreExtendedPurchaseService.PresentCodeRedemptionSheet();
66
+ ```
67
+
68
+ ### Entitlement Revocation
69
+
70
+ Listen for revoked entitlements (e.g., refund granted):
71
+
72
+ ```csharp
73
+ store.AppleStoreExtendedPurchaseService.OnEntitlementRevoked += (productId) =>
74
+ {
75
+ Debug.Log($"Entitlement revoked for: {productId}");
76
+ // Remove the content/feature from the player
77
+ };
78
+ ```
79
+
80
+ ### Store Capabilities
81
+
82
+ ```csharp
83
+ // Check if the device can make payments (parental controls may block)
84
+ bool canPay = store.AppleStoreExtendedService.canMakePayments;
85
+
86
+ // Set App Account Token for server-to-server verification
87
+ store.AppleStoreExtendedService.SetAppAccountToken(Guid.NewGuid());
88
+
89
+ // Fetch storefront info (StoreKit 2 only)
90
+ store.AppleStoreExtendedService.FetchStorefront(
91
+ (storefront) => Debug.Log($"Storefront: {storefront.CountryCode}"),
92
+ (error) => Debug.LogError($"Storefront error: {error}")
93
+ );
94
+ ```
95
+
96
+ ## Google Play Store Extensions
97
+
98
+ Access via `store.GooglePlayStoreExtendedPurchaseService` (for purchase features) and `store.GooglePlayStoreExtendedService` (for store features).
99
+
100
+ ### Subscription Upgrade/Downgrade
101
+
102
+ Change a player's subscription tier:
103
+
104
+ ```csharp
105
+ // Get the current subscription order and the new product
106
+ Order currentOrder = /* the player's current subscription order */;
107
+ Product newProduct = store.GetProductById("com.mygame.vip_annual");
108
+
109
+ store.GooglePlayStoreExtendedPurchaseService.UpgradeDowngradeSubscription(
110
+ currentOrder,
111
+ newProduct,
112
+ GooglePlayReplacementMode.ChargeFullPrice
113
+ );
114
+ ```
115
+
116
+ ### GooglePlayReplacementMode Values
117
+
118
+ | Mode | Behavior |
119
+ |---|---|
120
+ | `UnknownReplacementMode` | Default |
121
+ | `WithTimeProration` | Remaining time is adjusted |
122
+ | `ChargeProratedPrice` | Prorated charge for the upgrade |
123
+ | `WithoutProration` | New plan starts at next billing |
124
+ | `ChargeFullPrice` | Full price charged immediately |
125
+ | `Deferred` | Change takes effect at next billing |
126
+
127
+ ### Obfuscated IDs
128
+
129
+ Set obfuscated account/profile IDs for fraud detection:
130
+
131
+ ```csharp
132
+ store.GooglePlayStoreExtendedService.SetObfuscatedAccountId("hashed_account_id");
133
+ store.GooglePlayStoreExtendedService.SetObfuscatedProfileId("hashed_profile_id");
134
+ ```
135
+
136
+ Retrieve them from an order:
137
+
138
+ ```csharp
139
+ string accountId = store.GooglePlayStoreExtendedPurchaseService.GetObfuscatedAccountId(order);
140
+ string profileId = store.GooglePlayStoreExtendedPurchaseService.GetObfuscatedProfileId(order);
141
+ ```
142
+
143
+ ### Deferred Payment Events
144
+
145
+ ```csharp
146
+ store.GooglePlayStoreExtendedPurchaseService.OnDeferredPaymentUntilRenewalDate += (deferredOrder) =>
147
+ {
148
+ Debug.Log($"Payment deferred until renewal: {deferredOrder.SubscriptionOrdered.definition.id}");
149
+ };
150
+ ```
151
+
152
+ ## Apple JWS Representation (Server-Side Validation)
153
+
154
+ For server-side Apple receipt validation (replacing the deprecated `CrossPlatformValidator`):
155
+
156
+ ```csharp
157
+ store.OnPurchasePending += (pendingOrder) =>
158
+ {
159
+ // Access the JWS-signed transaction
160
+ string jws = pendingOrder.Info.Apple?.jwsRepresentation;
161
+ // Send to your server for validation with Apple's App Store Server API (v2)
162
+ ValidateOnServer(jws);
163
+ };
164
+ ```
165
+
166
+ The `jwsRepresentation` contains a signed JSON Web Signature that can be verified using Apple's public keys.
167
+
168
+ ## SubscriptionInfo Platform Nuances
169
+
170
+ | Method | Apple | Google |
171
+ |---|---|---|
172
+ | `GetPurchaseDate()` | Returns the **renewal date** (most recent renewal) | Returns the **original purchase date** |
173
+ | `GetCancelDate()` | Returns actual cancellation date | Returns `DateTime.MinValue` (not supported) |
174
+
175
+ Always check `IsSubscribed()` first — if the result is `Result.Unsupported`, the platform doesn't provide that information.
176
+
177
+ ## Cross-Platform Best Practices
178
+
179
+ | Concern | Recommendation |
180
+ |---|---|
181
+ | Restore button | Required on iOS (Apple guideline). Add a "Restore Purchases" button that calls `store.RestoreTransactions()`. |
182
+ | Receipt validation | **Google Play:** Use `CrossPlatformValidator(GooglePlayTangle.Data(), Application.identifier)` for local validation. **Apple (StoreKit 2):** Local validation via `CrossPlatformValidator` is a **no-op** — use `order.Info.Apple?.jwsRepresentation` for server-side validation instead. |
183
+ | Pending purchases | Always handle `OnPurchasePending` and call `ConfirmPurchase`. Unconfirmed purchases persist across launches. |
184
+ | Product IDs | Use reverse-domain naming: `com.company.game.product` |
185
+ | Testing | Use sandbox accounts (Apple) and license testing accounts (Google) for testing without real charges. |
186
+ | Subscriptions | Always check `IsSubscribed()` at app launch, not just purchase time. Subscriptions can expire or be cancelled externally. |
187
+
188
+ ## Platform Extension Availability
189
+
190
+ | Extension | iOS | Android | Editor |
191
+ |---|---|---|---|
192
+ | `AppleStoreExtendedService` | Available | `null` | `null` |
193
+ | `AppleStoreExtendedPurchaseService` | Available | `null` | `null` |
194
+ | `GooglePlayStoreExtendedService` | `null` | Available | `null` |
195
+ | `GooglePlayStoreExtendedPurchaseService` | `null` | Available | `null` |
196
+
197
+ **CRITICAL:** Always null-check platform extensions before use:
198
+
199
+ ```csharp
200
+ if (store.AppleStoreExtendedPurchaseService != null)
201
+ {
202
+ store.AppleStoreExtendedPurchaseService.OnPromotionalPurchaseIntercepted += HandlePromo;
203
+ }
204
+ ```
@@ -0,0 +1,205 @@
1
+ # Pre-Check: Project Scan and Path Routing
2
+
3
+ ## Table of Contents
4
+
5
+ - [Ambiguous Intent](#ambiguous-intent)
6
+ - [IAP D2C Capabilities (Direct-to-Customer, Third-Party Payment Provider)](#iap-d2c-capabilities-direct-to-customer-third-party-payment-provider)
7
+ - [Scan Order (standard IAP paths)](#scan-order-standard-iap-paths)
8
+ - [Routing Summary](#routing-summary)
9
+
10
+ Scan steps: [1 — Third-Party IAP Package Check](#1--third-party-iap-package-check-highest-priority) · [2 — Native Google Billing](#2--native-google-billing-check) · [2b — Native iOS StoreKit](#2b--native-ios-storekit-check) · [3 — Unity IAP v4](#3--unity-iap-v4-check) · [4 — Unity IAP v5 Already Installed](#4--unity-iap-v5-already-installed) · [5 — No IAP Detected](#5--no-iap-detected)
11
+ Third-party sub-checks: [1a Essential Kit](#1a--essential-kit-conversion-supported) · [1b UniPay](#1b--unipay-assessment-path) · [1c RevenueCat](#1c--revenuecat-assessment-path) · [1d Adapty](#1d--adapty-assessment-path)
12
+
13
+ Run this scan before doing anything else. Do not read any other reference file or make any changes until routing is resolved.
14
+
15
+ ## Ambiguous Intent
16
+
17
+ If the user's prompt does not clearly indicate which billing backend they want — for example:
18
+
19
+ - "Add a StoreController for me"
20
+ - "Add a purchase manager"
21
+ - "Set up IAP"
22
+ - "Help me add in-app purchases"
23
+ - "Upgrade to latest IAP"
24
+
25
+ **Stop and ask before scanning or routing:**
26
+
27
+ > "Would you like to implement purchasing using:
28
+ > - **Apple App Store / Google Play** (standard platform billing), or
29
+ > - **IAP D2C Capabilities** (third-party payment provider such as Stripe or Coda via Unity Cloud)?"
30
+
31
+ Do not assume a default. Route only after the user confirms their intent.
32
+
33
+ ---
34
+
35
+ ## IAP D2C Capabilities (Direct-to-Customer, Third-Party Payment Provider)
36
+
37
+ If the user explicitly asks for IAP D2C Capabilities, Stripe/Coda payment integration, or a third-party payment provider, **do not follow the standard scan order below**. Instead:
38
+
39
+ - If the project has IAP v4, native Google Billing, or a third-party IAP package → resolve those blockers first using the standard scan order, then return here.
40
+ - If the project has no IAP, or has `com.unity.purchasing` **v5.4+** → route to [path-implement-iap-d2c.md](path-implement-iap-d2c.md).
41
+ - If the project has `com.unity.purchasing` **v5.0–5.3** → inform the user that IAP D2C Capabilities require v5.4+, instruct them to upgrade via Package Manager, and continue once the upgrade is confirmed.
42
+
43
+ ---
44
+
45
+ ## Scan Order (standard IAP paths)
46
+
47
+ Run scans in this exact order. The first match wins — stop scanning and route immediately.
48
+
49
+ ---
50
+
51
+ ### 1 — Third-Party IAP Package Check (highest priority)
52
+
53
+ #### 1a — Essential Kit (conversion supported)
54
+
55
+ Search `Packages/manifest.json` and `Packages/packages-lock.json` for `com.voxelbusters.essentialkit`.
56
+
57
+ **If found → only one path is valid:**
58
+
59
+ > Route to [convert-essentialkit.md](convert-essentialkit.md)
60
+
61
+ Inform the user that Essential Kit was detected and that the conversion path will be used. Do not offer any other path.
62
+
63
+ ---
64
+
65
+ #### 1b — UniPay (assessment path)
66
+
67
+ Search `Packages/manifest.json`, `Packages/packages-lock.json`, and `Assets/Plugins/` for UniPay signals:
68
+
69
+ ```
70
+ com\.flobuk\.unipay|UniPay|Assets/Plugins/UniPay|Assets/Plugins/SIS
71
+ ```
72
+
73
+ **If found → only one path is valid:**
74
+
75
+ > Route to [convert-unipay.md](convert-unipay.md)
76
+
77
+ Inform the user that UniPay was detected and that the assessment path will be used. Do not offer any other path.
78
+
79
+ ---
80
+
81
+ #### 1c — RevenueCat (assessment path)
82
+
83
+ Search `Packages/manifest.json` and `Packages/packages-lock.json` for `com.revenuecat.purchases-unity`.
84
+
85
+ **If found → only one path is valid:**
86
+
87
+ > Route to [convert-revenuecat.md](convert-revenuecat.md)
88
+
89
+ Inform the user that RevenueCat was detected and that the assessment path will be used. Do not offer any other path.
90
+
91
+ ---
92
+
93
+ #### 1d — Adapty (assessment path)
94
+
95
+ Search `Packages/manifest.json`, `Packages/packages-lock.json`, and `Assets/` for Adapty signals:
96
+
97
+ ```
98
+ com\.adapty|Assets/Adapty|AdaptySDK
99
+ ```
100
+
101
+ **If found → only one path is valid:**
102
+
103
+ > Route to [convert-adapty.md](convert-adapty.md)
104
+
105
+ Inform the user that Adapty was detected and that the assessment path will be used. Do not offer any other path.
106
+
107
+ ---
108
+
109
+ ### 2 — Native Google Billing Check
110
+
111
+ Search the following locations:
112
+
113
+ - `Assets/**/*.cs` for: `AndroidJavaObject|AndroidJavaClass|BillingClient|BillingManager|GoogleBilling|BillingBridge`
114
+ - `Assets/Plugins/Android/**/*.java`, `*.kt` for: `com\.android\.billingclient`
115
+ - `mainTemplate.gradle`, `launcherTemplate.gradle`, `baseProjectTemplate.gradle` for: `com\.android\.billingclient:billing`
116
+
117
+ **If found → only one path is valid:**
118
+
119
+ > Route to [path-convert-native-google-billing.md](path-convert-native-google-billing.md)
120
+
121
+ Inform the user that native Google Billing was detected and that the conversion path will be used. If `com.unity.purchasing` is absent or not the latest stable version, instruct the user to install or upgrade to the latest stable version via Package Manager before proceeding.
122
+
123
+ Do not offer any other path.
124
+
125
+ ---
126
+
127
+ ### 2b — Native iOS StoreKit Check
128
+
129
+ Search the following for native StoreKit signals:
130
+
131
+ - `Assets/Plugins/iOS/**/*.m`, `*.mm`, `*.h`, `*.swift` for: `SKProductsRequest|SKPaymentQueue|SKPaymentTransaction|SKPaymentTransactionObserver|Product\.products|Transaction\.currentEntitlements`
132
+ - `Assets/**/*.cs` for: `DllImport.*__Internal` combined with IAP-related method names, or `UnitySendMessage` calls associated with StoreKit
133
+
134
+ **If found → only one path is valid:**
135
+
136
+ > Route to [path-convert-native-storekit.md](path-convert-native-storekit.md)
137
+
138
+ Inform the user that a native iOS StoreKit plugin was detected and that the conversion path will be used. If `com.unity.purchasing` is absent or not the latest stable version, instruct the user to install or upgrade via Package Manager before proceeding.
139
+
140
+ Do not offer any other path.
141
+
142
+ ---
143
+
144
+ ### 3 — Unity IAP v4 Check
145
+
146
+ Search `Packages/manifest.json` for `com.unity.purchasing` with a version matching `4\.`.
147
+
148
+ Also search `Assets/**/*.cs` for legacy v4 API patterns:
149
+
150
+ ```
151
+ IStoreListener|UnityPurchasing\.Initialize|ConfigurationBuilder
152
+ ```
153
+
154
+ **If found → only one path is valid:**
155
+
156
+ > Route to [migration-v4-to-v5.md](migration-v4-to-v5.md)
157
+
158
+ Inform the user that Unity IAP v4 was detected and that the v4→v5 migration path will be used. Do not offer any other path.
159
+
160
+ ---
161
+
162
+ ### 4 — Unity IAP v5 Already Installed
163
+
164
+ If none of the above matched, search `Packages/manifest.json` for `com.unity.purchasing` with a version matching `5\.`:
165
+
166
+ **If found → inform the user:**
167
+
168
+ > "This project already has Unity IAP v5 installed. You can extend the existing setup — for example, add new products, add platform-specific features, or integrate IAP D2C Capabilities. What would you like to do?"
169
+
170
+ Then route based on the user's answer. Do not automatically route to the new-project path — the project already has IAP configured.
171
+
172
+ ---
173
+
174
+ ### 5 — No IAP Detected
175
+
176
+ If none of the above matched and `com.unity.purchasing` is absent from `manifest.json`:
177
+
178
+ **→ only one path is valid:**
179
+
180
+ > Route to [path-add-iap-to-new-project.md](path-add-iap-to-new-project.md)
181
+
182
+ ---
183
+
184
+ ## Routing Summary
185
+
186
+ | What is detected | Valid path |
187
+ |---|---|
188
+ | Essential Kit (`com.voxelbusters.essentialkit`) | Convert Essential Kit billing → IAP 5 — see convert-essentialkit.md |
189
+ | UniPay (FLOBUK) | Assessment — see convert-unipay.md |
190
+ | RevenueCat | Assessment — see convert-revenuecat.md |
191
+ | Adapty | Assessment — see convert-adapty.md |
192
+ | Native Google BillingClient | Convert native Google Billing → IAP 5 — see path-convert-native-google-billing.md |
193
+ | Native iOS StoreKit plugin (`SKPaymentQueue` / `DllImport("__Internal")`) | Convert native StoreKit → IAP 5 — see path-convert-native-storekit.md |
194
+ | `com.unity.purchasing` v4 or v4 API patterns | Migrate IAP v4 → v5 |
195
+ | `com.unity.purchasing` v5 already installed | Ask user what to extend — do not auto-route |
196
+ | No IAP detected | Add Unity IAP 5 to new project |
197
+ | User explicitly requests IAP D2C Capabilities / payment provider | See IAP D2C Capabilities section above |
198
+
199
+ ---
200
+
201
+ ## Also check: Codeless catalog presence
202
+
203
+ Regardless of which route above wins, check whether `Assets/Resources/IAPProductCatalog.json` exists. This is the **Codeless IAP** catalog and is independent of the routing decision — but if it is present and `enableCodelessAutoInitialization` is true, adding a scripted `StoreController` creates a race condition with `CodelessIAPStoreListener`.
204
+
205
+ Surface the catalog's presence and auto-init flag to the user before generating scripted IAP code. See [codeless-catalog.md](codeless-catalog.md) for the race condition details and the three mitigation options.
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: incident-recovery
3
+ description: Coordinates evidence-preserving response to data loss, corruption, broken builds, failed migrations, or production-impacting Unity incidents.
4
+ allowed-tools: Read, Glob, Grep, Write, Edit, Bash, Task, AskUserQuestion
5
+ ---
6
+
7
+ # Incident Recovery
8
+
9
+ Read `.nccgs/project.yaml`, `.nccgs/state.md`, and the active context packet when present. Preserve Product Owner authority and unrelated work.
10
+
11
+ Prioritize containment and evidence preservation. Record incident scope, affected versions/data, current state, timeline, hypotheses, and irreversible-action boundaries. Avoid destructive cleanup and speculative rewrites. Build a recovery graph with backups, reproducible diagnostics, validation, and rollback. Apply only authorized recovery changes; maintain an incident record and follow-up prevention actions. Data deletion or production actions require explicit authority.
12
+
13
+ Return outcome, evidence, affected records, blockers or decisions, residual risk, and the exact next workflow. Do not claim DONE unless this is the `closure` skill and every configured gate passes.
14
+
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: initialize-ai-navigation
3
+ description: Sets up and configures the Unity AI Navigation system — NavMesh surfaces, NavMesh agents, obstacles, links, modifiers, areas and costs. Use when creating walkable navigation meshes, adding pathfinding agents, setting up patrol routes, configuring obstacle avoidance and carving, connecting separate NavMeshes with links, coupling navigation with animation, or troubleshooting navigation issues.
4
+ ---
5
+
6
+ Determine what the user needs and guide them through navigation setup. See [navigation-system.md](references/navigation-system.md) for expanded component details, API notes, code recipes, and troubleshooting.
7
+
8
+ ### Passing C# to `eval`
9
+
10
+ `eval` compiles a **statement block, not a file**. Two consequences, both of which cause a
11
+ compile error rather than a warning:
12
+
13
+ - **No `using` directives.** The compiler reads `using UnityEngine;` as a resource-disposal
14
+ statement and rejects it (`CS0210`).
15
+ - **Types must be fully qualified.** A bare `AssetDatabase` or `Volume` does not resolve
16
+ (`CS0246` / `CS0103`), and a bare `Object` is ambiguous with `object` (`CS0104`).
17
+
18
+ Where a snippet below is written as a file — with usings, for readability, or because it is
19
+ meant to be saved into the project — qualify the types before passing it to `eval`.
20
+
21
+ ## Routing Logic
22
+
23
+ | User Says | Interpretation |
24
+ |-----------|---------------|
25
+ | "add navigation" / "set up nav" | Full setup: NavMeshSurface + bake + NavMeshAgent |
26
+ | "make this character navigate" | Add NavMeshAgent, ensure NavMesh exists |
27
+ | "add pathfinding" | NavMeshAgent + movement script |
28
+ | "agent won't move" / "path not found" | Troubleshoot — see Troubleshooting Decision Tree in reference |
29
+ | "avoid obstacles" | NavMeshObstacle with carving or avoidance |
30
+ | "connect two areas" / "jump across" | NavMeshLink between areas |
31
+ | "patrol between points" | NavMeshAgent + patrol script |
32
+ | "click to move" | NavMeshAgent + raycast click-to-move script |
33
+ | "animate the character while navigating" | Couple Animator with NavMeshAgent |
34
+ | "different agent sizes" | Configure agent types in Navigation window |
35
+ | "areas and costs" / "restrict areas" | NavMesh area types, modifiers, and agent area masks |
36
+
37
+ ## Workflow
38
+
39
+ ### 0. Package Installation Check
40
+ Before doing anything else, verify that `com.unity.ai.navigation` is installed. If it's missing,
41
+ add it to `Packages/manifest.json` under `dependencies` — Unity resolves it when the Editor next
42
+ regains focus, and this needs no Editor connection:
43
+
44
+ ```json
45
+ "com.unity.ai.navigation": "<current 2.x version>"
46
+ ```
47
+
48
+ Don't invent the version string. Read the current one from the Unity registry —
49
+ `https://packages.unity.com/com.unity.ai.navigation` lists every published version — or copy the version an
50
+ adjacent Unity package in this manifest already uses. A version that doesn't exist makes
51
+ Unity fail resolution **silently**, so a wrong guess looks like nothing happened.
52
+
53
+ Proceed only once it's confirmed installed. If you have a live Editor to run C# in, see
54
+ [navigation-system.md](references/navigation-system.md) for the `Client.Add` equivalent.
55
+
56
+ ### 1. Pre-Flight: Assess Current Navigation Setup
57
+ Before making changes, inspect what already exists:
58
+ 1. Find the existing navigation components. With a connected Editor, query the live scene for
59
+ `NavMeshSurface`, `NavMeshAgent`, `NavMeshObstacle`, `NavMeshLink` and `NavMeshModifier` — see
60
+ the `unity-cli` skill for driving a running Editor. Without one, search the scene and prefab
61
+ files for those component names.
62
+ 2. Check configured agent types via **Window > AI > Navigation > Agents tab**.
63
+ 3. Summarize ALL detected navigation components before proposing changes.
64
+
65
+ ### 2. Gather Missing Information
66
+ Before creating components, ensure the user has specified: walkable surfaces, agent type/size, agent behavior, obstacles, links, and area/cost requirements. Ask if anything is unclear. See the Information Gathering Checklist in the reference for full details.
67
+
68
+ ### 3. Planning & Execution
69
+ Follow this general order. See the Component Setup Guide in the reference for detailed step-by-step instructions per component:
70
+ 1. **NavMesh Surface** — create the walkable mesh (bake it)
71
+ 2. **NavMesh Agent** — add pathfinding characters
72
+ 3. **NavMesh Obstacle** — add dynamic obstacles
73
+ 4. **NavMesh Link** — connect disconnected NavMesh areas
74
+ 5. **NavMesh Modifier / Modifier Volume** — fine-tune area types
75
+ 6. **Scripts** — movement, patrol, click-to-move, animation coupling (see Common Recipes in reference)
76
+
77
+ ### 4. Validation
78
+ After setup, confirm:
79
+ - NavMesh is baked and visible (blue overlay)
80
+ - NavMeshSurface agent type matches NavMeshAgent agent type
81
+ - Agents have a valid path to their destination
82
+ - Obstacles carve or obstruct correctly
83
+ - Links have both ends connected and Activated is enabled
84
+ - Area masks allow the intended movement
85
+ - No conflicting components (see Mixing Components Guide in reference)
86
+ - If using Rigidbody with NavMeshAgent, Is Kinematic is enabled
87
+
88
+ ### 5. Final Confirmation
89
+ Summarize what was created or changed:
90
+ - NavMesh Surfaces: which GameObject, agent type, geometry mode, bake status
91
+ - NavMesh Agent(s): which GameObject, speed, stopping distance, area mask
92
+ - NavMesh Obstacle(s): which GameObject, shape, carve on/off
93
+ - NavMesh Link(s): start/end, bidirectional, area type
94
+ - Scripts: which scripts attached to which GameObjects
95
+ - Any manual steps required (adjust waypoints, re-bake after scene changes, etc.)