devrites 3.0.6 → 3.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 (472) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +67 -45
  3. package/SECURITY.md +31 -29
  4. package/docs/adr/0001-go-engine-as-control-plane.md +1 -1
  5. package/docs/adr/0002-dual-host-harness.md +1 -1
  6. package/docs/adr/0004-state-schema-phases-sections.md +1 -2
  7. package/docs/adr/0006-clock-seam-and-engine-ci-gates.md +3 -4
  8. package/docs/adr/0009-prebuild-decision-coverage-and-readiness.md +67 -0
  9. package/docs/adr/0010-agent-first-fresh-context-orchestration.md +71 -0
  10. package/docs/adr/0011-define-plan-transition-rights.md +28 -0
  11. package/docs/adr/README.md +3 -0
  12. package/docs/agents/triage-labels.md +7 -7
  13. package/docs/architecture.md +157 -140
  14. package/docs/cli.md +41 -12
  15. package/docs/command-map.md +49 -35
  16. package/docs/engine/agent-contract.md +92 -15
  17. package/docs/engine/commands.md +242 -72
  18. package/docs/engine/state-schema.md +52 -23
  19. package/docs/engine/workspace-schema.md +94 -15
  20. package/docs/extensions.md +1 -1
  21. package/docs/flow.md +80 -50
  22. package/docs/harness-compliance.md +29 -5
  23. package/docs/orchestration.md +107 -79
  24. package/docs/quick-reference.md +7 -3
  25. package/docs/release.md +4 -3
  26. package/docs/skills.md +64 -38
  27. package/docs/usage.md +57 -38
  28. package/engine/cmd/releasepack/main.go +219 -0
  29. package/engine/cmd/releasepack/main_test.go +170 -0
  30. package/engine/commands.go +170 -23
  31. package/engine/git_guard.go +187 -0
  32. package/engine/git_guard_test.go +283 -0
  33. package/engine/hookpolicy.go +53 -55
  34. package/engine/hookpolicy_test.go +91 -1
  35. package/engine/hooks.go +296 -75
  36. package/engine/hooks_events_test.go +276 -6
  37. package/engine/hooks_workspace.go +640 -159
  38. package/engine/internal/devritespaths/paths.go +65 -10
  39. package/engine/internal/devritespaths/paths_test.go +110 -0
  40. package/engine/internal/doctor/doctor.go +153 -23
  41. package/engine/internal/doctor/doctor_test.go +74 -0
  42. package/engine/internal/forge/forge.go +940 -0
  43. package/engine/internal/forge/forge_test.go +576 -0
  44. package/engine/internal/forge/git.go +245 -0
  45. package/engine/internal/forge/liveness_unix.go +48 -0
  46. package/engine/internal/forge/liveness_windows.go +67 -0
  47. package/engine/internal/forge/manifest.go +402 -0
  48. package/engine/internal/gate/gate.go +90 -71
  49. package/engine/internal/gate/gate_test.go +71 -2
  50. package/engine/internal/harness/compliance.go +18 -24
  51. package/engine/internal/harness/harness.go +37 -44
  52. package/engine/internal/harness/harness_test.go +21 -5
  53. package/engine/internal/install/install.go +575 -58
  54. package/engine/internal/install/install_test.go +490 -9
  55. package/engine/internal/iohooks/iohooks.go +350 -59
  56. package/engine/internal/iohooks/iohooks_test.go +421 -1
  57. package/engine/internal/lib/buildreadiness.go +35 -18
  58. package/engine/internal/lib/clarifyreturn.go +91 -0
  59. package/engine/internal/lib/clarifyreturn_test.go +123 -0
  60. package/engine/internal/lib/context.go +54 -15
  61. package/engine/internal/lib/cursor_compat_test.go +8 -0
  62. package/engine/internal/lib/extensions.go +2 -3
  63. package/engine/internal/lib/gitauthority.go +601 -0
  64. package/engine/internal/lib/gitauthority_test.go +346 -0
  65. package/engine/internal/lib/jsonout.go +25 -11
  66. package/engine/internal/lib/jsonout_test.go +16 -0
  67. package/engine/internal/lib/lanes.go +14 -8
  68. package/engine/internal/lib/observability_test.go +358 -0
  69. package/engine/internal/lib/packageexistence.go +151 -35
  70. package/engine/internal/lib/packageexistence_test.go +163 -0
  71. package/engine/internal/lib/progress.go +11 -9
  72. package/engine/internal/lib/provenance.go +462 -0
  73. package/engine/internal/lib/provenance_test.go +154 -0
  74. package/engine/internal/lib/readiness_contract.json +111 -0
  75. package/engine/internal/lib/readinessartifact.go +510 -0
  76. package/engine/internal/lib/readinessartifact_test.go +321 -0
  77. package/engine/internal/lib/reconcile.go +712 -88
  78. package/engine/internal/lib/reconcile_test.go +335 -16
  79. package/engine/internal/lib/recoveryattempts.go +298 -0
  80. package/engine/internal/lib/recoveryattempts_test.go +215 -0
  81. package/engine/internal/lib/resolve.go +23 -19
  82. package/engine/internal/lib/runbook_context_test.go +20 -0
  83. package/engine/internal/lib/session.go +701 -9
  84. package/engine/internal/lib/session_test.go +80 -13
  85. package/engine/internal/lib/testintegrity.go +33 -37
  86. package/engine/internal/lib/testintegrity_test.go +63 -1
  87. package/engine/internal/migrate/migrate.go +81 -1
  88. package/engine/internal/migrate/migrate_test.go +22 -1
  89. package/engine/internal/reason/reason.go +180 -0
  90. package/engine/internal/reason/reason_test.go +35 -0
  91. package/engine/internal/rootfacts/facts.go +466 -0
  92. package/engine/internal/rootfacts/facts_test.go +306 -0
  93. package/engine/internal/safepath/safepath.go +55 -0
  94. package/engine/internal/safepath/safepath_test.go +69 -0
  95. package/engine/internal/safepath/safepath_windows_test.go +26 -0
  96. package/engine/internal/state/clarify_transition.go +165 -0
  97. package/engine/internal/state/clarify_transition_test.go +130 -0
  98. package/engine/internal/state/cmd/workflowmanifest/main.go +12 -8
  99. package/engine/internal/state/cursor.go +58 -0
  100. package/engine/internal/state/cursor_test.go +42 -1
  101. package/engine/internal/state/feature.go +35 -48
  102. package/engine/internal/state/schema.go +90 -37
  103. package/engine/internal/state/snapshot.go +18 -2
  104. package/engine/internal/state/state_test.go +187 -7
  105. package/engine/internal/state/status.go +48 -11
  106. package/engine/internal/state/workflow_manifest.json +231 -50
  107. package/engine/internal/toolpolicy/classifier.go +533 -0
  108. package/engine/internal/toolpolicy/classifier_test.go +424 -0
  109. package/engine/internal/toolpolicy/git.go +616 -0
  110. package/engine/internal/toolpolicy/scanner.go +382 -0
  111. package/engine/main.go +160 -77
  112. package/engine/observability_cli_test.go +52 -0
  113. package/engine/root_routing_test.go +277 -0
  114. package/engine/testdata/golden/TestParityBuildReadiness/arg=approved.golden +1 -1
  115. package/engine/testdata/golden/TestParityBuildReadiness/arg=emptystatus.golden +1 -1
  116. package/engine/testdata/golden/TestParityBuildReadiness/arg=noclarify.golden +1 -0
  117. package/engine/testdata/golden/TestParityBuildReadiness/arg=novet.golden +1 -0
  118. package/engine/testdata/golden/TestParityBuildReadiness/arg=stalevet.golden +1 -0
  119. package/engine/testdata/golden/TestParityBuildReadiness/arg=trailhash.golden +1 -1
  120. package/engine/testdata/golden/TestParityBuildReadiness/arg=trailpipe.golden +1 -1
  121. package/engine/testdata/golden/TestParityBuildReadiness/arg=vetnotready.golden +1 -0
  122. package/engine/testdata/golden/TestParityProgress/arg=allbuilt.golden +1 -1
  123. package/engine/testdata/golden/TestParityProgress/arg=done.golden +1 -1
  124. package/engine/testdata/golden/TestParityProgress/arg=mid.golden +1 -1
  125. package/engine/testdata/golden/TestParityProgress/arg=nophase.golden +1 -1
  126. package/engine/testdata/golden/TestParityProgress/arg=noslice.golden +1 -1
  127. package/engine/testdata/golden/TestParityProgress/arg=plan.golden +1 -1
  128. package/engine/testdata/golden/TestParityProgress/arg=seal.golden +1 -1
  129. package/engine/testdata/golden/TestParityReconcile/check-clean.golden +1 -1
  130. package/engine/testdata/golden/TestParityReconcile/inline-fallback.golden +1 -0
  131. package/engine/testdata/golden/TestParityReconcile/snapshot-no-allowlist.golden +1 -0
  132. package/engine/testdata/golden/TestParityWrightScope/devrites-edit-denied.golden +2 -0
  133. package/engine/testdata/golden/TestParityWrightScope/out-of-scope-enforce-denies.golden +1 -1
  134. package/engine/tests/adr_0011_define_plan_test.go +30 -0
  135. package/engine/tests/budget_test.go +19 -8
  136. package/engine/tests/concurrency_cli_test.go +7 -1
  137. package/engine/tests/doctor_cli_test.go +148 -2
  138. package/engine/tests/forge_cli_test.go +463 -0
  139. package/engine/tests/gate_test.go +63 -8
  140. package/engine/tests/hook_test.go +260 -8
  141. package/engine/tests/hooks_io_test.go +94 -3
  142. package/engine/tests/json_contract_test.go +127 -2
  143. package/engine/tests/migrate_cli_test.go +2 -2
  144. package/engine/tests/parity_buildreadiness_test.go +141 -10
  145. package/engine/tests/parity_learnings_test.go +16 -17
  146. package/engine/tests/parity_reconcile_test.go +20 -17
  147. package/engine/tests/parity_resolve_test.go +12 -11
  148. package/engine/tests/parity_test.go +21 -17
  149. package/pack/.claude/agents/devrites-code-reviewer.md +62 -48
  150. package/pack/.claude/agents/devrites-devex-reviewer.md +69 -53
  151. package/pack/.claude/agents/devrites-doubt-reviewer.md +29 -22
  152. package/pack/.claude/agents/devrites-evidence-scout.md +69 -0
  153. package/pack/.claude/agents/devrites-forge-judge.md +74 -61
  154. package/pack/.claude/agents/devrites-frontend-reviewer.md +48 -39
  155. package/pack/.claude/agents/devrites-performance-reviewer.md +49 -40
  156. package/pack/.claude/agents/devrites-plan-drafter.md +71 -0
  157. package/pack/.claude/agents/devrites-plan-reviewer.md +80 -47
  158. package/pack/.claude/agents/devrites-proof-runner.md +74 -0
  159. package/pack/.claude/agents/devrites-retrospector.md +48 -45
  160. package/pack/.claude/agents/devrites-security-auditor.md +46 -36
  161. package/pack/.claude/agents/devrites-simplifier-reviewer.md +50 -46
  162. package/pack/.claude/agents/devrites-slice-wright.md +153 -165
  163. package/pack/.claude/agents/devrites-spec-reviewer.md +34 -32
  164. package/pack/.claude/agents/devrites-strategy-reviewer.md +63 -34
  165. package/pack/.claude/agents/devrites-test-analyst.md +40 -30
  166. package/pack/.claude/settings.json +2 -1
  167. package/pack/.claude/skills/devrites-audit/SKILL.md +40 -61
  168. package/pack/.claude/skills/devrites-debug-recovery/SKILL.md +24 -13
  169. package/pack/.claude/skills/devrites-debug-recovery/reference/build-the-loop.md +24 -21
  170. package/pack/.claude/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +34 -6
  171. package/pack/.claude/skills/devrites-debug-recovery/reference/instrumentation.md +2 -2
  172. package/pack/.claude/skills/devrites-doubt/SKILL.md +25 -17
  173. package/pack/.claude/skills/devrites-interview/SKILL.md +53 -52
  174. package/pack/.claude/skills/devrites-lib/SKILL.md +11 -9
  175. package/pack/.claude/skills/devrites-lib/reference/intent-map.md +3 -2
  176. package/pack/.claude/skills/devrites-lib/reference/parallel-dispatch.md +82 -137
  177. package/pack/.claude/skills/devrites-lib/reference/reply-contract.md +8 -1
  178. package/pack/.claude/skills/devrites-lib/reference/standards/README.md +38 -55
  179. package/pack/.claude/skills/devrites-lib/reference/standards/afk-hitl.md +53 -27
  180. package/pack/.claude/skills/devrites-lib/reference/standards/agents.md +198 -190
  181. package/pack/.claude/skills/devrites-lib/reference/standards/anti-patterns.md +5 -15
  182. package/pack/.claude/skills/devrites-lib/reference/standards/ci-cd.md +27 -58
  183. package/pack/.claude/skills/devrites-lib/reference/standards/code-review.md +16 -52
  184. package/pack/.claude/skills/devrites-lib/reference/standards/coding-style.md +2 -10
  185. package/pack/.claude/skills/devrites-lib/reference/standards/context-hygiene.md +18 -61
  186. package/pack/.claude/skills/devrites-lib/reference/standards/core.md +23 -18
  187. package/pack/.claude/skills/devrites-lib/reference/standards/deprecation.md +17 -57
  188. package/pack/.claude/skills/devrites-lib/reference/standards/development-workflow.md +4 -33
  189. package/pack/.claude/skills/devrites-lib/reference/standards/git-workflow.md +4 -20
  190. package/pack/.claude/skills/devrites-lib/reference/standards/hooks.md +3 -14
  191. package/pack/.claude/skills/devrites-lib/reference/standards/patterns.md +9 -25
  192. package/pack/.claude/skills/devrites-lib/reference/standards/performance.md +0 -9
  193. package/pack/.claude/skills/devrites-lib/reference/standards/principles.md +1 -3
  194. package/pack/.claude/skills/devrites-lib/reference/standards/security.md +17 -7
  195. package/pack/.claude/skills/devrites-lib/reference/standards/testing.md +1 -27
  196. package/pack/.claude/skills/devrites-lib/reference/standards/tooling.md +46 -50
  197. package/pack/.claude/skills/devrites-lib/reference/workspace-artifact-schema.md +23 -10
  198. package/pack/.claude/skills/devrites-source-driven/SKILL.md +23 -22
  199. package/pack/.claude/skills/rite/SKILL.md +8 -6
  200. package/pack/.claude/skills/rite/reference/menu.md +8 -6
  201. package/pack/.claude/skills/rite-adopt/SKILL.md +33 -37
  202. package/pack/.claude/skills/rite-autocomplete/SKILL.md +33 -28
  203. package/pack/.claude/skills/rite-autocomplete/reference/loop.md +21 -21
  204. package/pack/.claude/skills/rite-autocomplete/reference/stop-conditions.md +15 -6
  205. package/pack/.claude/skills/rite-build/SKILL.md +35 -30
  206. package/pack/.claude/skills/rite-build/reference/afk-discipline.md +38 -38
  207. package/pack/.claude/skills/rite-build/reference/evidence-standard.md +10 -0
  208. package/pack/.claude/skills/rite-build/reference/forge.md +186 -156
  209. package/pack/.claude/skills/rite-build/reference/one-slice-cycle.md +4 -3
  210. package/pack/.claude/skills/rite-build/reference/phase-contract.md +96 -175
  211. package/pack/.claude/skills/rite-build/reference/wright-dispatch.md +129 -134
  212. package/pack/.claude/skills/rite-clarify/SKILL.md +89 -0
  213. package/pack/.claude/skills/rite-clarify/reference/decision-coverage.md +59 -0
  214. package/pack/.claude/skills/rite-converge/SKILL.md +35 -25
  215. package/pack/.claude/skills/rite-define/SKILL.md +57 -32
  216. package/pack/.claude/skills/rite-define/reference/gates.md +16 -15
  217. package/pack/.claude/skills/rite-define/reference/plan-template.md +16 -8
  218. package/pack/.claude/skills/rite-frame/reference/failure-modes.md +22 -24
  219. package/pack/.claude/skills/rite-plan/SKILL.md +44 -16
  220. package/pack/.claude/skills/rite-plan/reference/task-breakdown.md +4 -0
  221. package/pack/.claude/skills/rite-polish/SKILL.md +27 -23
  222. package/pack/.claude/skills/rite-prototype/SKILL.md +25 -26
  223. package/pack/.claude/skills/rite-prove/SKILL.md +27 -17
  224. package/pack/.claude/skills/rite-resolve/SKILL.md +12 -11
  225. package/pack/.claude/skills/rite-resolve/reference/answer-protocol.md +3 -0
  226. package/pack/.claude/skills/rite-review/SKILL.md +37 -28
  227. package/pack/.claude/skills/rite-seal/reference/phase-contract.md +27 -92
  228. package/pack/.claude/skills/rite-seal/reference/risk-and-rollback.md +13 -0
  229. package/pack/.claude/skills/rite-ship/reference/design-memory.md +31 -36
  230. package/pack/.claude/skills/rite-spec/SKILL.md +84 -135
  231. package/pack/.claude/skills/rite-spec/reference/investigation.md +37 -33
  232. package/pack/.claude/skills/rite-spec/reference/question-protocol.md +6 -2
  233. package/pack/.claude/skills/rite-spec/reference/spec-checklists.md +25 -24
  234. package/pack/.claude/skills/rite-spec/reference/spec-template.md +9 -2
  235. package/pack/.claude/skills/rite-spec/reference/state-workspace.md +13 -3
  236. package/pack/.claude/skills/rite-temper/SKILL.md +62 -47
  237. package/pack/.claude/skills/rite-temper/reference/review-dimensions.md +24 -22
  238. package/pack/.claude/skills/rite-vet/SKILL.md +110 -113
  239. package/pack/.claude/skills/rite-vet/reference/artifacts.md +42 -9
  240. package/pack/.claude/skills/rite-vet/reference/review-axes.md +39 -37
  241. package/pack/generated/claude/agents/devrites-code-reviewer.md +62 -48
  242. package/pack/generated/claude/agents/devrites-devex-reviewer.md +69 -53
  243. package/pack/generated/claude/agents/devrites-doubt-reviewer.md +29 -22
  244. package/pack/generated/claude/agents/devrites-evidence-scout.md +69 -0
  245. package/pack/generated/claude/agents/devrites-forge-judge.md +74 -61
  246. package/pack/generated/claude/agents/devrites-frontend-reviewer.md +48 -39
  247. package/pack/generated/claude/agents/devrites-performance-reviewer.md +49 -40
  248. package/pack/generated/claude/agents/devrites-plan-drafter.md +71 -0
  249. package/pack/generated/claude/agents/devrites-plan-reviewer.md +80 -47
  250. package/pack/generated/claude/agents/devrites-proof-runner.md +74 -0
  251. package/pack/generated/claude/agents/devrites-retrospector.md +48 -45
  252. package/pack/generated/claude/agents/devrites-security-auditor.md +46 -36
  253. package/pack/generated/claude/agents/devrites-simplifier-reviewer.md +50 -46
  254. package/pack/generated/claude/agents/devrites-slice-wright.md +153 -165
  255. package/pack/generated/claude/agents/devrites-spec-reviewer.md +34 -32
  256. package/pack/generated/claude/agents/devrites-strategy-reviewer.md +63 -34
  257. package/pack/generated/claude/agents/devrites-test-analyst.md +40 -30
  258. package/pack/generated/claude/settings.json +2 -1
  259. package/pack/generated/claude/skills/devrites-audit/SKILL.md +40 -61
  260. package/pack/generated/claude/skills/devrites-debug-recovery/SKILL.md +24 -13
  261. package/pack/generated/claude/skills/devrites-debug-recovery/reference/build-the-loop.md +24 -21
  262. package/pack/generated/claude/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +34 -6
  263. package/pack/generated/claude/skills/devrites-debug-recovery/reference/instrumentation.md +2 -2
  264. package/pack/generated/claude/skills/devrites-doubt/SKILL.md +25 -17
  265. package/pack/generated/claude/skills/devrites-interview/SKILL.md +53 -52
  266. package/pack/generated/claude/skills/devrites-lib/SKILL.md +11 -9
  267. package/pack/generated/claude/skills/devrites-lib/reference/intent-map.md +3 -2
  268. package/pack/generated/claude/skills/devrites-lib/reference/parallel-dispatch.md +82 -137
  269. package/pack/generated/claude/skills/devrites-lib/reference/reply-contract.md +8 -1
  270. package/pack/generated/claude/skills/devrites-lib/reference/standards/README.md +38 -55
  271. package/pack/generated/claude/skills/devrites-lib/reference/standards/afk-hitl.md +53 -27
  272. package/pack/generated/claude/skills/devrites-lib/reference/standards/agents.md +198 -190
  273. package/pack/generated/claude/skills/devrites-lib/reference/standards/anti-patterns.md +5 -15
  274. package/pack/generated/claude/skills/devrites-lib/reference/standards/ci-cd.md +27 -58
  275. package/pack/generated/claude/skills/devrites-lib/reference/standards/code-review.md +16 -52
  276. package/pack/generated/claude/skills/devrites-lib/reference/standards/coding-style.md +2 -10
  277. package/pack/generated/claude/skills/devrites-lib/reference/standards/context-hygiene.md +18 -61
  278. package/pack/generated/claude/skills/devrites-lib/reference/standards/core.md +23 -18
  279. package/pack/generated/claude/skills/devrites-lib/reference/standards/deprecation.md +17 -57
  280. package/pack/generated/claude/skills/devrites-lib/reference/standards/development-workflow.md +4 -33
  281. package/pack/generated/claude/skills/devrites-lib/reference/standards/git-workflow.md +4 -20
  282. package/pack/generated/claude/skills/devrites-lib/reference/standards/hooks.md +3 -14
  283. package/pack/generated/claude/skills/devrites-lib/reference/standards/patterns.md +9 -25
  284. package/pack/generated/claude/skills/devrites-lib/reference/standards/performance.md +0 -9
  285. package/pack/generated/claude/skills/devrites-lib/reference/standards/principles.md +1 -3
  286. package/pack/generated/claude/skills/devrites-lib/reference/standards/security.md +17 -7
  287. package/pack/generated/claude/skills/devrites-lib/reference/standards/testing.md +1 -27
  288. package/pack/generated/claude/skills/devrites-lib/reference/standards/tooling.md +46 -50
  289. package/pack/generated/claude/skills/devrites-lib/reference/workspace-artifact-schema.md +23 -10
  290. package/pack/generated/claude/skills/devrites-source-driven/SKILL.md +23 -22
  291. package/pack/generated/claude/skills/rite/SKILL.md +8 -6
  292. package/pack/generated/claude/skills/rite/reference/menu.md +8 -6
  293. package/pack/generated/claude/skills/rite-adopt/SKILL.md +33 -37
  294. package/pack/generated/claude/skills/rite-autocomplete/SKILL.md +33 -28
  295. package/pack/generated/claude/skills/rite-autocomplete/reference/loop.md +21 -21
  296. package/pack/generated/claude/skills/rite-autocomplete/reference/stop-conditions.md +15 -6
  297. package/pack/generated/claude/skills/rite-build/SKILL.md +35 -30
  298. package/pack/generated/claude/skills/rite-build/reference/afk-discipline.md +38 -38
  299. package/pack/generated/claude/skills/rite-build/reference/evidence-standard.md +10 -0
  300. package/pack/generated/claude/skills/rite-build/reference/forge.md +186 -156
  301. package/pack/generated/claude/skills/rite-build/reference/one-slice-cycle.md +4 -3
  302. package/pack/generated/claude/skills/rite-build/reference/phase-contract.md +96 -175
  303. package/pack/generated/claude/skills/rite-build/reference/wright-dispatch.md +129 -134
  304. package/pack/generated/claude/skills/rite-clarify/SKILL.md +89 -0
  305. package/pack/generated/claude/skills/rite-clarify/reference/decision-coverage.md +59 -0
  306. package/pack/generated/claude/skills/rite-converge/SKILL.md +35 -25
  307. package/pack/generated/claude/skills/rite-define/SKILL.md +57 -32
  308. package/pack/generated/claude/skills/rite-define/reference/gates.md +16 -15
  309. package/pack/generated/claude/skills/rite-define/reference/plan-template.md +16 -8
  310. package/pack/generated/claude/skills/rite-frame/reference/failure-modes.md +22 -24
  311. package/pack/generated/claude/skills/rite-plan/SKILL.md +44 -16
  312. package/pack/generated/claude/skills/rite-plan/reference/task-breakdown.md +4 -0
  313. package/pack/generated/claude/skills/rite-polish/SKILL.md +27 -23
  314. package/pack/generated/claude/skills/rite-prototype/SKILL.md +25 -26
  315. package/pack/generated/claude/skills/rite-prove/SKILL.md +27 -17
  316. package/pack/generated/claude/skills/rite-resolve/SKILL.md +12 -11
  317. package/pack/generated/claude/skills/rite-resolve/reference/answer-protocol.md +3 -0
  318. package/pack/generated/claude/skills/rite-review/SKILL.md +37 -28
  319. package/pack/generated/claude/skills/rite-seal/reference/phase-contract.md +27 -92
  320. package/pack/generated/claude/skills/rite-seal/reference/risk-and-rollback.md +13 -0
  321. package/pack/generated/claude/skills/rite-ship/reference/design-memory.md +31 -36
  322. package/pack/generated/claude/skills/rite-spec/SKILL.md +84 -135
  323. package/pack/generated/claude/skills/rite-spec/reference/investigation.md +37 -33
  324. package/pack/generated/claude/skills/rite-spec/reference/question-protocol.md +6 -2
  325. package/pack/generated/claude/skills/rite-spec/reference/spec-checklists.md +25 -24
  326. package/pack/generated/claude/skills/rite-spec/reference/spec-template.md +9 -2
  327. package/pack/generated/claude/skills/rite-spec/reference/state-workspace.md +13 -3
  328. package/pack/generated/claude/skills/rite-temper/SKILL.md +62 -47
  329. package/pack/generated/claude/skills/rite-temper/reference/review-dimensions.md +24 -22
  330. package/pack/generated/claude/skills/rite-vet/SKILL.md +110 -113
  331. package/pack/generated/claude/skills/rite-vet/reference/artifacts.md +42 -9
  332. package/pack/generated/claude/skills/rite-vet/reference/review-axes.md +39 -37
  333. package/pack/generated/codex/AGENTS.md +5 -2
  334. package/pack/generated/codex/agents/devrites-code-reviewer.toml +69 -47
  335. package/pack/generated/codex/agents/devrites-devex-reviewer.toml +75 -51
  336. package/pack/generated/codex/agents/devrites-doubt-reviewer.toml +35 -20
  337. package/pack/generated/codex/agents/devrites-evidence-scout.toml +75 -0
  338. package/pack/generated/codex/agents/devrites-forge-judge.toml +80 -59
  339. package/pack/generated/codex/agents/devrites-frontend-reviewer.toml +54 -37
  340. package/pack/generated/codex/agents/devrites-performance-reviewer.toml +55 -38
  341. package/pack/generated/codex/agents/devrites-plan-drafter.toml +77 -0
  342. package/pack/generated/codex/agents/devrites-plan-reviewer.toml +82 -47
  343. package/pack/generated/codex/agents/devrites-proof-runner.toml +80 -0
  344. package/pack/generated/codex/agents/devrites-retrospector.toml +54 -43
  345. package/pack/generated/codex/agents/devrites-security-auditor.toml +53 -35
  346. package/pack/generated/codex/agents/devrites-simplifier-reviewer.toml +56 -44
  347. package/pack/generated/codex/agents/devrites-slice-wright.toml +159 -163
  348. package/pack/generated/codex/agents/devrites-spec-reviewer.toml +40 -30
  349. package/pack/generated/codex/agents/devrites-strategy-reviewer.toml +65 -34
  350. package/pack/generated/codex/agents/devrites-test-analyst.toml +46 -28
  351. package/pack/generated/codex/hooks.json +4 -14
  352. package/pack/generated/codex/skills/devrites-api-interface/SKILL.md +7 -3
  353. package/pack/generated/codex/skills/devrites-audit/SKILL.md +47 -64
  354. package/pack/generated/codex/skills/devrites-browser-proof/SKILL.md +7 -3
  355. package/pack/generated/codex/skills/devrites-debug-recovery/SKILL.md +31 -16
  356. package/pack/generated/codex/skills/devrites-debug-recovery/reference/build-the-loop.md +24 -21
  357. package/pack/generated/codex/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +34 -6
  358. package/pack/generated/codex/skills/devrites-debug-recovery/reference/instrumentation.md +2 -2
  359. package/pack/generated/codex/skills/devrites-doubt/SKILL.md +32 -20
  360. package/pack/generated/codex/skills/devrites-frontend-craft/SKILL.md +7 -3
  361. package/pack/generated/codex/skills/devrites-interview/SKILL.md +60 -55
  362. package/pack/generated/codex/skills/devrites-lib/SKILL.md +18 -12
  363. package/pack/generated/codex/skills/devrites-lib/reference/intent-map.md +3 -2
  364. package/pack/generated/codex/skills/devrites-lib/reference/parallel-dispatch.md +82 -137
  365. package/pack/generated/codex/skills/devrites-lib/reference/reply-contract.md +8 -1
  366. package/pack/generated/codex/skills/devrites-lib/reference/standards/README.md +38 -55
  367. package/pack/generated/codex/skills/devrites-lib/reference/standards/afk-hitl.md +53 -27
  368. package/pack/generated/codex/skills/devrites-lib/reference/standards/agents.md +198 -190
  369. package/pack/generated/codex/skills/devrites-lib/reference/standards/anti-patterns.md +5 -15
  370. package/pack/generated/codex/skills/devrites-lib/reference/standards/ci-cd.md +27 -58
  371. package/pack/generated/codex/skills/devrites-lib/reference/standards/code-review.md +16 -52
  372. package/pack/generated/codex/skills/devrites-lib/reference/standards/coding-style.md +2 -10
  373. package/pack/generated/codex/skills/devrites-lib/reference/standards/context-hygiene.md +18 -61
  374. package/pack/generated/codex/skills/devrites-lib/reference/standards/core.md +23 -18
  375. package/pack/generated/codex/skills/devrites-lib/reference/standards/deprecation.md +17 -57
  376. package/pack/generated/codex/skills/devrites-lib/reference/standards/development-workflow.md +4 -33
  377. package/pack/generated/codex/skills/devrites-lib/reference/standards/git-workflow.md +4 -20
  378. package/pack/generated/codex/skills/devrites-lib/reference/standards/hooks.md +3 -14
  379. package/pack/generated/codex/skills/devrites-lib/reference/standards/patterns.md +9 -25
  380. package/pack/generated/codex/skills/devrites-lib/reference/standards/performance.md +0 -9
  381. package/pack/generated/codex/skills/devrites-lib/reference/standards/principles.md +1 -3
  382. package/pack/generated/codex/skills/devrites-lib/reference/standards/security.md +17 -7
  383. package/pack/generated/codex/skills/devrites-lib/reference/standards/testing.md +1 -27
  384. package/pack/generated/codex/skills/devrites-lib/reference/standards/tooling.md +46 -50
  385. package/pack/generated/codex/skills/devrites-lib/reference/workspace-artifact-schema.md +23 -10
  386. package/pack/generated/codex/skills/devrites-prose-craft/SKILL.md +7 -3
  387. package/pack/generated/codex/skills/devrites-refresh-indexes/SKILL.md +7 -3
  388. package/pack/generated/codex/skills/devrites-source-driven/SKILL.md +29 -24
  389. package/pack/generated/codex/skills/devrites-ux-shape/SKILL.md +7 -3
  390. package/pack/generated/codex/skills/rite/SKILL.md +19 -13
  391. package/pack/generated/codex/skills/rite/reference/menu.md +8 -6
  392. package/pack/generated/codex/skills/rite-adopt/SKILL.md +40 -40
  393. package/pack/generated/codex/skills/rite-autocomplete/SKILL.md +40 -31
  394. package/pack/generated/codex/skills/rite-autocomplete/reference/loop.md +21 -21
  395. package/pack/generated/codex/skills/rite-autocomplete/reference/stop-conditions.md +15 -6
  396. package/pack/generated/codex/skills/rite-build/SKILL.md +42 -33
  397. package/pack/generated/codex/skills/rite-build/reference/afk-discipline.md +38 -38
  398. package/pack/generated/codex/skills/rite-build/reference/evidence-standard.md +10 -0
  399. package/pack/generated/codex/skills/rite-build/reference/forge.md +186 -156
  400. package/pack/generated/codex/skills/rite-build/reference/one-slice-cycle.md +4 -3
  401. package/pack/generated/codex/skills/rite-build/reference/phase-contract.md +96 -175
  402. package/pack/generated/codex/skills/rite-build/reference/wright-dispatch.md +129 -134
  403. package/pack/generated/codex/skills/rite-clarify/SKILL.md +105 -0
  404. package/pack/generated/codex/skills/rite-clarify/reference/decision-coverage.md +59 -0
  405. package/pack/generated/codex/skills/rite-converge/SKILL.md +42 -28
  406. package/pack/generated/codex/skills/rite-customize/SKILL.md +7 -3
  407. package/pack/generated/codex/skills/rite-define/SKILL.md +64 -35
  408. package/pack/generated/codex/skills/rite-define/reference/gates.md +16 -15
  409. package/pack/generated/codex/skills/rite-define/reference/plan-template.md +16 -8
  410. package/pack/generated/codex/skills/rite-doctor/SKILL.md +7 -3
  411. package/pack/generated/codex/skills/rite-dogfood/SKILL.md +7 -3
  412. package/pack/generated/codex/skills/rite-explain/SKILL.md +7 -3
  413. package/pack/generated/codex/skills/rite-frame/SKILL.md +7 -3
  414. package/pack/generated/codex/skills/rite-frame/reference/failure-modes.md +22 -24
  415. package/pack/generated/codex/skills/rite-handoff/SKILL.md +7 -3
  416. package/pack/generated/codex/skills/rite-learn/SKILL.md +7 -3
  417. package/pack/generated/codex/skills/rite-plan/SKILL.md +51 -19
  418. package/pack/generated/codex/skills/rite-plan/reference/task-breakdown.md +5 -1
  419. package/pack/generated/codex/skills/rite-polish/SKILL.md +34 -26
  420. package/pack/generated/codex/skills/rite-pov/SKILL.md +7 -3
  421. package/pack/generated/codex/skills/rite-pr-feedback/SKILL.md +7 -3
  422. package/pack/generated/codex/skills/rite-pressure-test/SKILL.md +7 -3
  423. package/pack/generated/codex/skills/rite-prototype/SKILL.md +32 -29
  424. package/pack/generated/codex/skills/rite-prove/SKILL.md +34 -20
  425. package/pack/generated/codex/skills/rite-quick/SKILL.md +7 -3
  426. package/pack/generated/codex/skills/rite-resolve/SKILL.md +19 -14
  427. package/pack/generated/codex/skills/rite-resolve/reference/answer-protocol.md +3 -0
  428. package/pack/generated/codex/skills/rite-review/SKILL.md +44 -31
  429. package/pack/generated/codex/skills/rite-seal/SKILL.md +7 -3
  430. package/pack/generated/codex/skills/rite-seal/reference/phase-contract.md +27 -92
  431. package/pack/generated/codex/skills/rite-seal/reference/risk-and-rollback.md +13 -0
  432. package/pack/generated/codex/skills/rite-ship/SKILL.md +7 -3
  433. package/pack/generated/codex/skills/rite-ship/reference/design-memory.md +31 -36
  434. package/pack/generated/codex/skills/rite-spec/SKILL.md +91 -138
  435. package/pack/generated/codex/skills/rite-spec/reference/investigation.md +37 -33
  436. package/pack/generated/codex/skills/rite-spec/reference/question-protocol.md +6 -2
  437. package/pack/generated/codex/skills/rite-spec/reference/spec-checklists.md +25 -24
  438. package/pack/generated/codex/skills/rite-spec/reference/spec-template.md +9 -2
  439. package/pack/generated/codex/skills/rite-spec/reference/state-workspace.md +13 -3
  440. package/pack/generated/codex/skills/rite-status/SKILL.md +7 -3
  441. package/pack/generated/codex/skills/rite-temper/SKILL.md +69 -50
  442. package/pack/generated/codex/skills/rite-temper/reference/review-dimensions.md +24 -22
  443. package/pack/generated/codex/skills/rite-vet/SKILL.md +117 -116
  444. package/pack/generated/codex/skills/rite-vet/reference/artifacts.md +42 -9
  445. package/pack/generated/codex/skills/rite-vet/reference/review-axes.md +40 -38
  446. package/pack/generated/codex/skills/rite-zoom-out/SKILL.md +7 -3
  447. package/package.json +1 -1
  448. package/scripts/build-release-tarball.sh +32 -15
  449. package/scripts/check-authority-drift.py +125 -0
  450. package/scripts/check-instruction-size-baseline.mjs +19 -11
  451. package/scripts/check-invocation-integrity.py +2 -0
  452. package/scripts/codex-generate.sh +69 -33
  453. package/scripts/grade-feature.sh +121 -40
  454. package/scripts/live-hosts/agent-result.schema.json +230 -0
  455. package/scripts/live-hosts/claude.sh +87 -0
  456. package/scripts/live-hosts/codex.sh +81 -0
  457. package/scripts/live-hosts/common.sh +113 -0
  458. package/scripts/live-hosts/fake-host.py +264 -0
  459. package/scripts/live-hosts/host-transport.py +287 -0
  460. package/scripts/release-check.sh +5 -1
  461. package/scripts/run-agent-contract-evals.py +1380 -0
  462. package/scripts/run-behavioral-evals.sh +24 -30
  463. package/scripts/run-evals.sh +1 -5
  464. package/scripts/run-live-behavioral-evals.py +1274 -144
  465. package/scripts/run-outcome-evals.sh +414 -88
  466. package/scripts/run-tests.mjs +30 -2
  467. package/scripts/skills-inventory.mjs +1 -1
  468. package/scripts/validate-workflow-security.py +39 -20
  469. package/scripts/validate-workspace-schema.py +362 -10
  470. package/scripts/validate.sh +21 -15
  471. package/engine/testdata/golden/TestParityWrightScope/devrites-edit-allowed.golden +0 -1
  472. /package/engine/testdata/golden/{TestParityReconcile/check-no-claimed.golden → TestParityBuildReadiness/arg=clarifyopen.golden} +0 -0
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: rite-clarify
3
+ description: Run the topology-first decision-coverage scan after rite-spec and before strategy or architecture. Audit actors, journeys, states, data, integrations, operations, proof, assumptions, and must-NOT boundaries; close Partial/Missing rows and emit decision-coverage.md CLEAR. Use for missing/stale coverage or a missed pre-build product decision.
4
+ argument-hint: "[feature-slug]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # /rite-clarify: resolve product decisions
9
+
10
+ Run this required pass between spec and strategy. If the spec covers every material
11
+ decision, ask no questions. Otherwise stay until each material decision has an
12
+ owner. This phase settles behavior and constraints; `/rite-define` settles
13
+ implementation.
14
+
15
+ Reuse [`devrites-interview`](../devrites-interview/SKILL.md) in `/clarify mode`. Write
16
+ `decision-coverage.md` as scan evidence, not an interview transcript.
17
+
18
+ ## Rules consulted
19
+
20
+ Read `devrites-lib/reference/standards/core.md`, its `afk-hitl.md`, and
21
+ [`reference/decision-coverage.md`](reference/decision-coverage.md). Fresh evidence
22
+ dispatch uses
23
+ [`agents.md`](../devrites-lib/reference/standards/agents.md).
24
+
25
+ ## Rules
26
+
27
+ - Search code/docs/contracts first. Facts and reversible implementation/test choices
28
+ are agent-owned; ask only about product, scope, policy, irreversible risk, or human-only access.
29
+ - Enumerate the full topology before details so no sibling surface is omitted.
30
+ - Ask one coherent human-owned decision packet at a time. One packet may close several rows
31
+ only when owner and trade-off match; never ask permission for routine repair/retry.
32
+ - One scan may cap at five packets for cognitive load, but readiness has no question cap:
33
+ re-scan until clear.
34
+ - Material assumptions carry evidence, confidence, owner, validation, and consequence.
35
+
36
+ ## Workflow
37
+
38
+ 0. **Orient.** Run `devrites-engine preamble` and `snapshot`. Require `spec.md` plus
39
+ `Spec gate: passed`; otherwise STOP → `/rite-spec`. For a later-phase retrofit, run
40
+ `devrites-engine clarify-return enter <slug>` **before any pause**; this persists the
41
+ return cursor and enters `Phase: clarify`.
42
+ 1. **Enumerate topology** from the spec, references, live code, and prior decisions: actors,
43
+ journeys/components, states, data lifecycles, interfaces/integrations, operations, and
44
+ proof. Add omitted surfaces to the spec. **Completion:** every material surface appears
45
+ once with a source or canonical spec reference.
46
+ 2. **Scan coverage** with `devrites-interview /clarify mode` and the reference taxonomy.
47
+ Mark each surface Clear/Partial/Missing with evidence; include must-NOT and out-of-scope
48
+ behavior. Unmentioned never means not applicable. **Completion:** the matrix records every
49
+ surface with evidence.
50
+ 3. **Eliminate factual unknowns** through code intelligence, project/decision docs,
51
+ manifests/lockfiles, and authoritative external docs. Dispatch independent topology/fact
52
+ questions to `devrites-evidence-scout` (maximum three at once), await the cited dossiers,
53
+ and reconcile them in the root context. The root folds accepted facts into `spec.md` or
54
+ `assumptions.md`; the scout never asks or writes. **Completion:** each factual unknown is
55
+ source-backed or reclassified as an owned decision/assumption.
56
+ 4. **Audit assumptions and decisions.** Record the fields required above. For high-cost or
57
+ hard-to-reverse product/constraint choices, present two or three viable options, recommendation
58
+ first. A genuinely undecidable behavior may take one bounded `/rite-prototype` detour.
59
+ 5. **Close human-owned gaps** using the shared option-set contract: one highest-impact packet
60
+ per turn. Persist answers immediately in `spec.md` plus `decisions.md`/`questions.md`.
61
+ AFK remains within its gate ceiling; irreversible risk and principle exceptions pause.
62
+ 6. **Re-scan after edits** until each material row is `closed`, `agent-owned`,
63
+ `not-applicable`, or justified `deferred-nonblocking` with owner and validation gate.
64
+ Partial/Missing, an unowned material assumption, or an open blocking/escalating question
65
+ means `NEEDS CLARIFICATION`.
66
+ 7. **Write the verdict.** Update `decision-coverage.md`; success requires exactly
67
+ `Decision coverage: CLEAR`. Normal state is `Phase: clarify`, `Next step: /rite-temper`.
68
+ A contract-neutral retrofit runs `devrites-engine clarify-return restore <slug>`; a
69
+ changed behavior/acceptance contract leaves the return cursor unconsumed, writes
70
+ `drift.md`, and routes `/rite-plan repair`. Normal first-pass flow sets `/rite-temper`.
71
+ 8. **STOP.** Run `devrites-engine progress`; hand off only on `CLEAR`.
72
+
73
+ ## Output
74
+
75
+ Run `devrites-engine progress`, then use the shared completion reply contract
76
+ ([`devrites-lib/reference/reply-contract.md`](../devrites-lib/reference/reply-contract.md)):
77
+
78
+ ```text
79
+ Done: decision coverage closed for <slug>; <n> topology surfaces scanned.
80
+ Changed: decision-coverage.md, spec.md, decisions.md, assumptions.md, questions.md
81
+ Evidence: Decision coverage: CLEAR; human packets <n>; agent-owned facts <n>
82
+ Open: none blocking; deferred-nonblocking <n>
83
+ Next: /rite-temper
84
+ Record: .devrites/work/<slug>/decision-coverage.md
85
+ ↻ Hygiene: /clear before /rite-temper
86
+ ```
87
+
88
+ If not clear, name the exact rows and next genuine decision packet. An objective spec defect
89
+ or factual search task never routes through `/rite-resolve`.
@@ -0,0 +1,59 @@
1
+ # Decision coverage contract
2
+
3
+ `decision-coverage.md` proves a topology-first scan ran; reference canonical IDs instead of
4
+ duplicating their prose.
5
+
6
+ ## Coverage taxonomy
7
+
8
+ For each material surface scan: outcome/scope/must-NOT; behavior, permissions, and all states;
9
+ domain/data lifecycle/invariants/order/concurrency; interfaces/integrations and failure
10
+ contracts; security/privacy/compliance/accessibility/performance/reliability/compatibility;
11
+ configuration/observability/support/rollout/rollback; and executable acceptance proof,
12
+ environment, credentials/approvals, and evidence limits.
13
+
14
+ ## Status vocabulary
15
+
16
+ - `closed`: the canonical artifact records the decision.
17
+ - `agent-owned`: a reversible technical choice is explicitly delegated to define/vet.
18
+ - `not-applicable`: evidence shows the dimension does not apply.
19
+ - `deferred-nonblocking`: pre-code evidence is impossible or the item is an explicit
20
+ non-goal; owner and validation gate are named.
21
+
22
+ `Partial`, `Missing`, open, unknown, or ownerless rows never produce `CLEAR`.
23
+
24
+ ## Artifact shape
25
+
26
+ ```markdown
27
+ # Decision coverage
28
+
29
+ Decision coverage: <CLEAR | NEEDS CLARIFICATION>
30
+ Coverage inputs SHA-256: <exact value from `devrites-engine readiness-digest coverage <slug>`>
31
+
32
+ ## Topology
33
+ | Surface | Kind | Related IDs | Evidence |
34
+ | --- | --- | --- | --- |
35
+
36
+ ## Coverage matrix
37
+ | Surface | Dimension | Status | Canonical reference | Owner / validation gate | Consequence if wrong |
38
+ | --- | --- | --- | --- | --- | --- |
39
+
40
+ ## Assumption audit
41
+ | Assumption | Evidence | Confidence | Owner | Validation | Consequence if wrong |
42
+ | --- | --- | --- | --- | --- | --- |
43
+
44
+ ## Residual uncertainty
45
+ | Item | Why nonblocking | Owner | Validation gate |
46
+ | --- | --- | --- | --- |
47
+
48
+ ## Readiness verdict
49
+ No Partial, Missing, unowned material assumption, or unresolved blocking/escalating
50
+ question remains.
51
+ ```
52
+
53
+ Combine rows only when one decision and owner genuinely close them.
54
+
55
+ Run the digest command only after `brief.md`, `spec.md`, `decisions.md`,
56
+ `assumptions.md`, and `questions.md` are final for this clarification pass, then
57
+ copy its complete field line verbatim. The build gate recomputes the digest and
58
+ rejects stale coverage. Any open blocking, validating, or escalating question
59
+ also prevents `CLEAR`.
@@ -5,20 +5,19 @@ argument-hint: "[feature-slug]"
5
5
  user-invocable: true
