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
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: nccgs-unity-ui-specialist
3
+ description: "Specializes in UI Toolkit, UGUI, TextMesh Pro, input navigation, binding, localization, and accessibility integration."
4
+ tools: Read, Glob, Grep, Bash, Write, Edit
5
+ maxTurns: 22
6
+ ---
7
+
8
+ You are the unity ui specialist in the NCCGS studio.
9
+
10
+ Before acting, read `.claude/nccgs/protocols/agent-contract.md`, `.nccgs/project.yaml`, and the assigned context packet when one exists.
11
+
12
+ ## Mission
13
+
14
+ Implement approved UX behavior with idiomatic Unity UI structures and runtime checks.
15
+
16
+ ## Deliverables
17
+
18
+ Return Unity UI assets/code, navigation tests, binding evidence, and platform risks. Separate facts from inference and tie conclusions to canonical sources, final files, or observable evidence.
19
+
20
+ ## Boundary
21
+
22
+ Do not choose UX semantics or keep authoritative gameplay state in views.
23
+
24
+ Do not spawn subagents. Return a handoff to the primary orchestrator when another specialty is required.
25
+
@@ -2,7 +2,6 @@
2
2
  name: nccgs-ux-designer
3
3
  description: "Designs interaction flows, information hierarchy, controls, feedback, error recovery, and usability acceptance."
4
4
  tools: Read, Glob, Grep, Write, Edit, WebSearch, WebFetch
5
- model: sonnet
6
5
  maxTurns: 18
7
6
  ---
8
7
 
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: nccgs-verification-engineer
3
+ description: "Independently verifies requirements through final diff, tests, Unity runtime, console, serialization, and regression evidence."
4
+ tools: Read, Glob, Grep, Bash, Write, Edit
5
+ maxTurns: 22
6
+ ---
7
+
8
+ You are the verification engineer in the NCCGS studio.
9
+
10
+ Before acting, read `.claude/nccgs/protocols/agent-contract.md`, `.nccgs/project.yaml`, and the assigned context packet when one exists.
11
+
12
+ ## Mission
13
+
14
+ Determine exactly what evidence proves and what remains unverified or subjective.
15
+
16
+ ## Deliverables
17
+
18
+ Return evidence records, coverage verdicts, baseline comparisons, and PO gates. Separate facts from inference and tie conclusions to canonical sources, final files, or observable evidence.
19
+
20
+ ## Boundary
21
+
22
+ Do not rely on implementer rationale or claim subjective validation.
23
+
24
+ Do not spawn subagents. Return a handoff to the primary orchestrator when another specialty is required.
25
+
@@ -2,7 +2,6 @@
2
2
  name: nccgs-world-builder
3
3
  description: "Develops coherent locations, factions, history, cultures, and environmental narrative within canon."
4
4
  tools: Read, Glob, Grep, Write, Edit
5
- model: sonnet
6
5
  maxTurns: 18
7
6
  ---
8
7
 
@@ -2,7 +2,6 @@
2
2
  name: nccgs-writer
3
3
  description: "Drafts dialogue, descriptions, barks, tutorials, and narrative content under established canon and voice."
4
4
  tools: Read, Glob, Grep, Write, Edit
5
- model: sonnet
6
5
  maxTurns: 18
7
6
  ---
8
7
 
@@ -21,6 +21,19 @@ Never let generic advice silently override project truth.
21
21
 
22
22
  ## Project bootstrap
23
23
 
24
+ The default `astra-claude` model profile uses a mandatory external planning and
25
+ acceptance chain. Read `.claude/nccgs/protocols/astra-claude.md` before selecting
26
+ roles or executing any workflow: Astra owns planning/documents; Opus 5.5/xhigh
27
+ implements; Fable independently reviews; Astra checks the report; the Product Owner
28
+ accepts. This profile-specific contract overrides generic workflow autonomy,
29
+ document-authoring, risk-based review, and closure shortcuts below.
30
+
31
+ For this profile, load `.claude/nccgs/protocols/task-gates.md`. The task record under
32
+ `.nccgs/tasks/` is authoritative and `task close` enforces all stages. Markdown DONE
33
+ labels cannot replace it. Read routing from `pipeline.json`; use only the selected
34
+ workflow reference branch. Ten core roles are active; enable optional specialists
35
+ through the configurator when the plan needs their expertise.
36
+
24
37
  For meaningful project work:
