nccgs 1.1.0 → 1.3.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 (215) hide show
  1. package/.claude/agents/nccgs-adversarial-reviewer.md +7 -1
  2. package/.claude/agents/nccgs-engine-programmer.md +2 -1
  3. package/.claude/agents/nccgs-gameplay-programmer.md +2 -1
  4. package/.claude/agents/nccgs-qa-engineer.md +2 -1
  5. package/.claude/agents/nccgs-ui-programmer.md +2 -1
  6. package/.claude/agents/nccgs-unity-build-specialist.md +2 -1
  7. package/.claude/agents/nccgs-unity-implementer.md +2 -1
  8. package/.claude/agents/nccgs-unity-systems-specialist.md +2 -1
  9. package/.claude/agents/nccgs-unity-ui-specialist.md +2 -1
  10. package/.claude/agents/nccgs-verification-engineer.md +2 -1
  11. package/.claude/nccgs/VERSION +1 -1
  12. package/.claude/{agents → nccgs/agent-library}/nccgs-accessibility-specialist.md +0 -1
  13. package/.claude/nccgs/agent-library/nccgs-adversarial-reviewer.md +30 -0
  14. package/.claude/{agents → nccgs/agent-library}/nccgs-ai-programmer.md +0 -1
  15. package/.claude/{agents → nccgs/agent-library}/nccgs-analytics-engineer.md +0 -1
  16. package/.claude/{agents → nccgs/agent-library}/nccgs-art-direction-lead.md +0 -1
  17. package/.claude/{agents → nccgs/agent-library}/nccgs-audio-direction-lead.md +0 -1
  18. package/.claude/{agents → nccgs/agent-library}/nccgs-creative-director.md +0 -1
  19. package/.claude/{agents → nccgs/agent-library}/nccgs-documentation-manager.md +0 -1
  20. package/.claude/{agents → nccgs/agent-library}/nccgs-economy-designer.md +0 -1
  21. package/.claude/nccgs/agent-library/nccgs-engine-programmer.md +25 -0
  22. package/.claude/{agents → nccgs/agent-library}/nccgs-game-design-lead.md +0 -1
  23. package/.claude/{agents → nccgs/agent-library}/nccgs-game-designer.md +0 -1
  24. package/.claude/nccgs/agent-library/nccgs-gameplay-programmer.md +25 -0
  25. package/.claude/{agents → nccgs/agent-library}/nccgs-level-designer.md +0 -1
  26. package/.claude/{agents → nccgs/agent-library}/nccgs-live-ops-designer.md +0 -1
  27. package/.claude/{agents → nccgs/agent-library}/nccgs-localization-lead.md +0 -1
  28. package/.claude/{agents → nccgs/agent-library}/nccgs-narrative-lead.md +0 -1
  29. package/.claude/{agents → nccgs/agent-library}/nccgs-network-programmer.md +0 -1
  30. package/.claude/{agents → nccgs/agent-library}/nccgs-performance-analyst.md +0 -1
  31. package/.claude/{agents → nccgs/agent-library}/nccgs-producer.md +0 -1
  32. package/.claude/{agents → nccgs/agent-library}/nccgs-production-coordinator.md +0 -1
  33. package/.claude/{agents → nccgs/agent-library}/nccgs-programming-lead.md +0 -1
  34. package/.claude/{agents → nccgs/agent-library}/nccgs-prototyper.md +0 -1
  35. package/.claude/nccgs/agent-library/nccgs-qa-engineer.md +25 -0
  36. package/.claude/{agents → nccgs/agent-library}/nccgs-qa-lead.md +0 -1
  37. package/.claude/{agents → nccgs/agent-library}/nccgs-release-engineer.md +0 -1
  38. package/.claude/{agents → nccgs/agent-library}/nccgs-release-lead.md +0 -1
  39. package/.claude/{agents → nccgs/agent-library}/nccgs-security-engineer.md +0 -1
  40. package/.claude/{agents → nccgs/agent-library}/nccgs-sound-designer.md +0 -1
  41. package/.claude/{agents → nccgs/agent-library}/nccgs-systems-designer.md +0 -1
  42. package/.claude/{agents → nccgs/agent-library}/nccgs-technical-architect.md +0 -1
  43. package/.claude/{agents → nccgs/agent-library}/nccgs-technical-artist.md +0 -1
  44. package/.claude/{agents → nccgs/agent-library}/nccgs-technical-director.md +0 -1
  45. package/.claude/{agents → nccgs/agent-library}/nccgs-tools-programmer.md +0 -1
  46. package/.claude/nccgs/agent-library/nccgs-ui-programmer.md +25 -0
  47. package/.claude/nccgs/agent-library/nccgs-unity-build-specialist.md +25 -0
  48. package/.claude/{agents → nccgs/agent-library}/nccgs-unity-content-specialist.md +0 -1
  49. package/.claude/nccgs/agent-library/nccgs-unity-implementer.md +25 -0
  50. package/.claude/{agents → nccgs/agent-library}/nccgs-unity-rendering-specialist.md +0 -1
  51. package/.claude/nccgs/agent-library/nccgs-unity-systems-specialist.md +25 -0
  52. package/.claude/nccgs/agent-library/nccgs-unity-ui-specialist.md +25 -0
  53. package/.claude/{agents → nccgs/agent-library}/nccgs-ux-designer.md +0 -1
  54. package/.claude/nccgs/agent-library/nccgs-verification-engineer.md +25 -0
  55. package/.claude/{agents → nccgs/agent-library}/nccgs-world-builder.md +0 -1
  56. package/.claude/{agents → nccgs/agent-library}/nccgs-writer.md +0 -1
  57. package/.claude/nccgs/constitution.md +13 -0
  58. package/.claude/nccgs/hooks/agent-audit.mjs +6 -0
  59. package/.claude/nccgs/hooks/closure-guard.mjs +34 -0
  60. package/.claude/nccgs/hooks/runtime-observation.mjs +11 -0
  61. package/.claude/nccgs/hooks/session-start.mjs +8 -1
  62. package/.claude/nccgs/pipeline.json +176 -0
  63. package/.claude/nccgs/protocols/agent-contract.md +5 -0
  64. package/.claude/nccgs/protocols/astra-claude.md +77 -0
  65. package/.claude/nccgs/protocols/evidence.md +6 -0
  66. package/.claude/nccgs/protocols/model-routing.md +27 -5
  67. package/.claude/nccgs/protocols/orchestration.md +5 -0
  68. package/.claude/nccgs/protocols/task-gates.md +66 -0
  69. package/.claude/nccgs/routing.generated.md +11 -0
  70. package/.claude/nccgs/settings.fragment.json +73 -9
  71. package/.claude/nccgs/studio.json +187 -96
  72. package/.claude/nccgs/tools/approve-overrides.mjs +81 -0
  73. package/.claude/nccgs/tools/compile-policy.mjs +83 -0
  74. package/.claude/nccgs/tools/configure-models.mjs +76 -31
  75. package/.claude/nccgs/tools/gates.mjs +167 -0
  76. package/.claude/nccgs/tools/integrity.mjs +69 -0
  77. package/.claude/nccgs/tools/policy.mjs +62 -0
  78. package/.claude/nccgs/tools/runtime.mjs +40 -0
  79. package/.claude/nccgs/tools/task.mjs +77 -0
  80. package/.claude/nccgs/workflow-catalog.json +91 -14
  81. package/.claude/skills/accessibility-review/SKILL.md +6 -5
  82. package/.claude/skills/accessibility-review/references/astra.md +17 -0
  83. package/.claude/skills/accessibility-review/references/legacy.md +7 -0
  84. package/.claude/skills/architecture-decision/SKILL.md +6 -5
  85. package/.claude/skills/architecture-decision/references/astra.md +12 -0
  86. package/.claude/skills/architecture-decision/references/legacy.md +7 -0
  87. package/.claude/skills/asset-audit/SKILL.md +6 -5
  88. package/.claude/skills/asset-audit/references/astra.md +17 -0
  89. package/.claude/skills/asset-audit/references/legacy.md +7 -0
  90. package/.claude/skills/audit/SKILL.md +6 -7
  91. package/.claude/skills/audit/references/astra.md +17 -0
  92. package/.claude/skills/audit/references/legacy.md +9 -0
  93. package/.claude/skills/balance-review/SKILL.md +6 -5
  94. package/.claude/skills/balance-review/references/astra.md +17 -0
  95. package/.claude/skills/balance-review/references/legacy.md +7 -0
  96. package/.claude/skills/bug-triage/SKILL.md +6 -5
  97. package/.claude/skills/bug-triage/references/astra.md +20 -0
  98. package/.claude/skills/bug-triage/references/legacy.md +7 -0
  99. package/.claude/skills/closure/SKILL.md +5 -4
  100. package/.claude/skills/closure/references/astra.md +15 -0
  101. package/.claude/skills/closure/references/legacy.md +7 -0
  102. package/.claude/skills/compatibility-review/SKILL.md +6 -5
  103. package/.claude/skills/compatibility-review/references/astra.md +17 -0
  104. package/.claude/skills/compatibility-review/references/legacy.md +7 -0
  105. package/.claude/skills/context-pack/SKILL.md +5 -4
  106. package/.claude/skills/context-pack/references/astra.md +12 -0
  107. package/.claude/skills/context-pack/references/legacy.md +7 -0
  108. package/.claude/skills/dependency-review/SKILL.md +6 -5
  109. package/.claude/skills/dependency-review/references/astra.md +17 -0
  110. package/.claude/skills/dependency-review/references/legacy.md +7 -0
  111. package/.claude/skills/design/SKILL.md +6 -11
  112. package/.claude/skills/design/references/astra.md +12 -0
  113. package/.claude/skills/design/references/legacy.md +13 -0
  114. package/.claude/skills/design-review/SKILL.md +6 -5
  115. package/.claude/skills/design-review/references/astra.md +17 -0
  116. package/.claude/skills/design-review/references/legacy.md +7 -0
  117. package/.claude/skills/evidence-review/SKILL.md +6 -5
  118. package/.claude/skills/evidence-review/references/astra.md +17 -0
  119. package/.claude/skills/evidence-review/references/legacy.md +7 -0
  120. package/.claude/skills/hotfix/SKILL.md +6 -5
  121. package/.claude/skills/hotfix/references/astra.md +23 -0
  122. package/.claude/skills/hotfix/references/legacy.md +7 -0
  123. package/.claude/skills/incident-recovery/SKILL.md +6 -5
  124. package/.claude/skills/incident-recovery/references/astra.md +20 -0
  125. package/.claude/skills/incident-recovery/references/legacy.md +7 -0
  126. package/.claude/skills/localize-game/SKILL.md +6 -5
  127. package/.claude/skills/localize-game/references/astra.md +20 -0
  128. package/.claude/skills/localize-game/references/legacy.md +7 -0
  129. package/.claude/skills/migrate-project/SKILL.md +6 -14
  130. package/.claude/skills/migrate-project/references/astra.md +23 -0
  131. package/.claude/skills/migrate-project/references/legacy.md +19 -0
  132. package/.claude/skills/migrate-project/references/procedure.md +21 -1
  133. package/.claude/skills/milestone-review/SKILL.md +6 -5
  134. package/.claude/skills/milestone-review/references/astra.md +12 -0
  135. package/.claude/skills/milestone-review/references/legacy.md +7 -0
  136. package/.claude/skills/nccgs-code-review/SKILL.md +15 -0
  137. package/.claude/skills/nccgs-code-review/references/astra.md +15 -0
  138. package/.claude/skills/{code-review/SKILL.md → nccgs-code-review/references/legacy.md} +0 -7
  139. package/.claude/skills/performance-audit/SKILL.md +6 -5
  140. package/.claude/skills/performance-audit/references/astra.md +17 -0
  141. package/.claude/skills/performance-audit/references/legacy.md +7 -0
  142. package/.claude/skills/plan-feature/SKILL.md +6 -5
  143. package/.claude/skills/plan-feature/references/astra.md +12 -0
  144. package/.claude/skills/plan-feature/references/legacy.md +7 -0
  145. package/.claude/skills/playtest/SKILL.md +5 -4
  146. package/.claude/skills/playtest/references/astra.md +20 -0
  147. package/.claude/skills/playtest/references/legacy.md +7 -0
  148. package/.claude/skills/project-stage/SKILL.md +5 -4
  149. package/.claude/skills/project-stage/references/astra.md +12 -0
  150. package/.claude/skills/project-stage/references/legacy.md +7 -0
  151. package/.claude/skills/prototype-feature/SKILL.md +6 -5
  152. package/.claude/skills/prototype-feature/references/astra.md +20 -0
  153. package/.claude/skills/prototype-feature/references/legacy.md +7 -0
  154. package/.claude/skills/qa-plan/SKILL.md +6 -5
  155. package/.claude/skills/qa-plan/references/astra.md +12 -0
  156. package/.claude/skills/qa-plan/references/legacy.md +7 -0
  157. package/.claude/skills/release/SKILL.md +6 -9
  158. package/.claude/skills/release/references/astra.md +23 -0
  159. package/.claude/skills/release/references/legacy.md +11 -0
  160. package/.claude/skills/release-readiness/SKILL.md +6 -5
  161. package/.claude/skills/release-readiness/references/astra.md +17 -0
  162. package/.claude/skills/release-readiness/references/legacy.md +7 -0
  163. package/.claude/skills/retrospective/SKILL.md +6 -5
  164. package/.claude/skills/retrospective/references/astra.md +12 -0
  165. package/.claude/skills/retrospective/references/legacy.md +7 -0
  166. package/.claude/skills/review/SKILL.md +6 -7
  167. package/.claude/skills/review/references/astra.md +15 -0
  168. package/.claude/skills/review/references/legacy.md +9 -0
  169. package/.claude/skills/security-audit/SKILL.md +6 -5
  170. package/.claude/skills/security-audit/references/astra.md +17 -0
  171. package/.claude/skills/security-audit/references/legacy.md +7 -0
  172. package/.claude/skills/sprint-plan/SKILL.md +6 -5
  173. package/.claude/skills/sprint-plan/references/astra.md +12 -0
  174. package/.claude/skills/sprint-plan/references/legacy.md +7 -0
  175. package/.claude/skills/status/SKILL.md +5 -6
  176. package/.claude/skills/status/references/astra.md +13 -0
  177. package/.claude/skills/status/references/legacy.md +9 -0
  178. package/.claude/skills/story-readiness/SKILL.md +5 -4
  179. package/.claude/skills/story-readiness/references/astra.md +17 -0
  180. package/.claude/skills/story-readiness/references/legacy.md +7 -0
  181. package/.claude/skills/test/SKILL.md +6 -7
  182. package/.claude/skills/test/references/astra.md +20 -0
  183. package/.claude/skills/test/references/legacy.md +9 -0
  184. package/.claude/skills/ui-review/SKILL.md +6 -5
  185. package/.claude/skills/ui-review/references/astra.md +17 -0
  186. package/.claude/skills/ui-review/references/legacy.md +7 -0
  187. package/.claude/skills/work/SKILL.md +6 -27
  188. package/.claude/skills/work/references/astra.md +20 -0
  189. package/.claude/skills/work/references/closure.md +10 -0
  190. package/.claude/skills/work/references/feature-contracts.md +4 -0
  191. package/.claude/skills/work/references/legacy.md +29 -0
  192. package/README.md +67 -29
  193. package/UPGRADING.md +54 -4
  194. package/VERSION +1 -1
  195. package/docs/ARCHITECTURE.md +30 -13
  196. package/docs/HUONG-DAN-MIGRATE-VA-SU-DUNG.md +34 -322
  197. package/docs/MIGRATION-MATRIX.md +1 -1
  198. package/docs/NCCGS-1.3.md +125 -0
  199. package/docs/PROJECT-POLICY.md +18 -3
  200. package/docs/WORKFLOWS.md +20 -14
  201. package/package-assets/nccgs-project.gitignore +2 -0
  202. package/package.json +5 -3
  203. package/scaffold/.nccgs/gates.json +7 -0
  204. package/scaffold/.nccgs/project.yaml +6 -3
  205. package/scaffold/.nccgs/state.md +1 -1
  206. package/scaffold/.nccgs/templates/agent-handoff.md +10 -0
  207. package/scaffold/.nccgs/templates/closure-record.md +11 -0
  208. package/scaffold/.nccgs/templates/feature-contract.md +9 -0
  209. package/scaffold/.nccgs/templates/implementation-report.md +49 -0
  210. package/scripts/cli.mjs +10 -5
  211. package/scripts/doctor.mjs +102 -18
  212. package/scripts/install.mjs +221 -88
  213. package/scripts/validate.mjs +34 -6
  214. package/tests/framework.test.mjs +213 -8
  215. package/tests/gates.test.mjs +170 -0