6
6
  ---
7
7
 
8
- # /rite-converge: make the code and the intent converge
8
+ # /rite-converge: compare live code with intent
9
9
 
10
- Read `spec.md` + `plan.md` + `tasks.md` as the **sole source of intent** (with
10
+ Read `spec.md`, `plan.md`, and `tasks.md` as the **sole source of intent** (with
11
11
  `.devrites/principles.md` as governing constraints), assess what the **live codebase**
12
12
  implements, and **append every unmet piece as a new traceable `SLICE-###`** at the
13
- bottom of `tasks.md` so `/rite-build` can finish it. The recovery bridge for work that fell
14
- out of sync with its plan: a half-built feature picked up cold, a `/rite-adopt`'d codebase
15
- that drifted from its derived spec, or a build that stalled mid-slice. **Read the active
13
+ bottom of `tasks.md` so `/rite-build` can finish it. Use this for a resumed half-built
14
+ feature, an adopted codebase that drifted from its derived spec, or a build that stalled
15
+ mid-slice. **Read the active
16
16
  workspace first**; if there's no `spec.md`/`plan.md`/`tasks.md`, tell the user which
17
17
  prerequisite skill to run.
18
18
 
19
- > **Not a diff tool.** `/rite-converge` assesses the **present state** of the code against
20
- > intent: no git, no branch comparison, no history. "What does this codebase do *now* vs
21
- > what the artifacts asked for", not "what changed since commit X". For a change-scoped
19
+ > **This is not a diff tool.** `/rite-converge` compares current code with intent. It
20
+ > does not use git history or compare branches. For a change-scoped
22
21
  > review use `/rite-review`; to prove a finished feature use `/rite-prove`.
23
22
 
24
23
  ## Rules consulted (read on demand from `.claude/skills/devrites-lib/reference/standards/`)
@@ -41,16 +40,20 @@ Pull on demand:
41
40
  - **Clean means byte-for-byte unchanged.** When the code already satisfies everything, leave
42
41
  `tasks.md` untouched (no empty convergence header) and report a clean result. Recommend
43
42
  `/rite-prove`.
44
- - **Intent is the artifacts, not your memory.** The spec/plan/tasks (+ principles) are the
43
+ - **Use artifacts as intent.** The spec, plan, tasks, and principles are the
45
44
  contract. If assessing reveals the *spec* is wrong (the code is right and the requirement is
46
45
  stale), that's **Spec Drift**: stop and route it through the Spec Drift Guard
47
46
  (`rite-build/reference/spec-drift-guard.md`) + a recorded decision; never paper over a spec
48
- bug by appending a task that "fixes" the code to a wrong requirement.
47
+ bug by appending a task that changes correct code to match a wrong requirement.
49
48
  - **Partial is not done.** Code that exists but is untested, half-wired, or covers only the
50
49
  happy path is an unmet gap: enqueue the remainder, don't round it up.
51
50
  - **Principles are non-negotiable.** A live violation of a declared invariant with no recorded
52
51
  exception is the top-severity gap, walked first. Absent/empty principles file → none declared
53
52
  → skip the check gracefully, never block for its absence.
53
+ - **Scout observes; root classifies and writes.** Use
54
+ [`agents.md`](../devrites-lib/reference/standards/agents.md). The evidence scout returns
55
+ live-code citations only; the controlling chat owns built/partial/absent calls and append-only
56
+ workspace changes.
54
57
 
55
58
  ## Workflow
56
59
  0. **Read `.claude/skills/devrites-lib/reference/standards/core.md`** first (the always-on
@@ -59,14 +62,16 @@ Pull on demand:
59
62
  any is missing, **STOP** and name the prerequisite (`/rite-spec` for a missing spec,
60
63
  `/rite-define` for a missing plan/tasks, `/rite-adopt` to onboard existing code). Do not
61
64
  produce partial output.
65
+ Require `decision-coverage.md` with `Decision coverage: CLEAR`; otherwise STOP →
66
+ `/rite-clarify`.
62
67
  2. **Load intent:** [`reference/convergence-assessment.md`](reference/convergence-assessment.md).
63
68
  From `spec.md`: buildable `AC-###` / `### Requirement:` scenarios (skip `## Success metrics`);
64
69
  from `plan.md`: architecture decisions + named touch-points (files/components the plan says
65
70
  get built); from `tasks.md`: existing slices + their `Satisfies:`; from
66
71
  `.devrites/principles.md`: the invariants.
67
72
  **Completion:** every buildable criterion, touch-point, slice output, and principle is in the assessment inventory.
68
- 3. **Run the mechanical backbone**, then read the code. `devrites-engine analyze` gives coverage +
69
- consistency; `devrites-engine coverage` gives the AC→slice→proven matrix. They catch *unmapped*
73
+ 3. **Run the mechanical checks**, then read the code. `devrites-engine analyze` gives coverage
74
+ and consistency; `devrites-engine coverage` gives the AC→slice→proven matrix. They catch *unmapped*
70
75
  criteria; they do **not** see whether mapped code is built and correct, for that,
71
76
  read the live code (code-intelligence index per `tooling.md`).
72
77
  ```bash
@@ -78,7 +83,9 @@ Pull on demand:
78
83
  [`reference/convergence-assessment.md`](reference/convergence-assessment.md)): every
79
84
  acceptance criterion / scenario, every plan touch-point, and every existing slice's stated
80
85
  Produces. A principle violated in the current code is its own top-severity gap.
81
- **Completion:** every inventory unit is classified once with live-code evidence.
86
+ Dispatch up to three independent inventory partitions to `devrites-evidence-scout` on the
87
+ same frozen candidate, await their dossiers, then reconcile the cited facts in the root
88
+ context. **Completion:** every inventory unit is classified once with live-code evidence.
82
89
  5. **Enqueue the remainder as new slices.** For each *partial* or *absent* unit, append a
83
90
  `## SLICE-###` (continue the numbering after the highest existing id) in the `rite-define`
84
91
  slice grammar, each with a `Satisfies:` line tracing to the AC/REQ it closes and a
@@ -87,10 +94,14 @@ Pull on demand:
87
94
  **Completion:** every partial/absent unit has one traceable appended slice, or the file is byte-for-byte unchanged.
88
95
  6. **Write append-only + bookkeeping.** Append the slice batch to `tasks.md` (nothing else in
89
96
  that file changes); refresh `traceability.md` (`devrites-engine coverage` → new rows for the
90
- appended slices); update `state.md` (`Phase: converge`, `Next step: /rite-build`; or, when
91
- nothing was unmet, `Next step: /rite-prove`). Append `decisions.md` for any material call.
97
+ appended slices). Appending a slice changes the plan input, so invalidate the prior vet:
98
+ update `state.md` to `Phase: plan`, `Next step: /rite-vet`, and set an existing
99
+ `eng-review.md` field to `Implementation readiness: NEEDS REPLAN`. When nothing was unmet,
100
+ leave the plan/vet verdict untouched and set `Next step: /rite-prove`. Append
101
+ `decisions.md` for any material call.
92
102
  7. **STOP.** Report units assessed, built / partial / absent counts, slices appended, and any
93
- principle violation found; recommend `/rite-build` (or `/rite-prove` if the code already
103
+ principle violation found; recommend `/rite-vet` when slices were appended (or
104
+ `/rite-prove` if the code already
94
105
  converged).
95
106
 
96
107
  ## Appended slice format
@@ -105,11 +116,9 @@ Convergence: 2026-07-07 # marks this as a convergence-appended slice, not a
105
116
  <all remaining canonical slice fields>
106
117
  ```
107
118
 
108
- > **Mid-flight discipline.** When tempted to rewrite an existing slice instead of appending, to
109
- > edit the code directly "while you're in there", to mark a happy-path-only implementation as
110
- > built, or to enqueue a task that bends the code to a spec you suspect is wrong: see
111
- > [`reference/anti-patterns.md`](reference/anti-patterns.md). Load it the moment you reach for
112
- > the excuse.
119
+ > **Mid-flight discipline.** Do not rewrite an existing slice, edit source, mark a
120
+ > happy-path-only implementation as built, or add work for a spec you suspect is wrong.
121
+ > See [`reference/anti-patterns.md`](reference/anti-patterns.md).
113
122
 
114
123
  ## Output
115
124
 
@@ -118,14 +127,15 @@ Convergence: 2026-07-07 # marks this as a convergence-appended slice, not a
118
127
  Default success shape:
119
128
  ```
120
129
  Done: convergence assessed for <slug>; <n> slices appended.
121
- Changed: tasks.md <appended|unchanged>, traceability.md, state.md
130
+ Changed: tasks.md <appended|unchanged>, traceability.md, state.md, eng-review.md <invalidated|unchanged>
122
131
  Evidence: units <built>/<total> built · <partial> partial · <absent> absent · principle violations 0
123
132
  Open: none
124
- Next: /rite-build
133
+ Next: /rite-vet
125
134
  Record: .devrites/work/<slug>/tasks.md
126
- ↻ Hygiene: /clear before /rite-build
135
+ ↻ Hygiene: /clear before /rite-vet
127
136
  ```
128
137
  When nothing was unmet, render the same green form with `Next: /rite-prove`.
129
138
  If spec drift or another blocker remains, use the shared `Stopped / blocked` form
130
139
  and route `Fix:` to `/rite-plan`; do not recommend `/rite-build`.
131
- **DO NOT write application code, rewrite existing slices, or edit spec.md/plan.md here**: convergence assesses and enqueues; `/rite-build` implements.
140
+ **DO NOT write application code, rewrite existing slices, or edit spec.md/plan.md here.**
141
+ This phase assesses and enqueues; `/rite-build` implements.
@@ -7,11 +7,11 @@ user-invocable: true
7
7
 
8
8
  # /rite-define: plan from the spec
9
9
 
10
- Read the active feature's `spec.md` and turn it into a buildable workspace: feature
11
- architecture, approach, a dependency-ordered set of **vertical slices**, traceability, and
12
- the state cursor. The spec is the WHAT/WHY (from `/rite-spec`); this is the HOW. Splitting
13
- spec, architecture, plan, tasks, and traceability keeps each file small and phase-owned.
14
- **No code here.**
10
+ Turn the active feature's `spec.md` into a buildable workspace with architecture, an
11
+ implementation approach, dependency-ordered **vertical slices**, traceability, and a
12
+ state cursor. The spec defines what and why; this phase defines how. Keep spec,
13
+ architecture, plan, tasks, and traceability in their phase-owned files. **Do not write
14
+ code here.**
15
15
 
16
16
  ## Rules consulted (read on demand from `.claude/skills/devrites-lib/reference/standards/`)
17
17
  Pull these via `Read` when shaping the plan:
@@ -24,14 +24,16 @@ Pull these via `Read` when shaping the plan:
24
24
  - **Requires a readied spec.** Read the active workspace first; if `.devrites/ACTIVE` is empty,
25
25
  the workspace has no `spec.md`, its readiness gate hasn't passed, or any spec-quality
26
26
  `checklists/<domain>.md` has an open CRITICAL → **STOP** and tell the user to run
27
- `/rite-spec <feature>` first. **DO NOT plan from a missing or unreadied spec.**
28
- - Prefer existing conventions; ask before adding a dependency or a second design system.
29
- - **Author section by section, not in one dump.** Write `architecture.md` / `plan.md` one section
30
- at a time and pause after each; a section resting on an open design choice or a shaky estimate can
31
- be deepened right there with a technique from
27
+ `/rite-spec <feature>` first. A missing or non-`CLEAR` `decision-coverage.md` routes to
28
+ `/rite-clarify`. **DO NOT plan from a missing, unreadied, or unclarified spec.**
29
+ - Apply `afk-hitl.md` decision ownership. Prefer conventions; source-check new dependencies or
30
+ design systems, asking only about licensing/cost/security or explicit policy.
31
+ - **Author one section at a time.** Write `architecture.md` and `plan.md` section by
32
+ section, pausing after each. For an open design choice or uncertain estimate, use a
33
+ relevant technique from
32
34
  [`elicitation.md`](../devrites-lib/reference/standards/elicitation.md) (Tournament for two viable
33
35
  designs, Delphi for the estimate) before it hardens into slices.
34
- - **Slice count is derived, never dictated.** The number of slices falls out of the work.
36
+ - **Derive the slice count from the work.**
35
37
  One per independently-shippable increment, sized by `slicing.md`, every acceptance
36
38
  criterion mapped to ≥1 slice. A user-named count is a hint at most: slice logically and,
37
39
  if your honest count differs, present it and why. Never pad or compress to hit a figure.
@@ -40,6 +42,9 @@ Pull these via `Read` when shaping the plan:
40
42
  crosses many files, don't fake vertical slices. Add a compatibility/adapter slice, migrate
41
43
  small green batches, then remove the old path. If a batch cannot stay green, use an
42
44
  integration branch plus a final verify slice.
45
+ - **Root writes; drafter proposes.** Use the file-backed fresh-context contract in
46
+ [`agents.md`](../devrites-lib/reference/standards/agents.md). The root owns architecture
47
+ decisions, human questions, approval, and every canonical artifact write.
43
48
 
44
49
  ## Workflow
45
50
  0. **Read `.claude/skills/devrites-lib/reference/standards/core.md`:** the always-on operating rules and anti-rationalizations.
@@ -53,30 +58,46 @@ Pull these via `Read` when shaping the plan:
53
58
  ```
54
59
  If there is no active workspace, no `spec.md`, `spec-skeleton` blocks, or its readiness gate hasn't passed →
55
60
  **STOP** and tell the user to run `/rite-spec <feature>` first.
61
+ If `decision-coverage.md` is absent or does not say `Decision coverage: CLEAR`,
62
+ **STOP** → `/rite-clarify`.
56
63
  1. **Read the spec:** `spec.md` (objective, requirements, acceptance, **placement**,
57
64
  design references, gaps/decisions), plus `references.md`, `decisions.md`,
58
- `assumptions.md`, **`strategy.md` if present** (the scope mode, deferred / out-of-scope
65
+ `assumptions.md`, `decision-coverage.md`, **`strategy.md` if present** (the scope mode, deferred / out-of-scope
59
66
  register, and pre-mortem risks from `/rite-temper`: cut slices to mitigate the top risks
60
67
  and respect the IN/OUT line; map coverage against the **hardened** spec), and
61
68
  **`design-brief.md` if the feature touches UI** (the UX/UI contract `/rite-spec` shaped:
62
69
  its key states, interaction model, and proof targets drive how UI slices are cut). If a blocking
63
- `[NEEDS CLARIFICATION]` remains, stop → `/rite-spec`.
64
- 2. **Decide the architecture + approach** (the HOW the spec deliberately omitted): write
70
+ `[NEEDS CLARIFICATION]` remains, stop → `/rite-clarify`.
71
+ 1a. **Draft from fresh context.** Freeze the planning inputs and dispatch
72
+ `devrites-plan-drafter` in `define` mode for one atomic candidate bundle:
73
+ `architecture.md`, `plan.md`, `tasks.md`, and `traceability.md`, including proof mapping.
74
+ Await and validate `agent-result/v1`. The drafter does not write or ask; any human-owned
75
+ choice returns to this root context.
76
+ 2. **Reconcile and decide the architecture + approach** (the HOW the spec deliberately
77
+ omitted). Validate the candidate against live seams and the following rules; the root writes
78
+ accepted content at step 6. Shape
65
79
  `architecture.md` for owning layer, boundaries, integration points, data/API/events,
66
80
  dependencies, risks, and affected areas; write only the build strategy in `plan.md`.
67
81
  Use a
68
82
  code-intelligence index if available (see
69
83
  `.claude/skills/devrites-lib/reference/standards/tooling.md`) for structure/impact; for the current API or behaviour of
70
84
  an external library/framework the architecture will rely on, consult context7 if available.
71
- Record significant options in `decisions.md` as `DEC-###` ADR entries.
72
- **Deep-modules check**, while sketching the major modules, look for opportunities
85
+ Record significant options as `DEC-###`. For high-cost/hard-to-reverse boundaries, data
86
+ models, public contracts, or dependencies, compare ≥2 viable approaches by drivers,
87
+ trade-offs, and consequences. Specify cross-boundary interfaces for independent work:
88
+ invariants, I/O, ordering/idempotency, errors, versioning, config, and relevant budgets.
89
+ **Deep-module check:** while sketching the major modules, look for opportunities
73
90
  to extract a **deep module**: a small, stable interface that hides a meaningful chunk
74
- of behavior, and is therefore independently testable. A *shallow* module (interface
75
- nearly as complex as its implementation) earns nothing; either deepen it or delete
76
- it. Where a slice will produce a deep module, confirm with the user which deep
77
- modules they want unit-tested in isolation (this informs the slice's "Tests to
78
- write/run" field).
79
- 3. **Slice into vertical tasks:** each delivers one observable capability end-to-end and
91
+ of behavior and is independently testable. A *shallow* module whose interface is
92
+ nearly as complex as its implementation adds no value; deepen it or delete
93
+ it. Put independently testable deep-module behavior in the slice's `Tests/proof`;
94
+ `/rite-vet` confirms the level.
95
+ 2a. **Foreseeable-decision sweep.** Inspect questions, assumptions, architecture, dependencies,
96
+ proof prerequisites, and proposed checkpoints. Search facts and decide reversible technical
97
+ calls. New product/acceptance/policy/irreversible-risk gaps return to `/rite-clarify`; a build
98
+ checkpoint survives only for unavailable pre-code evidence or mandatory action-time approval.
99
+ **Completion:** no known implementation choice is postponed for build to ask later.
100
+ 3. **Create vertical tasks:** each delivers one observable capability end to end and
80
101
  is verifiable on its own; the **count emerges from the work, not a target number**;
81
102
  first slice = thinnest useful end-to-end path; order by dependency (risk-first within a
82
103
  tier). For a broad mechanical refactor, use expand → migrate batches → contract instead
@@ -87,12 +108,14 @@ Pull these via `Read` when shaping the plan:
87
108
  first, see `devrites-frontend-craft/reference/fullstack.md`). **For UI slices, name which
88
109
  of `design-brief.md`'s key states + interaction the slice delivers, and give it a binary
89
110
  **Visual acceptance** target (state × viewport × input + target R-id/brief rule)**, so
90
- the design contract maps onto slices, not just acceptance criteria.
91
- 4. **Map coverage:** every `AC-###` spec acceptance criterion maps to ≥1 `SLICE-###`
111
+ the design contract maps to slices as well as acceptance criteria.
112
+ `Tests/proof` names exact command, cwd, expected signal, prerequisites, and mutable
113
+ provenance inputs; `/rite-vet` preflights them.
114
+ 4. **Map coverage and wiring:** every `AC-###` spec acceptance criterion maps to ≥1 `SLICE-###`
92
115
  (`rite-spec/reference/acceptance-criteria.md`); no orphaned criteria, no slice without a
93
116
  criterion. Lift covered/backstop `Edge Coverage` rows and resolved `Prohibitions (must-NOT)`
94
- rows into `traceability.md` and `test-plan.md`; unresolved rows go to `assumptions.md` with
95
- their gate/owner.
117
+ rows into `traceability.md` and `test-plan.md`; unresolved rows get a gate/owner. Each
118
+ cross-slice boundary names producer, consumer, invariant, integration step, and proof.
96
119
  4a. **Parallel-lane sanity check**: after drafting `tasks.md` but before asking for plan
97
120
  approval, run the advisory lane planner:
98
121
  ```bash
@@ -109,7 +132,7 @@ Pull these via `Read` when shaping the plan:
109
132
  S="$(cat .devrites/ACTIVE 2>/dev/null)"
110
133
  devrites-engine coverage "$S" > ".devrites/work/$S/traceability.md"
111
134
  ```
112
- 5. **Complexity & deviations gate:** justify anything off DevRites defaults (new dep,
135
+ 5. **Complexity and deviations gate:** justify anything outside DevRites defaults (new dep,
113
136
  extra abstraction, second design system) in the plan; if you can't justify it, simplify.
114
137
  **Principles conformance:** read `.devrites/principles.md` (if present) and confirm the
115
138
  approach honors every declared invariant. A plan that conflicts with one is not "a deviation
@@ -125,11 +148,12 @@ Pull these via `Read` when shaping the plan:
125
148
  S="$(cat .devrites/ACTIVE 2>/dev/null)"
126
149
  devrites-engine analyze "$S"
127
150
  ```
128
- 7. **Readiness gate** (bottom of plan-template): every acceptance criterion covered by a
129
- slice, dependency order acyclic + risk-first, no unjustified deviation, rollback for
130
- every destructive/migration step. **Stop and confirm** before code. Render the review-before-code
151
+ 7. **Readiness gate** (plan-template): require CLEAR coverage, complete acceptance and
152
+ cross-slice wiring/proof, risk-first acyclic order, justified deviations, rollback, and a
153
+ closed decision sweep. **Stop and confirm** before code. Render the review-before-code
131
154
  digest first: `Intent` (one sentence from the spec), `Done means` (acceptance coverage x/y),
132
- `Plan sanity` (slice count + riskiest boundary/gate), and `Build exactly this?` (yes → approve;
155
+ `Plan sanity` (slice count + riskiest boundary/gate), `Expected build interruptions`
156
+ (`none` or only justified action-time gates), and `Build exactly this?` (yes → approve;
133
157
  no → `/rite-plan revise`). When the human confirms the plan, write `Plan approved: <iso>` to
134
158
  `state.md` (see [state-workspace](../rite-spec/reference/state-workspace.md)); `/rite-build`
135
159
  checks this exists before building.
@@ -141,7 +165,8 @@ Use the canonical slice grammar in
141
165
  Every slice must satisfy that complete field set; phase-specific gate details live in
142
166
  [`reference/gates.md`](reference/gates.md).
143
167
 
144
- > **Mid-flight discipline.** When tempted to skip vertical slicing, coverage mapping, or dependency-order discipline: see [`anti-patterns`](reference/anti-patterns.md) (Common Rationalizations + Red Flags). Load it the moment you reach for the excuse.
168
+ > **Mid-flight discipline.** Do not skip vertical slicing, coverage mapping, or
169
+ > dependency ordering. See [`anti-patterns`](reference/anti-patterns.md).
145
170
 
146
171
  ## Output
147
172
 
@@ -1,12 +1,10 @@
1
1
  # Gate taxonomy: advisory · validating · blocking · escalating
2
2
 
3
- DevRites uses a four-gate model for HITL pauses, adapted from the regulated-agentic-workflow
4
- governance pattern. Picking the right gate for each `Mode: HITL` slice is the difference
5
- between a workflow that catches real risk and one that becomes a review queue.
3
+ DevRites uses four HITL gates, adapted from the regulated-agentic-workflow governance
4
+ pattern. Choose the gate for each `Mode: HITL` slice by its risk and review needs.
6
5
 
7
- > **Default failure mode:** marking every HITL slice as `blocking`. The same reviewer ends
8
- > up approving low-stakes and high-stakes items at the same priority and the gate becomes
9
- > a queue. Mix gate types per slice; most plans use 2-3 of the 4.
6
+ > **Do not mark every HITL slice as `blocking`.** That gives low-stakes and high-stakes
7
+ > items the same priority. Most plans use 2 or 3 gate types.
10
8
 
11
9
  ## The four gates
12
10
 
@@ -39,7 +37,7 @@ validating question; the feature does not seal until the entry is resolved. An o
39
37
  **Example:** "Schema migration adds a non-null column with a default. Backfill plan is
40
38
  recorded; reviewer should confirm the default is the right one for archived rows."
41
39
 
42
- **SLA:** `4h`: the work continues but the validating queue should drain within hours,
40
+ **SLA:** `4h`: the work continues, but the validating queue should clear within hours,
43
41
  not days.
44
42
 
45
43
  ### blocking
@@ -56,8 +54,8 @@ STOPs. The slice is not built until `/rite-resolve` lands.
56
54
  - Auth/authz boundary change.
57
55
  - Public API break.
58
56
  - Spec drift that changes acceptance criteria.
59
- - Tests / types / lint are red and the agent cannot tell whether the slice's contract is
60
- wrong or the failing code is.
57
+ - Bounded debug recovery proved the remaining red test/type/lint failure is a genuine
58
+ product-contract ambiguity the human must decide.
61
59
 
62
60
  **SLA:** `15m`: synchronous gates demand fast turnaround; otherwise treat the work as
63
61
  genuinely blocked and re-plan around it.
@@ -79,7 +77,9 @@ it's `blocking`.
79
77
 
80
78
  ## Picking the gate
81
79
 
82
- Apply this decision tree per HITL slice:
80
+ First apply `afk-hitl.md` decision ownership: an objective implementation/tooling failure
81
+ or reversible technical choice is agent work and gets no human gate. Then apply this
82
+ decision tree per HITL slice:
83
83
 
84
84
  1. **Can the slice ship safely without the answer?**
85
85
  - Yes → `advisory`.
@@ -117,8 +117,9 @@ defaults and the always-pause rules:
117
117
  | `[advisory, validating]` | log + proceed | build + queue | pause | pause |
118
118
  | `[advisory, validating, blocking]` | log + proceed | build + queue | log + proceed* | pause |
119
119
 
120
- \* but **never** for destructive migrations, auth/authz boundary changes, public API
121
- breaks, or red tests/types/lint. Those always pause. See
120
+ \* but **never** for destructive migrations, auth/authz boundary changes, or public API
121
+ breaks. Red tests/types/lint remain hard build gates and must clear bounded recovery before
122
+ the next slice; only a resulting human-owned ambiguity becomes a pause. See
122
123
  [`.claude/skills/devrites-lib/reference/standards/afk-hitl.md`](../../devrites-lib/reference/standards/afk-hitl.md) for the irreversible-risk
123
124
  list.
124
125
 
@@ -127,8 +128,7 @@ shortcut.
127
128
 
128
129
  ## Anti-patterns
129
130
 
130
- - **One gate for everything.** Validates becomes a queue, blocks all work behind one
131
- reviewer. Pick gates per slice.
131
+ - **One gate for everything.** This puts all work behind one reviewer. Pick gates per slice.
132
132
  - **Marking a destructive migration `validating` to "keep the loop moving".** Destructive
133
133
  work is `blocking` regardless of the urge to ship.
134
134
  - **`advisory` as a synonym for "I'm not sure but I don't want to ask".** If the slice
@@ -143,7 +143,8 @@ shortcut.
143
143
  Mode: HITL
144
144
  Gate: blocking
145
145
  SLA: 15m
146
- Checkpoint: Confirm (user_id, created_at) composite index choice vs two single-col indexes.
146
+ Checkpoint: Approve irreversible deletion of legacy records after the dry-run count exists;
147
+ that evidence cannot exist before the migration rehearsal.
147
148
  Blocked by: SLICE-002
148
149
  ...
149
150
  ```
@@ -1,12 +1,11 @@
1
1
  # `plan.md` template
2
2
 
3
- Write **how** to build what `spec.md` defines. The plan is **living, not sacred**:
4
- `/rite-plan` repairs it when reality disagrees. This is where technology choices live
5
- (they're banned from the spec).
3
+ Write **how** to build what `spec.md` defines. Use `/rite-plan` when evidence requires
4
+ an update. Technology choices belong here, not in the spec.
6
5
 
7
6
  ```markdown
8
7
  # Plan: <Feature>
9
- Spec: ./spec.md Date: <date>
8
+ Spec: ./spec.md Decision coverage: ./decision-coverage.md Date: <date>
10
9
 
11
10
  ## Summary
12
11
  1–2 sentences: the primary requirement + the chosen approach.
@@ -17,7 +16,8 @@ Spec: ./spec.md Date: <date>
17
16
  - Storage / data: <...>
18
17
  - Testing tools + commands: <from spec "Commands discovered">
19
18
  - Target / platform / constraints: <...>
20
- - `[NEEDS CLARIFICATION: ...]` for any unknown that affects the approach.
19
+ - Any product/constraint unknown that affects the approach routes to `/rite-clarify`;
20
+ do not carry `[NEEDS CLARIFICATION]` into an approvable plan.
21
21
 
22
22
  ## Global constraints
23
23
  Project-wide requirements from the spec that every slice implicitly includes — version
@@ -26,6 +26,8 @@ values **verbatim from spec.md** (a paraphrased constraint drifts by the time sl
26
26
 
27
27
  ## Approach
28
28
  The strategy in a few sentences. Why this over the alternatives considered.
29
+ For high-cost/hard-to-reverse boundaries, models, contracts, or dependencies compare ≥2
30
+ viable `Option · Drivers · Trade-offs · Consequence`; skip theater for routine choices.
29
31
 
30
32
  ## Slice strategy
31
33
  How the feature is split into vertical `SLICE-###` increments, why the order is
@@ -36,9 +38,9 @@ green, or name the integration branch + final verify slice.
36
38
  ## Architecture decisions
37
39
  Key decisions + rationale (mirror into decisions.md). New pattern vs reuse — prefer
38
40
  reuse of existing project conventions. Record architecture as invariants, not scaffolding:
39
- include a decision only when two implementing slices could otherwise choose incompatibly. For each
40
- medium+ decision, include `Binds:` (what future work must follow) and `Prevents:` (the divergence
41
- or failure it avoids).
41
+ include a decision only when slices could choose incompatibly. Medium+ decisions include
42
+ `Binds:` and `Prevents:`. Cross-boundary interfaces name invariants, I/O, ordering/idempotency,
43
+ errors, versioning, config, and relevant budgets.
42
44
 
43
45
  ## Dependency graph
44
46
  What must exist before what (text is fine):
@@ -55,6 +57,7 @@ slices above the cut, and no slice above it depends on one below.
55
57
  ## Validation strategy
56
58
  After which slices to run tests / build / browser proof. For UI slices, name the visual
57
59
  acceptance targets from `design-brief.md`, not a generic "looks good" check.
60
+ Each proof names exact command/cwd/signal, prerequisites, and mutable provenance inputs.
58
61
 
59
62
  **Key links** — the wiring the assembled feature must exhibit, one row each:
60
63
  `<from> → <to> via <mechanism>` (route → handler via registration; producer → consumer via
@@ -81,14 +84,19 @@ Framework/library docs to consult (triggers devrites-source-driven). Record URLs
81
84
  decisions.md / evidence.md when used.
82
85
 
83
86
  ## Readiness gate *(must pass before /rite-build)*
87
+ - [ ] `decision-coverage.md` says `Decision coverage: CLEAR`
84
88
  - [ ] Every spec acceptance criterion is covered by a slice
85
89
  - [ ] Dependency order is acyclic and risk-first
86
90
  - [ ] An `MVP cut` is named, self-contained (ACs above the cut proven above the cut, no dependency reaching below), and marks a genuinely shippable scope
87
91
  - [ ] No unjustified deviation remains in the complexity gate
88
92
  - [ ] Rollback exists for every destructive / migration step
89
93
  - [ ] Every `Mode: HITL` slice has `Gate`, `SLA`, and `Checkpoint` populated
94
+ - [ ] Human-owned choices are resolved; surviving checkpoints need unavailable pre-code
95
+ evidence or action-time approval
96
+ - [ ] Slice proof commands, cwd, prerequisites, and provenance inputs are preflightable
90
97
  - [ ] Every UI slice names `Design brief states` and binary `Visual acceptance`
91
98
  - [ ] `Key links` rows cover every cross-slice wiring (or state `none`)
99
+ - [ ] Cross-boundary contracts name producer, consumer, invariants/errors/order, and proof
92
100
  - [ ] Any wide mechanical refactor is sliced expand → migrate batches → contract, with green migrate batches or an integration branch + final verify slice
93
101
  - [ ] No `Gate: blocking` slice is implicitly chained behind an AFK slice without surfacing the dependency
94
102
  ```