devrites 3.0.7 → 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 +12 -0
  2. package/README.md +67 -47
  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 +486 -38
  54. package/engine/internal/install/install_test.go +383 -10
  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
@@ -5,18 +5,17 @@ argument-hint: "<feature or idea>"
5
5
  user-invocable: true
6
6
  ---
7
7
 
8
- # /rite-spec: investigate deeply, write the spec
8
+ # /rite-spec: investigate and write the spec
9
9
 
10
- The spec phase. Turn a request (even a vague one) into a **fully-covered, correctly-placed
11
- `spec.md`** by investigating deeply and closing every material gap with the human, so
12
- `/rite-define` can plan it and nothing is missed. **No plan, tasks, or code here**. Those
13
- are `/rite-define` and `/rite-build`.
10
+ Turn a request into a **fully covered, correctly placed `spec.md`** by investigating
11
+ the existing system and resolving every material gap found during authoring.
12
+ `/rite-clarify` audits the full topology before `/rite-define` plans it. **Do not write
13
+ a plan, tasks, or code here.** Those belong to `/rite-define` and `/rite-build`.
14
14
 
15
- > **Too small to spec? Use `/rite-quick`.** A typo, copy tweak, config bump, or one-function
16
- > fix does **not** need a full workspace + lifecycle. Stop and run `/rite-quick <change>`: its
17
- > express lane (one contract TDD build scoped prove ship) escalates back here the moment
18
- > the change turns out to touch auth / data / a migration / a public API / more than one slice.
19
- > Spec is for real features; don't pay its ceremony for a one-off.
15
+ > **Use `/rite-quick` for a small change.** A typo, copy edit, config bump, or
16
+ > one-function fix does not need a full workspace and lifecycle. Run
17
+ > `/rite-quick <change>`. It returns here if the work touches auth, data, a migration, a
18
+ > public API, or more than one slice.
20
19
 
21
20
  ## Rules consulted (read on demand from `.claude/skills/devrites-lib/reference/standards/`)
22
21
  Pull `documentation.md` via `Read`
@@ -27,35 +26,34 @@ Pull `spec-grammar.md` and `devrites-lib/reference/workspace-artifact-schema.md`
27
26
  acceptance for a behavioral / high-risk requirement (auth,
28
27
  data model, state machine, public API, money, migration): the structured `### Requirement:` /
29
28
  `#### Scenario:` (SHALL · WHEN/THEN) form, lint-checked by `devrites-engine spec-validate`. Simple criteria
30
- stay flat `AC-###` bullets; the grammar is opt-in by rigor, never forced.
29
+ stay flat `AC-###` bullets; the grammar is opt-in by rigor, never forced. Use
30
+ [`reference/acceptance-criteria.md`](reference/acceptance-criteria.md) to keep each
31
+ criterion independently observable and binary.
31
32
 
32
33
  ## Operating rules (DevRites core)
33
34
  - No silent assumptions · no guessing through confusion · prefer existing conventions ·
34
35
  ask the human when an answer changes scope, placement, data model, UX, security,
35
36
  migration risk, or acceptance.
36
- - **Author section by section, not in one dump.** Draft the spec one section at a time
37
- (problem goal requirements acceptance edge cases), and pause after each: a section
38
- that carries real risk (a contested requirement, a boundary, an unstated assumption) can be
39
- deepened right there with a fitting technique from
40
- [`elicitation.md`](../devrites-lib/reference/standards/elicitation.md) before moving on. A spec
41
- written a section at a time is where sharper thinking lands cheaply; a wall-of-text spec hides
42
- the weak section.
37
+ - **Root authority:** the controlling chat asks every human question, makes decisions, and
38
+ writes the workspace. Read-only evidence work follows the fresh-context contract in
39
+ [`agents.md`](../devrites-lib/reference/standards/agents.md).
40
+ - **Author one section at a time.** Draft problem → goal → requirements → acceptance →
41
+ edge cases, pausing after each section. If a section contains a contested requirement,
42
+ boundary, or unstated assumption, apply a relevant technique from
43
+ [`elicitation.md`](../devrites-lib/reference/standards/elicitation.md) before continuing.
43
44
 
44
45
  ## Workflow
45
46
  0. **Read `.claude/skills/devrites-lib/reference/standards/core.md`:** the always-on operating rules and anti-rationalizations.
46
47
  Then run `devrites-engine preamble` for deterministic workspace orientation.
