@kal-elsam/kairo-runtime 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/README.md +937 -0
  2. package/bin/harness.js +11 -0
  3. package/bin/kairo-runtime.js +11 -0
  4. package/bin/kairo.js +11 -0
  5. package/global-template/components/catalog.json +25 -0
  6. package/global-template/components/orchestrator/orchestrator.md +55 -0
  7. package/global-template/components/sdd-core/handoff.md +38 -0
  8. package/global-template/components/sdd-core/spec-sizing.md +38 -0
  9. package/global-template/components/sdd-core/workflow.md +31 -0
  10. package/global-template/core/orchestrator.md +55 -0
  11. package/package.json +64 -0
  12. package/prompts/HARNESS_ENFORCEMENT_UPGRADE.md +11 -0
  13. package/prompts/HARNESS_ENTERPRISE.md +33 -0
  14. package/prompts/HARNESS_INSTALLER_MASTER.md +853 -0
  15. package/prompts/HARNESS_MINIMAL.md +30 -0
  16. package/prompts/HARNESS_SPEC_SIZING_UPGRADE.md +41 -0
  17. package/prompts/HARNESS_STANDARD.md +35 -0
  18. package/prompts/HARNESS_UNIVERSAL_PARITY.md +56 -0
  19. package/repo-template/.claude/agents/adapter-parity-reviewer.md +17 -0
  20. package/repo-template/.claude/agents/architect.md +17 -0
  21. package/repo-template/.claude/agents/eval-engineer.md +17 -0
  22. package/repo-template/.claude/agents/reviewer.md +17 -0
  23. package/repo-template/.claude/agents/sdd-reviewer.md +17 -0
  24. package/repo-template/.claude/agents/sdd-spec-writer.md +17 -0
  25. package/repo-template/.claude/skills/checkpoint/SKILL.md +13 -0
  26. package/repo-template/.claude/skills/eval-design/SKILL.md +3 -0
  27. package/repo-template/.claude/skills/evals/SKILL.md +13 -0
  28. package/repo-template/.claude/skills/loop-engineering/SKILL.md +16 -0
  29. package/repo-template/.claude/skills/maintainability-review/SKILL.md +3 -0
  30. package/repo-template/.claude/skills/quality-gate-review/SKILL.md +3 -0
  31. package/repo-template/.claude/skills/sdd/SKILL.md +13 -0
  32. package/repo-template/.claude/skills/spec-complexity-classifier/SKILL.md +10 -0
  33. package/repo-template/.claude/skills/spec-escalation-review/SKILL.md +10 -0
  34. package/repo-template/.claude/skills/spec-intake/SKILL.md +10 -0
  35. package/repo-template/.claude/skills/tdd/SKILL.md +13 -0
  36. package/repo-template/.claude/skills/trust-review/SKILL.md +3 -0
  37. package/repo-template/.codex/skills/adapter-parity/SKILL.md +29 -0
  38. package/repo-template/.codex/skills/checkpoint/SKILL.md +36 -0
  39. package/repo-template/.codex/skills/eval-design/SKILL.md +3 -0
  40. package/repo-template/.codex/skills/evals/SKILL.md +28 -0
  41. package/repo-template/.codex/skills/loop-engineering/SKILL.md +24 -0
  42. package/repo-template/.codex/skills/maintainability-review/SKILL.md +3 -0
  43. package/repo-template/.codex/skills/quality-gate-review/SKILL.md +3 -0
  44. package/repo-template/.codex/skills/sdd/SKILL.md +30 -0
  45. package/repo-template/.codex/skills/spec-complexity-classifier/SKILL.md +10 -0
  46. package/repo-template/.codex/skills/spec-escalation-review/SKILL.md +10 -0
  47. package/repo-template/.codex/skills/spec-intake/SKILL.md +10 -0
  48. package/repo-template/.codex/skills/tdd/SKILL.md +27 -0
  49. package/repo-template/.codex/skills/trust-review/SKILL.md +3 -0
  50. package/repo-template/.cursor/agents/adapter-parity-reviewer.md +29 -0
  51. package/repo-template/.cursor/agents/architect.md +27 -0
  52. package/repo-template/.cursor/agents/context-engineer.md +27 -0
  53. package/repo-template/.cursor/agents/debugger.md +27 -0
  54. package/repo-template/.cursor/agents/eval-engineer.md +27 -0
  55. package/repo-template/.cursor/agents/harness-orchestrator.md +27 -0
  56. package/repo-template/.cursor/agents/loop-controller.md +17 -0
  57. package/repo-template/.cursor/agents/loop-debugger.md +16 -0
  58. package/repo-template/.cursor/agents/reviewer.md +27 -0
  59. package/repo-template/.cursor/agents/sdd/sdd-acceptance-reviewer.md +31 -0
  60. package/repo-template/.cursor/agents/sdd/sdd-implementation-guardian.md +31 -0
  61. package/repo-template/.cursor/agents/sdd/sdd-intake-analyst.md +31 -0
  62. package/repo-template/.cursor/agents/sdd/sdd-orchestrator.md +31 -0
  63. package/repo-template/.cursor/agents/sdd/sdd-spec-reviewer.md +31 -0
  64. package/repo-template/.cursor/agents/sdd/sdd-spec-writer.md +31 -0
  65. package/repo-template/.cursor/agents/sdd/sdd-task-breakdown.md +31 -0
  66. package/repo-template/.cursor/agents/sdd/sdd-technical-planner.md +31 -0
  67. package/repo-template/.cursor/agents/sdd/sdd-test-planner.md +31 -0
  68. package/repo-template/.cursor/agents/spec-intake-analyst.md +14 -0
  69. package/repo-template/.cursor/agents/test-engineer.md +27 -0
  70. package/repo-template/.cursor/commands/adapter-parity.md +34 -0
  71. package/repo-template/.cursor/commands/checkpoint.md +30 -0
  72. package/repo-template/.cursor/commands/debug.md +13 -0
  73. package/repo-template/.cursor/commands/init-eval.md +12 -0
  74. package/repo-template/.cursor/commands/init-feature.md +12 -0
  75. package/repo-template/.cursor/commands/init-harness.md +13 -0
  76. package/repo-template/.cursor/commands/loop-debug.md +3 -0
  77. package/repo-template/.cursor/commands/loop-review.md +3 -0
  78. package/repo-template/.cursor/commands/loop-run.md +5 -0
  79. package/repo-template/.cursor/commands/review.md +21 -0
  80. package/repo-template/.cursor/commands/sdd-intake.md +18 -0
  81. package/repo-template/.cursor/commands/sdd-plan.md +18 -0
  82. package/repo-template/.cursor/commands/sdd-spec.md +18 -0
  83. package/repo-template/.cursor/commands/sdd-tasks.md +18 -0
  84. package/repo-template/.cursor/commands/sdd-validate.md +18 -0
  85. package/repo-template/.cursor/commands/spec-escalate.md +9 -0
  86. package/repo-template/.cursor/commands/spec-intake.md +10 -0
  87. package/repo-template/.cursor/commands/spec-size.md +21 -0
  88. package/repo-template/.cursor/rules/adapter-parity.mdc +20 -0
  89. package/repo-template/.cursor/rules/api.mdc +12 -0
  90. package/repo-template/.cursor/rules/core.mdc +21 -0
  91. package/repo-template/.cursor/rules/enforcement.mdc +16 -0
  92. package/repo-template/.cursor/rules/evals.mdc +10 -0
  93. package/repo-template/.cursor/rules/git.mdc +19 -0
  94. package/repo-template/.cursor/rules/harness.mdc +14 -0
  95. package/repo-template/.cursor/rules/loops.mdc +17 -0
  96. package/repo-template/.cursor/rules/testing.mdc +13 -0
  97. package/repo-template/.cursor/rules/ui.mdc +13 -0
  98. package/repo-template/.cursor/skills/api-design/SKILL.md +23 -0
  99. package/repo-template/.cursor/skills/architecture/SKILL.md +23 -0
  100. package/repo-template/.cursor/skills/code-review/SKILL.md +23 -0
  101. package/repo-template/.cursor/skills/context-graph/SKILL.md +23 -0
  102. package/repo-template/.cursor/skills/debugging/SKILL.md +23 -0
  103. package/repo-template/.cursor/skills/evals/SKILL.md +23 -0
  104. package/repo-template/.cursor/skills/git-workflow/SKILL.md +23 -0
  105. package/repo-template/.cursor/skills/testing/SKILL.md +23 -0
  106. package/repo-template/.cursor/skills/ui-design/SKILL.md +23 -0
  107. package/repo-template/.gentle-ai/README.md +37 -0
  108. package/repo-template/.gentle-ai/loops/README.md +27 -0
  109. package/repo-template/.gentle-ai/loops/sdd-tdd-repair.loop.md +27 -0
  110. package/repo-template/.gentle-ai/model-routing.md +25 -0
  111. package/repo-template/.github/copilot-instructions.md +37 -0
  112. package/repo-template/.github/dependabot.yml +11 -0
  113. package/repo-template/.github/instructions/harness.instructions.md +11 -0
  114. package/repo-template/.github/workflows/harness-quality-gate.yml +67 -0
  115. package/repo-template/.github/workflows/harness-security-gate.yml +32 -0
  116. package/repo-template/.harness/spec-sizing.json +33 -0
  117. package/repo-template/.opencode/README.md +71 -0
  118. package/repo-template/.opencode/agents/adapter-parity-reviewer.md +23 -0
  119. package/repo-template/.opencode/agents/architect.md +38 -0
  120. package/repo-template/.opencode/agents/checkpoint-reviewer.md +38 -0
  121. package/repo-template/.opencode/agents/eval-engineer.md +38 -0
  122. package/repo-template/.opencode/agents/loop-controller.md +38 -0
  123. package/repo-template/.opencode/agents/loop-debugger.md +38 -0
  124. package/repo-template/.opencode/agents/model-router.md +38 -0
  125. package/repo-template/.opencode/agents/sdd-orchestrator.md +38 -0
  126. package/repo-template/.opencode/agents/sdd-spec-reviewer.md +38 -0
  127. package/repo-template/.opencode/agents/spec-intake-analyst.md +19 -0
  128. package/repo-template/.opencode/agents/tdd-engineer.md +38 -0
  129. package/repo-template/.opencode/commands/checkpoint.md +3 -0
  130. package/repo-template/.opencode/commands/eval-design.md +3 -0
  131. package/repo-template/.opencode/commands/maintainability-review.md +3 -0
  132. package/repo-template/.opencode/commands/quality-gate.md +3 -0
  133. package/repo-template/.opencode/commands/spec-escalate.md +9 -0
  134. package/repo-template/.opencode/commands/spec-intake.md +10 -0
  135. package/repo-template/.opencode/commands/spec-size.md +21 -0
  136. package/repo-template/.opencode/commands/trust-review.md +3 -0
  137. package/repo-template/.opencode/loops/ai-behavior-improvement.loop.md +15 -0
  138. package/repo-template/.opencode/loops/bug-repair.loop.md +16 -0
  139. package/repo-template/.opencode/loops/documentation-sync.loop.md +13 -0
  140. package/repo-template/.opencode/loops/feature-development.loop.md +25 -0
  141. package/repo-template/.opencode/skills/spec-complexity-classifier/SKILL.md +10 -0
  142. package/repo-template/.opencode/skills/spec-escalation-review/SKILL.md +10 -0
  143. package/repo-template/.opencode/skills/spec-intake/SKILL.md +10 -0
  144. package/repo-template/.pi/README.md +21 -0
  145. package/repo-template/.pi/prompts/checkpoint.md +11 -0
  146. package/repo-template/.pi/prompts/loop-run.md +10 -0
  147. package/repo-template/.pi/prompts/sdd-plan.md +11 -0
  148. package/repo-template/.pi/prompts/sdd-spec.md +13 -0
  149. package/repo-template/.pi/prompts/spec-escalate.md +9 -0
  150. package/repo-template/.pi/prompts/spec-intake.md +10 -0
  151. package/repo-template/.pi/prompts/spec-size.md +21 -0
  152. package/repo-template/.pi/skills/adapter-parity/SKILL.md +7 -0
  153. package/repo-template/.pi/skills/checkpoint/SKILL.md +7 -0
  154. package/repo-template/.pi/skills/eval-design/SKILL.md +3 -0
  155. package/repo-template/.pi/skills/evals/SKILL.md +7 -0
  156. package/repo-template/.pi/skills/loop-engineering/SKILL.md +7 -0
  157. package/repo-template/.pi/skills/maintainability-review/SKILL.md +3 -0
  158. package/repo-template/.pi/skills/quality-gate-review/SKILL.md +3 -0
  159. package/repo-template/.pi/skills/sdd/SKILL.md +7 -0
  160. package/repo-template/.pi/skills/spec-complexity-classifier/SKILL.md +10 -0
  161. package/repo-template/.pi/skills/spec-escalation-review/SKILL.md +10 -0
  162. package/repo-template/.pi/skills/spec-intake/SKILL.md +10 -0
  163. package/repo-template/.pi/skills/tdd/SKILL.md +7 -0
  164. package/repo-template/.pi/skills/trust-review/SKILL.md +3 -0
  165. package/repo-template/AGENT.md +8 -0
  166. package/repo-template/AGENTS.md +165 -0
  167. package/repo-template/CLAUDE.md +9 -0
  168. package/repo-template/GEMINI.md +9 -0
  169. package/repo-template/docs/ai/adapter-parity.md +135 -0
  170. package/repo-template/docs/ai/agent-workflow.md +45 -0
  171. package/repo-template/docs/ai/api.md +28 -0
  172. package/repo-template/docs/ai/architecture.md +53 -0
  173. package/repo-template/docs/ai/context-budget.md +54 -0
  174. package/repo-template/docs/ai/context-graph.md +39 -0
  175. package/repo-template/docs/ai/conventions.md +34 -0
  176. package/repo-template/docs/ai/decision-log.md +5 -0
  177. package/repo-template/docs/ai/enforcement.md +63 -0
  178. package/repo-template/docs/ai/eval-strategy.md +42 -0
  179. package/repo-template/docs/ai/evals.md +44 -0
  180. package/repo-template/docs/ai/git-workflow.md +35 -0
  181. package/repo-template/docs/ai/governance.md +61 -0
  182. package/repo-template/docs/ai/harness.md +49 -0
  183. package/repo-template/docs/ai/installer-cli.md +34 -0
  184. package/repo-template/docs/ai/loop-log.md +5 -0
  185. package/repo-template/docs/ai/loop-observability.md +57 -0
  186. package/repo-template/docs/ai/loop-policy.md +86 -0
  187. package/repo-template/docs/ai/loops.md +95 -0
  188. package/repo-template/docs/ai/maintainability-gates.md +26 -0
  189. package/repo-template/docs/ai/memory.md +71 -0
  190. package/repo-template/docs/ai/model-policy.md +105 -0
  191. package/repo-template/docs/ai/observability-runtime.md +48 -0
  192. package/repo-template/docs/ai/provider-routing.md +138 -0
  193. package/repo-template/docs/ai/quality-gates.md +48 -0
  194. package/repo-template/docs/ai/rollback-runtime.md +25 -0
  195. package/repo-template/docs/ai/security.md +12 -0
  196. package/repo-template/docs/ai/spec-driven-development.md +124 -0
  197. package/repo-template/docs/ai/spec-escalation.md +44 -0
  198. package/repo-template/docs/ai/spec-intake.md +46 -0
  199. package/repo-template/docs/ai/spec-sizing.md +207 -0
  200. package/repo-template/docs/ai/test-driven-development.md +35 -0
  201. package/repo-template/docs/ai/testing.md +28 -0
  202. package/repo-template/docs/ai/tool-adapters.md +186 -0
  203. package/repo-template/docs/ai/trust-allowlist.md +5 -0
  204. package/repo-template/docs/ai/trust-policy.md +41 -0
  205. package/repo-template/docs/ai/ui.md +17 -0
  206. package/repo-template/docs/skills/adapter-parity-review.md +46 -0
  207. package/repo-template/docs/skills/api-design.md +37 -0
  208. package/repo-template/docs/skills/architecture.md +37 -0
  209. package/repo-template/docs/skills/code-review.md +37 -0
  210. package/repo-template/docs/skills/context-graph.md +38 -0
  211. package/repo-template/docs/skills/debugging.md +37 -0
  212. package/repo-template/docs/skills/eval-design.md +12 -0
  213. package/repo-template/docs/skills/evals.md +37 -0
  214. package/repo-template/docs/skills/git-workflow.md +37 -0
  215. package/repo-template/docs/skills/look-trust-review.md +12 -0
  216. package/repo-template/docs/skills/loop-debugging.md +16 -0
  217. package/repo-template/docs/skills/loop-design.md +39 -0
  218. package/repo-template/docs/skills/loop-retrospective.md +15 -0
  219. package/repo-template/docs/skills/loop-review.md +16 -0
  220. package/repo-template/docs/skills/maintainability-review.md +12 -0
  221. package/repo-template/docs/skills/model-selection.md +36 -0
  222. package/repo-template/docs/skills/quality-gate-review.md +12 -0
  223. package/repo-template/docs/skills/spec-complexity-classifier.md +41 -0
  224. package/repo-template/docs/skills/spec-escalation-review.md +34 -0
  225. package/repo-template/docs/skills/spec-intake.md +25 -0
  226. package/repo-template/docs/skills/testing.md +37 -0
  227. package/repo-template/docs/skills/tool-adapter-sync.md +36 -0
  228. package/repo-template/docs/skills/ui-design.md +37 -0
  229. package/repo-template/docs/specs/README.md +9 -0
  230. package/repo-template/docs/specs/templates/basic-spec.md +41 -0
  231. package/repo-template/docs/specs/templates/complex-spec.md +145 -0
  232. package/repo-template/docs/specs/templates/standard-spec.md +58 -0
  233. package/repo-template/evals/README.md +11 -0
  234. package/repo-template/evals/golden/sample-golden.json +12 -0
  235. package/repo-template/evals/loop-regression/README.md +11 -0
  236. package/repo-template/evals/regression/sample-regression.json +12 -0
  237. package/repo-template/evals/schema/sample-schema.json +12 -0
  238. package/repo-template/evals/tool-calls/sample-tool-calls.json +12 -0
  239. package/repo-template/opencode.json.sample +29 -0
  240. package/repo-template/scripts/harness/backup.mjs +7 -0
  241. package/repo-template/scripts/harness/doctor.mjs +20 -0
  242. package/repo-template/scripts/harness/run-evals.mjs +27 -0
  243. package/repo-template/setup-agent-links.sh +54 -0
  244. package/scripts/check-published-release.mjs +127 -0
  245. package/scripts/check-release-commit.mjs +32 -0
  246. package/scripts/install.sh +225 -0
  247. package/scripts/installer-smoke-test.sh +155 -0
  248. package/scripts/lib/attribution-guard.mjs +59 -0
  249. package/scripts/registry-smoke-test.sh +149 -0
  250. package/scripts/smoke-test.sh +197 -0
  251. package/scripts/ux-smoke-test.sh +140 -0
  252. package/src/cli.js +625 -0
  253. package/src/doctor.js +68 -0
  254. package/src/global/adapter-context.js +27 -0
  255. package/src/global/adapter-matrix.js +38 -0
  256. package/src/global/adapters/claude.js +8 -0
  257. package/src/global/adapters/codex.js +8 -0
  258. package/src/global/adapters/cursor.js +8 -0
  259. package/src/global/adapters/opencode.js +8 -0
  260. package/src/global/agents.js +7 -0
  261. package/src/global/apply-confirmation.js +62 -0
  262. package/src/global/backups.js +54 -0
  263. package/src/global/brand/cli.js +52 -0
  264. package/src/global/brand/index.js +85 -0
  265. package/src/global/clack/setup-preview.js +48 -0
  266. package/src/global/clack/setup-wizard-constants.js +6 -0
  267. package/src/global/clack/setup-wizard.js +207 -0
  268. package/src/global/clack/theme.js +145 -0
  269. package/src/global/component-authoring.js +121 -0
  270. package/src/global/component-builders.js +43 -0
  271. package/src/global/component-distribution.js +270 -0
  272. package/src/global/component-installer.js +106 -0
  273. package/src/global/component-paths.js +22 -0
  274. package/src/global/component-registry.js +89 -0
  275. package/src/global/components/orchestrator.js +14 -0
  276. package/src/global/components/sdd-core.js +17 -0
  277. package/src/global/diff.js +233 -0
  278. package/src/global/drift.js +264 -0
  279. package/src/global/explain.js +144 -0
  280. package/src/global/global-cli.js +1145 -0
  281. package/src/global/global-doctor.js +67 -0
  282. package/src/global/global-installer.js +284 -0
  283. package/src/global/history.js +313 -0
  284. package/src/global/ink/run-setup-ink.js +77 -0
  285. package/src/global/ink/setup-app.js +278 -0
  286. package/src/global/ink/setup-routing.js +51 -0
  287. package/src/global/ink/setup-state.js +180 -0
  288. package/src/global/ink/terminal.js +13 -0
  289. package/src/global/json-output.js +22 -0
  290. package/src/global/load-component-catalog.js +41 -0
  291. package/src/global/load-workspace-component-catalog.js +123 -0
  292. package/src/global/managed-body.js +28 -0
  293. package/src/global/managed-config-adapter.js +134 -0
  294. package/src/global/managed-section.js +73 -0
  295. package/src/global/npm-registry.js +25 -0
  296. package/src/global/paths.js +22 -0
  297. package/src/global/policy.js +344 -0
  298. package/src/global/preflight.js +65 -0
  299. package/src/global/registry.js +79 -0
  300. package/src/global/report.js +110 -0
  301. package/src/global/rollback.js +126 -0
  302. package/src/global/setup.js +284 -0
  303. package/src/global/state-migration.js +65 -0
  304. package/src/global/state.js +50 -0
  305. package/src/global/status.js +94 -0
  306. package/src/global/sync.js +129 -0
  307. package/src/global/upgrade.js +145 -0
  308. package/src/harness-files.js +145 -0
  309. package/src/harness-updater.js +120 -0
  310. package/src/hash.js +5 -0
  311. package/src/manifest.js +36 -0
  312. package/src/project-detection.js +105 -0
  313. package/src/template-installer.js +72 -0
  314. package/src/text-template.js +24 -0
  315. package/src/workspace-cli.js +115 -0
