@haposoft/cafekit 0.16.7 → 0.18.1

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 (231) hide show
  1. package/README.md +14 -22
  2. package/bin/__tests__/codex-hooks-ownership.test.js +2 -2
  3. package/bin/__tests__/codex-hooks.test.js +169 -272
  4. package/bin/__tests__/codex-native.test.js +100 -202
  5. package/bin/__tests__/develop-contract.test.js +122 -1413
  6. package/bin/__tests__/docs-sync-on-demand.test.js +93 -0
  7. package/bin/__tests__/grok-envelope.test.js +0 -56
  8. package/bin/__tests__/hook-payload.test.js +4 -6
  9. package/bin/__tests__/legacy-authority-decoupled.test.js +154 -0
  10. package/bin/__tests__/legacy-hooks-retired.test.js +221 -0
  11. package/bin/__tests__/omp-bridge.test.js +20 -17
  12. package/bin/__tests__/omp-hooks.test.js +0 -19
  13. package/bin/__tests__/optional-skill-inventory.test.js +112 -4
  14. package/bin/__tests__/orca-session.test.js +0 -2
  15. package/bin/__tests__/package-inventory.test.js +90 -925
  16. package/bin/__tests__/runtime-dir.test.js +0 -3
  17. package/bin/__tests__/runtime-schema.test.js +3 -2
  18. package/bin/__tests__/skill-routing-source.test.js +27 -15
  19. package/bin/__tests__/spec-narrowing.test.js +30 -161
  20. package/bin/__tests__/specs-v2-execution-closeout.test.js +0 -437
  21. package/bin/__tests__/test-runtime-dependency-closure.cjs +1 -2
  22. package/bin/__tests__/ui-ux-skill.test.js +101 -0
  23. package/bin/__tests__/usage-hook-retired.test.js +114 -0
  24. package/bin/__tests__/validator-grounding.test.js +18 -2949
  25. package/bin/lib/managed-writer.js +2 -3
  26. package/bin/phases/codex-runtime.js +27 -0
  27. package/bin/phases/copy-payload.js +13 -28
  28. package/bin/phases/omp-runtime.js +25 -0
  29. package/package.json +2 -3
  30. package/src/claude/CLAUDE.md +3 -10
  31. package/src/claude/agents/brainstormer.md +7 -3
  32. package/src/claude/agents/code-auditor.md +44 -56
  33. package/src/claude/agents/debugger.md +8 -88
  34. package/src/claude/agents/deployer.md +3 -5
  35. package/src/claude/agents/docs-keeper.md +6 -14
  36. package/src/claude/agents/git-ops.md +2 -4
  37. package/src/claude/agents/implementer.md +12 -16
  38. package/src/claude/agents/inspector.md +4 -3
  39. package/src/claude/agents/project-manager.md +9 -17
  40. package/src/claude/agents/researcher.md +9 -3
  41. package/src/claude/agents/spec-maker.md +15 -15
  42. package/src/claude/agents/test-runner.md +8 -11
  43. package/src/claude/agents/ui-ux-designer.md +0 -1
  44. package/src/claude/hooks/__tests__/fixtures/statusline-default.golden +1 -1
  45. package/src/claude/hooks/__tests__/spec-gate.test.js +244 -333
  46. package/src/claude/hooks/__tests__/spec-state-touched.test.js +160 -0
  47. package/src/claude/hooks/__tests__/state.test.js +68 -0
  48. package/src/claude/hooks/__tests__/statusline.test.js +140 -11
  49. package/src/claude/hooks/agent.cjs +2 -1
  50. package/src/claude/hooks/lib/hook-payload.cjs +2 -2
  51. package/src/claude/hooks/rules.cjs +2 -1
  52. package/src/claude/hooks/session.cjs +0 -1
  53. package/src/claude/hooks/spec-gate.cjs +17 -83
  54. package/src/claude/hooks/spec-state.cjs +142 -39
  55. package/src/claude/hooks/state.cjs +21 -2
  56. package/src/claude/migration-manifest.json +42 -22
  57. package/src/claude/output-styles/coding-level-0-eli5.md +9 -9
  58. package/src/claude/output-styles/coding-level-1-junior.md +3 -3
  59. package/src/claude/output-styles/coding-level-2-mid.md +3 -3
  60. package/src/claude/output-styles/coding-level-3-senior.md +2 -2
  61. package/src/claude/output-styles/coding-level-4-lead.md +5 -5
  62. package/src/claude/output-styles/coding-level-5-god.md +6 -6
  63. package/src/claude/rules/ai-dev-rules.md +2 -3
  64. package/src/claude/rules/hook-protocols.md +8 -15
  65. package/src/claude/rules/manage-docs.md +9 -23
  66. package/src/claude/rules/orchestrator.md +3 -4
  67. package/src/claude/rules/review-audit-self-decision.md +3 -3
  68. package/src/claude/rules/skill-domain-routing.md +1 -3
  69. package/src/claude/rules/skill-workflow-routing.md +4 -5
  70. package/src/claude/rules/state-sync.md +3 -12
  71. package/src/claude/rules/workflow.md +11 -19
  72. package/src/claude/runtime.schema.json +5 -3
  73. package/src/claude/scripts/generate-skill-catalog.cjs +7 -6
  74. package/src/claude/scripts/provenance.cjs +23 -5
  75. package/src/claude/scripts/spec-receipt.cjs +24 -121
  76. package/src/claude/scripts/spec-resolver.cjs +41 -458
  77. package/src/claude/scripts/workflow-policy.cjs +3 -1801
  78. package/src/claude/settings/settings.json +1 -32
  79. package/src/claude/skills/agent-browser/SKILL.md +1 -1
  80. package/src/claude/skills/{question → ask}/SKILL.md +9 -75
  81. package/src/claude/skills/brainstorm/SKILL.md +43 -131
  82. package/src/claude/skills/chrome-devtools/SKILL.md +14 -31
  83. package/src/claude/skills/code-review/SKILL.md +29 -81
  84. package/src/claude/skills/code-review/references/spec-compliance-review.md +4 -8
  85. package/src/claude/skills/debug/SKILL.md +29 -149
  86. package/src/claude/skills/develop/SKILL.md +26 -83
  87. package/src/claude/skills/develop/references/parallel-waves.md +0 -8
  88. package/src/claude/skills/develop/references/quality-gate.md +15 -13
  89. package/src/claude/skills/develop/references/subagent-patterns.md +0 -6
  90. package/src/claude/skills/docs/SKILL.md +2 -2
  91. package/src/claude/skills/docs/references/update-workflow.md +1 -1
  92. package/src/claude/skills/fix/SKILL.md +153 -0
  93. package/src/claude/skills/{hotfix → fix}/references/diagnosis-protocol.md +2 -2
  94. package/src/claude/skills/{hotfix → fix}/references/parallel-patterns.md +2 -2
  95. package/src/claude/skills/{hotfix → fix}/references/prevention-gate.md +3 -3
  96. package/src/claude/skills/{hotfix → fix}/references/review-cycle.md +1 -1
  97. package/src/claude/skills/git/SKILL.md +48 -9
  98. package/src/claude/skills/git/references/commit-protocols.md +35 -16
  99. package/src/claude/skills/git/references/worktree-blueprint.md +42 -6
  100. package/src/claude/skills/orca/SKILL.md +9 -8
  101. package/src/claude/skills/research/SKILL.md +17 -46
  102. package/src/claude/skills/scout/SKILL.md +61 -0
  103. package/src/claude/skills/{inspect → scout}/references/internal-inspection.md +26 -10
  104. package/src/claude/skills/specs/SKILL.md +22 -29
  105. package/src/claude/skills/specs/references/review.md +8 -6
  106. package/src/claude/skills/specs/references/templates.md +34 -41
  107. package/src/claude/skills/sync/SKILL.md +16 -45
  108. package/src/claude/skills/sync/references/rebind-and-audit.md +59 -0
  109. package/src/claude/skills/sync/references/sync-protocols.md +4 -13
  110. package/src/claude/skills/test/SKILL.md +39 -104
  111. package/src/claude/skills/test/references/execution-strategy.md +93 -21
  112. package/src/claude/skills/test/references/failure-triage.md +1 -1
  113. package/src/claude/skills/ui-ux/LICENSE +21 -0
  114. package/src/claude/skills/ui-ux/SKILL.md +497 -0
  115. package/src/claude/skills/ui-ux/references/brand-tokens.md +90 -0
  116. package/src/claude/skills/ui-ux/references/budgets.md +113 -0
  117. package/src/claude/skills/ui-ux/references/checklist.md +271 -0
  118. package/src/claude/skills/ui-ux/references/components/accordion.md +246 -0
  119. package/src/claude/skills/ui-ux/references/components/avatar.md +153 -0
  120. package/src/claude/skills/ui-ux/references/components/banner.md +43 -0
  121. package/src/claude/skills/ui-ux/references/components/breadcrumb.md +201 -0
  122. package/src/claude/skills/ui-ux/references/components/button.md +142 -0
  123. package/src/claude/skills/ui-ux/references/components/card.md +113 -0
  124. package/src/claude/skills/ui-ux/references/components/charts.md +376 -0
  125. package/src/claude/skills/ui-ux/references/components/chat.md +132 -0
  126. package/src/claude/skills/ui-ux/references/components/choice-controls.md +369 -0
  127. package/src/claude/skills/ui-ux/references/components/comment-thread.md +17 -0
  128. package/src/claude/skills/ui-ux/references/components/description-list.md +116 -0
  129. package/src/claude/skills/ui-ux/references/components/empty-state.md +98 -0
  130. package/src/claude/skills/ui-ux/references/components/file-upload.md +107 -0
  131. package/src/claude/skills/ui-ux/references/components/inline-edit.md +128 -0
  132. package/src/claude/skills/ui-ux/references/components/input.md +161 -0
  133. package/src/claude/skills/ui-ux/references/components/list-row.md +56 -0
  134. package/src/claude/skills/ui-ux/references/components/loading.md +198 -0
  135. package/src/claude/skills/ui-ux/references/components/logo.md +147 -0
  136. package/src/claude/skills/ui-ux/references/components/otp-input.md +43 -0
  137. package/src/claude/skills/ui-ux/references/components/quantity-input.md +100 -0
  138. package/src/claude/skills/ui-ux/references/components/range-slider.md +16 -0
  139. package/src/claude/skills/ui-ux/references/components/small-controls.md +340 -0
  140. package/src/claude/skills/ui-ux/references/components/sortable-header.md +86 -0
  141. package/src/claude/skills/ui-ux/references/components/tag-input.md +14 -0
  142. package/src/claude/skills/ui-ux/references/components/timeline.md +38 -0
  143. package/src/claude/skills/ui-ux/references/components/tree.md +30 -0
  144. package/src/claude/skills/ui-ux/references/design-process.md +650 -0
  145. package/src/claude/skills/ui-ux/references/layouts/app-kanban.html +303 -0
  146. package/src/claude/skills/ui-ux/references/layouts/app.md +1369 -0
  147. package/src/claude/skills/ui-ux/references/layouts/form.md +430 -0
  148. package/src/claude/skills/ui-ux/references/layouts/overlay.md +552 -0
  149. package/src/claude/skills/ui-ux/references/layouts/pricing.md +204 -0
  150. package/src/claude/skills/ui-ux/references/locked-rules.md +35 -0
  151. package/src/claude/skills/ui-ux/references/principles.md +408 -0
  152. package/src/claude/skills/ui-ux/references/refactor.md +245 -0
  153. package/src/claude/skills/ui-ux/references/responsive.md +195 -0
  154. package/src/claude/skills/ui-ux/references/review.md +528 -0
  155. package/src/claude/skills/ui-ux/references/rules-color.md +623 -0
  156. package/src/claude/skills/ui-ux/references/rules-form.md +235 -0
  157. package/src/claude/skills/ui-ux/references/rules-state.md +680 -0
  158. package/src/claude/skills/ui-ux/references/rules-type.md +369 -0
  159. package/src/claude/skills/ui-ux/references/styles.md +311 -0
  160. package/src/claude/skills/ui-ux/references/system.md +219 -0
  161. package/src/claude/skills/ui-ux/references/tailwind-v4-traps.md +237 -0
  162. package/src/claude/skills/ui-ux/references/tokens.css +362 -0
  163. package/src/claude/skills/ui-ux/scripts/lint-skill.mjs +216 -0
  164. package/src/claude/skills/ui-ux/scripts/package.json +9 -0
  165. package/src/claude/skills/ui-ux/scripts/probe.mjs +4447 -0
  166. package/src/claude/skills/ui-ux-pro-max/SKILL.md +25 -80
  167. package/src/claude/skills/web-testing/SKILL.md +2 -20
  168. package/src/claude/status.cjs +149 -144
  169. package/src/codex/AGENTS.md +8 -13
  170. package/src/codex/hooks/agent.cjs +2 -1
  171. package/src/codex/hooks/lib/spec-receipt.cjs +4 -32
  172. package/src/codex/hooks/lib/spec-utils.cjs +6 -52
  173. package/src/codex/hooks/rules.cjs +2 -1
  174. package/src/codex/hooks/session.cjs +0 -2
  175. package/src/codex/hooks/spec-gate.cjs +13 -81
  176. package/src/codex/hooks/spec-state.cjs +37 -41
  177. package/src/codex/hooks.json +0 -20
  178. package/src/codex/rules/state-sync.md +3 -12
  179. package/src/common/AGENTS.md +6 -12
  180. package/src/omp/extensions/cafekit-bridge.mjs +6 -6
  181. package/bin/__tests__/change-firewall.semantic-firewall.test.js +0 -2133
  182. package/bin/__tests__/finalizer-pass-gate.semantic-firewall.test.js +0 -342
  183. package/bin/__tests__/release-preflight.semantic-firewall.test.js +0 -586
  184. package/bin/__tests__/review-receipt-c2.semantic-firewall.test.js +0 -378
  185. package/bin/__tests__/specs-v2-policy-and-scaffold.test.js +0 -665
  186. package/bin/__tests__/specs-v2-validator-grounder-contract.test.js +0 -1132
  187. package/src/claude/hooks/__tests__/completion-authority.test.js +0 -990
  188. package/src/claude/hooks/__tests__/semantic-review-authority.test.js +0 -259
  189. package/src/claude/hooks/completion-authority-check.cjs +0 -56
  190. package/src/claude/hooks/completion-authority-state.cjs +0 -527
  191. package/src/claude/hooks/completion-authority.cjs +0 -163
  192. package/src/claude/hooks/lib/context.cjs +0 -616
  193. package/src/claude/hooks/lib/detect.cjs +0 -474
  194. package/src/claude/hooks/semantic-review-authority.cjs +0 -154
  195. package/src/claude/hooks/task-scaffold-guard.cjs +0 -114
  196. package/src/claude/hooks/usage.cjs +0 -197
  197. package/src/claude/scripts/change-firewall.cjs +0 -1748
  198. package/src/claude/scripts/spec-authoring-digest.cjs +0 -151
  199. package/src/claude/scripts/spec-authoring-validation.cjs +0 -126
  200. package/src/claude/scripts/spec-final-state.cjs +0 -290
  201. package/src/claude/scripts/spec-ground.cjs +0 -650
  202. package/src/claude/scripts/spec-readiness.cjs +0 -425
  203. package/src/claude/scripts/spec-scaffold.cjs +0 -2317
  204. package/src/claude/scripts/spec-semantic-model.cjs +0 -396
  205. package/src/claude/scripts/validate-spec-output.cjs +0 -3941
  206. package/src/claude/skills/code-review/references/verification-gate.md +0 -46
  207. package/src/claude/skills/delegate/SKILL.md +0 -124
  208. package/src/claude/skills/delegate/references/codex-delegation.md +0 -71
  209. package/src/claude/skills/delegate/references/grok-delegation.md +0 -84
  210. package/src/claude/skills/hotfix/SKILL.md +0 -289
  211. package/src/claude/skills/inspect/SKILL.md +0 -142
  212. package/src/claude/skills/loop/SKILL.md +0 -114
  213. package/src/claude/skills/loop/references/bounded-loop-protocol.md +0 -104
  214. package/src/claude/skills/loop/references/metric-and-guard-contract.md +0 -76
  215. package/src/claude/skills/route/SKILL.md +0 -94
  216. package/src/claude/skills/route/references/agent-timing.md +0 -46
  217. package/src/claude/skills/route/references/chaining-patterns.md +0 -53
  218. package/src/claude/skills/route/references/task-taxonomy.md +0 -48
  219. package/src/claude/skills/specs/templates/design.md +0 -82
  220. package/src/claude/skills/specs/templates/requirements-init.md +0 -8
  221. package/src/claude/skills/specs/templates/requirements.md +0 -42
  222. package/src/claude/skills/specs/templates/spec-state.json +0 -56
  223. package/src/claude/skills/specs/templates/task.md +0 -47
  224. package/src/codex/hooks/completion-authority-check.cjs +0 -67
  225. package/src/codex/hooks/completion-authority-state.cjs +0 -527
  226. package/src/codex/hooks/completion-authority.cjs +0 -109
  227. package/src/codex/hooks/semantic-review-authority.cjs +0 -130
  228. package/src/codex/hooks/task-scaffold-guard.cjs +0 -63
  229. /package/src/claude/skills/{question → ask}/templates/question.md +0 -0
  230. /package/src/claude/skills/{hotfix → fix}/references/escalation-tactics.md +0 -0
  231. /package/src/claude/skills/{hotfix → fix}/references/workflow-specialized.md +0 -0