package/UPGRADING.md CHANGED
@@ -2,6 +2,43 @@
2
2
 
3
3
  Always inspect a dry run and preserve project policy.
4
4
 
5
+ ## 1.3.0: executable gates and focused agent activation
6
+
7
+ Read the [1.3 guide](docs/NCCGS-1.3.md). Routing now comes from
8
+ `.claude/nccgs/pipeline.json`; generated files are checked for drift. Only ten core
9
+ agents are active by default; 35 additional roles are available through `agents
10
+ --enable`. Project customizations are preserved for explicit migration review.
11
+
12
+ Astra must map existing checks, closure artifacts and manual decisions into
13
+ `.nccgs/gates.json`, referencing the current project policy hash. A 1.2 policy with
14
+ embedded `profile_contracts` needs migration to the canonical `pipeline_policy`
15
+ reference. Do not discard project requirements during this migration.
16
+
17
+ Task records now enforce implementation -> independent review -> report -> Astra
18
+ check -> Product Owner acceptance. Missing observed effort blocks the gate; requested
19
+ settings alone do not prove runtime behavior. Each workflow loads only its selected
20
+ Astra or legacy branch. The legacy instructions later in this document apply only
21
+ to explicitly selected legacy profiles.
22
+
23
+ ## Astra / Opus / Fable routing
24
+
25
+ New installations default to `astra-claude`: Astra plans and owns documents;
26
+ Opus 5.5/xhigh implements; Fable/high reviews; Claude hands the reviewed report to
27
+ Astra; Astra checks it; the Product Owner accepts before DONE. See the
28
+ [handoff protocol](.claude/nccgs/protocols/astra-claude.md).
29
+
30
+ Existing projects keep their profile unless explicitly changed. In each Unity
31
+ project, run `npx nccgs@latest update --model-profile astra-claude --dry-run`, inspect
32
+ it, then remove `--dry-run`. Source checkouts can use `node <NCCGS>/scripts/cli.mjs`
33
+ instead of `npx nccgs@latest`. Publishing alone does not update installed projects.
34
+ Use `install` instead of `update` for a new installation. Require Claude Code
35
+ 2.1.280+ and access to Opus 5.5 and Fable. Review any
36
+ preserved agent/settings overrides so the observed model and effort match policy.
37
+ The configurator preserves unrelated shared settings and backs up replacements;
38
+ existing sessions and local/environment overrides still require a runtime check.
39
+
40
+ ## Earlier update behavior
41
+
5
42
  ```powershell
6
43
  cd "D:\path\to\UnityProject"
7
44
  npx nccgs@latest update --dry-run
@@ -9,10 +46,23 @@ npx nccgs@latest update
9
46
  npx nccgs@latest doctor
10
47
  ```