package/README.md ADDED
@@ -0,0 +1,937 @@
1
+ # Kairo Runtime
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@kal-elsam/kairo-runtime.svg)](https://www.npmjs.com/package/@kal-elsam/kairo-runtime)
4
+
5
+ **Kairo Runtime** is a local agent operating system — not a template dumper and not an
6
+ installer for AI apps. It detects agents you already use (Cursor, Codex, OpenCode,
7
+ Claude), writes managed sections into their configs, installs coordination components
8
+ under `~/.harness`, and keeps that ecosystem healthy with status, sync, backups,
9
+ and rollback.
10
+
11
+ The npm package (`@kal-elsam/kairo-runtime`) is how Kairo Runtime is distributed. The
12
+ product identity is the local control plane: setup, status, sync, doctor (with `update`
13
+ as a technical alias).
14
+
15
+ Terminal UX aims for Pi-like clarity (clear modes, non-interactive flags, extensible
16
+ commands) without depending on Pi as a runtime or adding a Pi adapter.
17
+
18
+ - **npm:** https://www.npmjs.com/package/@kal-elsam/kairo-runtime
19
+ - **repo:** https://github.com/Kal-elSam/harness
20
+
21
+ ## Quick start
22
+
23
+ Recommended entry — run Kairo Runtime in your terminal (interactive setup wizard in a TTY):
24
+
25
+ ```bash
26
+ npx @kal-elsam/kairo-runtime
27
+ ```
28
+
29
+ Preview without writing anything:
30
+
31
+ ```bash
32
+ npx @kal-elsam/kairo-runtime --dry-run
33
+ ```
34
+
35
+ One-liner bootstrap (checks Node/npm, previews the plan, writes nothing by default):
36
+
37
+ ```bash
38
+ curl -fsSL https://raw.githubusercontent.com/Kal-elSam/harness/main/scripts/install.sh | sh
39
+ ```
40
+
41
+ Preview the installer plan only (no download, no network package run):
42
+
43
+ ```bash
44
+ curl -fsSL https://raw.githubusercontent.com/Kal-elSam/harness/main/scripts/install.sh | sh -s -- --dry-run
45
+ ```
46
+
47
+ The bootstrap installer:
48
+
49
+ - requires Node.js 20.12+ and npm
50
+ - runs `@kal-elsam/kairo-runtime` via `npx` (or `npm exec`)
51
+ - ends with `kairo setup --dry-run` by default (no agent configs, no `~/.harness` writes)
52
+ - never uses `sudo`, never modifies shell profiles, and never installs AI apps
53
+
54
+ Apply the plan when you are ready:
55
+
56
+ ```bash
57
+ npx @kal-elsam/kairo-runtime --yes
58
+ # or
59
+ curl -fsSL https://raw.githubusercontent.com/Kal-elSam/harness/main/scripts/install.sh | sh -s -- --yes
60
+ ```
61
+
62
+ CI, scripts, and advanced non-interactive configure:
63
+
64
+ ```bash
65
+ npx @kal-elsam/kairo-runtime install --agents cursor,codex --yes
66
+ npx @kal-elsam/kairo-runtime setup --yes --agents all
67
+ ```
68
+
69
+ Passthrough examples:
70
+
71
+ ```bash
72
+ curl -fsSL https://raw.githubusercontent.com/Kal-elSam/harness/main/scripts/install.sh | sh -s -- --agents all --yes
73
+ curl -fsSL https://raw.githubusercontent.com/Kal-elSam/harness/main/scripts/install.sh | sh -s -- --components orchestrator,sdd-core --yes
74
+ ```
75
+
76
+ Control plane:
77
+
78
+ ```bash
79
+ kairo status
80
+ kairo sync
81
+ kairo upgrade --dry-run
82
+ npx @kal-elsam/kairo-runtime@latest setup --yes
83
+ ```
84
+
85
+ After `install.sh --yes`, verify health with `kairo status`, repair drift with `kairo sync`,
86
+ and move to the latest package with `npx @kal-elsam/kairo-runtime@latest setup --yes`.
87
+
88
+ ### Version and updates
89
+
90
+ ```bash
91
+ # Installed CLI version (local package / PATH)
92
+ kairo --version
93
+ npx @kal-elsam/kairo-runtime --version
94
+
95
+ # Latest published version on npm
96
+ npm view @kal-elsam/kairo-runtime version
97
+
98
+ # Converge to the latest published package
99
+ kairo upgrade --dry-run
100
+ npx @kal-elsam/kairo-runtime@latest setup --yes
101
+ npx @kal-elsam/kairo-runtime@latest sync
102
+ ```
103
+
104
+ ### npm alternative
105
+
106
+ If you prefer npm directly (no curl):
107
+
108
+ ```bash
109
+ npx @kal-elsam/kairo-runtime
110
+ npx @kal-elsam/kairo-runtime --dry-run
111
+ npx @kal-elsam/kairo-runtime install --agents cursor,codex --components orchestrator,sdd-core --yes
112
+ ```
113
+
114
+ Optional global install:
115
+
116
+ ```bash
117
+ npm i -g @kal-elsam/kairo-runtime
118
+ kairo --version
119
+ ```
120
+
121
+ Legacy opt-in: scaffold governance files into a repository:
122
+
123
+ ```bash
124
+ npx @kal-elsam/kairo-runtime install --scope=workspace
125
+ ```
126
+
127
+ ## CLI commands
128
+
129
+ | Command | Description |
130
+ |---|---|
131
+ | `kairo` | Primary — short and direct |
132
+ | `kairo-runtime` | Descriptive alias |
133
+ | `harness` | Legacy alias (prefer `kairo`) |
134
+ | `agentic-harness` | Legacy descriptive alias |
135
+
136
+ ```bash
137
+ kairo --version
138
+ kairo
139
+ kairo --dry-run
140
+ kairo setup
141
+ kairo setup --dry-run
142
+ kairo setup --agents all
143
+ kairo install --agents cursor,codex --yes
144
+ kairo status
145
+ kairo status --json
146
+ kairo adapters
147
+ kairo adapters --json
148
+ kairo sync
149
+ kairo sync --dry-run
150
+ kairo sync --dry-run --json
151
+ kairo policy
152
+ kairo policy --json
153
+ kairo policy set profile safe
154
+ kairo policy reset
155
+ kairo install
156
+ kairo install --agents all
157
+ kairo install --agents cursor,codex --components orchestrator,sdd-core
158
+ kairo doctor
159
+ kairo doctor --json
160
+ kairo update # technical alias; prefer sync
161
+ kairo detect
162
+ kairo components
163
+ kairo components validate
164
+ kairo components init <id> --label "<label>"
165
+ kairo components pack <id> --out <file> # advanced
166
+ kairo components import <file> # advanced
167
+ kairo backups
168
+ kairo history
169
+ kairo history --command sync --action repaired
170
+ kairo history last --json
171
+ kairo report
172
+ kairo report --json
173
+ kairo report --out ./diagnostics.txt
174
+ kairo rollback --to <snapshot> [--apply]
175
+ kairo uninstall
176
+ kairo install --scope=workspace # opt-in / legacy
177
+ ```
178
+
179
+ Legacy CLI aliases (backward compatible): `harness`, `agentic-harness`, `sgs-harness`, `harness-sgs`
180
+
181
+ `kairo help` lists commands and JSON support; longer examples live in this README.
182
+
183
+ To try locally from this repo:
184
+
185
+ ```bash
186
+ node ./bin/kairo.js setup --dry-run
187
+ node ./bin/kairo.js status
188
+ node ./bin/kairo.js sync --dry-run
189
+ node ./bin/kairo.js adapters --json
190
+ node ./bin/kairo.js install --dry-run
191
+ ```
192
+
193
+ ## Supported adapters (agent-global)
194
+
195
+ Kairo Runtime does **not** install Cursor, Codex, OpenCode, or Claude Code. It detects
196
+ their home-directory roots and writes managed sections into their config files.
197
+
198
+ | Adapter | Label | Root | Config file |
199
+ |---|---|---|---|
200
+ | `cursor` | Cursor | `~/.cursor` | `~/.cursor/AGENTS.md` |
201
+ | `codex` | Codex | `~/.codex` | `~/.codex/AGENTS.md` |
202
+ | `opencode` | OpenCode | `~/.config/opencode` | `~/.config/opencode/AGENTS.md` |
203
+ | `claude` | Claude Code | `~/.claude` | `~/.claude/CLAUDE.md` |
204
+
205
+ Inspect detection and managed state:
206
+
207
+ ```bash
208
+ kairo adapters
209
+ kairo adapters --json
210
+ ```
211
+
212
+ Agent selection defaults:
213
+
214
+ - If agent roots are detected → configure detected agents only.
215
+ - If none are detected → safe fallback to all four supported adapters.
216
+ - Force all four explicitly:
217
+
218
+ ```bash
219
+ kairo setup --agents all
220
+ kairo install --agents all
221
+ ```
222
+
223
+ Primary flow remains `kairo` → `status` → `sync` (or `kairo setup` explicitly).
224
+
225
+ ## Install scopes
226
+
227
+ | Scope | Default for | Behavior |
228
+ |---|---|---|
229
+ | `agent-global` | bare `kairo`, `setup`, `install`, `update`, `doctor`, `status`, `uninstall` | Primary path. Configures local agent roots, managed sections, `~/.harness` state. No project folders. |
230
+ | `workspace` | `init` only (opt-in/legacy) | Explicit `--scope=workspace`. Copies `repo-template/` into the current repo. |
231
+
232
+ ### `kairo` / `kairo setup`
233
+
234
+ Bare `kairo` opens the Ink setup UI (**Local Agent Operating System**) in a TTY. `kairo setup --simple` uses the Clack wizard instead. `kairo setup`
235
+ is equivalent. Detects agents, shows a plan, and lets you choose agents/components before
236
+ applying. Use `--dry-run` to preview without writing, or `--yes` / flags to skip prompts.
237
+ Use `kairo install` for explicit non-interactive configure in CI and scripts.
238
+
239
+ ```bash
240
+ kairo
241
+ kairo --dry-run
242
+ kairo setup
243
+ kairo setup --dry-run
244
+ kairo setup --agents cursor,codex --components orchestrator,sdd-core --yes
245
+ kairo install --agents cursor,codex --yes
246
+ ```
247
+
248
+ ### `kairo status`
249
+
250
+ Control panel for the local ecosystem: detected vs managed agents, installed
251
+ components, check counts (ok/missing/stale), backups, overall status, and the
252
+ recommended next action.
253
+
254
+ ```bash
255
+ kairo status
256
+ kairo status --json
257
+ ```
258
+
259
+ `--json` prints a stable machine-readable envelope for CI, tooling, and debugging
260
+ (`ok`, `overall`, `agents`, `components`, `checks`, `backups`, `nextAction`,
261
+ `cliVersion`). Human text remains the default. Exit code is non-zero when
262
+ `overall` is not `ok`.
263
+
264
+ ### `kairo sync`
265
+
266
+ Primary convergence command. Detects managed state, repairs drift with the same
267
+ safe engine as `update` (managed content only, backups before config changes,
268
+ user content preserved), then prints a status summary.
269
+
270
+ ```bash
271
+ kairo sync
272
+ kairo sync --dry-run
273
+ kairo sync --dry-run --json
274
+ ```
275
+
276
+ - No state → recommends `kairo setup`, writes nothing.
277
+ - Already OK → writes nothing.
278
+ - Drift/missing/stale → repairs, then shows status.
279
+ - `--json` uses the same stable envelope as `status`, plus sync fields
280
+ (`action`, `wrote`, planned/applied repairs when present).
281
+ - `kairo update` remains as a technical alias.
282
+
283
+ ### `kairo history`
284
+
285
+ Read-only audit log of managed operations under `~/.harness/history.jsonl`.
286
+ Use it to investigate what Kairo Runtime applied without parsing JSONL manually.
287
+
288
+ ```bash
289
+ kairo history
290
+ kairo history --command sync
291
+ kairo history --action repaired --limit 10
292
+ kairo history last
293
+ kairo history last --json
294
+ kairo history last --command sync
295
+ ```
296
+
297
+ - Filters: `--command`, `--action`, `--limit` (combine before limiting).
298
+ - `history last` prints the most recent matching event; exit 0 when empty.
299
+ - Queries never write to `~/.harness`.
300
+
301
+ ### `kairo report`
302
+
303
+ Read-only local diagnostics bundle for support and debugging. Combines status,
304
+ policy, adapters, diff/drift preview, and recent history without modifying
305
+ `~/.harness` or agent configs.
306
+
307
+ ```bash
308
+ kairo report
309
+ kairo report --json
310
+ kairo report --out ./diagnostics.txt
311
+ kairo report --limit 10
312
+ ```
313
+
314
+ - Default stdout is human-readable; `--json` is stable for CI.
315
+ - `--out <file>` writes only to the path you specify (text or JSON per flags).
316
+ - `--limit <n>` controls history events included (default 20).
317
+ - Corrupt `history.jsonl` lines appear as warnings; valid events still display.
318
+ - No telemetry and no full config contents — paths, states, and summaries only.
319
+
320
+ ### `kairo policy`
321
+
322
+ Optional local operation preferences under `~/.harness/policy.json`. Use this
323
+ when your team wants consistent apply/preflight defaults without repeating CLI
324
+ flags on every `setup`, `sync`, or `upgrade`.
325
+
326
+ ```bash
327
+ kairo policy
328
+ kairo policy --json
329
+ kairo policy set profile ci
330
+ kairo policy set preflight true
331
+ kairo policy set agents detected
332
+ kairo policy set components orchestrator,sdd-core
333
+ kairo policy reset
334
+ ```
335
+
336
+ Profiles:
337
+
338
+ | Profile | Behavior |
339
+ |---|---|
340
+ | `safe` | Preflight on; interactive terminal prompts before apply (default). |
341
+ | `ci` | Preflight on; non-interactive apply allowed via policy (`applyMode: confirm`). |
342
+ | `fast` | Same as `ci` — preflight on, confirmation via policy instead of a prompt. |
343
+
344
+ Precedence: **CLI flags > policy file > internal defaults**. Without a policy
345
+ file, behavior matches 0.18.0. `policy reset` deletes only `policy.json`; it
346
+ does not touch `state.json`, managed adapters, or installed components.
347
+
348
+ Keys: `profile`, `applyMode` (`prompt` \| `confirm`), `preflight`, `agents`
349
+ (`detected`, `all`, or a comma-separated list), `components`.
350
+
351
+ Visibility (0.20.0+): `kairo status`, `kairo explain`, and apply preflight on
352
+ `setup`/`sync`/`upgrade` show the effective policy and consent source (`cli`,
353
+ `policy`, `interactive`, or `none`). `status --json` includes a stable `policy`
354
+ field.
355
+
356
+ ### `kairo install` (agent-global)
357
+
358
+ Non-interactive configure. Same engine as `setup`.
359
+
360
+ ```bash
361
+ kairo install --dry-run # preview the plan, writes nothing
362
+ kairo install # apply
363
+ kairo install --agents cursor,claude
364
+ ```
365
+
366
+ What it does:
367
+
368
+ - Detects local agents: `cursor`, `codex`, `opencode`, `claude`. If none are
369
+ detected, it targets all supported agents.
370
+ - Installs the orchestrator/conductor contract to `~/.harness/core/`.
371
+ - Adds a managed marker section to each agent config
372
+ (for example `~/.cursor/AGENTS.md`):
373
+
374
+ ```md
375
+ <!-- harness:managed:start -->
376
+ ...managed content, refreshed by kairo sync...
377
+ <!-- harness:managed:end -->
378
+ ```
379
+
380
+ - Everything outside the markers is user-owned and always preserved.
381
+ - Before modifying any existing config it snapshots the file to
382
+ `~/.harness/backups/<timestamp>/`.
383
+ - Records everything in `~/.harness/state.json`.
384
+ - Set `HARNESS_HOME=/some/dir` to redirect the whole managed root (useful for
385
+ testing and sandboxed environments).
386
+
387
+ ### `kairo update` (agent-global)
388
+
389
+ Technical/compatibility alias for the repair engine used by `sync`. Prefer
390
+ `kairo sync` for day-to-day use. Requires an existing `~/.harness/state.json`.
391
+
392
+ ### `kairo doctor` (agent-global)
393
+
394
+ Reports installed agents, managed state, backups, and missing configs.
395
+ Exits non-zero when managed state or a tracked config is missing.
396
+
397
+ ```bash
398
+ kairo doctor
399
+ kairo doctor --json
400
+ ```
401
+
402
+ `--json` uses the same stable control-plane envelope as `status`, including the
403
+ detailed `checks` array.
404
+
405
+ ### `kairo uninstall` (agent-global)
406
+
407
+ Removes managed sections from agent configs (with a fresh backup first),
408
+ deletes `~/.harness/state.json` and `~/.harness/core/`. Backups are preserved.
409
+
410
+ ### Workspace components
411
+
412
+ Opt-in custom components live in the current repo under `.harness/components/`.
413
+ They never override bundled IDs (`orchestrator`, `sdd-core`) and install copies
414
+ assets into `~/.harness/components/<id>/` only when you pass `--components`.
415
+
416
+ Create, validate, and install:
417
+
418
+ ```bash
419
+ kairo components init team-rules --label "Team Rules"
420
+ # edit .harness/components/team-rules/README.md
421
+ kairo components validate
422
+ kairo install --components team-rules
423
+ ```
424
+
425
+ Advanced: share a workspace component between repos (no remote registry):
426
+
427
+ ```bash
428
+ kairo components pack team-rules --out team-rules.tgz
429
+ # copy team-rules.tgz into another repo
430
+ kairo components import team-rules.tgz
431
+ kairo components validate
432
+ kairo install --components team-rules
433
+ ```
434
+
435
+ - `kairo components` lists bundled and workspace catalogs.
436
+ - `kairo components validate [--cwd <path>]` runs the same loader used by install/doctor.
437
+ - `kairo components init <id> --label "<label>"` scaffolds `catalog.json`,
438
+ `.harness/components/<id>/README.md`, and a catalog entry (`version: "0.1.0"`).
439
+ It refuses existing IDs and bundled IDs, and does not write to `~/.harness`.
440
+ - `kairo components pack <id> --out <file>` builds a portable `.tgz` (partial catalog + assets).
441
+ - `kairo components import <file>` installs declared assets only; no overwrite by default,
442
+ no `~/.harness` writes, no package scripts.
443
+
444
+ ## Workspace lifecycle: init, update, doctor
445
+
446
+ The workspace harness is not a one-shot copy. Every `init` writes a manifest
447
+ that later `update` and `doctor` runs rely on. All workspace commands accept
448
+ `--scope=workspace`; `init` implies it.
449
+
450
+ ### `kairo init` / `kairo install --scope=workspace`
451
+
452
+ Installs `repo-template/` into the target project and writes
453
+ `.harness/manifest.json` with the installed mode, CLI version, and a content
454
+ hash for every file the harness created.
455
+
456
+ ```bash
457
+ kairo init --mode enterprise --all-adapters
458
+ kairo install --scope=workspace --mode standard --adapters codex,cursor
459
+ ```
460
+
461
+ By default it never overwrites a file that already exists. Pass `--force` to
462
+ overwrite, or `--dry-run` to preview without writing anything.
463
+
464
+ Important behavior:
465
+
466
+ - Running just `kairo` (or `npx/pnpm dlx @kal-elsam/kairo-runtime`) now runs the
467
+ **agent-global** install, not the workspace scaffold.
468
+ - Within workspace scope, `mode=standard` remains the default.
469
+ - `--adapters` installs only the requested adapters.
470
+ - `--all-adapters` keeps the previous “install everything” behavior.
471
+
472
+ Supported adapters:
473
+
474
+ ```txt
475
+ codex, cursor, claude, gemini, copilot, opencode, pi
476
+ ```
477
+
478
+ ### `kairo detect`
479
+
480
+ Read-only inspection command. It reports the global agents detected on this
481
+ machine, then the current project stack and adapter markers, and prints the
482
+ recommended install command.
483
+
484
+ ```bash
485
+ kairo detect
486
+ ```
487
+
488
+ ### `kairo update --scope=workspace`
489
+
490
+ Reapplies the current harness templates to an already-installed project.
491
+
492
+ ```bash
493
+ kairo update --scope=workspace --dry-run # preview: created / updated / unchanged / skipped
494
+ kairo update --scope=workspace # apply
495
+ kairo update --scope=workspace --force # also overwrite files you modified locally
496
+ ```
497
+
498
+ `update` is conservative by design:
499
+
500
+ - Files unchanged since install are safely refreshed to the latest template.
501
+ - Files you edited locally are **skipped** unless `--force` is passed.
502
+ - Files that exist but were never tracked by the harness are left alone.
503
+ - New files added in newer harness releases are created.
504
+ - `.harness/manifest.json` is rewritten with the new hashes, CLI version, and adapter selection.
505
+
506
+ ### `kairo doctor --scope=workspace`
507
+
508
+ Read-only health check. Never modifies files.
509
+
510
+ ```bash
511
+ kairo doctor --scope=workspace
512
+ ```
513
+
514
+ Reports each check as `OK`, `WARNING`, or `MISSING`:
515
+
516
+ - **Required** files missing (`AGENTS.md`, `docs/ai/harness.md`,
517
+ `docs/ai/memory.md`) fail the check (non-zero exit code).
518
+ - **Recommended** files missing are reported as warnings.
519
+ - If `.harness/manifest.json` is missing, doctor warns and suggests
520
+ `kairo init`.
521
+ - If a file tracked in the manifest was deleted after install, doctor
522
+ reports manifest drift.
523
+
524
+ ### `.harness/manifest.json`
525
+
526
+ ```json
527
+ {
528
+ "packageName": "@kal-elsam/kairo-runtime",
529
+ "cliVersion": "0.2.0",
530
+ "mode": "enterprise",
531
+ "adapters": ["codex", "cursor"],
532
+ "installedAt": "2026-07-02T18:00:00.000Z",
533
+ "updatedAt": "2026-07-02T18:00:00.000Z",
534
+ "files": {
535
+ "AGENTS.md": "3f9a...",
536
+ "docs/ai/harness.md": "8b21..."
537
+ }
538
+ }
539
+ ```
540
+
541
+ This file is the source of truth for what the harness owns in a project.
542
+ Commit it to version control.
543
+
544
+ ## What it installs
545
+
546
+ The CLI copies and personalizes `repo-template/` into the target project.
547
+
548
+ Always-installed core depends on the selected mode, and adapter folders are now
549
+ filtered separately.
550
+
551
+ Core examples:
552
+
553
+ ```txt
554
+ AGENTS.md
555
+ docs/ai/
556
+ docs/skills/
557
+ docs/specs/
558
+ .gentle-ai/
559
+ .harness/
560
+ setup-agent-links.sh
561
+ ```
562
+
563
+ Adapter-specific examples:
564
+
565
+ ```txt
566
+ .codex/
567
+ .cursor/
568
+ .claude/
569
+ .pi/
570
+ .opencode/
571
+ .github/copilot-instructions.md
572
+ CLAUDE.md
573
+ GEMINI.md
574
+ ```
575
+
576
+ Feature/extended examples (mostly `standard`/`enterprise` depending on mode):
577
+
578
+ ```txt
579
+ .github/
580
+ evals/
581
+ scripts/harness/
582
+ ```
583
+
584
+ Core rule:
585
+
586
+ ```txt
587
+ AGENTS.md governs.
588
+ Adapters translate.
589
+ MCPs observe and preserve context.
590
+ Human approves impact.
591
+ ```
592
+
593
+ Engram and Graphify are documented as external integrations: they help with memory and context graphs, but they do not replace the repo as the source of truth.
594
+
595
+ Built for:
596
+
597
+ - Cursor-first, but not Cursor-only.
598
+ - Gentle AI as the operational reference for SDD/TDD.
599
+ - AGENTS.md as the universal source.
600
+ - SDD, TDD, evals, checkpoints, review, and human approval.
601
+ - Engram/Graphify as external memory, analysis, or context-graph systems without locking the repo to a single tool.
602
+
603
+ ## Key files
604
+
605
+ ```txt
606
+ prompts/HARNESS_INSTALLER_MASTER.md
607
+ prompts/HARNESS_MINIMAL.md
608
+ prompts/HARNESS_STANDARD.md
609
+ prompts/HARNESS_ENTERPRISE.md
610
+ repo-template/
611
+ ```
612
+
613
+ ## Recommended usage
614
+
615
+ Install from the package:
616
+
617
+ ```bash
618
+ pnpm dlx @kal-elsam/kairo-runtime install
619
+ pnpm dlx @kal-elsam/kairo-runtime detect
620
+ pnpm dlx @kal-elsam/kairo-runtime install --scope=workspace --mode standard --adapters codex,cursor
621
+ pnpm dlx @kal-elsam/kairo-runtime init --mode enterprise --all-adapters
622
+ pnpm dlx @kal-elsam/kairo-runtime doctor
623
+ ```
624
+
625
+ Manual fallback for a new Cursor project (without the npm package):
626
+
627
+ 1. Open the project.
628
+ 2. Copy the contents of `prompts/HARNESS_INSTALLER_MASTER.md`.
629
+ 3. Paste it into Cursor.
630
+ 4. Specify the mode:
631
+
632
+ ```txt
633
+ Install the harness in standard mode.
634
+ ```
635
+
636
+ Or:
637
+
638
+ ```txt
639
+ Install the harness in enterprise mode because this project will have AI, API, DB, and external integrations.
640
+ ```
641
+
642
+ ## Modes
643
+
644
+ | Mode | Use case |
645
+ |---|---|
646
+ | minimal | scripts, technical spikes, landing pages, small prototypes |
647
+ | standard | real frontend/backend apps, simple SaaS, medium products |
648
+ | enterprise | AI agents, critical workflows, API/DB/auth/evals, multi-agent |
649
+
650
+ ## Publishing
651
+
652
+ Published on npm as `@kal-elsam/kairo-runtime`. Releases use **npm Trusted Publishing/OIDC** from GitHub Actions — no `NPM_TOKEN`.
653
+
654
+ Before tagging a new version:
655
+
656
+ ```bash
657
+ npm test
658
+ npm run smoke
659
+ npm pack --dry-run
660
+ ```
661
+
662
+ After the release commit, verify attribution was not added to the message:
663
+
664
+ ```bash
665
+ npm run release:check
666
+ git log -1 --format=%B
667
+ ```
668
+
669
+ CI also scans commit ranges for attribution trailers:
670
+
671
+ ```bash
672
+ npm run release:check -- --range origin/main...HEAD
673
+ ```
674
+
675
+ Release commits must **not** include `Co-authored-by` or other AI attribution
676
+ trailers. Do not rewrite published tags; ship a corrective patch version instead.
677
+
678
+ `npm run smoke` packs the current source into a tarball, installs it in a
679
+ throwaway temp project with a fake `HARNESS_HOME`, and exercises both scopes end
680
+ to end:
681
+
682
+ - **agent-global:** `setup --dry-run`, `status`, `install`, `doctor`, drift
683
+ simulation, `sync` repair, `backups`, rollback preview (no writes),
684
+ rollback apply (with safety backup), `uninstall`.
685
+ - **workspace:** `install --scope=workspace`, `doctor`, `update --dry-run`.
686
+
687
+ Release flow:
688
+
689
+ ```bash
690
+ # bump version in package.json and package-lock.json
691
+ git add .
692
+ git commit -m "chore: release 0.5.0"
693
+ npm run release:check
694
+ git tag v0.5.0
695
+ git push origin main
696
+ git push origin v0.5.0
697
+ ```
698
+
699
+ After npm publishes the tag, verify published provenance against git and the registry:
700
+
701
+ ```bash
702
+ git fetch --tags origin
703
+ git fetch origin main
704
+ npm run release:published -- --version 0.1.0
705
+ npm run smoke:registry -- --version 0.1.0
706
+ npm run smoke:installer -- --version 0.1.0
707
+ ```
708
+
709
+ `release:published` checks npm `version`, npm `gitHead`, local tag `v*`, remote tag on `origin`, and `origin/main`. Override the package with `--package @kal-elsam/kairo-runtime` when needed.
710
+
711
+ `smoke:registry` installs `@kal-elsam/kairo-runtime` from the npm registry (not the local tarball) into a throwaway workspace with a fake `HARNESS_HOME` and npm cache, then runs the recommended flow via `kairo`: `setup --dry-run`, `setup --yes`, `status`, drift simulation, `sync`, `status --json` (expects `overall=ok`), and `uninstall`. Use `latest` by default, pin with `--version x.y.z`, or override with `--package`.
712
+
713
+ `smoke:installer` validates the public one-liner path: `curl .../install.sh | sh` against GitHub `raw` and the npm registry with isolated `HARNESS_HOME`. Preview must not write `~/.harness`; `--yes --agents all` must reach `kairo status --json` with `overall=ok`, then `kairo uninstall` must remove managed sections. Pin with `--version x.y.z` after publish.
714
+
715
+ Suggested first publish tag: `kairo-runtime-v0.1.0` (or `v0.30.0` if you prefer repo version continuity).
716
+
717
+ The `publish.yml` workflow runs on `v*` tags and publishes to npm using the `npm-publish` environment.
718
+ It runs `npm run release:check` on `HEAD` immediately before `npm publish`.
719
+
720
+ See the full policy in `SECURITY.md`.
721
+
722
+ ## Base rule
723
+
724
+ The agent must not operate as a free-form programmer.
725
+
726
+ ```txt
727
+ Requirement
728
+ → Spec
729
+ → Plan
730
+ → Tests failing first
731
+ → Implementation
732
+ → Validation
733
+ → Review
734
+ → Human approval
735
+ ```
736
+
737
+ ## Gentle AI integration
738
+
739
+ After installing the harness in a repo, run:
740
+
741
+ ```bash
742
+ /sdd-init
743
+ gentle-ai skill-registry refresh
744
+ gentle-ai doctor
745
+ ```
746
+
747
+ `/sdd-init` detects stack and testing.
748
+ `skill-registry refresh` updates the skill registry.
749
+ `doctor` checks ecosystem health.
750
+
751
+ ## Engram/Graphify integration
752
+
753
+ This pack does not assume a specific implementation. It defines integration points in:
754
+
755
+ ```txt
756
+ docs/ai/context-graph.md
757
+ docs/ai/memory.md
758
+ docs/skills/context-graph.md
759
+ ```
760
+
761
+ The rule:
762
+
763
+ - The repo keeps the source of truth in Markdown.
764
+ - Engram can index decisions, specs, memory, and conventions.
765
+ - Graphify can build the architecture graph: modules, dependencies, features, and risks.
766
+ - No external memory replaces `AGENTS.md`, `docs/ai/`, or the code.
767
+
768
+ ## v2 — Universal-first, adapter-based
769
+
770
+ This version adds:
771
+
772
+ - `docs/ai/model-policy.md`
773
+ - `docs/ai/provider-routing.md`
774
+ - `docs/ai/tool-adapters.md`
775
+ - `docs/ai/context-budget.md`
776
+ - `docs/skills/model-selection.md`
777
+ - `docs/skills/tool-adapter-sync.md`
778
+ - Adapters for Codex, Claude, Gemini, GitHub Copilot, Cursor, and Gentle AI
779
+ - Codex skills: SDD, TDD, evals, checkpoint
780
+ - Claude agents/skills pointers
781
+ - Gemini pointer
782
+ - SDD subagents per phase
783
+ - Explicit policy for cost-efficient models such as DeepSeek
784
+
785
+ v2 principle:
786
+
787
+ ```txt
788
+ Universal core first.
789
+ Tool adapters second.
790
+ Model providers third.
791
+ ```
792
+
793
+ Cursor remains the primary editor, but not the source of truth.
794
+
795
+ ## v3 — Loop Engineering + OpenCode-first execution adapter
796
+
797
+ This version adds Loop Engineering as a formal harness layer and positions OpenCode + Gentle AI + DeepSeek as the primary execution adapter for this flow.
798
+
799
+ ```txt
800
+ OpenCode executes.
801
+ Gentle AI structures SDD/TDD.
802
+ DeepSeek iterates cheaply.
803
+ Harness governs.
804
+ Loops repair with boundaries.
805
+ Evals validate.
806
+ Graphify observes dependencies.
807
+ Engram preserves learning.
808
+ Human approves impact.
809
+ ```
810
+
811
+ New modules:
812
+
813
+ ```txt
814
+ docs/ai/loops.md
815
+ docs/ai/loop-policy.md
816
+ docs/ai/loop-observability.md
817
+ docs/ai/loop-log.md
818
+ docs/skills/loop-design.md
819
+ docs/skills/loop-debugging.md
820
+ docs/skills/loop-review.md
821
+ docs/skills/loop-retrospective.md
822
+ .opencode/
823
+ .gentle-ai/loops/
824
+ evals/loop-regression/
825
+ ```
826
+
827
+ ## v4 — Universal Adapter Parity
828
+
829
+ This version corrects the interpretation that the harness is OpenCode-based.
830
+
831
+ v4 rule:
832
+
833
+ ```txt
834
+ AGENTS.md governs.
835
+ docs/ai defines.
836
+ docs/skills operationalize.
837
+ docs/specs specify.
838
+ evals validate.
839
+ Adapters translate.
840
+ Models execute.
841
+ Humans approve impact.
842
+ ```
843
+
844
+ OpenCode may be the user's preferred runtime because Gentle AI + DeepSeek live there, but it has no higher authority than Cursor, Codex, Claude, Gemini, or Pi.
845
+
846
+ Key new document:
847
+
848
+ ```txt
849
+ docs/ai/adapter-parity.md
850
+ ```
851
+
852
+ New rule:
853
+
854
+ ```txt
855
+ No adapter is primary by authority.
856
+ An adapter can be primary only by workflow preference.
857
+ The core universal remains the governance layer.
858
+ ```
859
+
860
+ ## v5 — Enforcement-first Harness
861
+
862
+ This version moves the harness closer to a real control plane — beyond methodology and documentation.
863
+
864
+ ```txt
865
+ Docs guide.
866
+ Policies constrain.
867
+ CI gates enforce.
868
+ Evals measure.
869
+ Hooks block unsafe actions.
870
+ Trust policy protects skills/tools.
871
+ Installer manages lifecycle.
872
+ ```
873
+
874
+ New modules:
875
+
876
+ ```txt
877
+ docs/ai/enforcement.md
878
+ docs/ai/quality-gates.md
879
+ docs/ai/eval-strategy.md
880
+ docs/ai/trust-policy.md
881
+ docs/ai/installer-cli.md
882
+ docs/ai/observability-runtime.md
883
+ docs/ai/rollback-runtime.md
884
+ docs/ai/maintainability-gates.md
885
+ .github/workflows/harness-quality-gate.yml
886
+ .github/workflows/harness-security-gate.yml
887
+ .github/dependabot.yml
888
+ scripts/harness/
889
+ evals/golden/
890
+ evals/tool-calls/
891
+ evals/schema/
892
+ evals/regression/
893
+ ```
894
+
895
+ ## v6 — Spec Sizing and Complexity Classification
896
+
897
+ This version adds explicit feature/task spec sizing.
898
+
899
+ The harness already had installation modes:
900
+
901
+ ```txt
902
+ minimal
903
+ standard
904
+ enterprise
905
+ ```
906
+
907
+ But those describe harness installation size, not the complexity of a feature spec.
908
+
909
+ v6 adds:
910
+
911
+ ```txt
912
+ basic spec
913
+ standard spec
914
+ complex spec
915
+ ```
916
+
917
+ Rule:
918
+
919
+ ```txt
920
+ Do not force complex SDD on simple tasks.
921
+ Do not allow basic specs for high-impact work.
922
+ Spec complexity must match risk, ambiguity, architecture impact, testability and blast radius.
923
+ ```
924
+
925
+ New core files:
926
+
927
+ ```txt
928
+ docs/ai/spec-sizing.md
929
+ docs/ai/spec-intake.md
930
+ docs/ai/spec-escalation.md
931
+ docs/specs/templates/basic-spec.md
932
+ docs/specs/templates/standard-spec.md
933
+ docs/specs/templates/complex-spec.md
934
+ docs/skills/spec-complexity-classifier.md
935
+ docs/skills/spec-intake.md
936
+ docs/skills/spec-escalation-review.md
937
+ ```