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,119 @@
1
+ ## Code Templates
2
+
3
+ Each template is a snippet to run through the Editor's `eval` command. Hard stops `throw`,
4
+ so the eval fails loudly; anything the caller needs to read is `return`ed.
5
+
6
+ **`eval` compiles a statement block, not a file.** `using` directives are rejected there — the
7
+ compiler reads `using UnityEngine;` as a resource-disposal statement and fails. So these
8
+ templates fully qualify every type. If you instead save the code as a `.cs` file for the user
9
+ to keep, add the usings back and drop the qualification.
10
+
11
+ ### Creating a Global Volume with Effects
12
+
13
+ ```csharp
14
+ // Verify HDR is enabled on the URP Asset
15
+ var urpAsset = UnityEngine.Rendering.Universal.UniversalRenderPipeline.asset;
16
+ if (urpAsset == null) { throw new System.Exception("No UniversalRenderPipelineAsset active."); }
17
+ if (!urpAsset.supportsHDR) { throw new System.Exception("HDR is disabled on the URP Asset. Enable it for Bloom/Tonemapping."); }
18
+
19
+ var profile = UnityEngine.ScriptableObject.CreateInstance<UnityEngine.Rendering.VolumeProfile>();
20
+ var assetPath = UnityEditor.AssetDatabase.GenerateUniqueAssetPath("Assets/Settings/PostProcessProfile.asset");
21
+ UnityEditor.AssetDatabase.CreateAsset(profile, assetPath);
22
+
23
+ // MUST set overrideState = true on each property
24
+ var bloom = profile.Add<UnityEngine.Rendering.Universal.Bloom>();
25
+ bloom.threshold.overrideState = true;
26
+ bloom.threshold.value = 0.9f;
27
+ bloom.intensity.overrideState = true;
28
+ bloom.intensity.value = 1f;
29
+ bloom.scatter.overrideState = true;
30
+ bloom.scatter.value = 0.7f;
31
+
32
+ var tonemapping = profile.Add<UnityEngine.Rendering.Universal.Tonemapping>();
33
+ tonemapping.mode.overrideState = true;
34
+ tonemapping.mode.value = UnityEngine.Rendering.Universal.TonemappingMode.ACES;
35
+
36
+ var volumeObj = new UnityEngine.GameObject("Global Volume");
37
+ var volume = volumeObj.AddComponent<UnityEngine.Rendering.Volume>();
38
+ volume.isGlobal = true;
39
+ volume.profile = profile;
40
+
41
+ UnityEditor.Undo.RegisterCreatedObjectUndo(volumeObj, "Create Global Volume");
42
+ UnityEditor.EditorUtility.SetDirty(profile);
43
+ UnityEditor.AssetDatabase.SaveAssets();
44
+
45
+ return "Created Global Volume with Bloom and ACES Tonemapping.";
46
+ ```
47
+
48
+ ### Enabling Post-Processing on Camera
49
+
50
+ ```csharp
51
+ var cam = UnityEngine.Camera.main;
52
+ if (cam == null) { throw new System.Exception("No Main Camera found."); }
53
+
54
+ if (!cam.TryGetComponent<UnityEngine.Rendering.Universal.UniversalAdditionalCameraData>(out var data)) { throw new System.Exception("Missing UniversalAdditionalCameraData. Is URP active?"); }
55
+
56
+ UnityEditor.Undo.RecordObject(data, "Enable Post-Processing");
57
+ data.renderPostProcessing = true;
58
+ UnityEditor.EditorUtility.SetDirty(data);
59
+ return $"Post-processing enabled on '{cam.name}'.";
60
+ ```
61
+
62
+ ### Modifying an Existing Volume Profile
63
+
64
+ ```csharp
65
+ var volumeObj = UnityEngine.GameObject.Find("Global Volume");
66
+ if (volumeObj != null && volumeObj.TryGetComponent<UnityEngine.Rendering.Volume>(out var volume) && volume.profile != null)
67
+ {
68
+ if (volume.profile.TryGet<UnityEngine.Rendering.Universal.Bloom>(out var bloom))
69
+ {
70
+ bloom.intensity.overrideState = true;
71
+ bloom.intensity.value = 2f;
72
+ }
73
+ UnityEditor.EditorUtility.SetDirty(volume.profile);
74
+ }
75
+ ```
76
+
77
+ ### Making a change undoable through `eval`
78
+
79
+ `Undo.RecordObject` alone does **not** produce an undo entry when the snippet runs through the
80
+ Editor's `eval` command (measured: nothing appeared on the undo stack). `RecordObject` takes a
81
+ *deferred* snapshot that Unity flushes at the end of an Editor event, and a snippet executed by
82
+ the Pipeline server is outside that loop.
83
+
84
+ Use the explicit group + immediate-snapshot + flush sequence instead, which does not rely on
85
+ the event loop:
86
+
87
+ ```csharp
88
+ UnityEditor.Undo.IncrementCurrentGroup();
89
+ UnityEditor.Undo.SetCurrentGroupName("Set up post-processing"); // the label the user will see
90
+ var group = UnityEditor.Undo.GetCurrentGroup();
91
+
92
+ UnityEditor.Undo.RegisterCompleteObjectUndo(target, "Set up post-processing"); // immediate, not deferred
93
+ // ... make the modification, and for a newly created object:
94
+ // UnityEditor.Undo.RegisterCreatedObjectUndo(newObject, "Set up post-processing");
95
+ UnityEditor.EditorUtility.SetDirty(target);
96
+
97
+ UnityEditor.Undo.FlushUndoRecordObjects(); // force the snapshot out now
98
+ UnityEditor.Undo.CollapseUndoOperations(group); // one entry, not several
99
+
100
+ return UnityEditor.Undo.GetCurrentGroupName(); // report the label back to confirm it landed
101
+ ```
102
+
103
+ **Verify it landed rather than assuming.** The returned group name tells you the group exists;
104
+ to confirm the entry is actually on the stack, have the user check `Edit > Undo <label>` in the
105
+ menu — it should read your label.
106
+
107
+ **If it still doesn't land, fall back to a scoped revert rather than dropping the guarantee.**
108
+ Before modifying, read the current value of the field you're about to change and report it with
109
+ a one-line snippet that restores it, so reverting is a single command:
110
+
111
+ ```csharp
112
+ // captured before the change
113
+ var previous = data.renderPostProcessing; // report: previous = false
114
+ // revert snippet to hand the user:
115
+ // data.renderPostProcessing = false;
116
+ ```
117
+
118
+ Scene and prefab files are text-serialized, so version control is the last resort, not the
119
+ first answer — offer the scoped revert before pointing at `git`.
@@ -0,0 +1,86 @@
1
+ ## Effect Reference
2
+
3
+ **Bloom** (`Bloom`) — Glow on bright areas. Best with HDR rendering enabled on the URP Asset; works in SDR if `threshold` < 1.
4
+ - `threshold` (MinFloatParameter, default 0.9, min 0) — brightness cutoff below which pixels don't bloom.
5
+ - `intensity` (MinFloatParameter, default 0, min 0) — strength of the bloom effect.
6
+ - `scatter` (ClampedFloatParameter, default 0.7, 0–1) — spread/diffusion of the glow.
7
+ - `clamp` (MinFloatParameter, default 65472, min 0) — clamps pixel intensity to prevent artifacts.
8
+ - `tint` (ColorParameter, default white) — color tint applied to bloom.
9
+ - `highQualityFiltering` (BoolParameter, default false) — uses bicubic upsampling for smoother bloom.
10
+ - `downscale` (BloomDownscaleMode: `Half`, `Quarter`) — resolution for bloom computation.
11
+ - `maxIterations` (ClampedIntParameter, default 6, 2–8) — number of blur passes.
12
+
13
+ **Tonemapping** (`Tonemapping`) — Maps HDR to display range. Requires HDR.
14
+ - `mode` (TonemappingMode: `None`, `Neutral`, `ACES`) — `ACES` for cinematic, `Neutral` for minimal color shift.
15
+
16
+ **Color Adjustments** (`ColorAdjustments`) — **WARNING: Class is `ColorAdjustments`, NOT `ColorGrading`.**
17
+ - `postExposure` (FloatParameter, default 0) — exposure adjustment in EV units. Unbounded.
18
+ - `contrast` (ClampedFloatParameter, default 0, -100–100).
19
+ - `colorFilter` (ColorParameter, default white) — multiplied against the final color.
20
+ - `hueShift` (ClampedFloatParameter, default 0, -180–180) — shifts all hues.
21
+ - `saturation` (ClampedFloatParameter, default 0, -100–100).
22
+
23
+ **Depth of Field** (`DepthOfField`)
24
+ - `mode` (DepthOfFieldMode: `Off`, `Gaussian`, `Bokeh`).
25
+ - Gaussian mode: `gaussianStart` (MinFloatParameter, default 10, min 0), `gaussianEnd` (MinFloatParameter, default 30, min 0), `gaussianMaxRadius` (ClampedFloatParameter, default 1, 0.5–1.5).
26
+ - Bokeh mode: `focusDistance` (MinFloatParameter, default 10, min 0.1), `focalLength` (ClampedFloatParameter, default 50, 1–300), `aperture` (ClampedFloatParameter, default 5.6, 1–32), `bladeCount` (ClampedIntParameter, default 5, 3–9), `bladeCurvature` (ClampedFloatParameter, default 1, 0–1), `bladeRotation` (ClampedFloatParameter, default 0, -180–180).
27
+
28
+ **Vignette** (`Vignette`)
29
+ - `intensity` (ClampedFloatParameter, default 0, 0–1).
30
+ - `smoothness` (ClampedFloatParameter, default 0.2, 0.01–1).
31
+ - `color` (ColorParameter, default black).
32
+ - `center` (Vector2Parameter, default (0.5, 0.5)).
33
+ - `rounded` (BoolParameter, default false) — constrains vignette to circular shape.
34
+
35
+ **Motion Blur** (`MotionBlur`)
36
+ - `mode` (MotionBlurMode: `CameraOnly`, `CameraAndObjects`). `CameraAndObjects` requires per-object motion vectors.
37
+ - `quality` (MotionBlurQuality: `Low`, `Medium`, `High`).
38
+ - `intensity` (ClampedFloatParameter, default 0, 0–1).
39
+ - `clamp` (ClampedFloatParameter, default 0.05, 0–0.2) — maximum velocity in screen fraction.
40
+
41
+ **Film Grain** (`FilmGrain`)
42
+ - `type` (FilmGrainLookup: `Thin1`, `Thin2`, `Medium1`–`Medium6`, `Large01`, `Large02`, `Custom`).
43
+ - `intensity` (ClampedFloatParameter, default 0, 0–1).
44
+ - `response` (ClampedFloatParameter, default 0.8, 0–1).
45
+ - `texture` (NoInterpTextureParameter, default null) — required when `type` is `Custom`.
46
+
47
+ **Chromatic Aberration** (`ChromaticAberration`)
48
+ - `intensity` (ClampedFloatParameter, default 0, 0–1). Keep subtle (0.05–0.15) for realism.
49
+
50
+ **Split Toning** (`SplitToning`)
51
+ - `shadows` (ColorParameter, default grey).
52
+ - `highlights` (ColorParameter, default grey).
53
+ - `balance` (ClampedFloatParameter, default 0, -100–100).
54
+
55
+ **Lens Distortion** (`LensDistortion`)
56
+ - `intensity` (ClampedFloatParameter, default 0, -1–1). Negative = barrel, positive = pincushion.
57
+ - `xMultiplier` (ClampedFloatParameter, default 1, 0–1).
58
+ - `yMultiplier` (ClampedFloatParameter, default 1, 0–1).
59
+ - `center` (Vector2Parameter, default (0.5, 0.5)).
60
+ - `scale` (ClampedFloatParameter, default 1, 0.01–5).
61
+
62
+ **White Balance** (`WhiteBalance`)
63
+ - `temperature` (ClampedFloatParameter, default 0, -100–100). Negative = cool, positive = warm.
64
+ - `tint` (ClampedFloatParameter, default 0, -100–100). Negative = green, positive = magenta.
65
+
66
+ **Panini Projection** (`PaniniProjection`) — Only useful with camera FOV > 90.
67
+ - `distance` (ClampedFloatParameter, default 0, 0–1).
68
+ - `cropToFit` (ClampedFloatParameter, default 1, 0–1).
69
+
70
+ **Lift Gamma Gain** (`LiftGammaGain`) — Each is `Vector4Parameter` (RGBA where A is intensity offset, defaults to (1,1,1,0)).
71
+ - `lift` — affects shadows.
72
+ - `gamma` — affects midtones.
73
+ - `gain` — affects highlights.
74
+
75
+ **Shadows Midtones Highlights** (`ShadowsMidtonesHighlights`) — Each `Vector4Parameter`, defaults to (1,1,1,0).
76
+ - `shadows`, `midtones`, `highlights`.
77
+ - Zone boundaries: `shadowsStart` (default 0), `shadowsEnd` (default 0.3), `highlightsStart` (default 0.55), `highlightsEnd` (default 1). All `MinFloatParameter`, min 0.
78
+
79
+ **Color Curves** (`ColorCurves`) — All `TextureCurveParameter`.
80
+ - `master`, `red`, `green`, `blue` — default linear (0,0)→(1,1).
81
+ - `hueVsHue`, `hueVsSat`, `satVsSat`, `lumVsSat` — default empty, neutral at 0.5.
82
+
83
+ **Channel Mixer** (`ChannelMixer`) — All `ClampedFloatParameter`, -200–200.
84
+ - `redOutRedIn` (default 100), `redOutGreenIn` (default 0), `redOutBlueIn` (default 0).
85
+ - `greenOutRedIn` (default 0), `greenOutGreenIn` (default 100), `greenOutBlueIn` (default 0).
86
+ - `blueOutRedIn` (default 0), `blueOutGreenIn` (default 0), `blueOutBlueIn` (default 100).
@@ -0,0 +1,269 @@
1
+ ---
2
+ name: validate-urp-render-graph-renderer-feature
3
+ description: Use when the user wants to review or validate a Unity 6+ URP ScriptableRendererFeature that uses the Render Graph API. Checks for correctness issues - resource wiring, material binding, execution structure, descriptor usage, global resource exposure, and Render Graph best practices.
4
+ ---
5
+ # Skill: Validate a Unity URP Render Graph Renderer Feature
6
+
7
+ ## Purpose
8
+ Review a Unity 6+ URP Render Graph `ScriptableRendererFeature` and its associated pass implementation for correctness issues related to material binding, resource wiring, render graph texture creation, static render function structure, global resource exposure, and API/version usage.
9
+
10
+ ## When to Use
11
+ Use this skill when:
12
+ - reviewing AI-generated Unity URP Render Graph renderer feature code
13
+ - validating a custom `ScriptableRendererFeature` before integrating it
14
+ - checking for common Render Graph resource wiring and pass setup mistakes
15
+ - diagnosing suspicious but plausible Render Graph pass implementations
16
+ - reviewing whether a custom raster/blit/copy pass uses the most appropriate Render Graph helper APIs
17
+
18
+ ## Inputs
19
+ The skill should expect:
20
+ - **Unity version**
21
+ - **URP version**
22
+ - **Render Graph renderer feature code to review**
23
+ - `ScriptableRendererFeature`
24
+ - associated pass code
25
+ - or both
26
+ - **Intended behavior**
27
+ - **Expected inputs/outputs**, if known
28
+ - **Optional constraints**
29
+ - project conventions
30
+ - required pass type
31
+ - known resources
32
+ - required material/shader properties
33
+
34
+ ## Output Format
35
+ The skill must return results in the following structure:
36
+
37
+ ### 1. Validation Summary
38
+ A short overall assessment of the implementation.
39
+
40
+ ### 2. Confirmed Issues
41
+ Concrete issues directly supported by the provided code.
42
+
43
+ ### 3. Likely Issues / Risky Assumptions
44
+ Potential issues that depend on missing context or incomplete information.
45
+
46
+ ### 4. Recommended Fixes
47
+ Minimal targeted fixes for each issue.
48
+
49
+ ### 5. Corrected Snippets
50
+ Small corrected code snippets where useful.
51
+
52
+ ### 6. Missing Information
53
+ Any information needed to validate the code with higher confidence.
54
+
55
+ ## Validation Checklist
56
+
57
+ ### 1. Material Binding
58
+ Check that:
59
+ - materials are declared clearly
60
+ - serialized materials are exposed correctly when needed
61
+ - materials are passed into the pass correctly
62
+ - null handling exists where required
63
+ - declared materials are actually used
64
+ - **all required material inputs are bound before execution**
65
+ - **the primary input texture is explicitly bound when the shader expects one**
66
+ - auxiliary textures and parameter textures are also bound explicitly
67
+ - texture/property binding matches the shader’s expected property names
68
+
69
+ Flag as an issue when:
70
+ - a material is declared or passed but not actually used
71
+ - only secondary textures or parameters are bound while the main input texture is omitted
72
+ - the pass binds a mask/noise/auxiliary texture but fails to bind the primary color/input texture
73
+ - required shader properties are assumed to exist without being set
74
+ - property names are inconsistent or ambiguous
75
+ - the code relies on implicit main texture binding when explicit binding is required by the pass pattern
76
+
77
+ Prefer patterns where:
78
+ 1. the material is created or assigned clearly
79
+ 2. the primary source texture is bound explicitly
80
+ 3. all auxiliary textures are bound explicitly
81
+ 4. property names are consistent and intentional
82
+ 5. null or missing-resource cases are handled or reported
83
+
84
+ ### 2. Texture Resource Wiring
85
+ Check that:
86
+ - sampled/read textures, write targets, and auxiliary textures are clearly distinguished
87
+ - textures used with `UseTexture(...)` are appropriate for read access
88
+ - textures used with `SetRenderAttachment(...)` are appropriate as write targets
89
+ - source, destination, and auxiliary resources are not confused
90
+ - all expected textures are explicitly wired
91
+ - texture property names are explicit and consistent when materials are involved
92
+ - the implementation does not invent texture availability
93
+ - multi-texture resource usage is handled explicitly rather than implicitly
94
+
95
+ Flag as an issue when:
96
+ - a texture intended as an input/read resource is instead used as a write target without justification
97
+ - a destination/write target is confused with a sampled input
98
+ - auxiliary textures are used without being clearly sourced or wired
99
+ - a required texture resource is missing from the pass setup
100
+ - read/write resource roles are ambiguous or inconsistent
101
+
102
+ ### 3. Execution Structure / Static Render Function
103
+ Check that:
104
+ - the render function is declared as `static`
105
+ - the execution structure matches the target pass type and API style
106
+ - pass data is wired correctly into execution
107
+ - resources are accessed in the correct stage
108
+ - execution logic is consistent with the intended render pass behavior
109
+ - every `PassData` field used by the render function is explicitly assigned during pass setup for the current recording
110
+ - the implementation does not rely on default values or previously assigned `PassData` state
111
+ - resource handles stored in `PassData` are assigned fresh for the current frame/pass recording and are not left dangling from prior usage
112
+
113
+ Flag as an issue when:
114
+ - the render function is not `static`
115
+ - the implementation uses an instance method where the API pattern expects a static render function
116
+ - pass data or required resources are accessed through instance state instead of the pass data/context provided to the static function
117
+ - execution flow does not match the expected render graph or pass execution pattern
118
+ - a `PassData` field is read in the render function but is not clearly assigned during pass setup
119
+ - only some `PassData` fields are reassigned while others may retain stale values from previous pooled usage
120
+ - a resource handle stored in `PassData` may survive from a previous frame or pass due to incomplete reassignment
121
+ - the implementation risks using a dangling or stale handle because pass data is not fully initialized each time it is recorded
122
+
123
+ Prefer:
124
+ - explicitly assigning every `PassData` field used by the pass during each `RecordRenderGraph(...)` call
125
+ - treating `PassData` as transient per-recording data, not persistent state
126
+ - avoiding partial initialization of pooled pass data objects
127
+
128
+ ### 4. Render Graph Descriptor Validation
129
+ Check that:
130
+ - the implementation does **not** create a new `TextureDesc` by default when an appropriate graph-derived descriptor can be used directly
131
+ - when a texture should match the active render target, the descriptor is sourced from the relevant render graph resource first, such as:
132
+ - `resourceData.activeColorTexture.GetDescriptor(renderGraph)`
133
+ - or another appropriate existing graph-backed resource
134
+ - only the fields that actually need to differ are modified after sourcing the descriptor
135
+ - descriptor fields such as name, depth bits, format, and MSAA are intentionally preserved or intentionally overridden
136
+ - any manual reconstruction of descriptor data is justified by a specific requirement
137
+
138
+ Flag as an issue when:
139
+ - the code creates a fresh `TextureDesc` without first attempting to reuse a graph-derived descriptor
140
+ - width and height are manually copied into a new descriptor structure by default
141
+ - `cameraTargetDescriptor` is used as the primary source when a render-graph-derived descriptor is available and more accurate
142
+ - important properties such as MSAA, graphics format, or compatibility with the active render target are dropped accidentally
143
+ - descriptor reconstruction is used as a convenience shortcut rather than a necessary divergence from the source resource
144
+
145
+ Preferred rule:
146
+ - **Do not create a new `TextureDesc` unless a graph-derived descriptor cannot be used directly or the texture must intentionally diverge from the source resource.**
147
+
148
+ Preferred pattern:
149
+ 1. get the descriptor from the relevant render graph resource
150
+ 2. modify only the fields that must change
151
+ 3. create the texture from that derived descriptor whenever possible
152
+
153
+ Examples:
154
+
155
+ #### Preferred
156
+ ```csharp
157
+ RenderTextureDescriptor desc = resourceData.activeColorTexture.GetDescriptor(renderGraph);
158
+ desc.depthBufferBits = 0;
159
+ desc.name = "New name";
160
+ // other desired paramters
161
+ passData.targetTexture = renderGraph.CreateTexture(desc);
162
+ ```
163
+
164
+ ### 5. Manual Copy Pass Simplification
165
+ Check that:
166
+ - simple texture copy operations are not implemented as full custom raster passes when a built-in Render Graph helper is sufficient
167
+ - passes that only read one texture and write it unchanged to another target are simplified where appropriate
168
+ - the implementation prefers the most appropriate built-in helper for the target API/platform context
169
+ - `AddCopyPass(...)` is not recommended by default if a more compatible `AddBlitPass(...)` overload should be preferred in the current environment
170
+
171
+ Flag as an issue when:
172
+ - a raster pass exists only to copy one texture into another
173
+ - the pass uses no material and no custom processing
174
+ - the render function only performs a simple blit/copy equivalent
175
+ - the implementation uses a full custom raster pass where a built-in copy/blit helper would express the same behavior more directly
176
+
177
+ Prefer:
178
+ - the appropriate `AddBlitPass(...)` overload for straightforward copy-like operations when that is the recommended and more compatible path
179
+ - `AddCopyPass(...)` only when it is explicitly appropriate and supported for the target API/platform context
180
+ - a custom raster pass only when the copy requires additional logic or non-trivial behavior
181
+
182
+ ### 6. Manual Blit Pass Simplification
183
+ Check that:
184
+ - straightforward fullscreen material blits are not implemented as custom raster passes when `renderGraph.AddBlitPass(...)` would express the same behavior more directly
185
+ - custom raster passes are only used for blits when additional logic or non-trivial behavior is actually required
186
+ - simple source-to-destination material blits use the most direct render graph helper available
187
+
188
+ Flag as an issue when:
189
+ - a raster pass reads one source texture and writes one destination texture
190
+ - the pass uses a material but no additional custom pass logic
191
+ - the render function only performs a simple fullscreen blit
192
+ - `renderGraph.AddBlitPass(...)` would provide an equivalent result more clearly
193
+
194
+ Prefer:
195
+ - `renderGraph.AddBlitPass(...)` for straightforward fullscreen material blits
196
+ - a custom raster pass only when extra logic, multiple operations, conditional behavior, or special setup is actually required
197
+
198
+ ### 7. Global Resource Exposure
199
+ Check that:
200
+ - textures and buffers are not exposed globally unless explicitly requested or clearly required by a downstream consumer
201
+ - when global exposure is required in a render graph pass, the implementation uses the appropriate render graph publication mechanism
202
+ - direct command buffer global state mutation is not used as a substitute for render graph resource publication
203
+ - global exposure is not extending resource lifetime unnecessarily or reducing aliasing opportunities without justification
204
+
205
+ Flag as an issue when:
206
+ - `SetGlobalTextureAfterPass` is used without a clear consumer
207
+ - `context.cmd.SetGlobalTexture(...)` is used inside a render graph pass where render graph resource publication is the appropriate mechanism
208
+ - global exposure is used as a convenience shortcut instead of explicit pass-to-pass wiring
209
+ - hidden coupling is introduced unnecessarily
210
+ - a globally exposed texture may be kept alive longer than necessary due to downstream `UseGlobalTexture(...)` or `UseAllGlobalTextures()` usage, increasing memory pressure or reducing aliasing opportunities
211
+
212
+ Prefer:
213
+ - no global exposure by default
214
+ - explicit resource wiring where possible
215
+ - `builder.SetGlobalTextureAfterPass(...)` only when global publication is truly required in render graph
216
+ - resource lifetimes that remain as local and short-lived as possible
217
+
218
+ ### 8. Renderer Feature Input Declaration
219
+ Check that:
220
+ - the `ScriptableRendererFeature` and its associated pass declare required pipeline inputs using `ConfigureInput(...)` when needed
221
+ - the requested input flags match the feature’s intended behavior and visible resource usage
222
+ - the pass does not rely on pipeline-provided inputs without declaring them when required by the target API pattern
223
+ - unnecessary input requests are not declared by default, especially when they may introduce extra copies, intermediate resources, or avoidable pipeline work
224
+
225
+ Flag as an issue when:
226
+ - the feature’s pass uses or is clearly intended to use a pipeline-provided input but does not declare it with `ConfigureInput(...)`
227
+ - `ConfigureInput(...)` requests inputs that the feature/pass does not appear to use
228
+ - the declared input flags do not match the intended effect behavior
229
+ - the effect description, code, and declared inputs imply conflicting requirements
230
+ - unnecessary declared inputs may force extra copies, extra pass work, or other avoidable performance costs
231
+
232
+ Classification guidance:
233
+ - mark as a **confirmed issue** when the code clearly shows a required input is used but not declared
234
+ - mark as a **likely issue** when the intended effect implies a required input but the visible code does not fully prove shader/resource usage
235
+ - treat unnecessary input declarations as higher severity when they are likely to introduce additional copies or other measurable runtime cost
236
+
237
+ ## Guardrails
238
+ The skill must:
239
+ - avoid inventing unsupported APIs
240
+ - distinguish **confirmed** issues from **likely** issues
241
+ - prefer minimal targeted fixes over broad rewrites
242
+ - explain why each issue matters
243
+ - flag hidden coupling and unnecessary global state
244
+ - state when the provided code is insufficient for full certainty
245
+
246
+ ## Non-Goals
247
+ - guarantee runtime correctness
248
+ - rewrite the entire renderer feature unless necessary
249
+ - validate unrelated gameplay logic
250
+ - validate shader internals unless directly relevant to pass wiring or binding
251
+
252
+ ## Evaluation Criteria
253
+ A successful validation should:
254
+ - catch real wiring and API issues
255
+ - identify suspicious but plausible mistakes
256
+ - provide actionable fixes
257
+ - avoid false certainty
258
+ - improve trust in generated render pass code
259
+
260
+ ## Notes for Future Expansion
261
+ As new recurring issues are discovered, extend this checklist with additional rules such as:
262
+ - pass ordering / injection point validation
263
+ - resource lifetime and cleanup checks
264
+ - read/write hazard detection
265
+ - unnecessary copies or allocations
266
+ - camera depth/color dependency validation
267
+ - multi-pass dependency validation
268
+ - override material correctness
269
+ - pass configuration
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: work
3
+ description: Runs end-to-end Unity feature, bug-fix, refactor, tooling, content-integration, or other concrete project work. Routes by domain and risk, composes specialist roles, verifies independently, synchronizes records, and closes configured gates.
4
+ allowed-tools: Read, Glob, Grep, Write, Edit, Bash, Task, AskUserQuestion, WebSearch, WebFetch
5
+ ---
6
+
7
+ # Work
8
+
9
+ Complete the approved outcome rather than stopping at a plan.
10
+
11
+ ## Route
12
+
13
+ Read project policy and state, inspect Git status, and classify FAST, STANDARD, or CONTROLLED using [classification](references/classification.md). Identify affected domains before selecting roles from `../../nccgs/studio.json`.
14
+
15
+ - FAST normally stays in the main session or uses one specialist.
16
+ - STANDARD uses a context packet, an accountable implementer, and independent verification.
17
+ - CONTROLLED adds the relevant decision owner and adversarial review.
18
+
19
+ Read the [orchestration protocol](../../nccgs/protocols/orchestration.md) for multi-role work. Do not build a ceremonial management chain.
20
+
21
+ ## Contract
22
+
23
+ Use [feature contracts](references/feature-contracts.md). Create or refresh a context packet through `/context-pack` for STANDARD or CONTROLLED work. Resolve Product Owner decisions that affect semantics, scope, canon, compatibility, dependencies, or irreversibility; continue safe independent nodes while decisions are pending.
24
+
25
+ ## Execute
26
+
27
+ Build a dependency graph with one writer per path. Route distinct domains to their specialists. Use official Unity Skills for operation mechanics and `unity-cli` for connected Editor, tests, builds, and runtime evidence. Agents receive the context packet path and bounded ownership, not the entire chat or document set.
28
+
29
+ Fix in-scope failures, inspect the final diff, and preserve unrelated work.
30
+
31
+ ## Verify and close
32
+
33
+ Use [verification](references/verification.md) and the shared [evidence protocol](../../nccgs/protocols/evidence.md). Map objective evidence to requirements, run proportional regression, and separate PO gates. CONTROLLED work receives `/review` or `/evidence-review` from an independent role.
34
+
35
+ Synchronize state and technical records, then run `/closure`. Report classification, roles/models used, changed files, evidence, blockers, PO gates, residual risk, and final state.
36
+
@@ -0,0 +1,41 @@
1
+ # Task classification
2
+
3
+ Use the lowest tier that safely covers the actual risk.
4
+
5
+ ## FAST
6
+
7
+ Use when the intended behavior is unambiguous, impact is local, rollback is easy,
8
+ and no durable contract changes.
9
+
10
+ Examples: localized bug fix, safe refactor, editor utility, typo, missing reference,
11
+ small visual correction, test repair that preserves intent.
12
+
13
+ Minimum flow: inspect -> implement -> relevant test/verification -> diff -> report.
14
+
15
+ ## STANDARD
16
+
17
+ Default for ordinary features and multi-file behavior changes with established
18
+ design and architecture.
19
+
20
+ Signals: new player-visible behavior, a meaningful requirement, several coordinated
21
+ files, new tests/runtime scenario, or documentation/evidence that must persist.
22
+
23
+ Flow: focused contract -> impact check -> implement -> automated/runtime evidence ->
24
+ targeted regression -> docs/state sync -> closure.
25
+
26
+ ## CONTROLLED
27
+
28
+ Use only when at least one material risk applies:
29
+
30
+ - public or cross-system architecture contract;
31
+ - save, serialization, network authority, protocol, or compatibility change;
32
+ - package, service, platform, render-pipeline, or major project-setting decision;
33
+ - broad or irreversible migration;
34
+ - core gameplay design ambiguity or extensive blast radius;
35
+ - security, commerce, account, privacy, or release-critical behavior.
36
+
37
+ Flow adds explicit impact analysis, recorded decisions/ADR where durable, migration
38
+ and rollback planning, full relevant verification, and independent review.
39
+
40
+ File count alone does not make work CONTROLLED. Raise a tier when new facts expose
41
+ risk; record the reason in state/closure.
@@ -0,0 +1,50 @@
1
+ # Closure
2
+
3
+ Keep state vocabulary exact:
4
+
5
+ - IMPLEMENTED: change exists.
6
+ - VERIFIED: required objective evidence passes.
7
+ - VALIDATED: required subjective gates are accepted.
8
+ - DONE: every configured closure gate is satisfied; waivers have explicit authority.
9
+
10
+ ## Canonical record and linked artifacts
11
+
12
+ For persistent STANDARD/CONTROLLED work, write the canonical record at the path
13
+ configured by `closure.canonical_record`, normally
14
+ `.nccgs/closures/<feature-id>.md`. It is the single entry point for requirement
15
+ coverage, implementation, evidence, documents, gates, waivers, and final state.
16
+
17
+ The record may link additional project-required artifacts. Link them instead of
18
+ copying their contents. Examples include an implementation report, register entry,
19
+ manual evidence, migration log, recovery checklist, or deletion-safety gate.
20
+
21
+ ## Closure modes
22
+
23
+ - **lean**: the canonical record is sufficient. Linked artifacts are optional and
24
+ cannot become blocking unless policy changes mode.
25
+ - **linked**: artifacts with `required: true` must exist, be linked, and meet their
26
+ configured completion rule. Optional artifacts remain advisory.
27
+ - **strict**: every declared artifact and checklist condition is blocking. A missing
28
+ item prevents DONE unless the PO records an explicit waiver and accepted risk.
29
+
30
+ Unknown or missing mode is a configuration blocker for closure; do not silently
31
+ assume lean in an already-migrated project.
32
+
33
+ ## Gate evaluation
34
+
35
+ Before DONE:
36
+
37
+ 1. confirm implementation and objective verification;
38
+ 2. resolve applicable manual PO gates;
39
+ 3. inspect `closure.required_artifacts` and record each path, completion rule,
40
+ observed status, and waiver authority;
41
+ 4. ensure the canonical record links every required artifact;
42
+ 5. keep the final state below DONE while a blocking item remains.
43
+
44
+ Update `.nccgs/state.md` to contain only current objective, active feature/tier,
45
+ current phase, pending PO decisions, manual gates, closure blockers, last closure,
46
+ and next candidate. Git and closure records hold history.
47
+
48
+ Technical records may be synchronized autonomously. Canonical player-facing design
49
+ changes require an accepted PO decision. If code and canon disagree, fix or escalate;
50
+ never rewrite canon silently.
@@ -0,0 +1,32 @@
1
+ # Focused feature contracts
2
+
3
+ A feature contract records approved outcome and scope. Its context packet records the
4
+ current working-set map; neither is a rewritten GDD.
5
+
6
+ For meaningful STANDARD or CONTROLLED work, create or update
7
+ `.nccgs/features/<feature-id>.md` from the scaffold template. Include only:
8
+
9
+ - objective and approved player-facing intent;
10
+ - relevant requirement IDs and links to canonical sections;
11
+ - governing project policies and ADRs;
12
+ - affected systems and expected files, without treating the list as immutable;
13
+ - out-of-scope behavior;
14
+ - objective acceptance and subjective gates;
15
+ - verification and regression obligations;
16
+ - open PO decisions.
17
+
18
+ Create or refresh `.nccgs/context/<feature-id>.yaml` for the exact canonical sections,
19
+ decision summaries, source revisions, ownership, and execution working set. Keep the
20
+ contract stable across implementation while the context packet may change as the
21
+ working set is discovered.
22
+
23
+ Do not copy whole design or architecture documents. If discovery changes the working
24
+ set, update the contract rather than loading unrelated sources.
25
+
26
+ FAST work normally uses an in-memory contract. Persist it when the fix changes a
27
+ meaningful requirement, spans sessions, needs a manual gate, or will benefit future
28
+ debugging.
29
+
30
+ Requirement IDs belong in `.nccgs/requirements.yaml` only for player-visible
31
+ contracts, technical invariants, acceptance criteria, and cross-system dependencies.
32
+ Do not assign IDs to private class structure or every documentation sentence.
@@ -0,0 +1,26 @@
1
+ # Verification strategy
2
+
3
+ Choose evidence that directly proves the requirement.
4
+
5
+ | Evidence | Proves | Does not prove |
6
+ |---|---|---|
7
+ | Static/diff inspection | Structure and obvious policy conformance | Runtime behavior |
8
+ | EditMode test | Deterministic logic/editor behavior | Full scene/player experience |
9
+ | PlayMode test | Unity lifecycle and runtime integration | Subjective feel |
10
+ | Unity CLI runtime inspection | Actual state, references, errors, deterministic transitions | Broad regression or subjective quality |
11
+ | Build | Target compilation/packaging | Feature correctness by itself |
12
+ | PO gate | Subjective intended experience | Technical regression coverage |
13
+
14
+ For each acceptance criterion, classify evidence:
15
+
16
+ - **PASS**: direct evidence demonstrates it;
17
+ - **FAIL**: evidence contradicts it;
18
+ - **NOT PROVEN**: no adequate evidence exists;
19
+ - **PO GATE**: the criterion is intentionally subjective.
20
+
21
+ Run regression based on changed contracts and downstream consumers. A local bug fix
22
+ needs targeted regression; release or core contract work may justify a broader suite.
23
+
24
+ When Unity is involved, use the relevant official Unity Skill and `unity-cli`. Prefer
25
+ connected Editor observation/action/verification when available. Persist only useful
26
+ evidence summaries; do not dump console walls into closure records.