11
48
 
12
- Version 1.1 adds hash-aware, idempotent updates. Managed files that still match the
13
- previous install state update automatically. Project-modified framework files stop
14
- the update and require review; `--force` backs them up before replacement. Existing
15
- `.nccgs/project.yaml` remains project-owned and is never blindly overwritten.
49
+ Version 1.1.1 makes updates hash-aware, line-ending-aware, and override-aware.
50
+ Managed files that still match the previous install state update automatically;
51
+ CRLF/LF conversion alone is accepted as the same text. Genuine project-modified or
52
+ intentionally missing framework files are preserved and recorded in
53
+ `.nccgs/framework-overrides.json` as `pending_review`. The rest of the framework is
54
+ updated normally, so `--force` is no longer required to get past intentional local
55
+ customizations. Existing `.nccgs/project.yaml` remains project-owned and is never
56
+ blindly overwritten.
57
+
58
+ When pending overrides are reported, open a fresh Claude Code session and run
59
+ `/migrate-project` once. The workflow reviews and rebases each override, migrates the
60
+ project policy when needed, and records approval of the final hashes. A direct
61
+ `doctor` remains red until pending override review is complete. Use `--force` only
62
+ when you intentionally want to back up and discard every detected customization.
63
+
64
+ NCCGS 1.1.1 also names its specialized review command `/nccgs-code-review` to avoid
65
+ colliding with Claude Code's built-in `/code-review` command.
16
66
 