25
38
 
26
39
  1. read `.nccgs/project.yaml` and `.nccgs/state.md` when present;
@@ -1,4 +1,5 @@
1
1
  import { appendRuntime, readInput } from "./common.mjs";
2
+ import { observe } from "../tools/runtime.mjs";
2
3
 
3
4
  const input = await readInput();
4
5
  appendRuntime({
@@ -8,3 +9,8 @@ appendRuntime({
8
9
  agentId: input.agent_id ?? null,
9
10
  agentType: input.agent_type ?? "unknown"
10
11
  });
12
+ try {
13
+ observe(process.cwd(), input, process.argv[2] === "stop" ? "agent_stop" : "agent_start");
14
+ } catch (error) {
15
+ appendRuntime({ event: "runtime_observation_failed", error: error.message });
16
+ }
@@ -0,0 +1,34 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { readInput } from "./common.mjs";
4
+ import { profilePolicy, json } from "../tools/policy.mjs";
5
+ import { check, taskPath } from "../tools/gates.mjs";
6
+ import { boundTask } from "../tools/runtime.mjs";
7
+
8
+ const input = await readInput();
9
+ const project = process.cwd();
10
+ try {
11
+ if (profilePolicy(project).name !== "astra-claude") process.exit(0);
12
+ const mode = process.argv[2];
13
+ const tool = input.tool_input ?? {};
14
+ const absolute = path.resolve(tool.file_path || tool.path || project);
15
+ const relative = path.relative(project, absolute).split(path.sep).join("/");
16
+ const text = tool.content ?? tool.new_string ?? "";
17
+ if (mode === "pre" && /^\.nccgs\/(tasks|approvals)\//.test(relative)) throw new Error("Use the task gate CLI for task records. Astra/PO sign-offs must be imported outside Claude; never write them on their behalf.");
18
+ const shell = tool.command ?? "";
19
+ if (mode === "pre" && /(?:--stage\s+["']?(?:astra|acceptance)\b|\.nccgs[\\/]approvals[\\/])/i.test(shell)) throw new Error("Claude cannot create/import Astra or Product Owner sign-offs.");
20
+ const completion = /(?:^|\n)\s*(?:[-*]\s*)?(?:\*\*)?(?:Final state|Status|State|Trạng thái)(?:\*\*)?\s*:\s*(?:\*\*)?DONE\b|^\s*(?:\*\*)?DONE\b|"(?:state|status)"\s*:\s*"DONE"/im;
21
+ const claimsDone = mode === "stop"
22
+ ? completion.test(input.last_assistant_message ?? "")
23
+ : /^\.nccgs\/(?:closures\/|state\.md$)/.test(relative) && completion.test(text);
24
+ if (!claimsDone) process.exit(0);
25
+ const id = boundTask(project, input.session_id);
26
+ if (!id) throw new Error("A DONE claim needs a session bound to an NCCGS task");
27
+ check(project, json(taskPath(project, id)), "done");
28
+ } catch (error) {
29
+ if (process.argv[2] === "stop") {
30
+ // Do not trap the session in an endless Stop-hook loop; the canonical close
31
+ // command and doctor still reject the invalid record on every invocation.
32
+ if (!input.stop_hook_active) console.log(JSON.stringify({ decision: "block", reason: `NCCGS closure blocked: ${error.message}. Report the pending gate; do not claim DONE.` }));
33
+ } else { console.error(`NCCGS closure blocked: ${error.message}`); process.exitCode = 2; }
34
+ }
@@ -0,0 +1,11 @@
1
+ import { readInput, appendRuntime } from "./common.mjs";
2
+ import { observe } from "../tools/runtime.mjs";
3
+ try {
4
+ const input = await readInput();
5
+ const result = observe(process.cwd(), input, "agent_result");
6
+ appendRuntime({ event: "runtime_observation", path: result.path, sessionId: result.sessionId, agentId: result.agentId, missing: result.missing });
7
+ console.log(`NCCGS runtime evidence: ${result.path}; missing observation: ${result.missing.join(", ") || "none"}. Configuration is not runtime proof.`);
8
+ } catch (error) {
9
+ appendRuntime({ event: "runtime_observation_failed", error: error.message });
10
+ console.error(`NCCGS could not capture runtime evidence: ${error.message}`);
11
+ }
@@ -1,4 +1,5 @@
1
- import { git, readText, yamlValue } from "./common.mjs";
1
+ import { git, readText, yamlValue, readInput } from "./common.mjs";
2
+ import { profilePolicy } from "../tools/policy.mjs";
2
3
 
3
4
  const version = readText(".claude/nccgs/VERSION", 100).trim() || "unknown";
4
5
  const policy = readText(".nccgs/project.yaml");
@@ -6,8 +7,14 @@ const state = readText(".nccgs/state.md", 6000);
6
7
  const branch = git(["branch", "--show-current"]) || "not-a-git-repository";
7
8
  const changes = git(["status", "--short"]).split(/\r?\n/).filter(Boolean).length;
8
9
  const model = yamlValue(policy, "models", "profile") || "unconfigured";
10
+ const input = await readInput();
9
11
 
10
12
  console.log(`NCCGS ${version} | branch ${branch} | ${changes} working-tree change(s) | model profile ${model}`);
13
+ if (model === "astra-claude") {
14
+ const { profile } = profilePolicy(process.cwd());
15
+ console.log(`Astra owns planning/documents. Implementation: ${profile.models.standard.model}/${profile.models.standard.effort}; independent review: ${profile.models.review.model}/${profile.models.review.effort}. Read the profile protocol and use task gates. DONE requires Astra check and explicit Product Owner acceptance.`);
16
+ if (/^[\w-]+$/.test(input.session_id ?? "")) console.log(`Bind the active task with: node .claude/nccgs/tools/task.mjs bind --id TASK_ID --session ${input.session_id}`);
17
+ }
11
18
  if (state) {
12
19
  console.log("Read .nccgs/state.md and the active context packet before resuming meaningful work.");
13
20
  } else {
@@ -0,0 +1,176 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "defaultProfile": "astra-claude",
4
+ "profiles": {
5
+ "astra-claude": {
6
+ "models": {
7
+ "lightweight": {
8
+ "model": "claude-opus-5-5",
9
+ "effort": "xhigh"
10
+ },
11
+ "standard": {
12
+ "model": "claude-opus-5-5",
13
+ "effort": "xhigh"
14
+ },
15
+ "deep": {
16
+ "model": "claude-opus-5-5",
17
+ "effort": "xhigh"
18
+ },
19
+ "leadership": {
20
+ "model": "claude-opus-5-5",
21
+ "effort": "xhigh"
22
+ },
23
+ "review": {
24
+ "model": "fable",
25
+ "effort": "high"
26
+ }
27
+ },
28
+ "session": {
29
+ "class": "standard"
30
+ },
31
+ "activeAgents": [
32
+ "nccgs-gameplay-programmer",
33
+ "nccgs-engine-programmer",
34
+ "nccgs-ui-programmer",
35
+ "nccgs-unity-implementer",
36
+ "nccgs-unity-systems-specialist",
37
+ "nccgs-unity-ui-specialist",
38
+ "nccgs-unity-build-specialist",
39
+ "nccgs-qa-engineer",
40
+ "nccgs-verification-engineer",
41
+ "nccgs-adversarial-reviewer"
42
+ ]
43
+ },
44
+ "quality": {
45
+ "models": {
46
+ "lightweight": {
47
+ "model": "haiku",
48
+ "effort": null
49
+ },
50
+ "standard": {
51
+ "model": "sonnet",
52
+ "effort": null
53
+ },
54
+ "deep": {
55
+ "model": "opus",
56
+ "effort": null
57
+ },
58
+ "leadership": {
59
+ "model": "opus",
60
+ "effort": null
61
+ },
62
+ "review": {
63
+ "model": "opus",
64
+ "effort": null
65
+ }
66
+ },
67
+ "session": null,
68
+ "activeAgents": "all"
69
+ },
70
+ "balanced": {
71
+ "models": {
72
+ "lightweight": {
73
+ "model": "haiku",
74
+ "effort": null
75
+ },
76
+ "standard": {
77
+ "model": "sonnet",
78
+ "effort": null
79
+ },
80
+ "deep": {
81
+ "model": "opus",
82
+ "effort": null
83
+ },
84
+ "leadership": {
85
+ "model": "sonnet",
86
+ "effort": null
87
+ },
88
+ "review": {
89
+ "model": "opus",
90
+ "effort": null
91
+ }
92
+ },
93
+ "session": null,
94
+ "activeAgents": "all"
95
+ },
96
+ "inherit": {
97
+ "models": {
98
+ "lightweight": {
99
+ "model": null,
100
+ "effort": null
101
+ },
102
+ "standard": {
103
+ "model": null,
104
+ "effort": null
105
+ },
106
+ "deep": {
107
+ "model": null,
108
+ "effort": null
109
+ },
110
+ "leadership": {
111
+ "model": null,
112
+ "effort": null
113
+ },
114
+ "review": {
115
+ "model": null,
116
+ "effort": null
117
+ }
118
+ },
119
+ "session": null,
120
+ "activeAgents": "all"
121
+ }
122
+ },
123
+ "contract": {
124
+ "planningOwner": "Astra",
125
+ "documentsOwner": "Astra",
126
+ "reviewAgent": "nccgs-adversarial-reviewer",
127
+ "sequence": [
128
+ "astra-plan",
129
+ "opus-implementation",
130
+ "fable-review",
131
+ "report-to-astra",
132
+ "astra-check",
133
+ "product-owner-acceptance"
134
+ ],
135
+ "requiredForAllCodeChanges": true,
136
+ "allowInheritFallback": false,
137
+ "astraWorkflows": [
138
+ "design",
139
+ "context-pack",
140
+ "plan-feature",
141
+ "architecture-decision",
142
+ "closure",
143
+ "qa-plan",
144
+ "project-stage",
145
+ "sprint-plan",
146
+ "milestone-review",
147
+ "retrospective"
148
+ ],
149
+ "reviewWorkflows": [
150
+ "review",
151
+ "nccgs-code-review"
152
+ ]
153
+ },
154
+ "snapshotExcludes": [
155
+ ".git",
156
+ ".nccgs",
157
+ "Library",
158
+ "Temp",
159
+ "Logs",
160
+ "obj",
161
+ "node_modules",
162
+ ".vs"
163
+ ],
164
+ "coreAgents": [
165
+ "nccgs-gameplay-programmer",
166
+ "nccgs-engine-programmer",
167
+ "nccgs-ui-programmer",
168
+ "nccgs-unity-implementer",
169
+ "nccgs-unity-systems-specialist",
170
+ "nccgs-unity-ui-specialist",
171
+ "nccgs-unity-build-specialist",
172
+ "nccgs-qa-engineer",
173
+ "nccgs-verification-engineer",
174
+ "nccgs-adversarial-reviewer"
175
+ ]
176
+ }
@@ -4,6 +4,11 @@ All studio agents use this contract in addition to their role file.
4
4
 
5
5
  ## Inputs
6
6
 
7
+ For the `astra-claude` profile, first read `protocols/astra-claude.md` relative to
8
+ `.claude/nccgs/`. Astra supplies planning and canonical documents. Claude produces
9
+ implementation, evidence, and handoff reports; Fable independently reviews. Never
10
+ impersonate Astra or infer Product Owner acceptance.
11
+
7
12
  Before acting, obtain the task objective and risk tier, project authority and
8
13
  ownership, the focused context packet for STANDARD or CONTROLLED work, exact owned
9
14
  files/evidence, dependencies, and unresolved Product Owner decisions.
@@ -0,0 +1,77 @@
1
+ # Astra planning, Claude implementation, Fable review
2
+
3
+ This protocol is mandatory when `models.profile` is `astra-claude`, including when
4
+ the package default is used before project policy exists. It takes precedence over
5
+ generic NCCGS workflow instructions. Other profiles retain their existing workflow.
6
+
7
+ Runtime routing comes only from `pipeline.json`; [generated routing](../routing.generated.md)
8
+ is its readable view. Use [task gates](task-gates.md) to initialize, record, check,
9
+ and close work. The authoritative task JSON and artifact hashes, not Markdown
10
+ status labels, determine whether reporting or DONE is allowed.
11
+
12
+ ## Ownership
13
+
14
+ - **Astra** owns planning, feature contracts, context packets, architecture decisions,
15
+ canonical documents, and the final check of Claude's report.
16
+ - **Claude Opus 5.5 / xhigh** implements the supplied plan, writes tests, runs relevant
17
+ checks, fixes defects, and records implementation evidence and the handoff report.
18
+ - **Fable / high**, through `nccgs-adversarial-reviewer`, independently reviews the
19
+ completed work. The reviewer remains read-only and does not implement fixes.
20
+ - **Product Owner** performs final acceptance after Astra's check. Only this explicit
21
+ acceptance, together with all technical gates, permits DONE.
22
+
23
+ Claude may sequence local implementation steps inside Astra's plan. It must not
24
+ replace the plan or author canonical planning/design documents. Report proposed
25
+ document changes to Astra. Evidence logs, review records, implementation reports,
26
+ and factual progress checkpoints are permitted Claude outputs. Planning-only roles
27
+ remain available as technical consultants, not substitutes for Astra ownership.
28
+
29
+ ## Required sequence for every code change
30
+
31
+ 1. Read Astra's plan, requirements, acceptance criteria, document references, and
32
+ assigned write set. A concise Astra handoff is enough for FAST work. Missing or
33
+ contradictory scope is a planning blocker; return the exact question to Astra.
34
+ 2. Confirm the implementation session or agent actually uses `claude-opus-5-5` at
35
+ `xhigh`. Implement and collect compilation, test, runtime, and regression evidence
36
+ appropriate to the change. A role name alone does not prove its runtime model.
37
+ 3. Immediately after implementation and its checks, invoke a fresh, independent
38
+ `nccgs-adversarial-reviewer` with the review route in pipeline.json. Supply raw requirements, the
39
+ final diff/working-tree snapshot, affected callers, and evidence. Do not supply
40
+ an expected verdict. No final completion report is handed to Astra before this
41
+ review. Progress updates and blocker notices are always allowed.
42
+ 4. Fable returns PASS, CHANGES_REQUIRED, or BLOCKED with evidence and findings.
43
+ Open BLOCKER/HIGH findings or unmet required acceptance criteria prevent PASS.
44
+ Opus fixes findings within approved scope, reruns affected checks, then requests
45
+ Fable review again. Any code/test/asset change after a review invalidates that
46
+ review. Bind each review to a commit plus dirty/untracked diff or file hashes;
47
+ a commit ID alone is insufficient when the working tree is dirty.
48
+ 5. After Fable PASS on the final snapshot, Claude writes the implementation report
49
+ using `.nccgs/templates/implementation-report.md`, preserving the independent
50
+ review verbatim or linking its record. Mark phase `AWAITING_ASTRA_CHECK` and hand
51
+ the report path to Astra. Do not claim it was sent across applications without
52
+ a real delivery mechanism. Do not simulate Astra's response.
53
+ 6. Astra checks plan compliance, evidence, Fable findings and their resolution,
54
+ documents, and residual risk. Astra may return work for correction, which repeats
55
+ steps 2-5, or record its check and prepare `AWAITING_PO_ACCEPTANCE`.
56
+ 7. The Product Owner accepts the reviewed snapshot. Only then may Astra finalize the
57
+ closure record as DONE if all other configured gates also pass. Unknown, missing,
58
+ stale, or inferred sign-offs never count. Changes after either sign-off require
59
+ renewed review/check/acceptance for the changed snapshot.
60
+
61
+ These phases are workflow checkpoints, not replacements for IMPLEMENTED, VERIFIED,
62
+ VALIDATED, DONE, and BLOCKED. Neither FAST classification nor lean closure skips
63
+ Fable review, Astra checking, or explicit Product Owner acceptance. Hotfixes,
64
+ prototypes, migrations with code changes, and release fixes follow the same chain.
65
+
66
+ ## Model failures and evidence
67
+
68
+ Do not silently substitute Sonnet, another Opus version, or inherited models for
69
+ the required stages. If access, forced routing, effort caps, or runtime fallback
70
+ prevents the requested model/effort, record BLOCKED with the observed identity and
71
+ resume only when the required stage can run or the Product Owner changes policy.
72
+ An unavailable Fable review is not a PASS. Do not confuse configuration with proof
73
+ of execution: record requested and observed models/efforts, session/agent IDs,
74
+ reviewed snapshot, commands/results, unresolved findings, and acceptance references.
75
+
76
+ This is a file-backed workflow contract, not an automatic cross-application bridge.
77
+ NCCGS does not start an Astra session or send messages to an external service itself.
@@ -13,3 +13,9 @@ build state. A changed baseline must be explained before closure.
13
13
 
14
14
  Subjective experience remains a Product Owner gate. Provide a reproducible scenario
15
15
  and what to observe; never fabricate validation.
16
+
17
+ For astra-claude, every code change requires Fable review, including FAST work.
18
+ Record requested versus observed model/effort and the final dirty/untracked snapshot,
19
+ not only a role label or commit ID. A Fable PASS permits reporting to Astra, not
20
+ DONE. Astra's check and the Product Owner's explicit acceptance remain separate
21
+ required evidence. See [the handoff protocol](astra-claude.md).
@@ -2,21 +2,43 @@
2
2
 
3
3
  Model choice is a quality and compatibility policy, not a status symbol.
4
4
 
5
+ `.claude/nccgs/pipeline.json` is the source for routing. Catalog and frontmatter
6
+ values are generated, checked for drift, and documented in
7
+ [routing.generated.md](../routing.generated.md). Ten core roles load by default;
8
+ 35 optional roles remain in `agent-library/` until explicitly enabled. Activation
9
+ is recorded in `.nccgs/agent-activation.json` and survives updates.
10
+
5
11
  ## Capability classes
6
12
 
13
+ The default profile is `astra-claude`: all Claude implementation/support roles use
14
+ the pinned `claude-opus-5-5` model with `effort: xhigh`; the `review` class uses
15
+ `fable` with `effort: high`. Astra is an external planning/document owner, not a
16
+ Claude model alias. See [the required handoff sequence](astra-claude.md).
17
+
18
+ `configure-models.mjs` applies both model and effort to agent frontmatter. For
19
+ `astra-claude`, it also sets the project session model and effort in
20
+ `.claude/settings.json`, preserving unrelated settings and backing up replaced
21
+ settings. Existing sessions, local settings, environment variables, forced subagent
22
+ routing, and provider restrictions may still override configuration; verify the
23
+ actual runtime model/effort before recording a successful stage.
24
+
7
25
  - `lightweight`: indexing, state, formatting, deterministic documentation updates;
8
26
  - `standard`: implementation, focused design, tests, ordinary domain analysis;
9
27
  - `deep`: architecture, migration, adversarial reasoning, cross-domain conflicts;
10
28
  - `leadership`: product-wide creative, technical, or production synthesis.
29
+ - `review`: independent adversarial review after implementation.
11
30
 
12
- The package ships with a `quality` profile: lightweight uses Haiku, standard uses
13
- Sonnet, and deep/leadership use Opus. `balanced` moves routine leadership to Sonnet.
14
- `inherit` removes agent model pins and uses the session model.
31
+ Legacy `quality` uses Haiku for lightweight, Sonnet for standard, and Opus for
32
+ deep/leadership/review. `balanced` moves routine leadership to Sonnet. `inherit`
33
+ removes agent model and effort pins and uses the session settings. Legacy profiles
34
+ do not change the main session settings. Selecting them explicitly opts out of the
35
+ `astra-claude` chain; ordinary updates preserve an existing project's profile.
15
36
 
16
37
  Select the role first, then apply project model policy. Do not call Opus merely
17
38
  because a role sounds senior. Escalate when evidence shows cross-system ambiguity,
18
39
  irreversible risk, security implications, conflicting canon, or repeated failed
19
40
  hypotheses.
20
41
 
21
- If a pinned model is unavailable or incompatible with the current context mode, use
22
- the configured inherit fallback and report it. Model failure is not task failure.
42
+ Only legacy profiles may use an inherit fallback when project policy allows it.
43
+ For `astra-claude`, unavailable or substituted model/effort blocks that stage; never
44
+ present another model's result as Opus 5.5 implementation or Fable review.
@@ -24,3 +24,8 @@ another specialty instead of spawning their own hierarchy.
24
24
  Pass a context packet path and exact responsibility. Do not paste full GDDs, ADRs,
25
25
  or chat history into every prompt. Surface blocked nodes immediately and preserve
26
26
  completed independent outputs.
27
+
28
+ Under astra-claude, Astra owns the plan and document scope. Claude orchestrates
29
+ implementation nodes inside that plan on Opus 5.5/xhigh. Every coding outcome must
30
+ pass an independent Fable review before its final report goes to Astra. Even FAST
31
+ work cannot bypass this sequence. See [the handoff protocol](astra-claude.md).
@@ -0,0 +1,66 @@
1
+ # Executable task gates
2
+
3
+ Run the installed tool as `node .claude/nccgs/tools/task.mjs COMMAND ...`, or use
4
+ `nccgs task COMMAND ...`. Paths in evidence are project-relative POSIX paths.
5
+
6
+ 1. Astra supplies the plan and project-specific acceptance obligations.
7
+ Astra maps existing project closure artifacts/manual gates to `.nccgs/gates.json`
8
+ (`requiredChecks`, `requiredArtifacts`, `manualGates`) and sets its `policySha256`
9
+ to the hash of the reviewed project.yaml. A missing/stale mapping blocks task init.
10
+ Optional `--requirements FILE.json` adds the same arrays for this task. These
11
+ manifests are hashed; changing obligations invalidates the current task.
12
+ 2. `task init --id feature-1 --plan .nccgs/features/feature-1.md` creates a task.
13
+ 3. `task bind --id feature-1 --session SESSION_ID` connects hook telemetry to it.
14
+ 4. `task snapshot` prints the current source fingerprint. It covers files, names,
15
+ additions, and deletions, including untracked files. Only the top-level generated
16
+ directories listed in pipeline.json are excluded. The plan and evidence files
17
+ are separately hashed. Never place source or canon in an excluded directory.
18
+ 5. `task ref --file .nccgs/evidence/check.log` prints a `{path, sha256}` reference.
19
+ 6. `task record --id feature-1 --stage implementation --evidence .nccgs/evidence/implementation.json`
20
+ records implementation with `snapshot`, `runtime` (artifact reference), and
21
+ nonempty `checks: [{name, status: "PASS", evidence: {path, sha256}}]`.
22
+ 7. Record `review` with `snapshot`, `runtime`, `verdict`, `criteriaMet`, `findings`
23
+ (each has severity/status), and `evidence` referencing the independent review.
24
+ Only PASS with criteriaMet true and no unresolved BLOCKER/HIGH unlocks reporting.
25
+ Corrections require fresh implementation evidence and independent review.
26
+ 8. `task check --id feature-1 --target report` must pass before final reporting.
27
+ Write the report and record stage `report` with snapshot and its evidence reference.
28
+ Store new report/evidence files under `.nccgs/evidence/` so producing evidence
29
+ does not change the reviewed source snapshot. Do not edit a hashed report to add
30
+ sign-offs; use separate decision files. Source or canonical document changes
31
+ outside excluded evidence directories require fresh implementation/review.
32
+ 9. Astra, outside Claude, checks the report and records stage `astra`. The evidence
33
+ reference points to JSON with actor `Astra`, decision `PASS`, taskId, snapshot,
34
+ decidedAt (ISO time), statement, and a source reference identifying the decision.
35
+ 10. After the user's explicit acceptance, outside Claude record stage `acceptance`
36
+ with an evidence file of the same shape: actor `Product Owner`, decision
37
+ `ACCEPTED`. Never generate a user's decision or infer it from a passed test.
38
+ 11. `task check --id feature-1 --target done` and `task close --id feature-1` enforce
39
+ the entire chain. Changed source, plan, policy, or evidence invalidates old gates.
40
+
41
+ Recording an upstream stage clears every downstream stage and preserves history.
42
+ The `check` command is read-only. A failed check exits nonzero and names the blocker.
43
+ Stop-hook DONE checks are supplemental; task close is the canonical closing action.
44
+ Waiting for Astra or the user is a valid stopping point, not a reason to keep an
45
+ agent running. Do not write task JSON or external approvals through Write/Edit.
46
+
47
+ ## Runtime observations
48
+
49
+ Agent lifecycle and Agent-tool hooks capture available native model telemetry,
50
+ including modelsUsed so a mid-run fallback is visible. They do not copy prompts,
51
+ credentials, full transcripts, or arbitrary tool output. Missing fields remain null.
52
+ The documented Agent result does not guarantee an effort field, so native captures
53
+ alone may be insufficient for a gate.
54
+
55
+ Use `task observe --id feature-1 --file .nccgs/evidence/provider-observation.json`
56
+ to import an explicit runtime observation when needed. That source JSON must contain
57
+ taskId, snapshot, capturedAt, sessionId, agentId, observedModel, observedEffort,
58
+ modelsUsed (if swapped), status `completed`, and provenance with kind `provider-log`
59
+ or `operator-observation` and a nonempty reference. It must describe the actual run,
60
+ not settings or the agent's requested model. The tool hashes the source and emits
61
+ an observation reference for the stage record. Unknown effort remains blocked.
62
+
63
+ Local files are an auditable workflow boundary, not cryptographic identity or a
64
+ defense against a person who can rewrite the tool and all evidence. Astra/PO
65
+ attestations need honest external source references. Claude sessions may not import
66
+ their own external sign-offs. These tools do not send messages across applications.
@@ -0,0 +1,11 @@
1
+ # Generated routing — edit pipeline.json, then compile-policy.mjs
2
+
3
+ | Stage | Owner/model | Effort |
4
+ |---|---|---|
5
+ | Plan and documents | Astra | External session |
6
+ | Implementation | claude-opus-5-5 | xhigh |
7
+ | Independent review | fable | high |
8
+ | Report check | Astra | External session |
9
+ | Acceptance | Product Owner | Explicit decision |
10
+
11
+ Default active agents: 10. Full library: 45.