@@ -60,9 +60,8 @@ function writeManagedFile(opts) {
60
60
  // Ownership manifest for this platform (read at run start), NOT the migration manifest.
61
61
  const ownership = (ctx.ownership && ctx.ownership[platformFolder]) || { files: {} };
62
62
 
63
- // A file already written earlier THIS run (e.g. a spec template copied as part
64
- // of the specs/ tree, then revisited by the template-sync loop) is ours — treat
65
- // it as pristine against what we just wrote, not as a user-created file.
63
+ // A file already written earlier THIS run is ours — treat it as pristine
64
+ // against what we just wrote, not as a user-created file.
66
65
  const relForRun = tracker?.keyFor
67
66
  ? tracker.keyFor(dest)
68
67
  : path.relative(platformFolder, dest).replace(/\\/g, '/');
@@ -23,6 +23,32 @@ const CODEX_OWN_RUNTIME = [
23
23
  ['runtime.json', 'runtime.json']
24
24
  ];
25
25
 
26
+ /**
27
+ * Delete hooks, scripts and skill files the manifest marks obsolete. Codex tracker keys are project-relative
28
+ * (`.codex/hooks/…`), so the record is pruned through keyFor, and always: a record whose
29
+ * file is already gone must still leave the manifest.
30
+ */
31
+ function removeObsoleteCodexHooks(ctx, platformKey) {
32
+ const platform = PLATFORMS[platformKey];
33
+ const tracker = ctx.trackers && ctx.trackers[platformKey];
34
+ const obsoleteHooks = (ctx.manifest?.obsolete?.runtimeFiles || []).filter((rel) => rel.startsWith('hooks/') || rel.startsWith('scripts/') || rel.startsWith('skills/'));
35
+ for (const rel of obsoleteHooks) {
36
+ // Skill files live in the shared skills directory, not under the runtime folder.
37
+ const target = rel.startsWith('skills/')
38
+ ? path.join(platform.skillsDir, rel.slice('skills/'.length))
39
+ : path.join(platform.folder, rel);
40
+ const exists = fs.existsSync(target);
41
+ if (!ctx.dryRun) {
42
+ if (exists) fs.rmSync(target, { force: true, recursive: fs.statSync(target).isDirectory() });
43
+ if (tracker) tracker.prune(tracker.keyFor(target));
44
+ }
45
+ if (exists) {
46
+ ctx.ui.detail(` ↻ ${ctx.dryRun ? '[dry-run] ' : ''}Removed obsolete Codex runtime: ${rel}`);
47
+ ctx.results.updated++;
48
+ }
49
+ }
50
+ }
51
+
26
52
  function writeSourceFile(ctx, platformKey, src, dest, label) {
27
53
  const platform = PLATFORMS[platformKey];
28
54
  const { action } = writeManagedFile({
@@ -64,6 +90,7 @@ function installRuntimeFiles(ctx, platformKey) {
64
90
  tracker: ctx.trackers[platformKey]
65
91
  });
66
92
  report(ctx, treeAction(agg), 'Codex native hooks');
93
+ removeObsoleteCodexHooks(ctx, platformKey);
67
94
  // Keep one canonical command analyzer in the Claude source tree, then
68
95
  // materialize the same bytes into the installed Codex runtime.
69
96
  // One canonical runtime schema lives in the Claude source tree; both installed
@@ -94,37 +94,22 @@ function copyPlatformFiles(ctx, platformKey) {
94
94
  report(ctx, treeAction(agg), 'Skill: specs');
95
95
  }
96
96
 
97
- // Keep spec templates in sync (Claude command runtime reads these).
97
+ // The specs skill tree above carries its templates; remove the ones retired
98
+ // with the spec.json planning flow from earlier installs.
98
99
  if (platformKey === 'claude' || platformKey === 'codex') {
99
- const legacyInitTemplate = path.join(platform.skillsDir, 'specs', 'templates', 'init.json');
100
- if (platformKey === 'claude' && fs.existsSync(legacyInitTemplate)) {
101
- if (!ctx.dryRun) fs.rmSync(legacyInitTemplate, { force: true });
102
- ctx.ui.detail(` ↻ ${ctx.dryRun ? '[dry-run] ' : ''}Removed legacy template: ${legacyInitTemplate}`);
100
+ const retiredTemplates = platformKey === 'claude'
101
+ ? ['init.json', 'spec-state.json', 'requirements-init.md', 'requirements.md', 'design.md', 'task.md']
102
+ : ['spec-state.json', 'requirements-init.md', 'requirements.md', 'design.md', 'task.md'];
103
+ for (const fileName of retiredTemplates) {
104
+ const retired = path.join(platform.skillsDir, 'specs', 'templates', fileName);
105
+ if (!fs.existsSync(retired)) continue;
106
+ if (!ctx.dryRun) {
107
+ fs.rmSync(retired, { force: true });
108
+ if (tracker) tracker.prune(tracker.keyFor(retired));
109
+ }
110
+ ctx.ui.detail(` ↻ ${ctx.dryRun ? '[dry-run] ' : ''}Removed legacy template: ${retired}`);
103
111
  ctx.results.updated++;
104
112
  }
105
-
106
- const specTemplates = [
107
- 'spec-state.json',
108
- 'requirements-init.md',
109
- 'requirements.md',
110
- 'design.md',
111
- 'research.md',
112
- 'task.md'
113
- ];
114
-
115
- specTemplates.forEach((fileName) => {
116
- const src = path.join(specSkillSource, 'templates', fileName);
117
- const dest = path.join(platform.skillsDir, 'specs', 'templates', fileName);
118
- const { action } = writeManagedFile({
119
- src,
120
- dest,
121
- platformFolder,
122
- ctx,
123
- tracker,
124
- transform: bodyTransform
125
- });
126
- report(ctx, action, `template: ${fileName}`);
127
- });
128
113
  }
129
114
 
130
115
  // Core skills plus the optional document bundle selected for this runtime.
@@ -128,9 +128,34 @@ function installBridge(ctx, platformKey) {
128
128
  }
129
129
  }
130
130
 
131
+ /**
132
+ * Delete hooks, scripts and skill files the manifest marks obsolete. Mirrors removeObsoleteClaudeRuntimeFiles, but the
133
+ * omp tracker records keys relative to the project root (`.omp/hooks/…`), so the record is
134
+ * pruned through keyFor rather than by the bare `hooks/…` path.
135
+ */
136
+ function removeObsoleteOmpHooks(ctx, platformKey) {
137
+ const platform = PLATFORMS[platformKey];
138
+ const tracker = ctx.trackers && ctx.trackers[platformKey];
139
+ const obsoleteHooks = (ctx.manifest?.obsolete?.runtimeFiles || []).filter((rel) => rel.startsWith('hooks/') || rel.startsWith('scripts/') || rel.startsWith('skills/'));
140
+ for (const rel of obsoleteHooks) {
141
+ // Skill files live in the shared skills directory, not under the runtime folder.
142
+ const target = rel.startsWith('skills/')
143
+ ? path.join(platform.skillsDir, rel.slice('skills/'.length))
144
+ : path.join(platform.folder, rel);
145
+ if (!fs.existsSync(target)) continue;
146
+ if (!ctx.dryRun) {
147
+ fs.rmSync(target, { force: true, recursive: fs.statSync(target).isDirectory() });
148
+ if (tracker) tracker.prune(tracker.keyFor(target));
149
+ }
150
+ ctx.ui.detail(` ↻ ${ctx.dryRun ? '[dry-run] ' : ''}Removed obsolete omp runtime: ${rel}`);
151
+ ctx.results.updated++;
152
+ }
153
+ }
154
+
131
155
  function installOmpRuntime(ctx, platformKey) {
132
156
  if (platformKey !== 'omp') return;
133
157
  installHooks(ctx, platformKey);
158
+ removeObsoleteOmpHooks(ctx, platformKey);
134
159
  installRuntimeFiles(ctx, platformKey);
135
160
  installBridge(ctx, platformKey);
136
161
  copyRulesDirectory(ctx, platformKey);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haposoft/cafekit",
3
- "version": "0.16.7",
3
+ "version": "0.18.1",
4
4
  "description": "Native spec-driven workflows for Claude Code and Codex CLI. Bundles CafeKit skills, runtime hooks, agents, and installer scaffolding.",
5
5
  "author": "Haposoft <nghialt@haposoft.com>",
6
6
  "license": "MIT",
@@ -12,8 +12,7 @@
12
12
  "test": "node scripts/run-skill-self-tests.mjs",
13
13
  "test:package": "node --test bin/__tests__/package-inventory.test.js",
14
14
  "test:secrets": "node --test bin/__tests__/secret-scanner.test.js",
15
- "test:policy": "node --test bin/__tests__/develop-contract.test.js",
16
- "release:freeze": "node scripts/benchmark-workflow.mjs freeze"
15
+ "test:policy": "node --test bin/__tests__/develop-contract.test.js"
17
16
  },
18
17
  "files": [
19
18
  "bin",
@@ -12,9 +12,9 @@
12
12
  - macOS/Linux: `.claude/skills/.venv/bin/python3 scripts/<script>.py`
13
13
  - Windows: `.claude\skills\.venv\Scripts\python.exe scripts\<script>.py`
14
14
  - Consult `.claude/rules/state-sync.md`, `.claude/rules/hook-protocols.md`, and `.claude/rules/skill-workflow-routing.md` when their topics apply.
15
- - New Specs work uses the process-first flow. `/cf:specs` opens C1, writes
15
+ - New Specs work uses the process-first flow. `/cf:specs` opens GATE-SCOPE, writes
16
16
  `specs/<feature>/plan.md` with flat `task-NN-*.md` files beside it, then opens
17
- C2 after adversarial review. It never starts implementation.
17
+ GATE-REVIEW after adversarial review. It never starts implementation.
18
18
  - Start implementation only through a new explicit `/cf:develop` invocation.
19
19
  Execute one unblocked task at a time; each task has exactly one `Status:`
20
20
  field and the controller is its sole state-and-proof writer.
@@ -22,12 +22,5 @@
22
22
  requires a canonical final inline `## Receipt` with the exact command,
23
23
  `Exit: 0`, `Verification: PASS`, runtime-derived Base and Head values, and
24
24
  non-empty fenced current output.
25
- - At C3, show current receipts and unresolved limitations. The user decides
25
+ - At GATE-DONE, show current receipts and unresolved limitations. The user decides
26
26
  completion; no command, review, or host state may invent approval or proof.
27
-
28
- ### Legacy Specs compatibility
29
-
30
- Existing packets containing `spec.json`, nested tasks, or legacy kernel
31
- artifacts keep their installed adapter, `task_registry`, `semantic_model`,
32
- `planning_depth`, lane, `execution_tier`, machine authority, separate receipts,
33
- and closeout contract. Do not migrate them during unrelated process-first work.
@@ -3,7 +3,9 @@ name: brainstormer
3
3
  tools: Glob, Grep, Read, WebFetch, WebSearch
4
4
  description: >-
5
5
  Pressure-test a material software architecture choice after the Brainstorm
6
- controller has scouted the repository and bounded the user contract.
6
+ controller has scouted the repository and bounded the user contract. Its
7
+ report states a single-path conclusion in one line and English labels; keep both when relaying it.
8
+ Tell it which route applies; the routes are feature delivery; an explicitly authorized fix; diagnosis-only bug work; non-bug exploration.
7
9
  ---
8
10
 
9
11
  # Brainstormer — advisory solution architect
@@ -17,7 +19,8 @@ summary and Outcome, Constraints, Non-goals, Acceptance, and known touchpoints.
17
19
  Evaluate supplied paths first. Proceed to comparative analysis only when at
18
20
  least two viable architectural paths have materially different consequences.
19
21
  If one path is viable, return that conclusion and why alternatives fail the
20
- contract; never invent strawmen to fill a quota.
22
+ contract; never invent strawmen to fill a quota. State a single-path conclusion in one line, for example
23
+ `Only one viable path: <path>`, and list each other option as `rejected` with why.
21
24
 
22
25
  If the request is a symptom without an evidenced root cause, return it to
23
26
  `cf:debug`. If the controller has not identified whether the work is feature
@@ -41,7 +44,7 @@ routing context instead of guessing.
41
44
  6. Keep feasibility (`confirmed | plausible | unknown | infeasible`), confidence
42
45
  (`high | medium | low`), and disposition (`chosen | rejected | deferred`)
43
46
  separate and evidence-backed. A numeric estimate requires range, unit, basis,
44
- evidence, and assumptions; otherwise report `unknown`.
47
+ evidence, and assumptions; otherwise report `unknown`. Write these labels in English exactly as listed, whatever language the report uses.
45
48
  7. Recommend the smallest approach that satisfies the contract.
46
49
  8. Return a compact advisory block to the controller.
47
50
 
@@ -67,3 +70,4 @@ request.
67
70
  - Evidence-calibrated feasibility, confidence, and disposition.
68
71
  - Applied lenses and explicit skip reasons.
69
72
  - Route-specific notes for the Brainstorm controller.
73
+ - End the report with `Relay: keep the single-path line and every English label when you summarize this report.`
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: code-auditor
3
3
  tools: Glob, Grep, Read, Bash, WebFetch, WebSearch
4
- description: "Source Code Auditor. Verifies code quality, severities (🔴 Critical / 🟠 High / 🟡 Medium / 🔵 Low), Automatic Criticals, and task/spec completion drift. Returns one review verdict from the shared surface: PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED."
4
+ description: "Source Code Auditor. Verifies code quality, severities (🔴 Critical / 🟠 High / 🟡 Medium / 🔵 Low), Automatic Criticals, and task/spec completion drift. Returns one review verdict from the shared surface: PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED. It never runs tests. When it states execution proof as unavailable (owned by /cf:test) and the user asked only for a review, a caller relaying its review must not run tests itself to fill that gap and offers /cf:test instead; a user request to run tests, or a workflow that owns its own test step, is unaffected."
5
5
  ---
6
6
 
7
7
  # Code Auditor — Source Code Inspector
@@ -9,19 +9,29 @@ description: "Source Code Auditor. Verifies code quality, severities (🔴 Criti
9
9
  You are a senior engineer specialized in evaluating source code before production deployment.
10
10
  Goal: Catch the mistakes AI-written code commonly makes — logic errors, security holes, redundant code, convention mismatches.
11
11
 
12
- You DO NOT fix code. You only READ, CLASSIFY, and REPORT.
12
+ You never edit files. You read, classify, and report; the only commands you run are the ones the Test-Run Boundary below allows.
13
13
 
14
+ ## Test-Run Boundary
14
15
 
16
+ Never run the project's test suite or a test file, not even as a sanity check.
17
+ `Bash` is for read-only inspection only: `git show`, `git diff`, `git log`,
18
+ `git status`, search, and reading files; a read-only run of the reviewed code (for
19
+ example `node -e` on the changed function) to reproduce a defect, cited as a
20
+ reproduction and never as test evidence.
21
+ Never report a test result, pass count, or exit code as the review's evidence.
22
+ Without a `test-proof-v1` handoff, state execution proof as unavailable (owned by
23
+ `cf:test`): write the proof line exactly as `**Execution proof:** unavailable (owned by cf:test)`,
24
+ do not otherwise say whether tests pass, and still return the verdict.
25
+ When the proof line says unavailable, end the report with the caller line of the template, verbatim: if the user asked only for a review, the session that relays it must not run tests itself to fill the proof gap and offers `/cf:test` instead; a user request to run tests, or a workflow that owns its test step, is unaffected. With a consumed `test-proof-v1` handoff, omit the caller line.
15
26
 
16
- ## Pre-Review: Task / Spec Compliance (MANDATORY)
27
+ ## Pre-Review: Task / Spec Compliance
17
28
 
18
- If the prompt includes task file paths, requirement IDs, completion criteria, or design contracts, you MUST read them before reviewing code.
29
+ If the prompt includes task file paths, requirement IDs, completion criteria, or design contracts, read them before reviewing code.
19
30
  If the prompt says `SPEC COMPLIANCE REVIEW ONLY`, do not perform a general
20
31
  quality review yet. For process-first work, first prove the implementation
21
- matches `plan.md` accepted C1/C2 decisions and the active flat `task-NN-*.md` Outcome,
32
+ matches `plan.md` accepted GATE-SCOPE/GATE-REVIEW decisions and the active flat `task-NN-*.md` Outcome,
22
33
  Scope, Ownership, Acceptance, Dependencies, Verification Plan, and
23
- scout-discovered runtime entrypoints. Use `scope_lock`, requirements, and design
24
- contracts only for a valid legacy `spec.json` packet.
34
+ scout-discovered runtime entrypoints.
25
35
  Do NOT trust implementer reports. Verify claims by reading the actual code and, where useful, grepping import/call sites.
26
36
 
27
37
  For a process-first packet, extract and verify:
@@ -29,22 +39,18 @@ For a process-first packet, extract and verify:
29
39
  2. The active task's Scope and Ownership boundary
30
40
  3. Acceptance criteria and Dependencies
31
41
  4. Verification Plan expectations; execution proof remains owned by the controller
32
- 5. Contracts and invariants accepted through C1/C2 in `plan.md`
42
+ 5. Contracts and invariants accepted through GATE-SCOPE/GATE-REVIEW in `plan.md`
33
43
  6. Named technologies and runtime choices explicitly required by the plan/task
34
44
  7. Runtime entrypoints, callers, and reachability obligations from the task or task-aware scout report
35
45
 
36
- Only for a valid legacy adapter, instead extract its `Related Files`, completion
37
- criteria, `## Evidence` heading aliases, design contracts, `scope_lock`, and
38
- other `spec.json`-backed semantics. Never require those legacy artifacts from a
39
- process-first packet.
40
-
46
+ These compliance rules apply only when a task or spec is supplied.
41
47
  Any missing declared deliverable, placeholder-only wiring, or contract drift is a **Critical** issue even if tests/build pass.
42
48
  Any scoped behavior omitted, unapproved behavior added, orphaned component/service/route/command/worker/provider/reducer, unmounted UI, unregistered route, uncalled loader/service, or unreachable runtime surface is a **Critical** issue even if tests/build pass.
43
49
  If the task/spec explicitly names Better Auth, Hono, Next.js proxy routes, Redis, Drizzle, or any other concrete choice, replacing it with a custom simplification is a **Critical** issue unless the spec was amended first.
44
50
 
45
- ## Pre-Review: Blast Radius Check (MANDATORY)
51
+ ## Pre-Review: Blast Radius Check
46
52
 
47
- Before reading any specific logic, you MUST run a Dependency Scope Check (Blast Radius):
53
+ Before reading any specific logic, run a Dependency Scope Check (Blast Radius):
48
54
  1. Obtain the list of modified functions/components exported from the changed files.
49
55
  2. Run a global `Grep` across `src/` to find ALL files that import or call these functions.
50
56
  3. Identify if the signature change or internal state mutation breaks these dependents.
@@ -97,14 +103,18 @@ Assume the code may be AI-generated. Do not trust polished structure, confident
97
103
 
98
104
  ### Step 3: Classify
99
105
 
100
- Classify each issue by severity (no numeric scoring):
101
- - 🔴 **Critical** — Must fix immediately, blocks deployment.
102
- - 🟠 **High** — Should fix before merge.
103
- - 🟡 **Medium** — Improves code quality.
104
- - 🔵 **Low** — Minor optimization suggestions.
106
+ Classify each issue by its production impact with the shared scale of `cf:code-review` (no numeric scoring), and write the labels `Critical`, `High`, `Medium`, `Low` verbatim in English:
107
+ - 🔴 **Critical** — a concrete failure a user or operator hits that loses or corrupts data, breaks security, or stops the product (a login bypass).
108
+ - 🟠 **High** — a concrete wrong result a user or operator hits (an order exactly at a tier boundary priced with the wrong discount).
109
+ - 🟡 **Medium** — a real risk with a failure scenario that has not reached users (a changed boundary with no test; a leftover debug log).
110
+ - 🔵 **Low** — cleanup, clarity, or a question (a naming nit; a behavior the change's README or docs state as intended).
111
+
112
+ A leftover debug log is at most Medium; if it prints a secret or credential, report that exposure as a separate security finding at its own severity. A behavior the change's README or docs state as intended is not a Medium or heavier defect; raise it as Low or a question. `UNVERIFIED` means supplied proof that failed, never proof that is unavailable. A blocking Medium has a concrete failure before merge; when the heaviest remaining finding is a non-blocking Medium, the verdict is `PASS_WITH_WARNINGS`, and with only Low findings it is `PASS`.
105
113
 
106
114
  ## Report Format
107
115
 
116
+ Keep `## Review Report`, its headings and the severity labels verbatim in English; write the content in the user's language.
117
+
108
118
  ```markdown
109
119
  ## Review Report
110
120
 
@@ -113,11 +123,12 @@ Classify each issue by severity (no numeric scoring):
113
123
  - **High Issues:** [N]
114
124
  - **Medium Issues:** [N]
115
125
  - **Scope:** [N files, ~N lines of code]
126
+ - **Execution proof:** test-proof-v1 consumed | unavailable (owned by cf:test)
116
127
  - **Verdict:** [PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED]
117
- - **PASS:** no Critical or High findings and no blocking Medium finding. The definition of `PASS` defers to `cf:code-review`; do not redefine it with local severity counts.
118
- - **PASS_WITH_WARNINGS:** only documented non-blocking findings remain. It cannot finish a task; it routes to remediation or a user pause, never auto-accept.
119
- - **FAIL:** findings are actionable and map to a file/task/surface; report findings under FAIL.
120
- - **BLOCKED:** execution proof, permission, environment, or user-owned decision is missing. Stop without blind retries.
128
+ - **PASS:** no Critical, High, or Medium finding remains; Low findings may remain. The definition of `PASS` defers to `cf:code-review`; do not redefine it with local severity counts.
129
+ - **PASS_WITH_WARNINGS:** the heaviest remaining finding is a non-blocking Medium. It cannot finish a task; it routes to remediation or a user pause, never auto-accept.
130
+ - **FAIL:** a Critical, High, or blocking Medium finding remains; findings are actionable and map to a file/task/surface; report findings under FAIL.
131
+ - **BLOCKED:** a required review input, permission, environment, or user-owned decision is missing. Missing execution proof alone is not `BLOCKED`: state it as unavailable (owned by `cf:test`) and still return the verdict. Stop without blind retries.
121
132
 
122
133
  ### Task / Spec Compliance
123
134
  - [OK or issue] Required deliverables present?
@@ -139,30 +150,31 @@ Classify each issue by severity (no numeric scoring):
139
150
 
140
151
  ### ✅ Positive Observations
141
152
  - [Acknowledge good code, good patterns]
153
+
154
+ **For the caller:** this review ran no tests by design. If execution proof is unavailable and the user asked only for a review, do not run tests yourself to fill the gap; offer `/cf:test` to the user instead. A user request to run tests, or a workflow that owns its test step, is unaffected.
142
155
  ```
143
156
 
144
157
  ## Pass/Fail Thresholds (Used in Quality Gate)
145
158
 
146
- When called from `develop` Step 4 (Quality Gate Auto-Fix):
159
+ When called from the `cf:develop` quality gate (`references/quality-gate.md`):
147
160
 
148
161
  | Condition | Result |
149
162
  |-----------|--------|
150
- | No Critical, no High, no blocking Medium | ✅ **PASS** — Proceed to completion |
151
- | Only documented non-blocking findings remain | 🟡 **PASS_WITH_WARNINGS** — Remediation or user pause; cannot close a task |
163
+ | No Critical, High, or Medium remains (Low may remain) | ✅ **PASS** — Proceed to completion |
164
+ | The heaviest remaining finding is a non-blocking Medium | 🟡 **PASS_WITH_WARNINGS** — Remediation or user pause; cannot close a task |
152
165
  | One or more Critical, High, or blocking Medium | ❌ **FAIL** — Return issue list for AI to self-fix |
153
166
 
154
- **Automatic Criticals:**
167
+ **Automatic Criticals** (the logging-redaction and filesystem-write ones apply whenever the diff touches those surfaces; every other one applies only when a task or spec is supplied):
155
168
  - Missing required entrypoint/artifact/runtime output named in the task/spec
156
169
  - Runtime-facing artifact exists only as orphaned or unreachable code: component/export unused, UI unmounted, route unregistered, service/loader uncalled, provider not mounted, reducer/action disconnected, command/worker/manifest not wired
157
170
  - Missing scoped acceptance criteria or behavior outside the process-first
158
- Scope/Ownership boundary without a C1 amendment; for legacy packets, behavior
159
- outside `scope_lock` without a spec amendment
171
+ Scope/Ownership boundary without a GATE-SCOPE amendment
160
172
  - Placeholder scaffolding marked as complete when the task demanded real wiring
161
173
  - Auth/session/transport/persistence behavior that contradicts the design contracts
162
174
  - Silent replacement of a named framework/auth/provider/transport/datastore with a custom simplification
163
175
  - Cross-service behavior "proven" only by process-local memory, fake adapters, or other non-shared placeholders
164
176
  - Files or features from later tasks delivered early without explicit scope-escape justification
165
- - Task marked complete while required commands/evidence are still FAIL / UNVERIFIED
177
+ - Task marked complete while supplied proof is still FAIL / UNVERIFIED (`UNVERIFIED` is supplied proof that failed, never proof that is unavailable)
166
178
  - Logging redaction that over-redacts safe identifiers/public URLs, drops closing quotes, consumes `,`/`;` delimiters, or is not idempotent when the diff touches redaction/sanitization
167
179
  - Filesystem write that returns a lexical path instead of canonical `realpath`, skips `realpath` parent containment, follows or overwrites a final symlink, creates or mutates anything outside the root on rejection, or leaks a temp file / misses atomic same-directory `rename`
168
180
 
@@ -172,29 +184,5 @@ When called from `develop` Step 4 (Quality Gate Auto-Fix):
172
184
  - Acknowledge strong patterns — don't only criticize.
173
185
  - Focus on issues with production impact — skip trivial style nitpicks.
174
186
  - Respect project conventions if `docs/code-standards.md` exists.
175
- - DO NOT modify any files. Read and report only.
187
+ - Never modify files; run only the commands the Test-Run Boundary allows.
176
188
  - Integrate with `code-review` skill for full protocol.
177
-
178
- ## Strict Semantic Review Attestation (Honest-Agent Guardrail)
179
-
180
- This attestation belongs only to the valid legacy `spec.json` adapter. A
181
- process-first review reports findings to the controller and never fabricates a
182
- legacy semantic digest, separate receipt, or completion authority.
183
-
184
- This section is an honest-agent integrity guardrail, not a security boundary against same-account process tampering. It does not provide cryptographic attestation; it relies on a MAC-protected host-hook observation via an allowlisted `SubagentStop` event. Codex must use its event-capable thread-spawn path; its legacy internal multi-agent path stays fail-closed because it does not expose the child completion message through a supported hook event. If the host cannot provide unforgeable invocation, this documents causal host dispatch, not cryptographic proof.
185
-
186
- When the review request explicitly includes `assurance_level: Strict` with a `semantic_digest` and asks for an attestation marker, and you have verified that `verdict` is `PASS` and the `semantic_digest` exactly matches the current artifacts (recompute via `node .claude/scripts/validate-spec-output.cjs <specDir> --semantic-digest` or `node .codex/scripts/validate-spec-output.cjs <specDir> --semantic-digest`), emit exactly one line at the very end of your final assistant message:
187
-
188
- ```
189
- CAFEKIT_SEMANTIC_REVIEW_ATTESTATION {"feature_name":"<feature>","spec_file":"specs/<feature>/spec.json","semantic_digest":"sha256:<64 hex>","verdict":"PASS"}
190
- ```
191
-
192
- Requirements:
193
- - Emit only for `Strict` with an explicit digest; never for `Routine`/`Elevated`, never without a digest, never with `FAIL` or stale digest.
194
- - `spec_file` must be exactly `specs/<feature>/spec.json` relative to project root; never `scratch/spec.json` or absolute path.
195
- - `feature_name` must match `spec.json:feature_name` and directory name.
196
- - `semantic_digest` must be the literal `sha256:` plus 64 lowercase hex from the validator; do not fabricate.
197
- - Emit exactly one marker line, no extra markers, no surrounding prose on that line.
198
- - The host hook (`SubagentStop` with `agent_type` `code-auditor`/`code_auditor`) observes this marker and, if the digest matches current artifacts, persists a MAC-protected observation; only that host observation satisfies `Strict` readiness. Parent summaries, spawn-only events, and self-authored markers never satisfy readiness (fail-closed).
199
-
200
- If `Strict` is not requested, or the digest is missing/stale, or verdict is not `PASS`, do not emit any attestation marker.
@@ -8,8 +8,6 @@ tools: Glob, Grep, Read, Bash, WebFetch, WebSearch
8
8
 
9
9
  You are a veteran incident responder who has survived hundreds of production outages. You think in evidence chains: every hypothesis must be backed by log lines, stack traces, metrics, browser evidence, or code facts. You never guess when you can grep.
10
10
 
11
- **IMPORTANT**: Ensure token efficiency while maintaining high quality.
12
-
13
11
  ## Core Competencies
14
12
 
15
13
  You excel at:
@@ -23,12 +21,14 @@ You excel at:
23
21
  - **Side-Effect Analysis**: Mapping blast radius and defining the checks needed to prove a fix does not regress nearby behavior
24
22
  - **Strict Protocol (MANDATORY)**: Read the relevant manuals in `.claude/references/debugger/` before conclusions. At minimum read `core-philosophy.md`, `root-cause-tracing.md`, `verification-protocol.md`, and `side-effect-gate.md` before recommending a fix direction. Add domain references such as `log-ci-analysis.md`, `frontend-verification.md`, `performance-diagnostics.md`, or `condition-based-waiting.md` when they apply.
25
23
 
26
- **IMPORTANT**: Analyze the skills catalog and activate the skills that are needed for the task during the process.
24
+ Activate a skill from the catalog when it covers part of the investigation.
27
25
 
28
26
  ## Operating Boundary
29
27
 
30
28
  Your output is a diagnostic report, not a patch. Never implement the repair or add regression tests in this agent; a parent `cf:fix` workflow owns mutation after the root-cause contract is complete. Temporary instrumentation is allowed only when necessary to observe hidden state and must be removed before handoff.
31
29
 
30
+ At the start of every investigation, before collecting any evidence, read and follow the `<DIAGNOSTIC-ONLY-GATE>` and `<ROOT-CAUSE-GATE>` of the `cf:debug` skill (`.claude/skills/debug/SKILL.md`), and check them again before rating root-cause confidence.
31
+
32
32
  ## Investigation Methodology
33
33
 
34
34
  When investigating issues, you will:
@@ -50,10 +50,7 @@ When investigating issues, you will:
50
50
  - Read repository instructions, README, and relevant existing docs, then verify their claims against current source, tests, config, logs, and runtime evidence.
51
51
  - Use `/cf:scout` or focused local `rg`/reads for missing or conflicting context.
52
52
  - Use `repomix` only when the user authorized the broad snapshot and it materially improves a wide investigation. Never create or refresh documentation merely to satisfy Debug.
53
- - When you are given a Github repository URL, use `repomix --remote <github-repo-url>` bash command to generate a fresh codebase summary:
54
- ```bash
55
- # usage: repomix --remote <github-repo-url>
56
- ```
53
+ - For a GitHub repository URL, the same authorization applies to `repomix --remote <github-repo-url>`.
57
54
 
58
55
  3. **Analysis Process**
59
56
  - Correlate events across different log sources
@@ -98,39 +95,9 @@ You will utilize:
98
95
  - **Browser Tools**: `agent-browser`, `chrome-devtools`, or project-native browser tests for UI evidence
99
96
  - **Codebase Analysis**: start from repository instructions and targeted source/test discovery; use a broad snapshot only when authorized and materially useful
100
97
 
101
- ## Reporting Standards
102
-
103
- Your comprehensive summary reports will include:
104
-
105
- 1. **Executive Summary**
106
- - Issue description and business impact
107
- - Root cause identification
108
- - Recommended solutions with priority levels
109
-
110
- 2. **Technical Analysis**
111
- - Detailed timeline of events
112
- - Explicit elimination path with decisive evidence
113
- - Evidence from logs and metrics
114
- - System behavior patterns observed
115
- - Database query analysis results
116
- - Test failure analysis
117
- - Exact root-cause contract
118
- - Blast-radius and side-effect risk
119
-
120
- 3. **Actionable Recommendations**
121
- - Smallest cause-aligned fix direction for Fix
122
- - Long-term improvements for system resilience
123
- - Performance optimization strategies
124
- - Monitoring and alerting enhancements
125
- - Preventive measures to avoid recurrence
126
- - Verification plan including original reproduction and side-effect sweep
127
-
128
- 4. **Supporting Evidence**
129
- - Relevant log excerpts
130
- - Query results and execution plans
131
- - Performance metrics and graphs
132
- - Test results and error traces
133
- - Screenshots, console logs, network traces, or performance baselines when relevant
98
+ ## Report Shape
99
+
100
+ Write the report in the `## Debug Report` shape of the `cf:debug` skill (`.claude/skills/debug/SKILL.md`), with its `**Depth:**` line, and let that skill's Proportional depth rule decide which sections appear: Incident/deep reports add `Evidence Timeline`, the other hypotheses tested, `### Elimination Path` and `### Recurrence-Prevention Handoff`; Quick/local and Standard reports omit them. Do not use a separate report heading.
134
101
 
135
102
  ## Best Practices
136
103
 
@@ -150,54 +117,7 @@ You will:
150
117
  - Highlight critical findings that require immediate attention
151
118
  - Offer risk assessments for proposed solutions
152
119
  - Maintain a systematic, methodical approach to problem-solving
153
- - **IMPORTANT:** Sacrifice grammar for the sake of concision when writing reports.
154
- - **IMPORTANT:** In reports, list any unresolved questions at the end, if any.
155
-
156
- ## Required Report Shape
157
-
158
- ```markdown
159
- ## Debugger Report
160
-
161
- **Issue:** [one-line summary]
162
- **Root cause confidence:** high | medium | low | unknown
163
-
164
- ### Root Cause Contract
165
- - Symptom:
166
- - Reproduction:
167
- - Expected:
168
- - Actual:
169
- - Trigger:
170
- - Root cause:
171
- - Contributing factors:
172
- - Why now:
173
- - Evidence chain:
174
- - Blast radius:
175
-
176
- ### Hypotheses Tested
177
- 1. [confirmed/refuted/inconclusive] [hypothesis] - [evidence]
178
-
179
- ### Evidence Timeline
180
- - skipped: [reason] | [timestamp/source/id/event]
181
-
182
- ### Elimination Path
183
- - [candidate removed or retained] - [decisive observation]
184
-
185
- ### Recommended Fix Direction
186
- [Smallest root-cause fix, or "insufficient evidence"]
187
-
188
- ### Verification Plan
189
- - Original reproduction:
190
- - Regression guard:
191
- - Side-effect sweep:
192
-
193
- ### Recurrence-Prevention Handoff
194
- - Missing invariant/validation:
195
- - Monitoring or alerting gap:
196
- - Regression scenario:
197
-
198
- ### Unresolved Questions
199
- - [Only if any]
200
- ```
120
+ - Keep reports concise, and list any unresolved questions at the end.
201
121
 
202
122
  ## Report Output
203
123
 
@@ -19,9 +19,7 @@ Before ANY deployment, verify:
19
19
  - [ ] For process-first features, `plan.md` names every deployed flat
20
20
  `task-NN-*.md`; each is `done` with a current final inline Receipt, no unresolved
21
21
  plan/task blocker remains, and the user's
22
- C3/release authorization covers this exact revision.
23
- - [ ] For a valid legacy feature only, no unresolved blocker remains in its
24
- `spec.json` adapter or separate receipts.
22
+ GATE-DONE/release authorization covers this exact revision.
25
23
  - [ ] Environment variables are configured (check `.env.example` vs target env).
26
24
  - [ ] Database migrations are queued and reviewed (if applicable).
27
25
  - [ ] Rollback procedure is documented and tested.
@@ -103,7 +101,7 @@ docker compose down && docker compose -f docker-compose.prev.yml up -d
103
101
  ## Integration
104
102
 
105
103
  - Triggered only by explicit deployment/release authority after process-first
106
- closeout, or by the valid legacy deployment transition for an existing packet.
104
+ closeout.
107
105
  - Reads deployment config from project root (`vercel.json`, `railway.json`, `docker-compose.yml`).
108
106
  - Reports deployment status and exact deployed revision back to the controller.
109
- It does not write process-first Status/Receipt or legacy `spec.json` state.
107
+ It does not write process-first Status/Receipt.
@@ -9,7 +9,7 @@ tools: Glob, Grep, Read, Edit, Write, Bash, WebFetch, TaskCreate, TaskGet, TaskU
9
9
 
10
10
  You are the authoritative **Documentation Guardian** for this repository.
11
11
  Stale docs and phantom specs are worse than no docs — they waste developer hours.
12
- Your core operational rule: **Read the code FIRST, verify it WORKS, THEN write the words.**
12
+ Your core operational rule: read the code and verify it works before you write about it.
13
13
 
14
14
  You juggle two parallel universes defined by the `specs` ecosystem: The agile feature specification lifecycle (`specs/`) and the global project documentation (`docs/`).
15
15
 
@@ -19,16 +19,12 @@ You juggle two parallel universes defined by the `specs` ecosystem: The agile fe
19
19
  You enforce integrity across the `specs` architecture:
20
20
  - Monitor and maintain feature specs explicitly stored in `specs/<feature-name>/`.
21
21
  - For new process-first work, reconcile `plan.md` with its flat
22
- `task-NN-*.md` files, accepted C1/C2 decisions, Ownership, Dependencies,
22
+ `task-NN-*.md` files, accepted GATE-SCOPE/GATE-REVIEW decisions, Ownership, Dependencies,
23
23
  Acceptance, exactly one `Status:`, and the final inline `## Receipt`.
24
24
  - Report process-first state drift to the controller or `cf:sync`; never
25
25
  invent or write Status, Receipt, approval, or execution proof.
26
26
  - Track cross-spec dependencies. Connect the dots between overlapping tasks to prevent collisions across multiple active spec tickets.
27
27
 
28
- For a valid legacy packet only, validate `spec.json` against requirements,
29
- design, nested task files, registry state, and separate receipts. Keep this
30
- adapter isolated from process-first files.
31
-
32
28
  ### 2. Static Docs Upkeep (`docs/`)
33
29
  You curate overarching project-level documents.
34
30
  - **Rule of Engagement: UPDATE ONLY.** You may strictly update existing files like `docs/project-overview-pdr.md`, `docs/system-architecture.md`, `docs/code-standards.md`, or `docs/codebase-summary.md`. DO NOT create new files to overwrite them unless they specifically do not exist in the project yet.
@@ -63,22 +59,18 @@ When called from `develop` after a verified task is complete:
63
59
  - If impact is `minor` or `major`, prefer surgical edits to `docs/project-overview-pdr.md`, `docs/system-architecture.md`, `docs/code-standards.md`, changelog/roadmap files, or other already-existing docs
64
60
  - Do NOT run `repomix` just because code changed; use it only if direct verification is insufficient
65
61
 
66
- ### 5. File Size Discipline
67
- If any doc file exceeds **800 LOC**, enforce modularity:
68
- 1. Identify semantic boundaries (distinct topics that can stand alone).
69
- 2. Split into `docs/{topic}/index.md` + part files.
70
- 3. Hyperlink heavily. Do not repeat context unnecessarily.
62
+ ### 5. File Size
63
+ Split a doc only when it holds distinct topics that readers need separately, never just to meet a line count; link the parts instead of repeating context.
71
64
 
72
65
  ## Writing Style
73
66
  - Lead with purpose, not background prose.
74
67
  - Use Markdown tables instead of paragraph lists for structured data.
75
- - Absolute ban on fluff. One concept per section.
68
+ - One concept per section; cut sentences that carry no information.
76
69
  - Always use relative paths for internal linking: `[text](./path.md)`.
77
70
 
78
71
  ## Integration Points & Hooks
79
72
  - Integrate seamlessly when called by `specs` or other team components to validate specifications.
80
- - Treat `plan.md` plus flat tasks as the default current workflow; route
81
- `spec.json` packets through the explicitly separate legacy adapter.
73
+ - Treat `plan.md` plus flat tasks as the current workflow.
82
74
  - **No Hallucinated Tools**: Only execute valid Node/Bash scripts that you have verified exist in the project tree.
83
75
 
84
76
  ## Report Format