17
67
  When the installer reports that project migration is required, open a new Claude
18
68
  Code session and run one command:
package/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.3.0
@@ -11,8 +11,8 @@ distinct decision surface, failure mode, artifact, or verification lens.
11
11
  1. **Kernel** — constitution, authority, project policy, ownership, state, closure.
12
12
  2. **Router** — domain/risk classification, model profile, context packet, execution
13
13
  graph and write ownership.
14
- 3. **Studio roles** — 45 leadership, lead, specialist, Unity, quality, and release
15
- agents with shared handoff contracts.
14
+ 3. **Studio roles** — ten active core agents, with 35 optional roles in a 45-agent
15
+ library. Activation choices survive updates; customized files are preserved.
16
16
  4. **Workflow modules** — 36 composable skills with eight user-facing entrypoints.
17
17
  5. **Unity operations** — unmodified official Unity Skills and Unity CLI/Pipeline.
18
18
  6. **Automation** — Node hooks for recovery, audit and safety.
@@ -20,7 +20,9 @@ distinct decision surface, failure mode, artifact, or verification lens.
20
20
 
21
21
  ## Bounded orchestration
22
22
 
23
- The primary Claude Code session is the sole orchestrator. It constructs a DAG,
23
+ The primary Claude Code session is the sole Claude subagent orchestrator. Under the
24
+ default astra-claude profile, Astra owns planning/documents outside that session;
25
+ Claude executes within Astra's plan. It constructs an implementation DAG,
24
26
  selects the smallest complete role set, passes a context packet, assigns one writer
25
27
  per path, and merges handoffs. Studio agents do not recursively delegate.
26
28
 
@@ -40,14 +42,16 @@ require reconstructing truth from chat history.
40
42
 
41
43
  ## Model architecture
42
44
 
43
- Each catalog role has a capability class: lightweight, standard, deep, or leadership.
44
- An installation profile compiles that class into agent frontmatter. The package
45
- defaults to quality but supports balanced and inherit profiles without duplicating
46
- agent prompts.
45
+ Each catalog role has a capability class: lightweight, standard, deep, leadership,
46
+ or review. `pipeline.json` is the routing source; the compiler generates catalog
47
+ routes and agent frontmatter, and validation rejects drift. The default
48
+ astra-claude profile uses claude-opus-5-5/xhigh for Claude work and fable/high for
49
+ independent review. It also configures the main project session. Legacy quality,
50
+ balanced, and inherit profiles remain available without duplicating agent prompts.
47
51
 
48
- The router selects role/domain first and model second. Risk escalation is evidence
49
- based. Project policy records fallback behavior so model availability failure does
50
- not become an unexplained task blocker.
52
+ Legacy profiles support policy-directed fallback. The astra-claude profile instead
53
+ blocks a required stage when its model/effort cannot be confirmed; it never labels
54
+ an inherited model's output as Fable review or Opus 5.5 implementation.
51
55
 
52
56
  ## Unity boundary
53
57
 
@@ -57,9 +61,22 @@ SHA-256 manifest makes upstream modifications visible.
57
61
 
58
62
  ## Evidence and closure
59
63
 
60
- Implementation and verification are separate work nodes. STANDARD work normally has
61
- independent verification; CONTROLLED work adds adversarial review. Evidence is mapped
62
- to requirements and source revision.
64
+ For astra-claude, every code change follows Opus implementation -> Fable review ->
65
+ report to Astra -> Astra check -> explicit Product Owner acceptance. Opus fixes
66
+ findings and Fable re-reviews each changed snapshot. These gates apply to FAST and
67
+ lean work as well. `task.mjs` enforces this sequence using snapshot hashes, immutable
68
+ artifact references, runtime observations and explicit external decisions. A changed
69
+ snapshot invalidates previous review/acceptance. Re-recording an earlier stage clears
70
+ downstream stages while retaining history. Hooks supplement the task gate; they are
71
+ not a security sandbox. There is no automatic cross-app transport.
72
+
73
+ Requested model settings and observed runtime values are separate fields. Native
74
+ events can report the resolved model and fallback history; absent observed effort
75
+ stays unknown until supporting runtime evidence is imported.
76
+
77
+ Every workflow dispatcher loads exactly one `references/astra.md` or
78
+ `references/legacy.md`. Risk affects the extent of verification, never the mandatory
79
+ Fable gate in the Astra profile. Legacy profiles retain their risk-based review.
63
80
 
64
81
  One canonical closure record links existing project artifacts. `lean`, `linked`, and
65
82
  `strict` policies determine what blocks DONE. Waivers are item-specific and retain
@@ -1,334 +1,46 @@
1
- # Hướng dẫn migrate và sử dụng NCCGS 1.1
1
+ # Hướng dẫn migrate và sử dụng NCCGS 1.3
2
2
 
3
- NCCGS 1.1 là studio operating system dành cho Unity project trong Claude Code. Nó
4
- không thay thế cách chat trực tiếp; nó tự phân loại rủi ro, chọn workflow, agent và
5
- model phù hợp, sử dụng official Unity Skills, thu thập bằng chứng và áp dụng closure.
3
+ Đọc [hướng dẫn vận hành 1.3](NCCGS-1.3.md) trước khi bắt đầu task. Luồng mặc định:
4
+ Astra lập kế hoạch/tài liệu → Opus 5.5/xhigh triển khai → Fable/high review →
5
+ report cho Astra → Astra kiểm tra → bạn nghiệm thu.
6
6
 
7
- ## 1. Thành phần
7
+ ## Cài hoặc nâng cấp
8
8
 
