cabloy 5.1.191 → 5.1.192

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 (82) hide show
  1. package/.cabloy-version +1 -1
  2. package/.github/workflows/agent-governance.yml +39 -0
  3. package/.github/workflows/docs-pages.yml +1 -0
  4. package/.gitignore +3 -0
  5. package/CHANGELOG.md +7 -0
  6. package/package.json +11 -5
  7. package/repo-agent-governance/adapters/claude/contract-loop-gate.ts +199 -0
  8. package/{.claude → repo-agent-governance}/commands/release.md +20 -20
  9. package/repo-agent-governance/managed-assets.json +887 -0
  10. package/repo-agent-governance/manifest.json +56 -0
  11. package/{CLAUDE.md → repo-agent-governance/policies/repository.md} +4 -2
  12. package/repo-agent-governance/scripts/governance.mjs +570 -0
  13. package/repo-agent-governance/scripts/pack-check.mjs +43 -0
  14. package/{.claude → repo-agent-governance}/skills/cabloy-contract-loop/references/contract-loop-map.md +4 -4
  15. package/{.claude → repo-agent-governance}/skills/cabloy-master-detail/SKILL.md +1 -1
  16. package/{.claude → repo-agent-governance}/skills/cabloy-module-removal/SKILL.md +1 -1
  17. package/{.claude → repo-agent-governance}/skills/cabloy-spec-execution/SKILL.md +1 -1
  18. package/{.claude → repo-agent-governance}/skills/cabloy-spec-execution/references/execution-protocol.md +8 -8
  19. package/{.claude → repo-agent-governance}/skills/cabloy-spec-execution/references/status-and-evidence.md +9 -9
  20. package/{.claude → repo-agent-governance}/skills/cabloy-spec-generation/SKILL.md +2 -2
  21. package/{.claude → repo-agent-governance}/skills/cabloy-spec-generation/references/repo-aware-discovery.md +7 -7
  22. package/{.claude → repo-agent-governance}/skills/cabloy-spec-generation/references/repo-specs-document-set.md +30 -30
  23. package/{.claude → repo-agent-governance}/skills/cabloy-spec-generation/references/traceability-and-status-rules.md +9 -9
  24. package/{.claude → repo-agent-governance}/skills/cabloy-workflow/SKILL.md +7 -8
  25. package/{.claude → repo-agent-governance}/skills/cabloy-worktree-environment/SKILL.md +9 -9
  26. package/{.claude → repo-agent-governance}/skills/cabloy-zova-source-reading/SKILL.md +5 -5
  27. package/repo-agent-governance/tests/governance.test.mjs +295 -0
  28. package/repo-agent-governance/tools/contract-loop/check.mjs +71 -0
  29. package/repo-agent-governance/tools/contract-loop/core.mjs +189 -0
  30. package/repo-agent-governance/tools/spec-charts/generate-implementation-charts.mjs +858 -0
  31. package/{.claude/skills/cabloy-spec-generation/scripts → repo-agent-governance/tools/spec-charts}/generate-implementation-charts.test.mjs +95 -20
  32. package/repo-docs/.vitepress/config.mjs +1 -0
  33. package/repo-docs/ai/agent-governance.md +80 -0
  34. package/repo-docs/ai/cli-to-skill-map.md +3 -3
  35. package/repo-docs/ai/docs-skills-rules-mapping.md +27 -26
  36. package/repo-docs/ai/edition-consistency-checklist.md +8 -6
  37. package/repo-docs/ai/future-skill-roadmap.md +2 -2
  38. package/repo-docs/ai/introduction.md +7 -6
  39. package/repo-docs/ai/repo-guidance.md +3 -2
  40. package/repo-docs/ai/rules-and-config.md +23 -15
  41. package/repo-docs/ai/skills.md +7 -7
  42. package/repo-docs/ai/verification.md +2 -1
  43. package/repo-docs/fullstack/contract-loop-playbook.md +1 -1
  44. package/repo-docs/fullstack/quickstart.md +1 -1
  45. package/repo-docs/reference/package-map.md +3 -2
  46. package/repo-docs/reference/repo-scripts.md +17 -2
  47. package/scripts/bootstrapAgentGovernance.mjs +81 -0
  48. package/scripts/init.ts +1 -0
  49. package/scripts/release.ts +15 -0
  50. package/scripts/upgrade.ts +66 -7
  51. package/zova/pnpm-lock.yaml +3 -3
  52. package/.claude/hooks/contract-loop-gate.ts +0 -421
  53. package/.claude/scheduled_tasks.lock +0 -1
  54. package/.claude/skills/cabloy-spec-generation/scripts/generate-implementation-charts.mjs +0 -385
  55. /package/{.claude → repo-agent-governance/adapters/claude}/settings.json +0 -0
  56. /package/{.claude → repo-agent-governance}/skills/cabloy-backend-scaffold/SKILL.md +0 -0
  57. /package/{.claude → repo-agent-governance}/skills/cabloy-backend-scaffold/evals/evals.json +0 -0
  58. /package/{.claude → repo-agent-governance}/skills/cabloy-backend-scaffold/references/backend-thread-map.md +0 -0
  59. /package/{.claude → repo-agent-governance}/skills/cabloy-backend-scaffold/references/follow-up-checklist.md +0 -0
  60. /package/{.claude → repo-agent-governance}/skills/cabloy-contract-loop/SKILL.md +0 -0
  61. /package/{.claude → repo-agent-governance}/skills/cabloy-contract-loop/evals/evals.json +0 -0
  62. /package/{.claude → repo-agent-governance}/skills/cabloy-contract-loop/references/resource-custom-state-pattern.md +0 -0
  63. /package/{.claude → repo-agent-governance}/skills/cabloy-contract-loop/references/verification-checklist.md +0 -0
  64. /package/{.claude → repo-agent-governance}/skills/cabloy-domain-planning/SKILL.md +0 -0
  65. /package/{.claude → repo-agent-governance}/skills/cabloy-frontend-scaffold/SKILL.md +0 -0
  66. /package/{.claude → repo-agent-governance}/skills/cabloy-frontend-scaffold/evals/evals.json +0 -0
  67. /package/{.claude → repo-agent-governance}/skills/cabloy-frontend-scaffold/references/follow-up-checklist.md +0 -0
  68. /package/{.claude → repo-agent-governance}/skills/cabloy-frontend-scaffold/references/frontend-thread-map.md +0 -0
  69. /package/{.claude → repo-agent-governance}/skills/cabloy-resource-field-update/SKILL.md +0 -0
  70. /package/{.claude → repo-agent-governance}/skills/cabloy-resource-field-update/evals/evals.json +0 -0
  71. /package/{.claude → repo-agent-governance}/skills/cabloy-resource-field-update/references/custom-renderer-demo-checklist.md +0 -0
  72. /package/{.claude → repo-agent-governance}/skills/cabloy-resource-field-update/references/field-update-decision-tree.md +0 -0
  73. /package/{.claude → repo-agent-governance}/skills/cabloy-resource-field-update/references/follow-up-checklist.md +0 -0
  74. /package/{.claude → repo-agent-governance}/skills/cabloy-resource-field-update/references/verification-checklist.md +0 -0
  75. /package/{.claude → repo-agent-governance}/skills/cabloy-spec-execution/evals/evals.json +0 -0
  76. /package/{.claude → repo-agent-governance}/skills/cabloy-spec-generation/evals/evals.json +0 -0
  77. /package/{.claude → repo-agent-governance}/skills/cabloy-workflow/evals/evals.json +0 -0
  78. /package/{.claude → repo-agent-governance}/skills/cabloy-workflow/references/cli-strategy.md +0 -0
  79. /package/{.claude → repo-agent-governance}/skills/cabloy-workflow/references/edition-detection.md +0 -0
  80. /package/{.claude → repo-agent-governance}/skills/cabloy-worktree-environment/evals/evals.json +0 -0
  81. /package/{.claude → repo-agent-governance}/skills/cabloy-zova-source-reading/references/analysis-modes.md +0 -0
  82. /package/{.claude → repo-agent-governance}/skills/cabloy-zova-source-reading/references/core-reading-paths.md +0 -0
