@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
@@ -0,0 +1,11 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "npm"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ open-pull-requests-limit: 5
8
+ - package-ecosystem: "github-actions"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "weekly"
@@ -0,0 +1,11 @@
1
+ # Harness Instructions
2
+
3
+ Follow `AGENTS.md` as the universal source of truth.
4
+
5
+ For non-trivial changes:
6
+
7
+ 1. Create/update spec.
8
+ 2. Create tests/evals first.
9
+ 3. Implement minimum scope.
10
+ 4. Validate.
11
+ 5. Report risks.
@@ -0,0 +1,67 @@
1
+ name: Harness Quality Gate
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main, master]
7
+
8
+ jobs:
9
+ quality:
10
+ runs-on: ubuntu-latest
11
+ timeout-minutes: 20
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - name: Detect package manager
16
+ id: pm
17
+ shell: bash
18
+ run: |
19
+ if [ -f pnpm-lock.yaml ]; then echo "pm=pnpm" >> "$GITHUB_OUTPUT";
20
+ elif [ -f yarn.lock ]; then echo "pm=yarn" >> "$GITHUB_OUTPUT";
21
+ else echo "pm=npm" >> "$GITHUB_OUTPUT"; fi
22
+
23
+ - name: Setup Node
24
+ if: hashFiles('package.json') != ''
25
+ uses: actions/setup-node@v4
26
+ with:
27
+ node-version: 22
28
+ cache: ${{ steps.pm.outputs.pm }}
29
+
30
+ - name: Enable pnpm
31
+ if: steps.pm.outputs.pm == 'pnpm'
32
+ run: corepack enable
33
+
34
+ - name: Install dependencies
35
+ if: hashFiles('package.json') != ''
36
+ run: |
37
+ if [ "${{ steps.pm.outputs.pm }}" = "pnpm" ]; then pnpm install --frozen-lockfile; fi
38
+ if [ "${{ steps.pm.outputs.pm }}" = "yarn" ]; then yarn install --immutable || yarn install --frozen-lockfile; fi
39
+ if [ "${{ steps.pm.outputs.pm }}" = "npm" ]; then npm ci; fi
40
+
41
+ - name: Format check
42
+ if: hashFiles('package.json') != ''
43
+ run: npm run format:check --if-present
44
+
45
+ - name: Lint
46
+ if: hashFiles('package.json') != ''
47
+ run: npm run lint --if-present
48
+
49
+ - name: Typecheck
50
+ if: hashFiles('package.json') != ''
51
+ run: npm run typecheck --if-present
52
+
53
+ - name: Unit tests
54
+ if: hashFiles('package.json') != ''
55
+ run: npm test --if-present -- --runInBand
56
+
57
+ - name: Build
58
+ if: hashFiles('package.json') != ''
59
+ run: npm run build --if-present
60
+
61
+ - name: Harness doctor
62
+ run: |
63
+ if [ -f scripts/harness/doctor.mjs ]; then node scripts/harness/doctor.mjs; fi
64
+
65
+ - name: Harness evals
66
+ run: |
67
+ if [ -f scripts/harness/run-evals.mjs ]; then node scripts/harness/run-evals.mjs; fi
@@ -0,0 +1,32 @@
1
+ name: Harness Security Gate
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main, master]
7
+
8
+ permissions:
9
+ contents: read
10
+ security-events: write
11
+ pull-requests: read
12
+
13
+ jobs:
14
+ dependency-review:
15
+ if: github.event_name == 'pull_request'
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Dependency Review
20
+ uses: actions/dependency-review-action@v4
21
+ with:
22
+ fail-on-severity: moderate
23
+ deny-licenses: GPL-3.0, AGPL-3.0
24
+
25
+ secret-scan-basic:
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - name: Detect obvious secrets
30
+ shell: bash
31
+ run: |
32
+ ! grep -RInE "(sk-[A-Za-z0-9_-]{20,}|api[_-]?key\s*=|secret\s*=|password\s*=)" --exclude-dir=.git --exclude-dir=node_modules --exclude-dir=.next --exclude-dir=dist . || (echo "Potential secret detected" && exit 1)
@@ -0,0 +1,33 @@
1
+ {
2
+ "levels": {
3
+ "basic": {
4
+ "score": "0-3",
5
+ "description": "Low-risk localized work"
6
+ },
7
+ "standard": {
8
+ "score": "4-9",
9
+ "description": "Normal feature/change"
10
+ },
11
+ "complex": {
12
+ "score": "10+",
13
+ "description": "High-risk, architectural, cross-system or critical work"
14
+ }
15
+ },
16
+ "hardTriggers": [
17
+ "auth",
18
+ "authorization",
19
+ "payments",
20
+ "billing",
21
+ "secrets",
22
+ "production database migration",
23
+ "destructive data changes",
24
+ "infrastructure",
25
+ "CI/CD release gates",
26
+ "production AI behavior",
27
+ "MCP/tool permissions",
28
+ "cross-service contracts",
29
+ "architecture boundaries",
30
+ "compliance/legal/privacy",
31
+ "hard rollback"
32
+ ]
33
+ }
@@ -0,0 +1,71 @@
1
+ # OpenCode Adapter
2
+
3
+ OpenCode es el runtime principal recomendado para este harness cuando se usa Gentle AI + DeepSeek.
4
+
5
+ ## Rol
6
+
7
+ ```txt
8
+ OpenCode executes.
9
+ Gentle AI structures SDD/TDD.
10
+ DeepSeek iterates cheaply.
11
+ Harness governs.
12
+ Loops repair with boundaries.
13
+ ```
14
+
15
+ ## Uso
16
+
17
+ Desde la raíz del proyecto:
18
+
19
+ ```bash
20
+ opencode
21
+ ```
22
+
23
+ Inicialización recomendada:
24
+
25
+ ```txt
26
+ /init
27
+ ```
28
+
29
+ Si `AGENTS.md` ya existe, no dejes que OpenCode lo sobrescriba sin revisar. El core universal del repo gana.
30
+
31
+ ## Fuente de verdad
32
+
33
+ - `AGENTS.md`
34
+ - `docs/ai/`
35
+ - `docs/skills/`
36
+ - `docs/specs/`
37
+ - `evals/`
38
+
39
+ ## Agentes
40
+
41
+ Agentes por proyecto viven en:
42
+
43
+ ```txt
44
+ .opencode/agents/
45
+ ```
46
+
47
+ Usa `@agent-name` para invocarlos manualmente cuando aplique.
48
+
49
+ ## Loops
50
+
51
+ Loop definitions viven en:
52
+
53
+ ```txt
54
+ .opencode/loops/
55
+ .gentle-ai/loops/
56
+ ```
57
+
58
+ ## Governance clarification
59
+
60
+ OpenCode is workflow-primary for this user's current setup.
61
+
62
+ OpenCode is not governance-primary.
63
+
64
+ ```txt
65
+ AGENTS.md governs.
66
+ OpenCode executes.
67
+ Gentle AI structures.
68
+ DeepSeek iterates cheaply.
69
+ ```
70
+
71
+ If `.opencode/` conflicts with `AGENTS.md`, update `.opencode/`.
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Reviews whether OpenCode remains an adapter and does not override the universal core.
3
+ mode: subagent
4
+ temperature: 0.1
5
+ permission:
6
+ edit: deny
7
+ bash: deny
8
+ ---
9
+
10
+ # adapter-parity-reviewer
11
+
12
+ ## Source of truth
13
+
14
+ - `AGENTS.md`
15
+ - `docs/ai/adapter-parity.md`
16
+ - `docs/ai/governance.md`
17
+ - `docs/ai/tool-adapters.md`
18
+
19
+ ## Rules
20
+
21
+ - OpenCode is workflow-primary, not governance-primary.
22
+ - Do not modify files.
23
+ - Report conflicts and missing parity.
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: Reviews architecture, boundaries, ADRs and high-impact design.
3
+ mode: subagent
4
+ temperature: 0.1
5
+ permission:
6
+ edit: deny
7
+ bash: deny
8
+ ---
9
+
10
+ # architect
11
+
12
+ ## Source of truth
13
+
14
+ - `AGENTS.md`
15
+ - `docs/ai/harness.md`
16
+ - `docs/ai/loops.md`
17
+ - `docs/ai/loop-policy.md`
18
+ - `docs/ai/provider-routing.md`
19
+
20
+ ## Rules
21
+
22
+ - Respect context budget.
23
+ - Do not exceed loop boundaries.
24
+ - Do not approve critical impact.
25
+ - Escalate after repeated failures.
26
+ - Report files, tests, evals, risks and next action.
27
+
28
+ ## Output
29
+
30
+ ```txt
31
+ Agent:
32
+ Context:
33
+ Decision:
34
+ Validation:
35
+ Risks:
36
+ Escalation:
37
+ Next action:
38
+ ```
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: Runs final review/checkpoint without applying changes.
3
+ mode: subagent
4
+ temperature: 0.1
5
+ permission:
6
+ edit: deny
7
+ bash: deny
8
+ ---
9
+
10
+ # checkpoint-reviewer
11
+
12
+ ## Source of truth
13
+
14
+ - `AGENTS.md`
15
+ - `docs/ai/harness.md`
16
+ - `docs/ai/loops.md`
17
+ - `docs/ai/loop-policy.md`
18
+ - `docs/ai/provider-routing.md`
19
+
20
+ ## Rules
21
+
22
+ - Respect context budget.
23
+ - Do not exceed loop boundaries.
24
+ - Do not approve critical impact.
25
+ - Escalate after repeated failures.
26
+ - Report files, tests, evals, risks and next action.
27
+
28
+ ## Output
29
+
30
+ ```txt
31
+ Agent:
32
+ Context:
33
+ Decision:
34
+ Validation:
35
+ Risks:
36
+ Escalation:
37
+ Next action:
38
+ ```
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: Creates and reviews AI evals for prompts, agents, tool calling and RAG.
3
+ mode: subagent
4
+ temperature: 0.1
5
+ permission:
6
+ edit: ask
7
+ bash: ask
8
+ ---
9
+
10
+ # eval-engineer
11
+
12
+ ## Source of truth
13
+
14
+ - `AGENTS.md`
15
+ - `docs/ai/harness.md`
16
+ - `docs/ai/loops.md`
17
+ - `docs/ai/loop-policy.md`
18
+ - `docs/ai/provider-routing.md`
19
+
20
+ ## Rules
21
+
22
+ - Respect context budget.
23
+ - Do not exceed loop boundaries.
24
+ - Do not approve critical impact.
25
+ - Escalate after repeated failures.
26
+ - Report files, tests, evals, risks and next action.
27
+
28
+ ## Output
29
+
30
+ ```txt
31
+ Agent:
32
+ Context:
33
+ Decision:
34
+ Validation:
35
+ Risks:
36
+ Escalation:
37
+ Next action:
38
+ ```
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: Controls bounded repair/validation loops and escalates when limits are reached.
3
+ mode: subagent
4
+ temperature: 0.1
5
+ permission:
6
+ edit: ask
7
+ bash: ask
8
+ ---
9
+
10
+ # loop-controller
11
+
12
+ ## Source of truth
13
+
14
+ - `AGENTS.md`
15
+ - `docs/ai/harness.md`
16
+ - `docs/ai/loops.md`
17
+ - `docs/ai/loop-policy.md`
18
+ - `docs/ai/provider-routing.md`
19
+
20
+ ## Rules
21
+
22
+ - Respect context budget.
23
+ - Do not exceed loop boundaries.
24
+ - Do not approve critical impact.
25
+ - Escalate after repeated failures.
26
+ - Report files, tests, evals, risks and next action.
27
+
28
+ ## Output
29
+
30
+ ```txt
31
+ Agent:
32
+ Context:
33
+ Decision:
34
+ Validation:
35
+ Risks:
36
+ Escalation:
37
+ Next action:
38
+ ```
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: Diagnoses loops that fail, repeat or do not converge.
3
+ mode: subagent
4
+ temperature: 0.1
5
+ permission:
6
+ edit: ask
7
+ bash: ask
8
+ ---
9
+
10
+ # loop-debugger
11
+
12
+ ## Source of truth
13
+
14
+ - `AGENTS.md`
15
+ - `docs/ai/harness.md`
16
+ - `docs/ai/loops.md`
17
+ - `docs/ai/loop-policy.md`
18
+ - `docs/ai/provider-routing.md`
19
+
20
+ ## Rules
21
+
22
+ - Respect context budget.
23
+ - Do not exceed loop boundaries.
24
+ - Do not approve critical impact.
25
+ - Escalate after repeated failures.
26
+ - Report files, tests, evals, risks and next action.
27
+
28
+ ## Output
29
+
30
+ ```txt
31
+ Agent:
32
+ Context:
33
+ Decision:
34
+ Validation:
35
+ Risks:
36
+ Escalation:
37
+ Next action:
38
+ ```
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: Selects economic vs strong model according to provider routing.
3
+ mode: subagent
4
+ temperature: 0.1
5
+ permission:
6
+ edit: deny
7
+ bash: deny
8
+ ---
9
+
10
+ # model-router
11
+
12
+ ## Source of truth
13
+
14
+ - `AGENTS.md`
15
+ - `docs/ai/harness.md`
16
+ - `docs/ai/loops.md`
17
+ - `docs/ai/loop-policy.md`
18
+ - `docs/ai/provider-routing.md`
19
+
20
+ ## Rules
21
+
22
+ - Respect context budget.
23
+ - Do not exceed loop boundaries.
24
+ - Do not approve critical impact.
25
+ - Escalate after repeated failures.
26
+ - Report files, tests, evals, risks and next action.
27
+
28
+ ## Output
29
+
30
+ ```txt
31
+ Agent:
32
+ Context:
33
+ Decision:
34
+ Validation:
35
+ Risks:
36
+ Escalation:
37
+ Next action:
38
+ ```
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: Coordinates SDD flow with bounded loops.
3
+ mode: subagent
4
+ temperature: 0.1
5
+ permission:
6
+ edit: ask
7
+ bash: ask
8
+ ---
9
+
10
+ # sdd-orchestrator
11
+
12
+ ## Source of truth
13
+
14
+ - `AGENTS.md`
15
+ - `docs/ai/harness.md`
16
+ - `docs/ai/loops.md`
17
+ - `docs/ai/loop-policy.md`
18
+ - `docs/ai/provider-routing.md`
19
+
20
+ ## Rules
21
+
22
+ - Respect context budget.
23
+ - Do not exceed loop boundaries.
24
+ - Do not approve critical impact.
25
+ - Escalate after repeated failures.
26
+ - Report files, tests, evals, risks and next action.
27
+
28
+ ## Output
29
+
30
+ ```txt
31
+ Agent:
32
+ Context:
33
+ Decision:
34
+ Validation:
35
+ Risks:
36
+ Escalation:
37
+ Next action:
38
+ ```
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: Reviews SDD specs for ambiguity, contradictions and scope creep.
3
+ mode: subagent
4
+ temperature: 0.1
5
+ permission:
6
+ edit: deny
7
+ bash: deny
8
+ ---
9
+
10
+ # sdd-spec-reviewer
11
+
12
+ ## Source of truth
13
+
14
+ - `AGENTS.md`
15
+ - `docs/ai/harness.md`
16
+ - `docs/ai/loops.md`
17
+ - `docs/ai/loop-policy.md`
18
+ - `docs/ai/provider-routing.md`
19
+
20
+ ## Rules
21
+
22
+ - Respect context budget.
23
+ - Do not exceed loop boundaries.
24
+ - Do not approve critical impact.
25
+ - Escalate after repeated failures.
26
+ - Report files, tests, evals, risks and next action.
27
+
28
+ ## Output
29
+
30
+ ```txt
31
+ Agent:
32
+ Context:
33
+ Decision:
34
+ Validation:
35
+ Risks:
36
+ Escalation:
37
+ Next action:
38
+ ```
@@ -0,0 +1,19 @@
1
+ ---
2
+ description: Classifies task complexity and chooses basic, standard or complex spec.
3
+ mode: subagent
4
+ temperature: 0.1
5
+ permission:
6
+ edit: ask
7
+ bash: deny
8
+ ---
9
+
10
+ # spec-intake-analyst
11
+
12
+ Read:
13
+
14
+ - `docs/ai/spec-sizing.md`
15
+ - `docs/ai/spec-intake.md`
16
+ - `docs/skills/spec-complexity-classifier.md`
17
+
18
+ Create or recommend the right spec template.
19
+ Do not implement application code.
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: Creates failing tests first and validates behavior.
3
+ mode: subagent
4
+ temperature: 0.1
5
+ permission:
6
+ edit: ask
7
+ bash: ask
8
+ ---
9
+
10
+ # tdd-engineer
11
+
12
+ ## Source of truth
13
+
14
+ - `AGENTS.md`
15
+ - `docs/ai/harness.md`
16
+ - `docs/ai/loops.md`
17
+ - `docs/ai/loop-policy.md`
18
+ - `docs/ai/provider-routing.md`
19
+
20
+ ## Rules
21
+
22
+ - Respect context budget.
23
+ - Do not exceed loop boundaries.
24
+ - Do not approve critical impact.
25
+ - Escalate after repeated failures.
26
+ - Report files, tests, evals, risks and next action.
27
+
28
+ ## Output
29
+
30
+ ```txt
31
+ Agent:
32
+ Context:
33
+ Decision:
34
+ Validation:
35
+ Risks:
36
+ Escalation:
37
+ Next action:
38
+ ```
@@ -0,0 +1,3 @@
1
+ # checkpoint
2
+
3
+ Read AGENTS.md and the relevant docs/ai enforcement documents. Execute this workflow without overriding the universal core.
@@ -0,0 +1,3 @@
1
+ # eval-design
2
+
3
+ Read AGENTS.md and the relevant docs/ai enforcement documents. Execute this workflow without overriding the universal core.
@@ -0,0 +1,3 @@
1
+ # maintainability-review
2
+
3
+ Read AGENTS.md and the relevant docs/ai enforcement documents. Execute this workflow without overriding the universal core.
@@ -0,0 +1,3 @@
1
+ # quality-gate
2
+
3
+ Read AGENTS.md and the relevant docs/ai enforcement documents. Execute this workflow without overriding the universal core.
@@ -0,0 +1,9 @@
1
+ # spec-escalate
2
+
3
+ Review whether the current spec must be upgraded.
4
+
5
+ Read:
6
+
7
+ - `docs/skills/spec-escalation-review.md`
8
+
9
+ Stop implementation if risk exceeds the current spec level.
@@ -0,0 +1,10 @@
1
+ # spec-intake
2
+
3
+ Run spec intake and create the right spec template.
4
+
5
+ Read:
6
+
7
+ - `docs/skills/spec-intake.md`
8
+ - `docs/skills/spec-complexity-classifier.md`
9
+
10
+ Do not implement yet.
@@ -0,0 +1,21 @@
1
+ # spec-size
2
+
3
+ Classify the requested task as basic, standard or complex.
4
+
5
+ Read:
6
+
7
+ - `docs/ai/spec-sizing.md`
8
+ - `docs/ai/spec-intake.md`
9
+ - `docs/ai/spec-escalation.md`
10
+
11
+ Return:
12
+
13
+ ```txt
14
+ Spec level:
15
+ Score:
16
+ Hard triggers:
17
+ Reason:
18
+ Template:
19
+ Validation:
20
+ Approval:
21
+ ```
@@ -0,0 +1,3 @@
1
+ # trust-review
2
+
3
+ Read AGENTS.md and the relevant docs/ai enforcement documents. Execute this workflow without overriding the universal core.