9
- - 45 studio agents chuyên biệt.
10
- - 36 NCCGS workflows; 8 entrypoint chính.
11
- - 3 model profiles: `quality`, `balanced`, `inherit`.
12
- - 11 path-scoped rules.
13
- - 8 Node hooks cho recovery, audit và safety.
14
- - 22 official Unity Skills giữ nguyên và kiểm tra hash.
9
+ Trong từng Unity project, chạy `npx nccgs@latest update --model-profile astra-claude
10
+ --dry-run`. Đọc kết quả, bỏ `--dry-run` để áp dụng, rồi chạy `npx nccgs@latest doctor`.
11
+ Dùng CLI `scripts/cli.mjs` với `--project <UnityProject>` nếu cài từ mã nguồn.
12
+ Dùng `install` thay `update` nếu chưa cài. Update giữ profile hiện tại nếu không
13
+ truyền `--model-profile`. Cần Node.js 18+ và Claude Code tương thích các model.
15
14
 
16
- ```text
17
- Bạn
18
- -> Claude Code chính
19
- -> NCCGS router (domain + risk + model)
20
- -> studio agents cần thiết
21
- -> official Unity Skills + Unity CLI/Pipeline
22
- -> evidence + review + closure
23
- ```
15
+ ## Astra chuẩn bị migration
24
16
 
25
- Claude Code chính là orchestrator duy nhất. Agent không tự tạo thêm cây subagent.
26
- Mỗi path chỉ có một writing owner trong một batch.
17
+ Astra kiểm tra tài liệu chuẩn, `.nccgs/project.yaml`, yêu cầu kiểm chứng, artifact
18
+ và manual gate đang có. Giữ nguyên các bảo đảm hiện hành; chỉ giảm gate khi bạn đã
19
+ quyết định rõ ràng.
27
20
 
28
- ## 2. Cài mới hoặc cập nhật
21
+ Với policy cũ chứa `profile_contracts`, chuyển sang tham chiếu
22
+ `pipeline_policy: .claude/nccgs/pipeline.json`. Map đầy đủ nghĩa vụ của dự án vào
23
+ `.nccgs/gates.json` và điền hash project policy đã kiểm tra. Sau đó cung cấp plan
24
+ migration cho Claude. Không dùng fallback thay Opus/Fable trong profile này.
29
25
 
30
- Trong PowerShell:
26
+ Claude chạy `/migrate-project` theo plan của Astra, xử lý override đã được phân tích,
27
+ kiểm chứng, rồi qua Fable review. Tùy chỉnh local được bảo toàn để review; không dùng
28
+ `--force` chỉ để làm biến mất cảnh báo. Mở phiên Claude mới sau khi đổi cấu hình.
31
29
 
32
- ```powershell
33
- cd "D:\path\to\UnityProject"
34
- npx nccgs@latest install --dry-run
35
- npx nccgs@latest install
36
- ```
30
+ ## Vận hành hằng ngày
37
31
 
38
- Nếu project đã có NCCGS:
32
+ Có 10 agent lõi hoạt động mặc định, 35 vai trò tùy chọn trong thư viện. Bật/tắt vai
33
+ trò bổ sung bằng `agents --enable/--disable`; lựa chọn được giữ qua update. 36 workflow
34
+ chỉ nạp nhánh Astra hoặc legacy tương ứng với profile hiện tại.
39
35
 
40
- ```powershell
41
- npx nccgs@latest update --dry-run
42
- npx nccgs@latest update
43
- npx nccgs@latest doctor
44
- ```
36
+ Astra cung cấp plan và gate; Claude khởi tạo/bind task, triển khai và ghi bằng chứng.
37
+ Fable review độc lập trên cùng snapshot. Chỉ sau PASS mới ghi report; Astra và bạn
38
+ quyết định các bước cuối ngoài phiên Claude. `task close` kiểm tra toàn bộ chuỗi.
39
+ Schema và lệnh chi tiết có trong [hướng dẫn 1.3](NCCGS-1.3.md).
45
40
 
46
- NCCGS mặc định cài vào directory hiện tại. Bạn không cần truyền đường dẫn project;
47
- hãy mở PowerShell tại Unity project root hoặc dùng `cd` đến đó trước.
41
+ `/status` đọc trạng thái và gate còn thiếu. Cấu hình model/effort yêu cầu được phân
42
+ biệt với quan sát runtime. Thiếu bằng chứng effort thực chạy thì task chưa đủ điều
43
+ kiện bàn giao. Report là file; NCCGS chưa tự gửi giữa ứng dụng.
48
44
 