47
- 0a. **Brownfield check: onboard before speccing onto un-adopted existing code.** If this is an
48
- **existing codebase** (real source predating DevRites) that has **never been adopted** (no
48
+ 0a. **Check whether existing code needs adoption.** If this is an
49
+ **existing codebase** that has **never been adopted** (no
49
50
  `.devrites/conventions.md`, no prior `.devrites/work`, `.devrites/features`, or `.devrites/archive`) the build has no
50
- conventions ledger to follow and the first slice would guess the project's idioms. Route
51
- through `/rite-adopt` **first**, carrying `$ARGUMENTS` as its *next objective*: adopt
52
- reverse-derives the baseline `spec.md`, **seeds the conventions ledger**, and proposes
53
- principles, so this feature is specced on top of an onboarded project (adopt owns the
54
- onboarding; `/rite-spec` only detects and routes: no duplicated logic). In **HITL** present a
55
- ranked option (recommended: *adopt first, then spec this on top*; escape hatch: *spec-only, skip
56
- onboarding*); in **AFK** (adoption allowed) run `/rite-adopt` first automatically. **Greenfield
57
- (no pre-existing source) or an already-onboarded project → skip silently**: never block a spec
58
- for the absence of adoption (the same no-op discipline as the principles gate). Cheap probe:
51
+ conventions ledger, route through `/rite-adopt` **first** and pass `$ARGUMENTS` as its
52
+ next objective. Adopt derives the baseline `spec.md`, seeds conventions, and proposes
53
+ principles; `/rite-spec` only detects and routes. In **HITL**, present a ranked option:
54
+ recommend adoption first and include a spec-only escape hatch. In **AFK**, when adoption
55
+ is allowed, run `/rite-adopt` automatically. **Skip this check silently for greenfield or
56
+ already-onboarded projects.** Never block a spec only because adoption is absent. Probe:
59
57
  ```bash
60
58
  if [ ! -f .devrites/conventions.md ] && [ ! -d .devrites/archive ] \
61
59
  && [ -z "$(ls .devrites/work .devrites/features 2>/dev/null)" ] \
@@ -63,137 +61,88 @@ stay flat `AC-###` bullets; the grammar is opt-in by rigor, never forced.
63
61
  echo "brownfield, not yet adopted → recommend /rite-adopt first (carry this idea as its next objective)"
64
62
  else echo "greenfield or already onboarded → continue spec"; fi
65
63
  ```
66
- 1. **Understand the request** (`$ARGUMENTS`). Restate the goal and the *real problem
67
- behind it* in a sentence or two.
68
- **Completion:** one sentence states both requested outcome and underlying problem.
64
+ 1. **Understand the request** (`$ARGUMENTS`). State the requested outcome and the
65
+ underlying problem in one or two sentences.
66
+ **Completion:** one sentence includes both.
69
67
  1a. **Local dedupe.** Search local issues/PRDs and archived specs before creating a new workspace:
70
68
  ```bash
71
69
  devrites-engine spec-dedupe "$ARGUMENTS"
72
70
  ```
73
71
  If it finds a close match, ask the user: extend existing / adopt / new spec. Record the choice in
74
72
  `decisions.md` once the workspace exists. No match → continue silently.
75
- 2. **Investigate deeply:** [investigation](reference/investigation.md). Produce, and
76
- later write into the spec: **current behavior**; **placement** (which module/layer/
77
- file/component should own it, the seam, patterns to reuse, and integration points:
78
- callers, dependents, data, APIs/events); **what it resolves**; **issues**
79
- (conflicts/constraints); **gaps** (unknowns); **blast radius**. Use a code-intelligence
80
- index **if available**: `codebase-memory-mcp` first, cross-checked with `codegraph`
81
- (`.codegraph/` / `codegraph_*`) + `graphify` (`graphify-out/`), else standard methods
82
- (LSP / `Read`/`Grep`/`Glob`); see `.claude/skills/devrites-lib/reference/standards/tooling.md`:
83
- for placement/callers/impact instead of broad file reads; fall back to reading files. For
84
- uncertain external library/framework facts that bear on placement or feasibility, consult
85
- context7 if available. When a material decision turns on a fact outside the codebase: a
86
- common UX pattern, a standard, a prevailing best practice, how comparable products solve it:
87
- **search the web if available** (brave MCP preferred; see `.claude/skills/devrites-lib/reference/standards/tooling.md`), and
88
- carry the cited finding into the option you put to the human at step 4.
89
- Also discover the project's **test / build/typecheck/lint** commands and the
90
- frontend/backend systems; read `PRODUCT.md` / `DESIGN.md` / `CLAUDE.md` / `AGENTS.md` if
91
- present (`AGENTS.md` is the cross-tool agent-conventions standard (treat it as project
92
- conventions the build must follow, same standing as `CLAUDE.md`), and read
93
- `.devrites/principles.md` if present) the declared invariants the feature must respect.
94
- **Consult the capability ledger**: the living record of what the system already does
73
+ 2. **Investigate:** follow [investigation](reference/investigation.md) through its
74
+ complete findings and done-when gate. Also discover the project's **test /
75
+ build/typecheck/lint** commands, frontend/backend systems, and declared project guidance
76
+ (`PRODUCT.md`, `DESIGN.md`, `CLAUDE.md`, `AGENTS.md`, and `.devrites/principles.md` when
77
+ present).
78
+ **Consult the capability ledger**, which records current system behavior
95
79
  ([`ledger.md`](../rite-ship/reference/ledger.md)): `devrites-engine ledger list` for the
96
80
  capabilities on record, then `devrites-engine ledger show <capability>` for any this feature
97
81
  touches. Also search prior decisions with `devrites-engine decisions search "<2-4 feature nouns>"`
98
- before asking the human to re-decide a settled architecture/API/auth choice. Starting from the proven contract (not a cold re-derive) is what makes the spec store
99
- compound across features; it also tells you which requirements are new vs a change to existing
100
- behavior, which decides the delta kind in step 5.
101
- 3. **Gather design references (optional):** [references-intake](reference/references-intake.md).
102
- The human **may** attach screenshots, mockups, a Figma link, a video, or links, or
103
- **none at all** (perfectly normal; skip this step then). If any are given: **view/fetch**
82
+ before asking the human to revisit a settled architecture, API, or auth choice. The
83
+ ledger shows whether each requirement is new or changes existing behavior, which
84
+ determines the delta kind in step 5.
85
+ Identify proof constraints now: human-only credentials, unavailable environments, approval
86
+ windows, or acceptance not observable through existing test/runtime/browser surfaces.
87
+ Split independent placement, blast-radius, and external-fact questions into at most three
88
+ bounded `devrites-evidence-scout` packets on one frozen baseline. Await and reconcile every
89
+ cited dossier before step 4. The scout supplies facts only; it never asks the human or writes
90
+ the spec.
91
+ 3. **Gather design references when provided:** [references-intake](reference/references-intake.md).
92
+ The human may attach screenshots, mockups, a Figma link, a video, links, or nothing.
93
+ Skip this step when none are provided. Otherwise, **view or fetch**
104
94
  them, **save local files** into `.devrites/work/<slug>/references/`, and index them in
105
95
  `references.md` as target, constraint, or inspiration. Later phases honor that role
106
96
  rather than treating every reference as a fidelity target.
107
97
  **Completion:** every supplied reference is saved and classified, or absence is explicit.
108
- 3a. **Shape the UX/UI before code (if the feature touches UI)**, when this feature is
109
- frontend ([frontend-trigger](../rite-build/reference/frontend-trigger.md)), apply
110
- `devrites-ux-shape` **now**, woven into the spec, not as a separate phase. It turns the
111
- references + the spec into a feature-level **`design-brief.md`** (design direction, key
98
+ 3a. **Shape UX/UI before code when the feature is frontend**
99
+ ([frontend-trigger](../rite-build/reference/frontend-trigger.md)). Apply
100
+ `devrites-ux-shape` within the spec phase. It turns the
101
+ references and spec into a feature-level **`design-brief.md`** (design direction, key
112
102
  states, interaction model, optional Figma/image visual-direction probe) that `/rite-build`
113
- targets so the UI is built to plan, not guessed. In HITL it pauses for the human to
103
+ targets for the build. In HITL it pauses for the human to
114
104
  confirm the direction; in AFK it asserts the best guess and logs it. Pure
115
105
  backend/data/CLI features skip this.
116
- 4. **Close the gaps with the human. You recommend, the human decides.** Every material gap
117
- (one that moves **objective · scope · placement · data model · UX · integration ·
118
- non-functional · security · migration risk · acceptance**) is **put to the human as a ranked
119
- option set**, one gap at a time, via the harness `AskUserQuestion` in HITL: **2-4 concrete
120
- options, your recommended one first and marked `(Recommended)`**, each with a one-line
121
- rationale + trade-off tagged by the dimensions that matter, plus an escape hatch (*Something
122
- else. I'll describe it*). Render contract + AFK behaviour: the **Option set** section of
123
- [`afk-hitl.md`](../devrites-lib/reference/standards/afk-hitl.md); spec-phase question discipline:
124
- [question-protocol](reference/question-protocol.md). Your job is to **investigate, rank, and
125
- recommend**, not to settle a material decision yourself. **Confidence changes the *cost* of
126
- the question, not its *owner*:** when you're near-certain, you still present the set (the
127
- human just confirms your `(Recommended)` option in one pick) you do **not** silently decide
128
- it because you predicted the answer. Only a **genuinely reversible, low-impact** detail is
129
- auto-decided and logged to `assumptions.md`; when unsure whether a gap is material, ask.
130
- (Vague ask `devrites-interview`; rough idea → `/rite-pressure-test`.) For a vague ask,
131
- load [`reference/interview-patterns.md`](reference/interview-patterns.md), **map the decision
132
- tree**, and resolve each branch depth-first; **cover every dimension**:
133
- each resolved by a human pick or explicitly deferred (logged, non-blocking), never silently
134
- skipped. Aim for **zero blocking gaps**. *If a gap is genuinely undecidable on paper (state
135
- machine that may deadlock, data shape ambiguity, "which UX wins") → suggest a
136
- scoped detour to `/rite-prototype` to answer that ONE question before
137
- continuing.* **Invariant conflict is a blocking gap:** if a requirement or acceptance
138
- criterion can only be satisfied by breaking a declared principle (`.devrites/principles.md`),
139
- surface it: the principle wins by default; breaking it needs a recorded, scoped exception a
140
- human approves, never a spec that silently contradicts an invariant.
141
- 5. **Create the workspace** + set `.devrites/ACTIVE`
142
- ([state-workspace](reference/state-workspace.md)). Write compact `README.md`,
143
- `brief.md`, and `spec.md` ([spec-template](reference/spec-template.md)). WHAT/WHY,
144
- technology-agnostic, with requirements, acceptance, edge cases, scope boundaries, links
145
- to future `architecture.md` / `traceability.md`, and measurable acceptance
146
- ([acceptance-criteria](reference/acceptance-criteria.md)). For a
147
- behavioral / high-risk requirement, write the acceptance as a structured
148
- `### Requirement:` (SHALL) + `#### Scenario:` (WHEN/THEN) block per
149
- [`spec-grammar.md`](../devrites-lib/reference/standards/spec-grammar.md), nesting the `AC-###` id inside each scenario
150
- so `/rite-seal` still grades it; routine criteria stay flat `AC-###` bullets. **When a
151
- capability the ledger already holds is changing, write those requirements as deltas**:
152
- `## ADDED / MODIFIED / REMOVED Requirements — capability: <c>` (spec-grammar.md § Delta form):
153
- so the change, not just the end state, is explicit and `/rite-ship` folds it cleanly; a
154
- capability with no ledger entry stays flat (the first sync seeds it). Also
155
- write `brief.md`, `references.md`, `questions.md`, `decisions.md`, `assumptions.md`,
156
- and an initial compact `state.md` (phase: spec) from
157
- [state-workspace](reference/state-workspace.md). When the feature touches
158
- UI, `design-brief.md` is written here too (by `devrites-ux-shape`, step 3a).
159
- Populate `## Edge Coverage` with the deterministic boundary classes implied by each requirement
160
- (empty/huge input, rounding, timezone, ordering, permissions, races, migration) and `## Prohibitions (must-NOT)`
161
- only for bespoke constraints. If the feature touches model calls, RAG, agents, evals, or LLM output,
162
- also create `ai-spec.md` from [ai-spec-template](reference/ai-spec-template.md). Then refresh any
163
- managed project context block so `AGENTS.md` / `CLAUDE.md` point at the new active workspace:
106
+ 4. **Resolve human-owned gaps.** Recommend an option and let the human decide. Apply
107
+ [question-protocol](reference/question-protocol.md), the shared
108
+ [`afk-hitl.md` option-set and decision-ownership rules](../devrites-lib/reference/standards/afk-hitl.md#decision-ownership-search-before-asking),
109
+ and [`interview-patterns.md`](reference/interview-patterns.md) for a vague ask. Every
110
+ material dimension is resolved by a human pick or explicitly deferred as non-blocking;
111
+ only genuinely reversible, low-impact details go to `assumptions.md`. A paper-only
112
+ uncertainty may take one scoped `/rite-prototype` detour. A declared-principle conflict
113
+ remains blocking until the human approves a recorded, scoped exception.
114
+ 4a. **Build-interruption forecast.** Search first, then list and close foreseeable human needs:
115
+ product/acceptance ambiguity, irreversible/external approval, or human-only access. Record
116
+ owned prerequisites. Keep a build checkpoint only for unavailable pre-code evidence or a
117
+ mandatory action-time approval. **Completion:** no foreseeable human choice is deferred.
118
+ 5. **Create the workspace** + set `.devrites/ACTIVE` from
119
+ [state-workspace](reference/state-workspace.md). Write every required artifact and
120
+ conditional annex exactly from [spec-template](reference/spec-template.md), including its
121
+ grammar/delta, coverage-seed, edge/prohibition, UI, and AI rules. Then refresh any managed
122
+ project context block so `AGENTS.md` / `CLAUDE.md` point at the new active workspace:
164
123
  ```bash
165
124
  devrites-engine context sync || true
166
125
  ```
167
- 5a. **Score the spec prose: "unit tests for English"** ([spec-checklists](reference/spec-checklists.md)).
168
- Emit `.devrites/work/<slug>/checklists/<domain>.md` (one per requirement domain the spec covers:
169
- functional · data-model · interaction · non-functional · edge-cases). Each tests the *requirement
170
- prose* for completeness / clarity / measurability: "is 'prominent' quantified?", "is every
171
- enumeration closed?", **not** the implementation. Fix each CRITICAL fail by editing the spec
172
- (not by softening the question); minor fails are logged. The checklists feed the readiness gate.
173
- 6. **Run the spec readiness gate** (bottom of spec-template): no blocking
174
- `[NEEDS CLARIFICATION]`, placement decided, all material gaps resolved, any design
175
- references provided are saved, **UX/UI shaped into `design-brief.md` if the feature is
176
- UI**, requirements testable, success criteria measurable, **one-sentence intent** (the whole
177
- change states its intent in a single sentence (if it can't, it is two features: split it or
178
- narrow the scope), **every `checklists/<domain>.md` at
179
- `Verdict: pass`**, and **any structured requirement blocks are grammar-valid**) run
180
- `devrites-engine spec-skeleton` first, then `devrites-engine spec-validate` with
181
- `--against .devrites/specs` so any delta sections are also
182
- reconciled against the ledger (an ADDED that already exists, or a MODIFIED/REMOVED that doesn't,
183
- is a blocking failure to fix, not soften):
126
+ 5a. **Check the spec prose** with [spec-checklists](reference/spec-checklists.md).
127
+ Emit every applicable domain checklist and fix each CRITICAL by correcting the spec,
128
+ never by softening the question.
129
+ 6. **Run the complete readiness gate** at the bottom of
130
+ [spec-template](reference/spec-template.md), then validate structure and ledger deltas:
184
131
  ```bash
185
132
  devrites-engine spec-skeleton ".devrites/work/<slug>"
186
133
  devrites-engine spec-validate ".devrites/work/<slug>" --against .devrites/specs
187
134
  ```
188
135
  **Do not run `devrites-engine analyze` in this phase:** `tasks.md` deliberately does not
189
136
  exist yet. `/rite-define` owns the first analyze pass after it writes the slices.
190
- Treat edge/prohibition findings as blocking just like grammar findings. When it passes, write `Spec gate: passed <iso>` to `state.md`.
191
- 6a. **Review-before-code digest.** Before handing off to planning, render the cheap human review:
137
+ Any failure blocks. The interruption forecast must be resolved, owned, or a justified
138
+ action-time gate. Then write `Spec gate: passed <iso>`.
139
+ 6a. **Review-before-code digest.** Before planning, render the compact human review:
192
140
  `Intent` (one sentence), `Done means` (top acceptance/scenario IDs), `Scope/risk` (what is in/out
193
141
  plus the hard gates), and `Build exactly this?` (yes → next phase; no → revise now). The digest
194
142
  is a view over `spec.md`, not a new artifact. **Stop** after the digest.
195
143
 
196
- > **Mid-flight discipline.** When tempted to skip investigation depth, gap-closing, or placement decisions: see [`anti-patterns`](reference/anti-patterns.md) (Common Rationalizations + Red Flags). Load it the moment you reach for the excuse.
144
+ > **Mid-flight discipline.** Do not skip investigation, gap resolution, or placement
145
+ > decisions. See [`anti-patterns`](reference/anti-patterns.md).
197
146
 
198
147
  ## Output
199
148
 
@@ -204,12 +153,12 @@ Default success shape:
204
153
  Done: spec ready for <slug>; placement decided and gaps closed.
205
154
  Changed: spec.md, decisions.md, assumptions.md, questions.md, references/ <updated|n/a>
206
155
  Evidence: checklists passed; grammar <valid | n/a flat acceptance>; design brief <path | n/a>
207
- Open: <none | n non-blocking questions | Alternative: /rite-define for small reversible work>; review digest: intent + done-means + scope/risk rendered
208
- Next: /rite-temper
156
+ Open: <none | n non-blocking questions | Alternative: /rite-quick if express-lane eligible>; review digest: intent + done-means + scope/risk rendered
157
+ Next: /rite-clarify
209
158
  Record: .devrites/work/<slug>/spec.md
210
- ↻ Hygiene: /clear before the next phase; /rite-handoff if away > a few hours
159
+ ↻ Hygiene: /clear before /rite-clarify; /rite-handoff if away > a few hours
211
160
  ```
212
- If a workspace with the slug already exists, update its spec rather than overwriting blindly:
161
+ If a workspace with the slug already exists, update its spec rather than overwriting it,
213
162
  and **show the human a short diff of what changed** in `spec.md` (acceptance criteria added /
214
163
  removed / reworded) before proceeding. A spec edit reviewed as a diff catches silent scope
215
164
  drift that a full re-read buries; this is the spec-review view (`/rite-spec --review` renders
@@ -1,23 +1,21 @@
1
- # Investigation: understand deeply before specifying
1
+ # Investigation before specification
2
2
 
3
- The spec is only as good as the investigation behind it. Goal: understand the
4
- requirement **completely**, decide **where it correctly belongs**, name what it
5
- **resolves**, and surface every **issue and gap**, then drive the gaps to closure with
6
- the user so the spec ships fully-covered and correctly-placed. A gap found here is cheap;
7
- a gap found in `/rite-build` is a drift event.
3
+ Understand the requirement, decide where it belongs, define the outcome, and identify
4
+ every issue and gap. Resolve material gaps with the user before the spec is ready. A
5
+ gap first found during `/rite-build` is a drift event.
8
6
 
9
7
  Use a code-intelligence index if available (see
10
- `../../devrites-lib/reference/standards/tooling.md`) for the structural parts below; it answers "where does this
11
- live / what calls it / what would it break" far more cheaply and accurately than reading files.
12
- With none present, fall back to Read/Grep/Glob. When a gap turns on a fact the codebase can't
13
- answer: a standard, a prevailing UX pattern, how comparable products solve it: **search the
14
- web if available** (brave MCP preferred; `../../devrites-lib/reference/standards/tooling.md`) and cite the finding in
15
- the option you present, so the human's pick is informed rather than guessed.
8
+ `../../devrites-lib/reference/standards/tooling.md`) for structural questions such as
9
+ where code lives, what calls it, and what it could break. With none present, use
10
+ Read/Grep/Glob. When a gap depends on an external fact, such as a standard, UX pattern,
11
+ or comparable product, **search the web if available** (brave MCP preferred;
12
+ `../../devrites-lib/reference/standards/tooling.md`). Cite the finding in the option
13
+ presented to the human.
16
14
 
17
- ## Prior art: check our own archive first (cheap, silent when empty)
18
- Before investigating outward, check whether we already shipped this. Grep the shipped
19
- archive for the feature's key nouns: a hit means an extension, a conflict, or a re-spec of
20
- solved work, and you inherit its decisions instead of re-deriving them:
15
+ ## Check the archive first
16
+ Before external research, check whether the project already shipped related work. Search
17
+ the archive for the feature's key nouns. A hit may indicate an extension, conflict, or
18
+ replacement and provides prior decisions:
21
19
  ```bash
22
20
  devrites-engine archive-search "<key nouns>" 2>/dev/null \
23
21
  || grep -rliE '<noun1>|<noun2>' .devrites/archive/*/spec.md 2>/dev/null
@@ -29,18 +27,18 @@ devrites-engine archive-search "<key nouns>" 2>/dev/null \
29
27
  brownfield / principles no-op discipline).
30
28
 
31
29
  ## Produce these findings (write into spec.md)
32
- 1. **The real ask:** restate the goal and the *problem behind the request* (people ask
30
+ 1. **The request and problem:** restate the goal and the problem behind it (people ask
33
31
  for "a dashboard" when they want an answer to a question). Who hits it, how often,
34
32
  what they do today instead.
35
33
  2. **Current behavior:** how it works today, or what's absent. Read the actual code and
36
34
  flows; don't assume.
37
- 3. **Placement, where it should live** *(so it's correctly placed to be used)*
35
+ 3. **Placement**
38
36
  - Which module / layer / file / component should own this; the right seam.
39
37
  - Existing patterns/components/utilities to **extend or reuse** instead of duplicating.
40
38
  - **Integration points**: callers and dependents, the data it reads/writes, the
41
39
  APIs/events/contracts it touches (interface analysis: how it interacts with the
42
40
  rest of the system).
43
- 4. **What it resolves:** the outcome/value and how we'll *observe* it's resolved (feeds
41
+ 4. **Outcome:** the result and how to observe it (feeds
44
42
  success + acceptance criteria).
45
43
  5. **Issues:** conflicts with existing code/UX/data/permissions, constraints, and
46
44
  anything that makes the obvious approach wrong. Each issue gets a disposition.
@@ -48,19 +46,22 @@ devrites-engine archive-search "<key nouns>" 2>/dev/null \
48
46
  becomes a question** (next section).
49
47
  7. **Blast radius:** what this change could break (use the code graph's impact/callers).
50
48
  Informs risks, test strategy, and rollback.
49
+ 8. **Human prerequisites:** credentials, accounts, approval windows, or irreversible
50
+ action-time decisions the acceptance path requires. Separate these from agent-owned
51
+ implementation and diagnostic work.
51
52
 
52
- Also gather any **design/reference materials** the human supplies (screenshots, Figma,
53
- links, video): see [references-intake](references-intake.md). They're part of
54
- understanding the requirement and become the target later phases verify against.
53
+ Gather any design or reference materials the human supplies, including screenshots,
54
+ Figma, links, or video. See [references-intake](references-intake.md). Record whether
55
+ each is a target, constraint, or inspiration for later phases.
55
56
 
56
57
  ## Gap analysis (present → desired)
57
- State the **present state** and the **desired state**; the delta is the work, and the
58
- **unknowns in the delta are the gaps**. Drive the count of open gaps toward zero before
59
- handing off to `/rite-define`. Mark each gap inline with `[NEEDS CLARIFICATION: question]`.
58
+ State the present and desired states. Their delta defines the work; unknowns in that
59
+ delta are gaps. Resolve them before `/rite-define`. Mark each gap inline with
60
+ `[NEEDS CLARIFICATION: question]`.
60
61
 
61
- ## Turn gaps & issues into questions WITH options: you recommend, the human decides
62
- For each material gap/issue (one that changes scope, placement, data model, UX, security,
63
- migration risk, or acceptance), **put it to the human**: one gap at a time, as a ranked
62
+ ## Present gaps and issues as options
63
+ For each material gap or issue that changes scope, placement, data model, UX, security,
64
+ migration risk, or acceptance, **ask the human** one gap at a time with a ranked
64
65
  option set with the recommended option **first and marked `(Recommended)`** plus an escape
65
66
  hatch (via `AskUserQuestion` in HITL):
66
67
  ```
@@ -70,15 +71,18 @@ hatch (via `AskUserQuestion` in HITL):
70
71
  3. <alternative> — <implication>
71
72
  4. Something else — I'll describe it
72
73
  ```
73
- Investigate and recommend; don't settle a material decision yourself. Confidence in the answer
74
- lowers the *cost* of the question (a one-pick confirm), not its owner: present the set anyway.
74
+ Investigate and recommend, but do not settle a material decision. High confidence may
75
+ make the answer a one-pick confirmation; it does not change the decision owner.
75
76
  Only a **genuinely reversible, low-impact** gap is decided and recorded in `assumptions.md`
76
77
  without asking. Full render contract + AFK behaviour: [`afk-hitl.md`](../../devrites-lib/reference/standards/afk-hitl.md).
77
78
 
78
79
  ## Done when
79
80
  - The shipped archive was checked for prior art; any overlap was surfaced to the human.
80
- - The real problem, current behavior, placement, and what-it-resolves are written down.
81
+ - The problem, current behavior, placement, and outcome are written down.
81
82
  - Every issue has a disposition; every material gap is resolved **by a human pick** from its
82
83
  option set (or explicitly deferred as non-blocking), not settled silently on your confidence.
83
- - No blocking `[NEEDS CLARIFICATION]` remains: the spec is **fully covered and correctly
84
- placed**. This is the `/rite-spec` readiness gate before `/rite-define` plans it.
84
+ - Every foreseeable build-time human prerequisite is resolved, assigned, or justified as an
85
+ action-time gate; objective repair/retry work is not disguised as a question.
86
+ - No blocking `[NEEDS CLARIFICATION]` remains. The spec covers the gaps found during
87
+ authoring and records correct placement. This is the `/rite-spec` readiness gate
88
+ before `/rite-clarify` performs the systematic topology scan.
@@ -17,13 +17,17 @@ deferred** (logged and non-blocking), never silently skipped:
17
17
  - [ ] **Integration**: external systems / APIs / contracts (or "none").
18
18
  - [ ] **Non-functional**: auth, sensitive data, latency / scale (or "n/a").
19
19
  - [ ] **Acceptance**: how each requirement is *proven* (test / observation).
20
+ - [ ] **Human prerequisites**: credentials, approval windows, irreversible action-time gates
21
+ (or "none").
20
22
 
21
23
  A blocking gap in any dimension keeps the interview open; a deferred one goes to
22
24
  `questions.md` and doesn't block. This feeds the `/rite-spec` readiness gate.
23
25
 
24
26
  ## Spec question boundary
25
- - Things the codebase answers (read it first).
26
- - Reversible implementation details (decide and note as an assumption).
27
+ - Things the codebase, prior decisions, or authoritative docs answer (search them first).
28
+ - Reversible implementation and test details (decide and note as an assumption).
29
+ - Objective tooling/environment failures (record the prerequisite or technical blocker; never
30
+ ask the human to authorize the agent's repair work).
27
31
  - Everything at once "to be thorough." Thoroughness is depth on the few that matter.
28
32
 
29
33
  ## Record
@@ -1,27 +1,26 @@
1
- # Spec-quality checklists: "unit tests for the English"
1
+ # Spec-quality checklists
2
2
 
3
- Before the spec hands off to `/rite-define`, test the **requirement prose itself** the way you'd
4
- unit-test code: is each requirement complete, unambiguous, and measurable? These checklists
5
- interrogate the *writing*, not the implementation. There is no code to run yet. A criterion like
6
- "the banner is prominent" passes a human skim and fails here ("prominent" is unquantified).
7
- Catching it now is a one-line spec edit; catching it at `/rite-prove` is a reslice.
3
+ Before `/rite-define`, check that each requirement is complete, unambiguous, and
4
+ measurable. These checklists evaluate the prose, not the implementation. For example,
5
+ "the banner is prominent" fails because "prominent" has no threshold. Fixing that in
6
+ the spec avoids a later reslice.
8
7
 
9
- **Not implementation tests.** A checklist item asks "is *export* defined for an empty dataset?":
10
- it does **not** ask "does `exportCsv()` handle `[]`?". The first tests the spec; the second is
11
- `/rite-vet`'s test-plan and `/rite-prove`'s job. These files never name a function, file, or library.
8
+ These are not implementation tests. Ask "is *export* defined for an empty dataset?", not
9
+ "does `exportCsv()` handle `[]`?". Implementation checks belong to `/rite-vet` and
10
+ `/rite-prove`. These files never name a function, file, or library.
12
11
 
13
12
  ## Output: one file per requirement domain
14
13
 
15
- Emit `.devrites/work/<slug>/checklists/<domain>.md`, one per domain the spec covers (skip
16
- a domain the spec marks "none"). The domains mirror the interview taxonomy, so a gap here maps to a
17
- `devrites-interview` dimension:
14
+ Emit `.devrites/work/<slug>/checklists/<domain>.md`, one per domain the spec covers.
15
+ Skip a domain marked "none". The domains match the interview taxonomy, so each gap maps
16
+ to a `devrites-interview` dimension:
18
17
 
19
18
  | Domain file | Tests the prose of |
20
19
  |---|---|
21
20
  | `functional.md` | Functional requirements + scenarios: is each capability stated, bounded, testable? |
22
21
  | `data-model.md` | Key entities / data model: shapes, fields, lifecycle, relationships (skip if "none"). |
23
22
  | `interaction.md` | API / UI impact + UX states: every screen state and contract named (skip if no UI/API). |
24
- | `non-functional.md` | Constraints, auth / data sensitivity, latency / scale / compatibility budgets. |
23
+ | `non-functional.md` | Constraints, auth / data sensitivity, latency / scale / compatibility budgets, human-only proof prerequisites. |
25
24
  | `edge-cases.md` | Empty / boundary / invalid / concurrent / failure paths the requirements imply. |
26
25
 
27
26
  ## Each item: a question, a verdict, the line it interrogates
@@ -41,11 +40,11 @@ Verdict is `pass` / `fail` / `n/a`. A `fail` carries a severity:
41
40
  - **CRITICAL:** the ambiguity would change the build or its acceptance: an unquantified
42
41
  acceptance/success criterion, an incomplete enumeration in a requirement, an ambiguous data
43
42
  shape, an undefined edge case on a stated flow, a contradictory pair of requirements.
44
- - **minor:** vague but non-load-bearing prose. Record it; it does not block.
43
+ - **minor:** vague but nonessential prose. Record it; it does not block.
45
44
 
46
- ## The question bank (seed: extend per domain)
45
+ ## Question bank
47
46
 
48
- Each question tests one of the failure modes of requirement prose:
47
+ Each question checks one requirement-prose failure mode:
49
48
  - **Measurability:** every "good / fast / prominent / simple / secure" carries a number, a budget,
50
49
  or a named reference. No adjective stands in for a threshold.
51
50
  - **Completeness:** every enumeration is closed (no "etc."); every requirement with a precondition
@@ -56,18 +55,20 @@ Each question tests one of the failure modes of requirement prose:
56
55
  - **Testability:** each acceptance criterion is binary and names (or clearly implies) its evidence.
57
56
  A criterion only provable by reading code is a fail.
58
57
  - **Consistency:** no requirement contradicts another, the data model, or a non-goal.
58
+ - **Non-functional:** each NFR names affected REQ/AC IDs or a bounded `global` scope;
59
+ human-only proof prerequisites name their owner.
59
60
 
60
- ## How it feeds the readiness gate
61
+ ## Readiness gate
61
62
 
62
- The spec **Readiness gate** (bottom of [`spec-template.md`](spec-template.md)) folds these in: every
63
+ The spec **Readiness gate** at the bottom of
64
+ [`spec-template.md`](spec-template.md) requires every
63
65
  emitted `checklists/<domain>.md` must reach `Verdict: pass` (zero CRITICAL fails) before the gate
64
66
  passes. Minor fails are logged, not blocking. A single open CRITICAL keeps the spec `Status: Draft`.
65
- `/rite-define` reads the checklists at its step 0 and **hard-blocks while any CRITICAL is unchecked**;
66
- a spec that skips the checklists is treated as not-yet-scored: define stops and routes back here.
67
+ `/rite-define` reads the checklists at step 0 and **hard-blocks while any CRITICAL is
68
+ unchecked**. A spec without checklists is not yet checked, so define stops and routes
69
+ back here.
67
70
 
68
71
  ## Discipline
69
- - Score honestly. A checklist you pass by softening the *question* instead of the *spec* is the
70
- spec-quality version of weakening a test to go green. It defeats the gate.
72
+ - Score honestly. Do not soften a checklist question to pass a weak spec.
71
73
  - Don't pad. Five real questions that find one CRITICAL beat thirty rubber-stamped rows.
72
- - These are *English* tests. The moment a question needs a function name to answer, it belongs in
73
- `/rite-vet`'s `test-plan.md`, not here.
74
+ - If a question needs a function name, it belongs in `/rite-vet`'s `test-plan.md`.
@@ -1,13 +1,13 @@
1
1
  # `spec.md` template
2
2
 
3
3
  Write the product contract: WHAT users get, WHY it matters, how success is
4
- measured, and what is out of scope. Keep HOW in `plan.md`; put topology and
4
+ measured, and what is out of scope. Keep HOW in `plan.md`; put technical topology and
5
5
  diagrams in `architecture.md` / `flows.md`; put coverage in `traceability.md`.
6
6
 
7
7
  Rules:
8
8
 
9
9
  1. Mark unknowns with `[NEEDS CLARIFICATION: <question>]`; blocking unknowns
10
- stop `/rite-define`.
10
+ stop `/rite-clarify`.
11
11
  2. Use stable IDs: `REQ-001` for requirements and `AC-001` for acceptance.
12
12
  3. Link to source artifacts instead of duplicating them.
13
13
  4. Keep the file compact. If it exceeds the schema budget, add
@@ -84,11 +84,17 @@ Use `resolved/test`, `resolved/judgment`, `dismissed`, or `unresolved`.
84
84
  - Does not own: <adjacent area>.
85
85
  - Placement summary: <one-line module/layer summary>; full technical map lives in `architecture.md`.
86
86
 
87
+ ## Coverage seed
88
+ - Actors/journeys/components: <material surfaces discovered while authoring>.
89
+ - States/data/contracts/integrations: <material boundaries discovered>.
90
+ - Operations/proof surfaces: <configuration, observability, rollout/rollback, evidence constraints>.
91
+
87
92
  ## References
88
93
  - `brief.md` - request, objective, non-goals, success definition.
89
94
  - `architecture.md` - technical placement and integration points.
90
95
  - `flows.md` - diagrams when useful.
91
96
  - `decisions.md` - ADR-style product/technical decisions.
97
+ - `decision-coverage.md` - topology scan and clarity verdict once `/rite-clarify` runs.
92
98
  - `traceability.md` - AC/REQ coverage once `/rite-define` runs.
93
99
  - `design-brief.md` - UI direction when UI is in scope.
94
100
 
@@ -107,4 +113,5 @@ Use `resolved/test`, `resolved/judgment`, `dismissed`, or `unresolved`.
107
113
  - [ ] Non-goals and scope boundaries are explicit.
108
114
  - [ ] Architecture/flows/decisions are linked out instead of duplicated here.
109
115
  - [ ] UI work has `design-brief.md`; non-UI work states UI is out of scope.
116
+ - [ ] Coverage seed names the material surfaces `/rite-clarify` must scan.
110
117
  ```