@@ -1,8 +1,9 @@
1
+ import assert from 'node:assert/strict';
1
2
  import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
2
3
  import { tmpdir } from 'node:os';
3
4
  import { resolve } from 'node:path';
4
5
  import { test } from 'node:test';
5
- import assert from 'node:assert/strict';
6
+
6
7
  import {
7
8
  createChartModel,
8
9
  generateCharts,
@@ -92,6 +93,51 @@ test('requires formal ATP definitions rather than prose mentions', () => {
92
93
  assert.deepEqual([...parseAtpIds('A prose mention of ATP-DEMO-99.')], []);
93
94
  });
94
95
 
96
+ test('parses progress rows by formal WBS and Status header columns', () => {
97
+ const progress = parseProgress(
98
+ [
99
+ '# Progress',
100
+ '',
101
+ '> 最后审查日期: 2026-09-01',
102
+ '',
103
+ '| WBS ID | Work item | Status |',
104
+ '| --- | --- | --- |',
105
+ '| `WBS-DEMO-01` | Implementation title | `verified` |',
106
+ '',
107
+ ].join('\r\n'),
108
+ );
109
+ assert.equal(progress.reviewed, '2026-09-01');
110
+ assert.deepEqual([...progress.rows], [['WBS-DEMO-01', 'verified']]);
111
+ });
112
+
113
+ test('does not parse prose wildcard ATP references as concrete IDs', () => {
114
+ const model = parseWbs(
115
+ [
116
+ '# Delivery Plan',
117
+ '',
118
+ '### Phase 10: Baseline',
119
+ '',
120
+ '#### WBS-DEMO-01: Freeze the baseline',
121
+ '',
122
+ '- Track every `ATP-DEMO-*` after planning.',
123
+ '',
124
+ ].join('\n'),
125
+ );
126
+ assert.deepEqual(model.tasks[0].atps, []);
127
+ });
128
+
129
+ test('rejects malformed WBS headings with a trailing hyphen', () => {
130
+ assert.throws(
131
+ () =>
132
+ parseWbs(
133
+ ['# Delivery Plan', '', '### Phase 10: Baseline', '', '#### WBS-DEMO-01-: Freeze', ''].join(
134
+ '\n',
135
+ ),
136
+ ),
137
+ /No formal `#### WBS-…:` tasks/,
138
+ );
139
+ });
140
+
95
141
  test('creates a mixed-status model with deferred scope separated', () => {
96
142
  const model = createChartModel({
97
143
  readme: files['README.md'],
@@ -126,8 +172,14 @@ test('renders a phase description directly beneath its phase label', async t =>
126
172
  });
127
173
  t.after(() => removeFixture(directory));
128
174
  const gantt = (await generateCharts(directory)).artifacts.get('implementation-gantt.svg');
129
- assert.match(gantt, /<text class="phase" x="72" y="270">Phase 10<\/text><text class="small" x="72" y="283">A deliberately extended<\/text><text class="small" x="72" y="295">&lt;phase&gt; &amp; description that<\/text><text class="small" x="72" y="307">wraps safely<\/text><text class="num" x="265" y="329">WBS-10-01<\/text>/);
130
- assert.match(gantt, /<text class="phase" x="72" y="363">Phase 20<\/text><text class="small" x="72" y="376">Delivery<\/text><text class="num" x="265" y="398">WBS-20-01<\/text>/);
175
+ assert.match(
176
+ gantt,
177
+ /<text class="phase" x="72" y="270">Phase 10<\/text><text class="small" x="72" y="283">A deliberately extended<\/text><text class="small" x="72" y="295">&lt;phase&gt; &amp; description that<\/text><text class="small" x="72" y="307">wraps safely<\/text><text class="num" x="265" y="329">WBS-10-01<\/text>/,
178
+ );
179
+ assert.match(
180
+ gantt,
181
+ /<text class="phase" x="72" y="363">Phase 20<\/text><text class="small" x="72" y="376">Delivery<\/text><text class="num" x="265" y="398">WBS-20-01<\/text>/,
182
+ );
131
183
  assert.doesNotMatch(gantt, /y="432">Delivery<\/text>/);
132
184
  });
133
185
 
@@ -141,7 +193,10 @@ test('widens and wraps the Dependencies column without covering status', async t
141
193
  t.after(() => removeFixture(directory));
142
194
  const gantt = (await generateCharts(directory)).artifacts.get('implementation-gantt.svg');
143
195
  assert.match(gantt, /<text class="small" x="680" y="246">Dependencies<\/text>/);
144
- assert.match(gantt, /<text class="small" x="680" y="\d+"><tspan x="680" dy="0">[^<]+<\/tspan><tspan x="680" dy="12">[^<]+<\/tspan><\/text><circle cx="905" cy="\d+"/);
196
+ assert.match(
197
+ gantt,
198
+ /<text class="small" x="680" y="\d+"><tspan x="680" dy="0">[^<]+<\/tspan><tspan x="680" dy="12">[^<]+<\/tspan><\/text><circle cx="905" cy="\d+"/,
199
+ );
145
200
  });
146
201
 
147
202
  test('selects Chinese chart copy from a Chinese README', () => {
@@ -156,18 +211,26 @@ test('selects Chinese chart copy from a Chinese README', () => {
156
211
  });
157
212
 
158
213
  test('rejects missing progress rows and dangling ATP references', () => {
159
- assert.throws(() => createChartModel({
160
- readme: files['README.md'],
161
- wbs: files['pdp-wbs.md'],
162
- progress: files['progress.md'].replace('| `WBS-20-01` | `in-progress` |\n', ''),
163
- testPlan: files['test-plan.md'],
164
- }), /WBS-20-01 has no corresponding progress/);
165
- assert.throws(() => createChartModel({
166
- readme: files['README.md'],
167
- wbs: files['pdp-wbs.md'].replace('ATP-DEMO-01', 'ATP-MISSING-01'),
168
- progress: files['progress.md'],
169
- testPlan: files['test-plan.md'],
170
- }), /references undefined ATP-MISSING-01/);
214
+ assert.throws(
215
+ () =>
216
+ createChartModel({
217
+ readme: files['README.md'],
218
+ wbs: files['pdp-wbs.md'],
219
+ progress: files['progress.md'].replace('| `WBS-20-01` | `in-progress` |\n', ''),
220
+ testPlan: files['test-plan.md'],
221
+ }),
222
+ /WBS-20-01 has no corresponding progress/,
223
+ );
224
+ assert.throws(
225
+ () =>
226
+ createChartModel({
227
+ readme: files['README.md'],
228
+ wbs: files['pdp-wbs.md'].replace('ATP-DEMO-01', 'ATP-MISSING-01'),
229
+ progress: files['progress.md'],
230
+ testPlan: files['test-plan.md'],
231
+ }),
232
+ /references undefined ATP-MISSING-01/,
233
+ );
171
234
  });
172
235
 
173
236
  test('renders partial burndown progress at its remaining-count position', async t => {
@@ -180,8 +243,14 @@ test('renders partial burndown progress at its remaining-count position', async
180
243
  assert.match(burndown, />1 remaining · 1 verified</);
181
244
  assert.match(burndown, />2 remaining</);
182
245
  assert.doesNotMatch(burndown, />0 \/ 2</);
183
- assert.match(burndown, /<line x1="190" y1="410" x2="550\.0" y2="530\.0" stroke="var\(--blue\)" stroke-width="2"\/>/);
184
- assert.match(burndown, /<line x1="550\.0" y1="530\.0" x2="910" y2="650" stroke="var\(--blue\)" stroke-width="2" stroke-dasharray="6 5"/);
246
+ assert.match(
247
+ burndown,
248
+ /<line x1="190" y1="410" x2="550\.0" y2="530\.0" stroke="var\(--blue\)" stroke-width="2"\/>/,
249
+ );
250
+ assert.match(
251
+ burndown,
252
+ /<line x1="550\.0" y1="530\.0" x2="910" y2="650" stroke="var\(--blue\)" stroke-width="2" stroke-dasharray="6 5"/,
253
+ );
185
254
  assert.match(burndown, /<circle cx="550\.0" cy="530\.0" r="8"/);
186
255
  assert.doesNotMatch(burndown, /r="14" fill="var\(--aqua\)"/);
187
256
  });
@@ -209,7 +278,13 @@ test('writes deterministic XML-escaped artifacts and detects stale output', asyn
209
278
  assert.match(first.artifacts.get('implementation-burndown.svg'), /role="img"/);
210
279
  assert.equal((await generateCharts(directory, { check: true })).stale.length, 0);
211
280
  await writeFile(resolve(directory, 'implementation-gantt.svg'), 'stale');
212
- await assert.rejects(() => generateCharts(directory, { check: true }), /implementation-gantt\.svg/);
281
+ await assert.rejects(
282
+ () => generateCharts(directory, { check: true }),
283
+ /implementation-gantt\.svg/,
284
+ );
213
285
  const second = await generateCharts(directory);
214
- assert.equal(second.artifacts.get('implementation-gantt.svg'), first.artifacts.get('implementation-gantt.svg'));
286
+ assert.equal(
287
+ second.artifacts.get('implementation-gantt.svg'),
288
+ first.artifacts.get('implementation-gantt.svg'),
289
+ );
215
290
  });
@@ -21,6 +21,7 @@ const aiItems = [
21
21
  collapsed: true,
22
22
  items: [
23
23
  { text: 'Repo Guidance', link: '/ai/repo-guidance' },
24
+ { text: 'Agent Governance', link: '/ai/agent-governance' },
24
25
  { text: 'Skills', link: '/ai/skills' },
25
26
  { text: 'Docs / Skills Mapping', link: '/ai/docs-skills-rules-mapping' },
26
27
  { text: 'CLI to Skill Map', link: '/ai/cli-to-skill-map' },
@@ -0,0 +1,80 @@
1
+ # Agent Governance
2
+
3
+ Cabloy keeps shared AI-development guidance in one authored repository surface while providing adapters for the coding agents used in this repository.
4
+
5
+ ## Canonical source and generated adapters
6
+
7
+ `repo-agent-governance/` is the canonical source for portable repository rules, root workflow skill bundles, bundled references, deterministic tools, and adapter metadata.
8
+
9
+ Do not hand-edit generated adapter output. Regenerate it instead:
10
+
11
+ ```bash
12
+ npm run agent:governance:render
13
+ npm run agent:governance:check
14
+ ```
15
+
16
+ The committed repository adapter outputs are:
17
+
18
+ | Agent surface | Generated repository assets |
19
+ | ------------- | ---------------------------------------------------------------------------------------------- |
20
+ | Claude Code | `CLAUDE.md`, `.claude/skills/`, `.claude/commands/`, `.claude/settings.json`, `.claude/hooks/` |
21
+ | Codex | `AGENTS.md`, `.agents/skills/` |
22
+ | Cursor | `.cursor/rules/cabloy-governance.mdc`, `.cursor/skills/` |
23
+
24
+ The same root rule and skill sources are copied to every listed adapter. Platform-specific discovery metadata is intentionally thin and lives in the adapter layer. The generated Codex and Cursor skill paths are configured adapter locations; their client discovery behavior requires a version-pinned external smoke check before it is claimed as supported.
25
+
26
+ ### Package migration bridge
27
+
28
+ The transition package deliberately excludes generated root adapters because the immediately preceding upgrader overwrites those paths before it starts the incoming initializer. This prevents that legacy path from silently replacing customized adapters. The package still includes canonical governance and `scripts/init.ts`; `npm run init` performs ownership-aware adoption for both a staged upgrade and a fresh project. A source checkout retains its committed generated adapters. This bridge is package-transition behavior, not a claim that agents generate instructions at startup.
29
+
30
+ ## Capability boundary
31
+
32
+ Rules, procedural skills, references, eval fixtures, contract-loop analysis, and ordinary deterministic repository tools are portable.
33
+
34
+ Hooks, tool permissions, local settings, credentials, MCP registration, slash-command discovery, confirmation UI, and automatic command execution are not portable contracts. Claude Code retains the repository `PostToolUse` contract-loop convenience hook. Codex and Cursor receive the same advisory contract-loop guidance but must not be described as running the Claude hook or its automatic commands.
35
+
36
+ No adapter output owns `settings.local.json`, `CLAUDE.local.md`, worktree state, scheduled-task state, credentials, or arbitrary user-owned agent files.
37
+
38
+ ## Maintain and verify governance assets
39
+
40
+ Use these commands during repository maintenance:
41
+
42
+ ```bash
43
+ npm run agent:governance:render
44
+ npm run agent:governance:check
45
+ npm run test:agent-governance
46
+ npm run agent:governance:pack-check
47
+ ```
48
+
49
+ `agent:governance:check` is read-only and fails when a committed adapter output or `managed-assets.json` is stale. `agent:governance:pack-check` verifies that the npm package includes the canonical and adapter assets but excludes local state.
50
+
51
+ For an existing project whose adapter files predate governance ownership, inspect adoption first:
52
+
53
+ ```bash
54
+ npm run agent:governance:adopt
55
+ npm run agent:governance:adopt -- --apply
56
+ ```
57
+
58
+ Adoption creates missing assets and records byte-identical assets. It preserves differing legacy or locally changed managed files as conflicts. Only an explicit path-specific `--force <target>` can replace a conflict.
59
+
60
+ ## Contract-loop tooling
61
+
62
+ The portable advisory checker accepts a reviewed source path and never starts a build by default:
63
+
64
+ ```bash
65
+ npm run contract:gate -- --file zova/src/suite/<suite>/modules/<module>/src/.metadata/index.ts --format json
66
+ ```
67
+
68
+ Follow [Contract Loop Playbook](/fullstack/contract-loop-playbook) for the full forward, reverse, consumer-drift, and local-dependency-drift workflow. The checker provides a signal and command guidance; it is not proof that generation, build, or dependency refresh has completed.
69
+
70
+ ## Placement rules
71
+
72
+ Keep the existing Cabloy knowledge boundary:
73
+
74
+ - `repo-docs/` explains durable workflows for people and agents.
75
+ - `repo-docs-internal/` records supporting maintainer rationale and ADRs.
76
+ - `repo-specs/<suite>/` remains authority for suite product, delivery, acceptance, and evidence records.
77
+ - `repo-agent-governance/` owns portable agent rules, root skill workflows, adapters, and deterministic governance tooling.
78
+ - platform directories are generated runtime/discovery adapters, not a second authored source.
79
+
80
+ For a broader placement decision, see [Docs, Skills, Rules, and CLI Mapping](/ai/docs-skills-rules-mapping).
@@ -189,10 +189,10 @@ Avoid these mistakes in skills:
189
189
 
190
190
  ## Current root skill example
191
191
 
192
- The root-level skill:
192
+ The canonical root-level skill:
193
193
 
194
- - `.claude/skills/cabloy-workflow/SKILL.md`
194
+ - `repo-agent-governance/skills/cabloy-workflow/SKILL.md`
195
195
 
196
- already follows this philosophy: detect edition, classify layer, prefer CLI, then verify.
196
+ is rendered to the Claude adapter path and already follows this philosophy: detect edition, classify layer, prefer CLI, then verify.
197
197
 
198
198
  Future skills should follow the same mapping pattern.
@@ -71,49 +71,50 @@ Relevant internal records answer questions like:
71
71
  - why is AI enablement structured this way?
72
72
  - what invariants should future contributors preserve?
73
73
 
74
- ### 4. Rules and commands
74
+ ### 4. Agent governance, rules, and commands
75
75
 
76
- Locations:
76
+ Canonical location:
77
77
 
78
- - `CLAUDE.md`
79
- - `.claude/commands/`
78
+ - `repo-agent-governance/`
80
79
 
81
- Use rules for:
80
+ Generated adapter locations include:
82
81
 
83
- - concise repo-wide operational guidance
84
- - default behavior Claude should follow in this repo
85
- - short durable constraints such as edition detection and CLI-first preference
82
+ - policy adapters: `CLAUDE.md`, `AGENTS.md`, and `.cursor/rules/`
83
+ - Claude-specific command adapter: `.claude/commands/`
86
84
 
87
- Use commands for:
85
+ Codex and Cursor adapter paths are configured output locations; verify active-client discovery externally before claiming that behavior is supported.
88
86
 
89
- - named recurring operator workflows
90
- - shorter, explicit actions such as release or future migration helpers
87
+ Use the canonical repository policy for concise repo-wide operational guidance and durable constraints such as edition detection and CLI-first preference. Use canonical commands for named recurring operator workflows such as release.
91
88
 
92
89
  These layers answer questions like:
93
90
 
94
- - what should Claude check first in this repo?
91
+ - what should an agent check first in this repo?
95
92
  - when should CLI be preferred over manual scaffolding?
96
93
  - what recurring workflow deserves a named command?
97
94
 
98
95
  ### 5. Skills
99
96
 
100
- Location:
97
+ Canonical location:
98
+
99
+ - `repo-agent-governance/skills/`
101
100
 
102
- - `.claude/skills/`
101
+ Generated adapter locations include `.claude/skills/`, `.agents/skills/`, and `.cursor/skills/`. The Codex and Cursor locations are configured output paths, not verified client-discovery claims; validate the active client version externally before relying on discovery.
103
102
 
104
103
  Use skills for:
105
104
 
106
105
  - procedural decision trees
107
106
  - reusable workflows with branching logic
108
- - tasks that benefit from bundled references, evals, or future deterministic helpers
107
+ - tasks that benefit from bundled references, evals, or deterministic helpers
109
108
  - repo-specific orchestration over CLI and source inspection
110
109
 
111
110
  Skills answer questions like:
112
111
 
113
- - how should Claude choose the right Cabloy workflow?
112
+ - how should an agent choose the right Cabloy workflow?
114
113
  - when should it branch between Basic and Start?
115
114
  - what is the right verification path after generation or refactor work?
116
115
 
116
+ Do not treat provider hooks, permissions, local settings, or command discovery as portable skill capabilities. These remain platform-specific adapters.
117
+
117
118
  ## Decision rule for authors: where should a new piece of knowledge go?
118
119
 
119
120
  Use this quick rule:
@@ -121,7 +122,7 @@ Use this quick rule:
121
122
  - if people and agents both need to read and understand it, put it in **public docs**
122
123
  - if it is product, contract, delivery, ATP, decision, or observed-evidence authority for one suite, use `repo-specs/<suite>/`
123
124
  - if it is maintainer rationale or long-lived design history, use `repo-docs-internal/`; shared guidance remains complete without any particular internal record
124
- - if it is short repo-wide behavioral guidance, put it in **CLAUDE.md**
125
+ - if it is short portable repo-wide behavioral guidance, put it in **`repo-agent-governance/policies/`** and render its adapters
125
126
  - if it is a named repeatable operator action, put it in a **command**
126
127
  - if it is a reusable procedural workflow with branching, put it in a **skill**
127
128
 
@@ -131,26 +132,26 @@ Use this quick rule:
131
132
 
132
133
  - public explanation → [Cabloy Editions: For AI Development](/editions/overview#for-ai-development)
133
134
  - consistency review surface → [Edition Consistency Checklist](/ai/edition-consistency-checklist)
134
- - repo-wide behavior rule → `CLAUDE.md`
135
+ - repo-wide behavior rule → `repo-agent-governance/policies/`, rendered to generated policy adapters
135
136
  - procedural enforcement → `cabloy-workflow` skill
136
137
 
137
138
  ### Example: “Use Zova CLI refactors before hand-editing page params/query/component props”
138
139
 
139
140
  - conceptual explanation → public docs in frontend and AI sections
140
- - default agent behavior → `CLAUDE.md`
141
+ - default agent behavior → `repo-agent-governance/policies/`, rendered to generated policy adapters
141
142
  - step-by-step orchestration → `cabloy-workflow` skill or future specialized skills
142
143
 
143
144
  ### Example: “How should a backend base class be placed?”
144
145
 
145
146
  - public operational explanation → [Class Placement Rule](/ai/class-placement-rule)
146
147
  - maintainer rationale and invariants → `repo-docs-internal/`
147
- - default repo-wide behavior → `CLAUDE.md`
148
+ - default repo-wide behavior → `repo-agent-governance/policies/`, rendered to generated policy adapters
148
149
  - procedural decision workflow → `cabloy-workflow` skill
149
150
 
150
151
  ### Example: “How should AI look up a backend global bean?”
151
152
 
152
153
  - public lookup explanation → [Global Bean Lookup](/ai/global-bean-lookup)
153
- - default repo-wide behavior → `CLAUDE.md`
154
+ - default repo-wide behavior → `repo-agent-governance/policies/`, rendered to generated policy adapters
154
155
  - procedural lookup sequence → `cabloy-workflow` skill
155
156
 
156
157
  ### Example: “How backend OpenAPI becomes frontend SDK”
@@ -161,7 +162,7 @@ Use this quick rule:
161
162
  ### Example: “How should one persisted resource serve Admin and Web users?”
162
163
 
163
164
  - full architecture explanation → [Admin Resource and Web Self-Service](/fullstack/admin-resource-and-web-self-service)
164
- - concise repo-wide default → `CLAUDE.md`
165
+ - concise repo-wide default → `repo-agent-governance/policies/repository.md`, rendered to policy adapters
165
166
  - contract regeneration, consumer-boundary choice, and verification routing → `cabloy-contract-loop`
166
167
  - extend the existing contract-loop skill references and evals; do not create an Order-specific skill
167
168
 
@@ -169,7 +170,7 @@ Use this quick rule:
169
170
 
170
171
  - public operational explanation → [Playbook: Module Removal](/ai/playbook-module-removal)
171
172
  - maintainer rationale and pitfalls → `repo-docs-internal/`
172
- - avoid putting the full workflow in `CLAUDE.md` because the task needs branching, cleanup order, generated-runtime recovery, and verification
173
+ - avoid putting the full workflow in the concise canonical policy because the task needs branching, cleanup order, generated-runtime recovery, and verification
173
174
  - procedural decision workflow → `cabloy-module-removal` skill
174
175
 
175
176
  ### Example: “How should AI plan a new business domain name and structure?”
@@ -177,7 +178,7 @@ Use this quick rule:
177
178
  - public naming and suite-first explanation → [Suites and Modules](/fullstack/suites-and-modules)
178
179
  - frontend-side naming companion → [Modules and Suites](/frontend/modules-and-suites)
179
180
  - keep the durable naming rules in docs instead of duplicating them in repo rules
180
- - avoid putting the full branching workflow in `CLAUDE.md` because the task needs proposal, validation, confirmation, and CLI handoff
181
+ - avoid putting the full branching workflow in the concise canonical policy because the task needs proposal, validation, confirmation, and CLI handoff
181
182
  - procedural decision workflow → `cabloy-domain-planning` skill
182
183
 
183
184
  ### Example: “How should AI create or maintain a repository-native suite specification?”
@@ -202,13 +203,13 @@ Use this quick rule:
202
203
  - full explanation → [Entity Guide](/backend/entity-guide) and [DTO Guide](/backend/dto-guide)
203
204
  - AI workflow reminder → [Playbook: Add a Backend Module](/ai/playbook-backend-module)
204
205
  - procedural checklist reminder → backend scaffold skill references
205
- - avoid putting the full explanation only in `CLAUDE.md` because this is a framework-specific authoring rule, not a short global behavior rule
206
+ - avoid putting the full explanation only in the concise canonical policy because this is a framework-specific authoring rule, not a short global behavior rule
206
207
 
207
208
  ## Anti-patterns to avoid
208
209
 
209
210
  Avoid these mistakes:
210
211
 
211
- - putting large conceptual explanations in `CLAUDE.md`
212
+ - putting large conceptual explanations in the concise canonical policy
212
213
  - using a skill as the only place where an important architectural rule is explained
213
214
  - duplicating the same workflow prose across docs and skills without giving each a distinct role
214
215
  - creating a command for something that actually needs a branching decision tree
@@ -5,9 +5,9 @@ This checklist helps maintainers keep docs, rules, commands, and skills aligned
5
5
  Use it whenever you add or revise:
6
6
 
7
7
  - edition-aware docs
8
- - `CLAUDE.md` guidance
9
- - `.claude/commands/`
10
- - `.claude/skills/`
8
+ - `repo-agent-governance/` rules, commands, and skill bundles
9
+ - generated Claude, Codex, or Cursor adapter outputs
10
+ - platform-specific Claude commands, hooks, or settings when they are affected
11
11
  - AI workflow playbooks
12
12
 
13
13
  ## The baseline story that should stay consistent
@@ -98,14 +98,15 @@ For scripts, flavors, paths, and examples, confirm that:
98
98
  Confirm that the same guidance is distributed correctly:
99
99
 
100
100
  - **docs** explain the workflow in durable prose
101
- - **`CLAUDE.md`** captures short repo-wide behavioral rules
101
+ - **`repo-agent-governance/`** owns short portable repo-wide behavioral rules, commands, and root skills
102
+ - **generated adapters** expose that shared guidance to Claude Code, Codex, and Cursor without becoming a second authored source
102
103
  - **skills** encode procedural branching and follow-up logic
103
104
  - **commands** are used only for named operator workflows, not as the only home for conceptual guidance
104
105
 
105
106
  Avoid these drifts:
106
107
 
107
108
  - a skill contains the only explanation of an edition rule
108
- - `CLAUDE.md` grows into a long architectural essay
109
+ - the concise canonical repository policy grows into a long architectural essay
109
110
  - docs duplicate every procedural branch that belongs in a skill
110
111
 
111
112
  ## Checklist 7: verification guidance matches the edition model
@@ -138,7 +139,8 @@ Before you finish an edition-aware change, ask:
138
139
  2. Did I preserve the correct Basic vs Start creation path?
139
140
  3. Did I avoid turning UI difference into the whole story?
140
141
  4. Did I point Start-specific operational truth back to the active Start repository where needed?
141
- 5. Do docs, rules, and skills each play their proper role?
142
+ 5. Do docs, canonical governance, generated adapters, and skills each play their proper role?
143
+ 6. Did I regenerate and check every affected adapter without claiming platform-specific automation is portable?
142
144
 
143
145
  ## Read together with
144
146
 
@@ -92,9 +92,9 @@ The purpose of the roadmap is not to create many skills.
92
92
  The purpose is to create a small number of high-leverage skills that directly reuse the knowledge system now being built in:
93
93
 
94
94
  - `repo-docs/`
95
- - `CLAUDE.md`
95
+ - `repo-agent-governance/policies/`
96
96
  - `repo-docs-internal/`
97
- - `.claude/skills/`
97
+ - `repo-agent-governance/skills/`
98
98
  - the Vona and Zova CLIs
99
99
 
100
100
  That is how Cabloy gets long-term value from the documentation work.
@@ -11,7 +11,7 @@ The Cabloy monorepo is a good fit for AI vibe coding because the source tree alr
11
11
  - Zova CLI source and command groups
12
12
  - archived docs that still capture valuable concepts
13
13
  - `repo-docs-internal/` engineering docs for maintainers
14
- - Claude commands and skills
14
+ - agent-neutral repository governance, generated adapters, and deterministic tools
15
15
 
16
16
  ## The main design goal
17
17
 
@@ -32,7 +32,7 @@ For contributor and automation workflows in this repository, prefer this order:
32
32
  1. inspect the active edition and repo markers before making UI-sensitive or workflow-sensitive assumptions
33
33
  2. inspect root scripts, Vona CLI, and Zova CLI before inventing manual scaffolding or custom workflow steps
34
34
  3. use public docs for durable user-facing and agent-facing guidance; consult relevant `repo-docs-internal/` records for supporting maintainer rationale
35
- 4. encode repeatable behavior in Claude rules, commands, or skills instead of relying on unstated habits
35
+ 4. encode repeatable behavior in the canonical agent-governance rules, commands, or skills instead of relying on unstated habits
36
36
 
37
37
  ## The knowledge layers
38
38
 
@@ -46,13 +46,13 @@ For normal project usage, prefer the user-facing entry docs such as [Fullstack Q
46
46
 
47
47
  Use `repo-docs-internal/` for architecture notes, ADRs, and maintainer rationale that should not be mixed into public how-to documentation. Relevant records support a shared workflow without being prerequisites; an unavailable or irrelevant individual record must not cause its rationale to be moved into public how-to documentation automatically.
48
48
 
49
- ### Claude rules and commands
49
+ ### Agent governance and adapters
50
50
 
51
- Use root `CLAUDE.md` and `.claude/commands/` for concise operational behavior and repeatable workflows.
51
+ Use `repo-agent-governance/` as the authored source for portable repository rules, root workflow skills, bundled references, and deterministic tools. It generates committed adapter outputs for Claude Code, Codex, and Cursor. See [Agent Governance](/ai/agent-governance) for the ownership and capability boundary.
52
52
 
53
- ### Skills
53
+ ### Platform runtime integration
54
54
 
55
- Use `.claude/skills/` for procedural workflows that benefit from reusable instructions, bundled references, or future deterministic scripts.
55
+ `CLAUDE.md`, `.claude/commands/`, `.claude/skills/`, `AGENTS.md`, `.agents/skills/`, and `.cursor/` are adapter/runtime surfaces. Hooks, permissions, local settings, credentials, and provider-specific command discovery stay platform-specific rather than becoming shared framework facts.
56
56
 
57
57
  ## AI reading paths
58
58
 
@@ -63,6 +63,7 @@ Use this page as the main AI-development hub, then choose the path that matches
63
63
  Start here when the task is about choosing the right repo surface, docs location, or automation boundary:
64
64
 
65
65
  - [Repo Guidance](/ai/repo-guidance)
66
+ - [Agent Governance](/ai/agent-governance)
66
67
  - [Docs / Skills Mapping](/ai/docs-skills-rules-mapping)
67
68
  - [CLI to Skill Map](/ai/cli-to-skill-map)
68
69
  - [Skills](/ai/skills)
@@ -10,9 +10,10 @@ Check the root repository signals first:
10
10
  - edition marker files such as `__CABLOY_BASIC__` or `__CABLOY_START__`
11
11
  - `repo-docs-internal/`
12
12
  - `repo-specs/` when the task concerns a suite plan, WBS increment, acceptance record, or evidence
13
- - root `.claude/` assets
13
+ - `repo-agent-governance/` canonical rules, skill bundles, and deterministic tools
14
+ - generated platform adapter assets such as `CLAUDE.md`, `AGENTS.md`, `.claude/`, `.agents/`, and `.cursor/`
14
15
 
15
- These surfaces tell the agent which repo it is in and which scripts are canonical. Inspect relevant `repo-docs-internal/` records as supporting context rather than as a gate to workflow guidance.
16
+ These surfaces tell the agent which repo it is in, which scripts are canonical, and where shared agent instructions are authored. Treat platform directories as generated adapters; regenerate them from `repo-agent-governance/` rather than hand-editing them. Inspect relevant `repo-docs-internal/` records as supporting context rather than as a gate to workflow guidance.
16
17
 
17
18
  ## 2. Prefer framework entrypoints over scattered examples
18
19
 
@@ -1,29 +1,37 @@
1
1
  # Rules and Config
2
2
 
3
- Cabloy’s AI behavior should be organized into a few clear layers instead of one oversized instruction file.
3
+ Cabloy’s AI behavior is organized into authored governance, generated platform adapters, and platform-local runtime configuration. This prevents the same repository knowledge from drifting across agent-specific directories.
4
4
 
5
- ## Root `CLAUDE.md`
5
+ ## `repo-agent-governance/`
6
6
 
7
- Use the root `CLAUDE.md` for concise, durable operational guidance such as:
7
+ Use `repo-agent-governance/` as the only authored source for portable repository rules, root procedural skill bundles, bundled references, deterministic tools, and adapter definitions.
8
8
 
9
- - how the monorepo is organized
10
- - where public docs live
11
- - where `repo-docs-internal/` holds supporting maintainer rationale
12
- - which command entrypoints are preferred
13
- - why edition detection is mandatory before UI-sensitive guidance or project-creation assumptions
9
+ It contains the concise repository policy that adapters render to `CLAUDE.md`, `AGENTS.md`, and Cursor MDC rules. It also owns the source bundles rendered to Claude, Codex, and Cursor skill locations.
14
10
 
15
- ## `.claude/commands/`
11
+ Run these maintenance checks after changing governance assets:
16
12
 
17
- Use commands for reusable operator workflows that are naturally invoked as a named action, such as release or future docs migration helpers.
13
+ ```bash
14
+ npm run agent:governance:render
15
+ npm run agent:governance:check
16
+ npm run test:agent-governance
17
+ ```
18
18
 
19
- ## `.claude/skills/`
19
+ ## Generated platform adapters
20
20
 
21
- Use skills for workflows that need more procedural context, bundled references, or iterative selection logic.
21
+ The following are committed generated outputs, not parallel authored knowledge sources:
22
22
 
23
- ## `settings.json` and `settings.local.json`
23
+ - Claude Code: `CLAUDE.md`, `.claude/commands/`, `.claude/skills/`, `.claude/settings.json`, `.claude/hooks/`
24
+ - Codex: `AGENTS.md`, `.agents/skills/`
25
+ - Cursor: `.cursor/rules/cabloy-governance.mdc`, `.cursor/skills/`
24
26
 
25
- Use Claude settings for permissions and execution environment, not as the primary place to explain framework concepts.
27
+ The Codex and Cursor skill paths are configured generated adapter locations; verify client discovery with a version-pinned external smoke check before presenting it as supported behavior. The adapter model shares rules and procedures, not platform runtime behavior. Claude Code's contract-loop hook is a Claude-specific convenience integration; Codex and Cursor receive advisory guidance but do not claim the same automatic after-edit action.
28
+
29
+ ## Local configuration and permissions
30
+
31
+ Keep local settings, credentials, worktree state, scheduled-task state, and user-owned agent configuration out of the generated ownership surface. In particular, do not overwrite or adopt `settings.local.json`, `CLAUDE.local.md`, or unregistered files merely because they are near an adapter directory.
32
+
33
+ Use agent settings for permissions and execution environment, not as the primary place to explain framework concepts.
26
34
 
27
35
  ## Documentation boundary
28
36
 
29
- If a rule is important for people and agents to understand, it probably belongs in public docs too. `repo-docs-internal/` holds supporting maintainer rationale rather than user-facing workflow; individual records may vary by edition.
37
+ If a rule is important for people and agents to understand, it belongs in public docs as well. `repo-docs-internal/` holds supporting maintainer rationale rather than user-facing workflow; individual records may vary by edition. See [Agent Governance](/ai/agent-governance) for the complete ownership, adoption, and package-distribution model.
@@ -2,15 +2,15 @@
2
2
 
3
3
  Skills are the procedural layer of Cabloy’s AI development model.
4
4
 
5
- ## Using a Skill in Claude Code
5
+ ## Using a Skill
6
6
 
7
- Invoke a Cabloy Skill by typing its slash name followed by the task input. For example, describe the business capability you want to plan:
7
+ Root Cabloy skill bundles are authored in `repo-agent-governance/skills/` and rendered to configured Claude Code, Codex, and Cursor adapter locations. Codex and Cursor skill discovery must be confirmed by a version-pinned external smoke check before being presented as supported client behavior. Use the invocation UI and syntax of the active agent; for example, in Claude Code:
8
8
 
9
9
  ```text
10
10
  /cabloy-spec-generation <business description>
11
11
  ```
12
12
 
13
- The AI guides you through the task-specific confirmation and next steps. See [Generate a Cabloy Suite Specification](/ai/playbook-spec-generation) for the complete planning experience.
13
+ The AI guides you through the task-specific confirmation and next steps. See [Generate a Cabloy Suite Specification](/ai/playbook-spec-generation) for the complete planning experience. See [Agent Governance](/ai/agent-governance) for adapter and capability details.
14
14
 
15
15
  ## What a skill should do here
16
16
 
@@ -29,8 +29,8 @@ If a generator or refactor command exists, the skill should orchestrate it inste
29
29
 
30
30
  ## Skill placement
31
31
 
32
- - Use root `.claude/skills/` for cross-stack, monorepo-wide workflows.
33
- - Use subtree-local `.claude/skills/` only when a workflow is truly specific to one framework area.
32
+ - Author cross-stack, monorepo-wide workflow bundles in `repo-agent-governance/skills/`; generated root adapter copies are not a second authoring surface.
33
+ - Use subtree-local agent skill directories only when a workflow is truly specific to one framework area and has not been approved for portable root governance.
34
34
 
35
35
  ## Skill structure recommendation
36
36
 
@@ -48,7 +48,7 @@ For edition-aware skills, use [Cabloy Editions: For AI Development](/editions/ov
48
48
 
49
49
  ## Current root workflow skills
50
50
 
51
- The repository currently provides these cross-stack and monorepo-wide workflows in root `.claude/skills/`:
51
+ The repository currently authors these cross-stack and monorepo-wide workflows in `repo-agent-governance/skills/` and renders them to root platform adapters; Codex and Cursor discovery remains subject to external client validation:
52
52
 
53
53
  - `cabloy-workflow` for choosing the correct Cabloy work path before implementation
54
54
  - `cabloy-domain-planning` for proposing and confirming providerId, suite, and initial module names before scaffolding a new business domain
@@ -65,7 +65,7 @@ The repository currently provides these cross-stack and monorepo-wide workflows
65
65
 
66
66
  The specification workflows show the same boundary: [AI Spec-Driven Development](/ai/ai-spec-driven-development) explains the public Traceable Spec Delivery method, while [Generate a Cabloy Suite Specification](/ai/playbook-spec-generation) and [Execute an Approved Cabloy Specification Increment](/ai/playbook-spec-execution) explain its operational paths. The skills retain branching, confirmation gates, specialist routing, and evidence protocol; suite-local records remain the authority for a specific increment.
67
67
 
68
- The module-removal workflow is a good example of why skills belong in `.claude/skills/` instead of `CLAUDE.md`: the task needs branching, cleanup order, recovery guidance for generated runtime directories such as `vona/.vona` and `zova/.zova`, and a verification checklist that would be too large for a short repo-wide rule.
68
+ The module-removal workflow is a good example of why skills belong in `repo-agent-governance/skills/` instead of the concise repository policy: the task needs branching, cleanup order, recovery guidance for generated runtime directories such as `vona/.vona` and `zova/.zova`, and a verification checklist that would be too large for a short repo-wide rule. The canonical bundle is rendered to each supported platform skill adapter.
69
69
 
70
70
  ## Advanced subtree-local diagnostics
71
71