49
- Từ 1.1, update kiểm tra hash của lần cài trước. File NCCGS chưa bị project sửa sẽ tự
50
- được backup và cập nhật. File đã sửa tay sẽ chặn update; chỉ dùng `--force` sau khi
51
- đã review và chấp nhận thay thế bản override.
52
-
53
- Installer sẽ:
54
-
55
- 1. validate NCCGS;
56
- 2. backup file framework/settings bị thay thế vào `.nccgs/backups/<timestamp>/`;
57
- 3. cập nhật `.claude/`;
58
- 4. chỉ tạo những scaffold file `.nccgs/` còn thiếu, không ghi đè project truth;
59
- 5. merge NCCGS hooks vào `.claude/settings.json` mà không xóa settings khác;
60
- 6. cấu hình model cho agents;
61
- 7. thêm NCCGS import vào `CLAUDE.md`.
62
-
63
- Sau khi cài, đóng phiên Claude Code cũ và mở phiên mới tại project root.
64
-
65
- ## 3. Chọn model profile
66
-
67
- | Profile | Cách dùng |
68
- |---|---|
69
- | `quality` | Mặc định; Opus cho deep/leadership, Sonnet cho implementation, Haiku cho việc nhẹ |
70
- | `balanced` | Giữ Opus cho deep reasoning, leadership thông thường chạy Sonnet |
71
- | `inherit` | Bỏ toàn bộ model pin; agents dùng model của phiên chính |
72
-
73
- Cài với profile cụ thể:
74
-
75
- ```powershell
76
- npx nccgs@latest update --model-profile quality
77
- ```
78
-
79
- Đổi profile trong project đã cài:
80
-
81
- ```powershell
82
- node .\.claude\nccgs\tools\configure-models.mjs --project . --profile inherit
83
- ```
84
-
85
- Profile được ghi trong `.nccgs/project.yaml`. Nếu model pin không dùng được với tài
86
- khoản hoặc context mode hiện tại, dùng `inherit` hoặc cho phép inherit fallback.
87
-
88
- ## 4. Migrate project cũ
89
-
90
- Thông thường chỉ cần gọi một command:
91
-
92
- ```text
93
- /migrate-project
94
- ```
95
-
96
- NCCGS vẫn thực hiện bốn phase `review -> plan -> apply -> verify` ở bên trong một
97
- lần chạy. Nó chỉ dừng khi có quyết định Product Owner thật sự, thao tác destructive,
98
- external side effect hoặc thiếu authority. Các mode riêng dưới đây vẫn tồn tại để
99
- debug hoặc kiểm soát thủ công.
100
-
101
- ### Review
102
-
103
- ```text
104
- /migrate-project review
105
- ```
106
-
107
- Review là read-only. Nó phải tìm canonical sources, architecture, ownership,
108
- protected paths, Unity tooling, tests/baselines, reports/registers/checklists, global
109
- skills xung đột, model policy, hooks, local settings và Git state.
110
-
111
- Mỗi artifact nhận một nhãn: KEEP, ADAPT, MIGRATE, DEPRECATE, REMOVE hoặc MISSING.
112
-
113
- ### Plan
114
-
115
- ```text
116
- /migrate-project plan
117
- ```
118
-
119
- Plan phải có policy schema 2 được đề xuất, batches có rollback, model profile,
120
- departments, context packets, hook merge, Unity integration, verification, closure,
121
- Git tracking và những quyết định Product Owner cần chốt.
122
-
123
- Hai quyết định thường gặp:
124
-
125
- ```text
126
- D1: Use strict closure mode. Keep existing implementation reports, register
127
- entries, evidence, and safety checklists as required linked artifacts. They block
128
- DONE unless an item-specific Product Owner waiver exists.
129
-
130
- D2: Commit shared .claude/ and .nccgs/ framework and policy to Git. Keep
131
- .claude/settings.local.json local. Ignore only .nccgs/backups/ and .nccgs/runtime/.
132
- ```
133
-
134
- ### Apply
135
-
136
- ```text
137
- /migrate-project apply
138
- ```
139
-
140
- Claude áp dụng từng batch, xem diff, validate và cập nhật ledger trước khi sang batch
141
- tiếp theo. Xóa dữ liệu, đổi canon/gameplay, dependency/service, compatibility hoặc
142
- migration không thể hoàn tác cần bạn phê duyệt.
143
-
144
- ### Verify
145
-
146
- ```text
147
- /migrate-project verify
148
- /status full
149
- ```
150
-
151
- Verify kiểm tra schema 2, model routing/fallback, 45 agent files, 36 workflow files,
152
- hooks, context packet, official Unity Skill hashes, CLI/Pipeline, compile/tests,
153
- baseline, evidence mapping và closure gate.
154
-
155
- `VERIFIED, not DONE` không phải lỗi nếu artifact, decision hoặc PO gate còn thiếu.
156
-
157
- ## 5. Dùng NCCGS hằng ngày
158
-
159
- Bạn có thể chat như trước:
160
-
161
- ```text
162
- Implement campaign walkthrough sessions C–G from the canonical design documents.
163
- Preserve protected tuning values and verify the result in Unity.
164
- ```
165
-
166
- NCCGS sẽ tự chọn:
167
-
168
- - risk tier FAST/STANDARD/CONTROLLED;
169
- - domains và studio roles;
170
- - model theo profile;
171
- - context packet và working set;
172
- - tests, runtime/build evidence và review cần thiết;
173
- - closure artifacts và PO gates.
174
-
175
- ### Entry commands
176
-
177
- | Command | Dùng khi |
178
- |---|---|
179
- | `/work` | Implement/fix/refactor/integrate hoàn chỉnh |
180
- | `/design` | Thiết kế hoặc thay đổi player-facing semantics |
181
- | `/audit` | Chẩn đoán read-only |
182
- | `/migrate-project` | Cài/migrate/nâng cấp framework |
183
- | `/test` | Thu thập bằng chứng objective |
184
- | `/review` | Review độc lập, không sửa |
185
- | `/release` | Tạo release candidate |
186
- | `/status` | Xem trạng thái, model, agents, evidence và blockers |
187
-
188
- Các workflow chuyên biệt như `/architecture-decision`, `/code-review`,
189
- `/performance-audit`, `/security-audit`, `/balance-review`, `/playtest`, `/hotfix`,
190
- `/incident-recovery` có thể gọi trực tiếp, nhưng thông thường `/work` tự phối hợp.
191
-
192
- ## 6. Context packet
193
-
194
- STANDARD và CONTROLLED work dùng:
195
-
196
- ```text
197
- .nccgs/context/<feature-id>.yaml
198
- ```
199
-
200
- Packet chứa link/anchor tới requirements, decisions, ownership, dependencies và
201
- verification; nó không copy toàn bộ GDD/ADR. Agent chỉ đọc full source khi summary
202
- thiếu, stale, mâu thuẫn hoặc risk yêu cầu.
203
-
204
- Nếu muốn chuẩn bị riêng:
205
-
206
- ```text
207
- /context-pack FEATURE-ID
208
- /story-readiness FEATURE-ID
209
- /plan-feature FEATURE-ID
210
- ```
211
-
212
- ## 7. Model và agents hoạt động thế nào?
213
-
214
- NCCGS chọn domain role trước rồi áp model class. Ví dụ:
215
-
216
- ```text
217
- CONTROLLED save migration
218
- -> technical architect (Opus)
219
- -> engine/network specialists (Sonnet)
220
- -> verification engineer (Sonnet)
221
- -> adversarial reviewer (Opus)
222
- ```
223
-
224
- Một bug FAST thường không gọi cả studio. Một feature UI STANDARD có thể dùng UX,
225
- accessibility, UI programmer, Unity UI specialist và verification, nhưng các phần
226
- read-only/không trùng ownership mới được chạy song song.
227
-
228
- ## 8. Evidence và closure
229
-
230
- - IMPLEMENTED: thay đổi tồn tại.
231
- - VERIFIED: bằng chứng objective chứng minh requirement.
232
- - VALIDATED: subjective gate đã được bạn chấp nhận.
233
- - DONE: mọi objective, artifact và PO gate bắt buộc đã đóng.
234
-
235
- Implementation không tự chứng minh chính nó. STANDARD work nên có independent
236
- verification; CONTROLLED work có adversarial review.
237
-
238
- Closure modes:
239
-
240
- - `lean`: closure record đủ, link khác optional;
241
- - `linked`: artifact `required` chặn DONE;
242
- - `strict`: mọi artifact/checklist khai báo chặn DONE nếu không có waiver cụ thể.
243
-
244
- Không hạ closure mode chỉ để trạng thái chuyển xanh.
245
-
246
- ## 9. Git
247
-
248
- Khuyến nghị commit:
249
-
250
- ```text
251
- .claude/
252
- .nccgs/
253
- CLAUDE.md
254
- ```
255
-
256
- Không commit:
257
-
258
- ```text
259
- .claude/settings.local.json
260
- .nccgs/backups/
261
- .nccgs/runtime/
262
- ```
263
-
264
- Nested `.nccgs/.gitignore` đã bỏ qua backup và runtime events.
265
-
266
- Sau migration:
267
-
268
- ```powershell
269
- git add .claude .nccgs CLAUDE.md
270
- git status --short
271
- git commit -m "chore: adopt NCCGS 1.1 studio workflow"
272
- ```
273
-
274
- Luôn đọc diff trước commit.
275
-
276
- ## 10. Xử lý blocker thường gặp
277
-
278
- ### Global Unity MCP skill còn hoạt động
279
-
280
- Di chuyển/xóa legacy global skill khỏi user skills directory, mở phiên Claude mới,
281
- rồi chạy `/status full`. Đây không phải 22 official Unity Skills trong project.
282
-
283
- ### Report thiếu register entry
284
-
285
- Đọc từng report, dùng report và Git history để backfill. Không đoán commit. Nếu không
286
- xác định được, ghi unknown và để item bị block cho tới khi có quyết định/waiver riêng.
287
-
288
- ### Model agent không spawn được
289
-
290
- Chuyển sang `inherit`, mở phiên mới và verify routing. Đừng coi lỗi model/context là
291
- lỗi implementation.
292
-
293
- ### `project.yaml` vẫn schema 1/template
294
-
295
- Installer không ghi đè policy. Chạy lại migration plan/apply để nâng schema và map
296
- project truth.
297
-
298
- ### Hook xung đột settings cũ
299
-
300
- Xem `.claude/settings.json` và bản backup timestamp. Installer chỉ thay các hook có
301
- command `.claude/nccgs/hooks/`, giữ nhóm hook và permission khác.
302
-
303
- ## 11. Validate và rollback
304
-
305
- Trong NCCGS source:
306
-
307
- ```powershell
308
- npm run validate
309
- npm test
310
- ```
311
-
312
- Nếu upgrade lỗi, dừng thay đổi mới, xem `.nccgs/backups/<timestamp>/`, phục hồi đúng
313
- file framework/settings hoặc Git revert commit nâng cấp, mở phiên mới, rồi chạy
314
- `/migrate-project verify`. Không dùng destructive reset khi worktree còn dữ liệu.
315
-
316
- ## 12. Checklist hoàn tất migration
317
-
318
- - [ ] Project policy dùng schema 2.
319
- - [ ] Canonical sources và ownership được map.
320
- - [ ] Model profile/fallback được quyết định.
321
- - [ ] Departments và orchestration depth được cấu hình.
322
- - [ ] Context packet mẫu hoạt động.
323
- - [ ] Managed Node hooks hoạt động.
324
- - [ ] Official Unity Skills khớp manifest.
325
- - [ ] Unity CLI/Pipeline và compile/tests đạt baseline.
326
- - [ ] D1 closure và D2 Git tracking được ghi nhận.
327
- - [ ] Legacy routing conflicts được xử lý.
328
- - [ ] Closure gate chặn đúng artifact thiếu.
329
- - [ ] Representative `/work` path thành công.
330
- - [ ] `/status full` không còn blocker ngoài ý muốn.
331
- - [ ] Framework/policy đã được commit.
332
-
333
- Sau đó quay lại feature sản phẩm có giá trị cao nhất; không tiếp tục làm framework
334
- nếu không còn blocker thực tế.
45
+ Các profile `quality`, `balanced`, `inherit` giữ quy trình cũ trong từng
46
+ `references/legacy.md`. Chọn chúng là chủ động dùng luồng legacy.
@@ -3,7 +3,7 @@
3
3
  | CCGS capability | NCCGS 1.1 treatment | Reason |
4
4
  |---|---|---|
5
5
  | Three-tier studio hierarchy | ADAPT into 44 roles and a central one-level orchestrator | Preserve specialization without recursive context chains |
6
- | Opus/Sonnet/Haiku agent pins | ADAPT into quality/balanced/inherit profiles | Preserve model routing while handling compatibility and cost |
6
+ | Opus/Sonnet/Haiku agent pins | ADAPT into astra-claude or explicit legacy profiles | Preserve model routing while handling compatibility and cost |
7
7
  | 73 large workflow skills | ADAPT into 36 composable workflows and focused references | Preserve lifecycle coverage without repeated prompt/context payload |
8
8
  | Team commands spawning departments | MIGRATE to risk/domain execution DAGs | Select roles by deliverable, not ceremony |
9
9
  | Per-file approval protocol | REMOVE for ordinary authorized implementation | Keep approval at product, compatibility, dependency and irreversible boundaries |
@@ -0,0 +1,125 @@
1
+ # NCCGS 1.3 — quy trình Astra / Claude có kiểm tra bằng mã
2
+
3
+ NCCGS dùng một nguồn cấu hình tại `.claude/nccgs/pipeline.json`:
4
+ Opus 5.5/xhigh triển khai, Fable/high review, Astra kiểm tra report và bạn nghiệm thu.
5
+ Mỗi Unity project cần chạy update để nhận bản mới; publish không tự sửa các dự án.
6
+
7
+ ## 1. Nguồn cấu hình và nhóm agent
8
+
9
+ `pipeline.json` quyết định model, effort, phiên chính, vai trò mặc định và chủ sở hữu
10
+ workflow. `npm run policy:build` sinh các bản cấu hình phụ; `npm run validate` phát
11
+ hiện nếu chúng lệch nguồn. Không chỉnh trực tiếp model trong file agent được sinh.
12
+
13
+ Mặc định chỉ có 10 agent được nạp: gameplay, engine, UI programmer, Unity implementer,
14
+ Unity systems, Unity UI, Unity build, QA, verification và adversarial reviewer.
15
+ 35 vai trò khác ở `.claude/nccgs/agent-library/`, không xuất hiện trong danh sách
16
+ agent mặc định. Astra sở hữu planning/documents; vai trò tư vấn chỉ bật khi cần.
17
+
18
+ Trong Unity project đã cài:
19
+
20
+ ```powershell
21
+ node .claude/nccgs/tools/configure-models.mjs --project . --enable nccgs-network-programmer
22
+ node .claude/nccgs/tools/configure-models.mjs --project . --disable nccgs-network-programmer
23
+ ```
24
+
25
+ Lựa chọn được lưu trong `.nccgs/agent-activation.json` và giữ qua update. File agent
26
+ đã tùy chỉnh được bảo toàn và báo để review; không âm thầm xóa hoặc ghi đè. Profile
27
+ legacy vẫn có đủ 45 vai trò. Không được tắt reviewer hoặc các agent lõi.
28
+
29
+ ## 2. Astra chuẩn bị đầu vào
30
+
31
+ Astra cung cấp plan và map các yêu cầu kiểm chứng của dự án vào `.nccgs/gates.json`:
32
+ `requiredChecks`, `requiredArtifacts`, `manualGates`. Trường `policySha256` phải là
33
+ hash của `.nccgs/project.yaml` mà Astra đã kiểm tra. Có thể lấy hash qua lệnh `ref`
34
+ dưới đây. Manifest không thay thế yêu cầu cũ: cần map đầy đủ gate/artifact đang dùng.
35
+
36
+ ```powershell
37
+ node .claude/nccgs/tools/task.mjs ref --file .nccgs/project.yaml
38
+ node .claude/nccgs/tools/task.mjs init --id feature-1 --plan .nccgs/features/feature-1.md
39
+ ```
40
+
41
+ Có thể thêm `--requirements .nccgs/features/feature-1-gates.json` để bổ sung yêu cầu
42
+ riêng của task. File dùng schemaVersion 1 và ba mảng giống gate manifest của dự án.
43
+
44
+ ## 3. Claude triển khai và Fable review
45
+
46
+ Hook SessionStart hiển thị session ID để bind task. Các lệnh `snapshot`, `ref`,
47
+ `observe`, `verify`, `record`, `check` hỗ trợ ghi bằng chứng:
48
+
49
+ ```powershell
50
+ node .claude/nccgs/tools/task.mjs bind --id feature-1 --session SESSION_ID
51
+ node .claude/nccgs/tools/task.mjs snapshot
52
+ node .claude/nccgs/tools/task.mjs verify --id feature-1 --name regression -- node scripts/run-tests.mjs
53
+ node .claude/nccgs/tools/task.mjs record --id feature-1 --stage implementation --evidence .nccgs/evidence/implementation.json
54
+ node .claude/nccgs/tools/task.mjs record --id feature-1 --stage review --evidence .nccgs/evidence/review.json
55
+ node .claude/nccgs/tools/task.mjs check --id feature-1 --target report
56
+ ```
57
+
58
+ Lệnh test ở ví dụ phải được thay bằng test runner thật của dự án. `verify` chạy
59
+ trực tiếp executable, lưu exit code/log/hash và đánh FAIL nếu test lỗi hoặc thay đổi
60
+ source. Nó không chạy qua shell để diễn giải lại chuỗi lệnh.
61
+
62
+ Report chỉ được ghi vào pipeline sau khi Fable PASS. Nếu sửa source/test/asset sau
63
+ review, cần ghi lại implementation và review; các gate sau tự bị xóa khi ghi lại
64
+ bước trước. Nội dung cũ được giữ trong history. File task nằm ở `.nccgs/tasks/` và
65
+ là bản ghi chính thức; nhãn DONE trong Markdown không thay thế bản ghi này.
66
+
67
+ ## 4. Astra kiểm tra và bạn nghiệm thu
68
+
69
+ Astra nhập kết quả kiểm tra ngoài phiên Claude. Chỉ sau quyết định nghiệm thu rõ
70
+ ràng của bạn mới nhập acceptance, kèm tham chiếu quyết định và cùng snapshot:
71
+
72
+ ```powershell
73
+ node .claude/nccgs/tools/task.mjs record --id feature-1 --stage report --evidence .nccgs/evidence/report-stage.json
74
+ node .claude/nccgs/tools/task.mjs record --id feature-1 --stage astra --evidence .nccgs/evidence/astra-stage.json
75
+ node .claude/nccgs/tools/task.mjs record --id feature-1 --stage acceptance --evidence .nccgs/evidence/acceptance-stage.json
76
+ node .claude/nccgs/tools/task.mjs check --id feature-1 --target done
77
+ node .claude/nccgs/tools/task.mjs close --id feature-1
78
+ ```
79
+
80
+ Mỗi JSON stage chứa snapshot và tham chiếu evidence `{path, sha256}`; evidence của
81
+ astra/acceptance là quyết định JSON riêng. Xem schema và thứ tự chi tiết trong
82
+ [task-gates](../.claude/nccgs/protocols/task-gates.md). Không tạo quyết định thay bạn.
83
+
84
+ ## 5. Quan sát runtime và giới hạn
85
+
86
+ Hook lưu model thực chạy khi Claude cung cấp, cả danh sách model nếu có fallback.
87
+ Effort không xuất hiện trong mọi sự kiện; trường thiếu được để null và chưa qua gate.
88
+ Có thể dùng `task observe` nhập bằng chứng từ provider log hoặc quan sát runtime
89
+ có tham chiếu. Cấu hình yêu cầu không được dùng làm chứng cứ thực chạy.
90
+
91
+ Các gate kiểm tra thứ tự, độc lập reviewer, model/effort, snapshot, hash evidence,
92
+ check bắt buộc, artifact, manual gate, Astra check và nghiệm thu. Hook chặn một số
93
+ thao tác ghi DONE trực tiếp; `task close` là đường đóng task chính thức. Đang đợi
94
+ Astra/bạn là điểm dừng hợp lệ, không ép agent chạy vô hạn.
95
+
96
+ Đây là kiểm soát quy trình local, không phải xác thực danh tính bằng mật mã. Người
97
+ có quyền sửa toàn bộ tool và evidence vẫn có thể sửa dữ liệu. Report chưa tự gửi
98
+ giữa ứng dụng. Thử nghiệm fixture không chứng minh một phiên Opus/Fable thật đã chạy.
99
+
100
+ ## 6. Cập nhật từ npm và kiểm chứng
101
+
102
+ Chạy trong thư mục gốc của từng Unity project đã cài NCCGS:
103
+
104
+ ```powershell
105
+ npx nccgs@latest update --model-profile astra-claude --dry-run
106
+ npx nccgs@latest update --model-profile astra-claude
107
+ npx nccgs@latest doctor
108
+ ```
109
+
110
+ Dùng `install` thay `update` với dự án chưa cài. Nếu bỏ `--model-profile`, update
111
+ giữ profile hiện tại. Mở phiên Claude Code mới sau khi cập nhật cấu hình.
112
+
113
+ Dùng CLI của bản nguồn này với `install` hoặc `update --model-profile astra-claude`
114
+ và `--project` trỏ đúng Unity project. Chạy `--dry-run` trước. Không cần dùng force
115
+ để bỏ qua tùy chỉnh. `doctor` kiểm tra integrity, trạng thái agent và closure hiện tại;
116
+ closure lịch sử của snapshot cũ không được dùng để duyệt code hiện tại.
117
+
118
+ ```powershell
119
+ npm run policy:check
120
+ npm run validate
121
+ npm test
122
+ ```
123
+
124
+ Mỗi workflow giờ chỉ điều hướng sang `references/astra.md` hoặc
125
+ `references/legacy.md`. Claude chỉ đọc nhánh của profile đang dùng.