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
@@ -10,16 +10,20 @@ This is the Codex mirror of a DevRites skill. In Codex:
10
10
 
11
11
  - Load DevRites engineering standards from `.agents/skills/devrites-lib/reference/standards/`. Read `.agents/skills/devrites-lib/reference/standards/core.md` before workflow work, then load the other `.agents/skills/devrites-lib/reference/standards/*.md` files exactly when this skill asks for them.
12
12
  - Use the installed `devrites-engine` binary as the canonical runtime helper surface for orientation, gates, and state mutation.
13
- - When this skill asks for a DevRites specialist or writer agent, **explicitly** spawn the matching Codex custom agent from `.codex/agents/devrites-*.toml` through Codex subagents (`spawn_agent`), then wait for its result and reconcile it as the skill instructs. Do not do the review inline just because the instruction to spawn is embedded here: Codex under-fires embedded spawn/skill instructions (openai/codex #23496), so treat the spawn as required, not optional.
14
- - The independence of a fresh-context subagent is the point. If Codex genuinely cannot spawn subagents in the current surface, run the documented inline fallback and **label the result an inline fallback, not an independent review**: an inline pass shares the calling context and is weaker evidence.
15
- - Codex project hooks are installed in `.codex/hooks.json`. Review and trust them with `/hooks` before relying on hook enforcement.
13
+ - **Invocation and dispatch are different:** invoke means run a skill in this context; dispatch means start a fresh agent with `spawn_agent`, await it, and reconcile its result. Never describe inline skill work as a dispatch.
14
+ - For every DevRites specialist or writer dispatch, first call `spawn_agent` with the named `devrites-<role>` custom role. The matching project contract is `.codex/agents/devrites-<role>.toml`.
15
+ - If `spawn_agent` is callable but a named read-only role is unavailable, use generic `explorer` only when the host proves that run has a runtime-enforced read-only sandbox. Tell it to read `.codex/agents/devrites-<role>.toml`, follow its `developer_instructions`, and execute the unchanged packet. A missing read-only custom role is not evidence that spawning is unavailable.
16
+ - Never dispatch generic `worker` for `devrites-slice-wright` unless the host proves that worker run carries exact DevRites identity and the same `.wright-allowlist` enforcement as the named role. Codex reports a generic run as `agent_type=worker`, so the generated global hooks cannot prove that binding. Reject that unsafe rung and use the documented labelled inline wright path with `.reconcile-inline` plus the full reconcile gate.
17
+ - If the host cannot prove the generic explorer is runtime read-only, reject that rung too. Only when no spawn primitive exists or a higher-priority policy rejects a safe spawn may the root run the documented discipline inline. Label it `independence: fallback`, never call it independent, and apply every fallback risk gate. An unbound generic wright or unconfined generic explorer is such a safety rejection, not evidence that no agents exist.
18
+ - Wait for every required fresh-context dispatch before reconciling or advancing. A backgrounded or lost result is incomplete.
19
+ - Codex project hooks are installed in `.codex/hooks.json`; declared-leaf hooks are scoped inside `.codex/agents/devrites-*.toml`. Review and trust them with `/hooks` before relying on hook enforcement.
16
20
  - When this skill asks a HITL question via `AskUserQuestion`: Codex's equivalent (`request_user_input`) exists only in Plan mode. Outside Plan mode, render the option set as a plain numbered list in chat and **end the turn** so the human answers: NEVER silently pick an option yourself; auto-picking is AFK's contract, gated by the `.devrites/AFK` sentinel.
17
21
 
18
22
 
19
23
  # devrites-source-driven: verify, don't guess
20
24
 
21
- A confident wrong assumption about a library is a bug waiting to ship. When behavior
22
- matters and isn't certain, check the source of truth.
25
+ When library behavior matters and is uncertain, verify it against installed source or
26
+ authoritative documentation before relying on it.
23
27
 
24
28
  ## When to trigger
25
29
  - You're about to rely on an API signature, default, config key, or behavior you're not
@@ -33,32 +37,33 @@ matters and isn't certain, check the source of truth.
33
37
  version-specific.
34
38
  2. **Consult the source of truth**, in order: the installed package's own source/types
35
39
  in `node_modules`/gem/site-packages; context7 if available (`resolve-library-id` →
36
- `query-docs`) for current upstream docs; official docs for *that version*; the project's
37
- existing usage of the same API.
40
+ `query-docs`) for current upstream docs; official docs for *that version*.
38
41
  3. **Confirm the specific fact:** the signature, the default, the edge behavior, not a
39
42
  general impression.
40
- 4. **Record it** in `decisions.md` (or `evidence.md`): the fact, the version, and the
41
- source (path or URL). Future phases trust the record instead of re-checking.
43
+ 4. **Return it** with fact, version, and source. The root orchestrator records accepted
44
+ evidence in `decisions.md` or `evidence.md`; a leaf agent never writes the workspace.
42
45
 
43
- ## Delegate reading legwork bigger than one fact
44
- When the question is an *area*, not a fact (surveying a library's API surface, an unfamiliar
45
- subsystem's docs, a migration guide) dispatch a **background agent** instead of reading inline:
46
- it investigates against the same source-of-truth order above, cites each claim (path or URL +
47
- version), and writes one note to the active workspace's `references/` directory, linked from
48
- `references.md`. You keep working while it reads; later phases trust the cited note. The inline
49
- flow above stays the path for confirming a single fact.
46
+ ## Delegate broad research
47
+ When the question is an *area* (a library surface, unfamiliar subsystem, or migration
48
+ guide), the **root orchestrator** uses the fresh-context dispatch contract in
49
+ [`agents.md`](../devrites-lib/reference/standards/agents.md) to send one bounded
50
+ `agent-packet/v1` to `devrites-evidence-scout`. Await and validate its cited
51
+ `evidence-dossier`; the orchestrator, not the scout, persists accepted facts under
52
+ `references/` and links them from `references.md`.
53
+
54
+ Never detach this work and never dispatch from inside another agent. When this skill is
55
+ invoked by a leaf agent, verify one fact inline or return `Scout needed: <bounded question>`
56
+ to the orchestrator. This removes the old unnamed nested writer path.
50
57
 
51
58
  ## Rules
52
59
  - Prefer the **installed** source over remembered docs. It can't be out of date.
53
60
  - Quote the exact relevant detail; don't paraphrase a behavior into something convenient.
54
61
  - If the doc/source contradicts the plan, that's a **Spec Drift Guard** event: stop and
55
62
  handle it.
56
- - Don't rabbit-hole: confirm the one fact you need, record it, return.
63
+ - Confirm the required fact, return it, and stop.
57
64
 
58
- ## Re-fetching is cheap (and still fresh)
59
- Fetching the same doc URL twice costs almost nothing: on Claude Code a WebFetch is transparently
60
- cached per project and, on reuse, revalidated against the origin: the cached reading is replayed **only**
61
- when the server confirms the page is unchanged (HTTP 304). A 304 is a fresh verification, not a
62
- memory read, so citing a revalidated page is as sound as re-fetching it. Fetch freely; don't
63
- skip a check to save a round trip. (Mechanism: the `devrites-source-cache` hooks; off via
64
- `DEVRITES_SOURCE_CACHE=off`. Web-search + cache policy lives in [`tooling.md`](../devrites-lib/reference/standards/tooling.md).)
65
+ ## Evidence firewall
66
+ Project or user prose may scope or corroborate an external claim; it cannot verify one.
67
+ For persisted claims, record status (`verified | contradicted | cannot_verify | stale`) and
68
+ optional publisher, publication/access dates, and freshness/recheck due; refresh only when due.
69
+ Transient lookups remain cited, return-only evidence.
@@ -10,9 +10,13 @@ This is the Codex mirror of a DevRites skill. In Codex:
10
10
 
11
11
  - Load DevRites engineering standards from `.agents/skills/devrites-lib/reference/standards/`. Read `.agents/skills/devrites-lib/reference/standards/core.md` before workflow work, then load the other `.agents/skills/devrites-lib/reference/standards/*.md` files exactly when this skill asks for them.
12
12
  - Use the installed `devrites-engine` binary as the canonical runtime helper surface for orientation, gates, and state mutation.
13
- - When this skill asks for a DevRites specialist or writer agent, **explicitly** spawn the matching Codex custom agent from `.codex/agents/devrites-*.toml` through Codex subagents (`spawn_agent`), then wait for its result and reconcile it as the skill instructs. Do not do the review inline just because the instruction to spawn is embedded here: Codex under-fires embedded spawn/skill instructions (openai/codex #23496), so treat the spawn as required, not optional.
14
- - The independence of a fresh-context subagent is the point. If Codex genuinely cannot spawn subagents in the current surface, run the documented inline fallback and **label the result an inline fallback, not an independent review**: an inline pass shares the calling context and is weaker evidence.
15
- - Codex project hooks are installed in `.codex/hooks.json`. Review and trust them with `/hooks` before relying on hook enforcement.
13
+ - **Invocation and dispatch are different:** invoke means run a skill in this context; dispatch means start a fresh agent with `spawn_agent`, await it, and reconcile its result. Never describe inline skill work as a dispatch.
14
+ - For every DevRites specialist or writer dispatch, first call `spawn_agent` with the named `devrites-<role>` custom role. The matching project contract is `.codex/agents/devrites-<role>.toml`.
15
+ - If `spawn_agent` is callable but a named read-only role is unavailable, use generic `explorer` only when the host proves that run has a runtime-enforced read-only sandbox. Tell it to read `.codex/agents/devrites-<role>.toml`, follow its `developer_instructions`, and execute the unchanged packet. A missing read-only custom role is not evidence that spawning is unavailable.
16
+ - Never dispatch generic `worker` for `devrites-slice-wright` unless the host proves that worker run carries exact DevRites identity and the same `.wright-allowlist` enforcement as the named role. Codex reports a generic run as `agent_type=worker`, so the generated global hooks cannot prove that binding. Reject that unsafe rung and use the documented labelled inline wright path with `.reconcile-inline` plus the full reconcile gate.
17
+ - If the host cannot prove the generic explorer is runtime read-only, reject that rung too. Only when no spawn primitive exists or a higher-priority policy rejects a safe spawn may the root run the documented discipline inline. Label it `independence: fallback`, never call it independent, and apply every fallback risk gate. An unbound generic wright or unconfined generic explorer is such a safety rejection, not evidence that no agents exist.
18
+ - Wait for every required fresh-context dispatch before reconciling or advancing. A backgrounded or lost result is incomplete.
19
+ - Codex project hooks are installed in `.codex/hooks.json`; declared-leaf hooks are scoped inside `.codex/agents/devrites-*.toml`. Review and trust them with `/hooks` before relying on hook enforcement.
16
20
  - When this skill asks a HITL question via `AskUserQuestion`: Codex's equivalent (`request_user_input`) exists only in Plan mode. Outside Plan mode, render the option set as a plain numbered list in chat and **end the turn** so the human answers: NEVER silently pick an option yourself; auto-picking is AFK's contract, gated by the `.devrites/AFK` sentinel.
17
21
 
18
22
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: rite
3
- description: User-invoked DevRites menu and router; no args renders the menu, a verb dispatches to the matching `rite-<verb>` skill.
3
+ description: User-invoked DevRites menu and router; no args renders the menu, a verb invokes the matching `rite-<verb>` skill.
4
4
  argument-hint: "[verb [args...]]"
5
5
  user-invocable: true
6
6
  disable-model-invocation: true
@@ -12,9 +12,13 @@ This is the Codex mirror of a DevRites skill. In Codex:
12
12
 
13
13
  - Load DevRites engineering standards from `.agents/skills/devrites-lib/reference/standards/`. Read `.agents/skills/devrites-lib/reference/standards/core.md` before workflow work, then load the other `.agents/skills/devrites-lib/reference/standards/*.md` files exactly when this skill asks for them.
14
14
  - Use the installed `devrites-engine` binary as the canonical runtime helper surface for orientation, gates, and state mutation.
15
- - When this skill asks for a DevRites specialist or writer agent, **explicitly** spawn the matching Codex custom agent from `.codex/agents/devrites-*.toml` through Codex subagents (`spawn_agent`), then wait for its result and reconcile it as the skill instructs. Do not do the review inline just because the instruction to spawn is embedded here: Codex under-fires embedded spawn/skill instructions (openai/codex #23496), so treat the spawn as required, not optional.
16
- - The independence of a fresh-context subagent is the point. If Codex genuinely cannot spawn subagents in the current surface, run the documented inline fallback and **label the result an inline fallback, not an independent review**: an inline pass shares the calling context and is weaker evidence.
17
- - Codex project hooks are installed in `.codex/hooks.json`. Review and trust them with `/hooks` before relying on hook enforcement.
15
+ - **Invocation and dispatch are different:** invoke means run a skill in this context; dispatch means start a fresh agent with `spawn_agent`, await it, and reconcile its result. Never describe inline skill work as a dispatch.
16
+ - For every DevRites specialist or writer dispatch, first call `spawn_agent` with the named `devrites-<role>` custom role. The matching project contract is `.codex/agents/devrites-<role>.toml`.
17
+ - If `spawn_agent` is callable but a named read-only role is unavailable, use generic `explorer` only when the host proves that run has a runtime-enforced read-only sandbox. Tell it to read `.codex/agents/devrites-<role>.toml`, follow its `developer_instructions`, and execute the unchanged packet. A missing read-only custom role is not evidence that spawning is unavailable.
18
+ - Never dispatch generic `worker` for `devrites-slice-wright` unless the host proves that worker run carries exact DevRites identity and the same `.wright-allowlist` enforcement as the named role. Codex reports a generic run as `agent_type=worker`, so the generated global hooks cannot prove that binding. Reject that unsafe rung and use the documented labelled inline wright path with `.reconcile-inline` plus the full reconcile gate.
19
+ - If the host cannot prove the generic explorer is runtime read-only, reject that rung too. Only when no spawn primitive exists or a higher-priority policy rejects a safe spawn may the root run the documented discipline inline. Label it `independence: fallback`, never call it independent, and apply every fallback risk gate. An unbound generic wright or unconfined generic explorer is such a safety rejection, not evidence that no agents exist.
20
+ - Wait for every required fresh-context dispatch before reconciling or advancing. A backgrounded or lost result is incomplete.
21
+ - Codex project hooks are installed in `.codex/hooks.json`; declared-leaf hooks are scoped inside `.codex/agents/devrites-*.toml`. Review and trust them with `/hooks` before relying on hook enforcement.
18
22
  - When this skill asks a HITL question via `AskUserQuestion`: Codex's equivalent (`request_user_input`) exists only in Plan mode. Outside Plan mode, render the option set as a plain numbered list in chat and **end the turn** so the human answers: NEVER silently pick an option yourself; auto-picking is AFK's contract, gated by the `.devrites/AFK` sentinel.
19
23
 
20
24
 
@@ -23,7 +27,7 @@ This is the Codex mirror of a DevRites skill. In Codex:
23
27
  You are the DevRites entry point. Two modes:
24
28
 
25
29
  - **No args** → run `devrites-engine first-task`, render one recommended-start line above the menu, then stop. Do not execute a phase or read `state.md`: status is `$rite-status`.
26
- - **Verb arg** → pass-through dispatch to the matching `rite-<verb>` skill (`$rite spec foo` ≡ `$rite-spec foo`); the called skill owns the output.
30
+ - **Verb arg** → pass-through invocation of the matching `rite-<verb>` skill (`$rite spec foo` ≡ `$rite-spec foo`); the called skill owns the output.
27
31
 
28
32
  When the user asks which rite fits, load [`devrites-lib/reference/intent-map.md`](../devrites-lib/reference/intent-map.md).
29
33
  When they ask how phases connect, load [`reference/menu.md`](reference/menu.md).
@@ -39,12 +43,13 @@ F=.agents/skills/rite-$V/SKILL.md
39
43
  # Then Read "$F" and follow its workflow with $ARGS as that skill's $ARGUMENTS.
40
44
  ```
41
45
 
42
- What each verb does lives once, in the Menu below; this table is the dispatch map only.
46
+ What each verb does lives once, in the Menu below; this table is the invocation map only.
43
47
 
44
48
  | Verb | Skill |
45
49
  |---|---|
46
50
  | `spec [feature]` | `$rite-spec` |
47
51
  | `adopt [area]` | `$rite-adopt` |
52
+ | `clarify [feature]` | `$rite-clarify` |
48
53
  | `temper [--mode]` | `$rite-temper` |
49
54
  | `define` | `$rite-define` |
50
55
  | `vet [--cross-model]` | `$rite-vet` |
@@ -75,17 +80,17 @@ What each verb does lives once, in the Menu below; this table is the dispatch ma
75
80
  | `quick [change]` | `$rite-quick` |
76
81
  | `frame [task]` | `$rite-frame` |
77
82
 
78
- Both forms hit the same skill: the menu form for discovery, the `/rite-<verb>` shortcut for muscle memory.
83
+ Both forms call the same skill. The menu supports discovery; `/rite-<verb>` is the direct form.
79
84
 
80
85
  `use <slug>` is handled **inline**. There is no `rite-use` skill. Confirm
81
86
  `.devrites/work/<slug>/` exists, then re-point `.devrites/ACTIVE` to `<slug>` and report
82
87
  the now-active feature. It is cheap context-switching only: no re-spec, no phase run. If
83
88
  the workspace is missing, list the slugs under `.devrites/work/` and stop.
84
89
 
85
- `guide` is an inline first-feature walkthrough. Agree on one **real, genuinely small**
86
- change, then run spec → temper → define → vet → build → prove → polish → review → seal →
90
+ `guide` is an inline walkthrough for the first feature. Agree on one **real, small**
91
+ change, then run spec → clarify → temper → define → vet → build → prove → polish → review → seal →
87
92
  ship. Before each phase, say what it decides; after, name what it wrote and why. Pause at
88
- every boundary. Teach without lecturing.
93
+ every boundary and explain only what the user needs for the next decision.
89
94
 
90
95
  Specialist triggers (model-invoked inside the above):
91
96
  `devrites-frontend-craft` (UI) · `devrites-browser-proof` (UI verify) ·
@@ -101,7 +106,7 @@ Reply-contract exception: `$rite` is the menu/router, not a workspace completion
101
106
  Called phase skills own the shared completion reply contract
102
107
  ([`reply-contract.md`](../devrites-lib/reference/reply-contract.md)).
103
108
 
104
- 1. **Verb in `$ARGUMENTS`** → dispatch per the table above.
109
+ 1. **Verb in `$ARGUMENTS`** → invoke the matching skill per the table above.
105
110
  2. **No args** → menu mode, as above.
106
111
  3. **Unrecognized first token** → tell the user the known verbs and stop. Don't guess.
107
112
  4. **No active feature** and the user asked "where am I" or named no verb → point at `$rite spec <feature>` (or `$rite-spec`). Don't summarize state yourself: `$rite status` (or `$rite-status`) owns that.
@@ -114,6 +119,7 @@ Recommended start: <greenfield: $rite spec <feature> | brownfield-unadopted: $ri
114
119
  menu form direct shortcut
115
120
  SPEC $rite spec ≡ $rite-spec investigate deeply → write spec.md
116
121
  ADOPT $rite adopt ≡ $rite-adopt onboard existing code → reverse-derive spec.md + seed conventions
122
+ CLARIFY $rite clarify ≡ $rite-clarify close the complete decision surface before planning
117
123
  TEMPER $rite temper ≡ $rite-temper optional — strategic review: scope mode + pre-mortem, harden the spec
118
124
  PLAN $rite define ≡ $rite-define turn the spec into plan + task slices + state
119
125
  VET $rite vet ≡ $rite-vet mandatory every plan — light/full engineering review by stakes
@@ -143,8 +149,8 @@ UTILITY $rite frame | prototype | handoff | zoom-out | pressure-test (or
143
149
 
144
150
  > **Small one-off change?** A typo, copy tweak, config bump, or one-function fix → **`$rite-quick`**
145
151
  > (express lane: one contract → build → prove → ship, no full workspace). It escalates to
146
- > `$rite-spec` the instant the change grows past small / reversible / unambiguous. The full
147
- > lifecycle above is for real features: don't pay its ceremony for a one-off.
152
+ > `$rite-spec` when the change is no longer small, reversible, and unambiguous. Use the
153
+ > full lifecycle above for features.
148
154
 
149
155
  ## Core operating rules (every DevRites skill enforces)
150
156
 
@@ -7,16 +7,17 @@ what each command does or how phases connect.
7
7
 
8
8
  | Phase | Command | Use when |
9
9
  |---|---|---|
10
- | Spec | `$rite-spec <feature>` | **New feature.** Investigate deeply → write spec.md. Asks with options; gathers attached design references (optional). |
10
+ | Spec | `$rite-spec <feature>` | **New feature.** Investigate → write spec.md. Asks with options; gathers attached design references (optional). |
11
11
  | Adopt | `$rite-adopt` | Onboard an existing codebase instead of starting fresh: reverse-derive spec.md + seed the conventions ledger. |
12
+ | Clarify | `$rite-clarify` | _Required after spec._ Topology-first decision-coverage scan; zero-question fast path when already clear. |
12
13
  | Temper | `$rite-temper` | _Optional, before define._ Strategic review of the spec: scope mode (expand/selective/hold-rigor/reduce) + pre-mortem; hardens the spec. Best on big/risky features; mandatory in `$rite-autocomplete`. |
13
14
  | Plan | `$rite-define` | Turn the approved spec into plan + vertical task slices + state. |
14
15
  | Vet | `$rite-vet` | _Required before build._ Review every plan: scope · architecture · tests · perf; light for simple/reversible, full for high stakes. |
15
16
  | Re-plan | `$rite-plan` | The active plan is too big, wrong, stale, ambiguous, or blocked. |
16
17
  | Build | `$rite-build` | Implement the next single vertical slice. Stops after one slice. |
17
- | Converge | `$rite-converge` | _Recovery._ Code drifted from / falls short of intent (resumed cold, adopted, stalled build): assess live code vs spec/plan/tasks and append the remaining work as new slices for `$rite-build`. |
18
+ | Converge | `$rite-converge` | _Recovery._ Code drifted from or falls short of intent after a resume, adoption, or stalled build: compare live code with spec/plan/tasks and append remaining work as new slices for `$rite-build`. |
18
19
  | Prove | `$rite-prove` | Prove the current scope: tests, build, runtime, browser evidence. |
19
- | Polish | `$rite-polish` | Code polish always; UI normalize + ship-quality polish if UI is in scope. Modes: `bolder/quieter/distill/harden/normalize-only`. |
20
+ | Polish | `$rite-polish` | Code polish always; normalize and polish UI when in scope. Modes: `bolder/quieter/distill/harden/normalize-only`. |
20
21
  | Review | `$rite-review` | Feature-scoped review before sealing. |
21
22
  | Seal | `$rite-seal` | Final GO / NO-GO decision (no git). |
22
23
  | Ship | `$rite-ship` | Type-GO → commit/push/tag, then archive the task + clear ACTIVE. |
@@ -26,14 +27,15 @@ what each command does or how phases connect.
26
27
 
27
28
  ## Typical orderings
28
29
 
29
- - **Every feature**: `$rite-spec` (spec) → *(big feature? `$rite-temper`: strategic review)*
30
+ - **Every feature**: `$rite-spec` (spec) → `$rite-clarify` (decision coverage) →
31
+ *(big feature? `$rite-temper`: strategic review)* →
30
32
  `$rite-define` (plan) → `$rite-vet` (engineering review; light or full) →
31
33
  `$rite-build` ×N (all slices) → `$rite-prove` (once all built) →
32
34
  `$rite-polish` (always: code + UI if UI) → `$rite-review` → `$rite-seal` → `$rite-ship`.
33
- - **Existing codebase**: `$rite-adopt` → `$rite-define` → `$rite-vet` → build.
35
+ - **Existing codebase**: `$rite-adopt` → `$rite-clarify` → `$rite-define` → `$rite-vet` → build.
34
36
  - **Drift mid-build**: stop → drift question → `$rite-plan` (repair) → resume build.
35
37
  - **Resumed / adopted / stalled**: `$rite-converge` (assess live code vs intent → append the
36
- remaining slices) → `$rite-build` ×N → continue at `$rite-prove`.
38
+ remaining slices) → `$rite-vet` → `$rite-build` ×N → continue at `$rite-prove`.
37
39
 
38
40
  ## Rules this menu obeys
39
41
 
@@ -11,26 +11,27 @@ This is the Codex mirror of a DevRites skill. In Codex:
11
11
 
12
12
  - Load DevRites engineering standards from `.agents/skills/devrites-lib/reference/standards/`. Read `.agents/skills/devrites-lib/reference/standards/core.md` before workflow work, then load the other `.agents/skills/devrites-lib/reference/standards/*.md` files exactly when this skill asks for them.
13
13
  - Use the installed `devrites-engine` binary as the canonical runtime helper surface for orientation, gates, and state mutation.
14
- - When this skill asks for a DevRites specialist or writer agent, **explicitly** spawn the matching Codex custom agent from `.codex/agents/devrites-*.toml` through Codex subagents (`spawn_agent`), then wait for its result and reconcile it as the skill instructs. Do not do the review inline just because the instruction to spawn is embedded here: Codex under-fires embedded spawn/skill instructions (openai/codex #23496), so treat the spawn as required, not optional.
15
- - The independence of a fresh-context subagent is the point. If Codex genuinely cannot spawn subagents in the current surface, run the documented inline fallback and **label the result an inline fallback, not an independent review**: an inline pass shares the calling context and is weaker evidence.
16
- - Codex project hooks are installed in `.codex/hooks.json`. Review and trust them with `/hooks` before relying on hook enforcement.
14
+ - **Invocation and dispatch are different:** invoke means run a skill in this context; dispatch means start a fresh agent with `spawn_agent`, await it, and reconcile its result. Never describe inline skill work as a dispatch.
15
+ - For every DevRites specialist or writer dispatch, first call `spawn_agent` with the named `devrites-<role>` custom role. The matching project contract is `.codex/agents/devrites-<role>.toml`.
16
+ - If `spawn_agent` is callable but a named read-only role is unavailable, use generic `explorer` only when the host proves that run has a runtime-enforced read-only sandbox. Tell it to read `.codex/agents/devrites-<role>.toml`, follow its `developer_instructions`, and execute the unchanged packet. A missing read-only custom role is not evidence that spawning is unavailable.
17
+ - Never dispatch generic `worker` for `devrites-slice-wright` unless the host proves that worker run carries exact DevRites identity and the same `.wright-allowlist` enforcement as the named role. Codex reports a generic run as `agent_type=worker`, so the generated global hooks cannot prove that binding. Reject that unsafe rung and use the documented labelled inline wright path with `.reconcile-inline` plus the full reconcile gate.
18
+ - If the host cannot prove the generic explorer is runtime read-only, reject that rung too. Only when no spawn primitive exists or a higher-priority policy rejects a safe spawn may the root run the documented discipline inline. Label it `independence: fallback`, never call it independent, and apply every fallback risk gate. An unbound generic wright or unconfined generic explorer is such a safety rejection, not evidence that no agents exist.
19
+ - Wait for every required fresh-context dispatch before reconciling or advancing. A backgrounded or lost result is incomplete.
20
+ - Codex project hooks are installed in `.codex/hooks.json`; declared-leaf hooks are scoped inside `.codex/agents/devrites-*.toml`. Review and trust them with `/hooks` before relying on hook enforcement.
17
21
  - When this skill asks a HITL question via `AskUserQuestion`: Codex's equivalent (`request_user_input`) exists only in Plan mode. Outside Plan mode, render the option set as a plain numbered list in chat and **end the turn** so the human answers: NEVER silently pick an option yourself; auto-picking is AFK's contract, gated by the `.devrites/AFK` sentinel.
18
22
 
19
23
 
20
- # $rite-adopt: brownfield on-ramp
24
+ # $rite-adopt: onboard existing code
21
25
 
22
- The **reverse** of `$rite-spec`. `$rite-spec` goes idea spec; `$rite-adopt` goes
23
- **existing code spec + seeded conventions**, so an already-built project can enter the
24
- DevRites lifecycle without hand-writing a spec from nothing. It produces the same
25
- `spec.md` the rest of the lifecycle expects, plus a head start in the conventions ledger
26
- so the very first new slice already knows the project's idioms.
26
+ `$rite-adopt` derives a spec and initial conventions from existing code. It produces the
27
+ same `spec.md` used by the rest of the lifecycle and seeds the conventions ledger with
28
+ observed project idioms.
27
29
 
28
- Use it once, at the start, to onboard a repo (or a sub-area of one). After it, the normal
29
- lifecycle (`$rite-temper` `$rite-define` `$rite-build` …) takes over.
30
+ Use it once when onboarding a repository or one of its sub-areas. Continue with
31
+ `$rite-clarify`, `$rite-temper`, `$rite-define`, and `$rite-build`.
30
32
 
31
- > **Just want a map, not an onboarding?** `$rite-zoom-out` returns a structural map of
32
- > unfamiliar code without creating a workspace or ledger. `$rite-adopt` is the heavier move:
33
- > it *commits the project to the lifecycle*. Pick zoom-out to look, adopt to begin.
33
+ > **Need only a code map?** `$rite-zoom-out` maps unfamiliar code without creating a
34
+ > workspace or ledger. Use `$rite-adopt` when the project should enter the lifecycle.
34
35
 
35
36
  ## Rules consulted (read on demand from `.agents/skills/devrites-lib/reference/standards/`)
36
37
  Pull `documentation.md` when recording the adoption decisions (why-not-what) in
@@ -49,7 +50,7 @@ upholds invariants worth proposing as project principles (step 4a).
49
50
  if stated: what the user wants to build *next* on top of it. If the next-build objective
50
51
  is missing, ask once (it shapes the spec's acceptance); if the area is ambiguous, confirm
51
52
  before investigating the whole tree.
52
- 2. **Reverse-investigate the existing code:** the durable shape of the project. Use a
53
+ 2. **Inspect the existing code** to establish the project's current structure. Use a
53
54
  code-intelligence index if available (codebase-memory-mcp first (its `get_architecture`
54
55
  gives a fast overview), cross-checked with codegraph + graphify, else standard methods
55
56
  (LSP / Read/Grep/Glob); see `.agents/skills/devrites-lib/reference/standards/tooling.md`) for
@@ -64,10 +65,10 @@ upholds invariants worth proposing as project principles (step 4a).
64
65
  **current behavior as the baseline** and the **next objective** (what adoption is for) with
65
66
  measurable acceptance. Also write `decisions.md`, `assumptions.md`, `questions.md`, and
66
67
  `state.md` (phase: spec).
67
- 3a. **Seed the capability ledger** from the baseline. If the reverse-derived `spec.md` carries
68
+ 3a. **Seed the capability ledger** from the baseline. If the derived `spec.md` carries
68
69
  structured `### Requirement:` blocks, fold them into the living
69
- `.devrites/specs/<capability>/spec.md` ledger so the project's *current* proven behavior is on
70
- record before the first new feature: the ledger the next `$rite-spec` writes deltas against
70
+ `.devrites/specs/<capability>/spec.md` ledger so the project's current proven behavior is
71
+ recorded before the first new feature. The next `$rite-spec` writes deltas against this ledger
71
72
  ([ledger.md](../rite-ship/reference/ledger.md)). A flat baseline folds as all-ADDED into the
72
73
  feature slug's capability; tag capabilities in the spec first if you want finer granularity.
73
74
  ```bash
@@ -75,29 +76,28 @@ upholds invariants worth proposing as project principles (step 4a).
75
76
  devrites-engine ledger sync .devrites/work/<slug> # seed
76
77
  ```
77
78
  Skip when the baseline records no structured requirements (nothing to seed).
78
- 4. **Seed the conventions ledger** from what the investigation *observed*:
79
- [adoption § seeding](reference/adoption.md). This is the deliberate bootstrap exception to
80
- evidence-gated promotion: the seeds start at the base band and are provenance-tagged as
81
- onboarding observations, not sealed-slice proofs, so real slices later corroborate or
82
- (fresh-wins) contradict them.
79
+ 4. **Seed the conventions ledger** from observed behavior:
80
+ [adoption § seeding](reference/adoption.md). This is the bootstrap exception to
81
+ evidence-gated promotion. Seeds start at the base band with onboarding provenance;
82
+ later sealed slices may confirm or contradict them, and fresh evidence wins.
83
83
  **Completion:** every seed names observed evidence, provenance, and the base band.
84
- 4a. **Propose candidate principles** (human-ratified; optional). Where the investigation found an
85
- invariant the code *consistently and deliberately* upholds (money always in integer cents, PII
86
- always redacted from logs, every v1 endpoint preserved) surface it as a **candidate
87
- principle**, not a seeded convention. Principles are prescriptive and gating, so they are
88
- **ratified by the human, never auto-seeded** the way conventions are: present the candidates via
89
- `AskUserQuestion` with the evidence (where the code upholds it), and write the ones the human
90
- ratifies to `.devrites/principles.md` with a dated Governance entry
91
- ([`principles.md`](../devrites-lib/reference/standards/principles.md)). Propose, don't impose: an unratified candidate
92
- stays a convention, not a gate. Skip cleanly when nothing rises to an invariant (common: a
93
- fresh adopt may declare zero principles, and that's valid).
94
- 5. **Hand off.** Spec and ledger are ready. Next: `$rite-temper` if big/risky,
95
- else `$rite-define`; every plan then runs `$rite-vet` before build. Do not plan/build here.
84
+ 4a. **Propose candidate principles** (optional and human-ratified). When the code
85
+ consistently enforces an invariant, such as integer cents for money, redacted PII in
86
+ logs, or preserved v1 endpoints, propose it as a **candidate principle** rather than a
87
+ convention. Principles are prescriptive gates, so **never seed them automatically**.
88
+ Present each candidate through `AskUserQuestion` with evidence, and write human-ratified
89
+ candidates to `.devrites/principles.md` with a dated Governance entry
90
+ ([`principles.md`](../devrites-lib/reference/standards/principles.md)). An unratified
91
+ candidate remains a convention, not a gate. If no invariant qualifies, declare no
92
+ principles.
93
+ 5. **Hand off.** Continue with `$rite-clarify`. Its topology scan asks no questions when
94
+ the derived contract is already clear. Every plan then runs `$rite-vet` before build.
95
+ Do not plan or build here.
96
96
  **Completion:** one next rite is reported and no plan or application code was written.
97
97
 
98
- > **Mid-flight discipline.** Don't invent conventions the code doesn't follow, don't
99
- > seed an idiom you only assumed, and don't expand scope into a rewrite: adoption documents
100
- > what exists; the *next* feature changes it. See [`anti-patterns`](reference/anti-patterns.md).
98
+ > **Mid-flight discipline.** Do not invent conventions, seed an assumed idiom, or turn
99
+ > adoption into a rewrite. Adoption records existing behavior; a later feature changes it.
100
+ > See [`anti-patterns`](reference/anti-patterns.md).
101
101
 
102
102
  ## Output
103
103
 
@@ -108,8 +108,8 @@ Default success shape:
108
108
  Done: adopted existing behavior into <slug>; baseline spec and placement recorded.
109
109
  Changed: spec.md, decisions.md, conventions ledger, principles proposals <updated|none>
110
110
  Evidence: not applicable; reverse-derived behavior is recorded for review
111
- Open: <none | adoption questions | Alternative: $rite-define for straightforward follow-up>
112
- Next: $rite-temper
111
+ Open: <none | adoption questions>
112
+ Next: $rite-clarify
113
113
  Record: .devrites/work/<slug>/spec.md
114
114
  ↻ Hygiene: /clear before the next phase
115
115
  ```
@@ -11,41 +11,48 @@ This is the Codex mirror of a DevRites skill. In Codex:
11
11
 
12
12
  - Load DevRites engineering standards from `.agents/skills/devrites-lib/reference/standards/`. Read `.agents/skills/devrites-lib/reference/standards/core.md` before workflow work, then load the other `.agents/skills/devrites-lib/reference/standards/*.md` files exactly when this skill asks for them.
13
13
  - Use the installed `devrites-engine` binary as the canonical runtime helper surface for orientation, gates, and state mutation.
14
- - When this skill asks for a DevRites specialist or writer agent, **explicitly** spawn the matching Codex custom agent from `.codex/agents/devrites-*.toml` through Codex subagents (`spawn_agent`), then wait for its result and reconcile it as the skill instructs. Do not do the review inline just because the instruction to spawn is embedded here: Codex under-fires embedded spawn/skill instructions (openai/codex #23496), so treat the spawn as required, not optional.
15
- - The independence of a fresh-context subagent is the point. If Codex genuinely cannot spawn subagents in the current surface, run the documented inline fallback and **label the result an inline fallback, not an independent review**: an inline pass shares the calling context and is weaker evidence.
16
- - Codex project hooks are installed in `.codex/hooks.json`. Review and trust them with `/hooks` before relying on hook enforcement.
14
+ - **Invocation and dispatch are different:** invoke means run a skill in this context; dispatch means start a fresh agent with `spawn_agent`, await it, and reconcile its result. Never describe inline skill work as a dispatch.
15
+ - For every DevRites specialist or writer dispatch, first call `spawn_agent` with the named `devrites-<role>` custom role. The matching project contract is `.codex/agents/devrites-<role>.toml`.
16
+ - If `spawn_agent` is callable but a named read-only role is unavailable, use generic `explorer` only when the host proves that run has a runtime-enforced read-only sandbox. Tell it to read `.codex/agents/devrites-<role>.toml`, follow its `developer_instructions`, and execute the unchanged packet. A missing read-only custom role is not evidence that spawning is unavailable.
17
+ - Never dispatch generic `worker` for `devrites-slice-wright` unless the host proves that worker run carries exact DevRites identity and the same `.wright-allowlist` enforcement as the named role. Codex reports a generic run as `agent_type=worker`, so the generated global hooks cannot prove that binding. Reject that unsafe rung and use the documented labelled inline wright path with `.reconcile-inline` plus the full reconcile gate.
18
+ - If the host cannot prove the generic explorer is runtime read-only, reject that rung too. Only when no spawn primitive exists or a higher-priority policy rejects a safe spawn may the root run the documented discipline inline. Label it `independence: fallback`, never call it independent, and apply every fallback risk gate. An unbound generic wright or unconfined generic explorer is such a safety rejection, not evidence that no agents exist.
19
+ - Wait for every required fresh-context dispatch before reconciling or advancing. A backgrounded or lost result is incomplete.
20
+ - Codex project hooks are installed in `.codex/hooks.json`; declared-leaf hooks are scoped inside `.codex/agents/devrites-*.toml`. Review and trust them with `/hooks` before relying on hook enforcement.
17
21
  - When this skill asks a HITL question via `AskUserQuestion`: Codex's equivalent (`request_user_input`) exists only in Plan mode. Outside Plan mode, render the option set as a plain numbered list in chat and **end the turn** so the human answers: NEVER silently pick an option yourself; auto-picking is AFK's contract, gated by the `.devrites/AFK` sentinel.
18
22
 
19
23
 
20
24
  # $rite-autocomplete: full lifecycle, unattended
21
25
 
22
- Drives every DevRites phase in order without stopping for discretionary input. The
23
- prompt may be vague: autocomplete asks its clarifying questions **up front**, then
24
- runs to completion. It does **not** disable the safety gates: hard irreversible-risk,<!-- pack-scan-ignore: negated statement: gates are NOT disabled -->
26
+ Runs every DevRites phase in order without pausing for discretionary input. It asks
27
+ clarifying questions **before** unattended work begins. Safety gates remain active:
28
+ hard irreversible-risk,<!-- pack-scan-ignore: negated statement: gates are NOT disabled -->
25
29
  blocking / escalating gates, and any NO-GO still pause.
26
30
 
27
31
  ## Rules consulted (read on demand from `.agents/skills/devrites-lib/reference/standards/`)
28
32
  **Step 0:** Read `.agents/skills/devrites-lib/reference/standards/core.md` and `.agents/skills/devrites-lib/reference/standards/afk-hitl.md` first.
29
33
 
30
34
  ## Operating rules
31
- - **One human window.** Clarifying questions are batched up front via
32
- `devrites-interview`. After that, discretionary decisions are made automatically and
33
- recorded in `decisions.md`, not asked. See [reference/decision-policy.md](reference/decision-policy.md).
35
+ - **Use one initial human window.** Run spec and topology-first clarify; arm AFK only after
36
+ `Decision coverage: CLEAR`. Later discretionary calls are recorded, not asked
37
+ ([decision policy](reference/decision-policy.md)).
34
38
  - **Safety gates are not bypassable.** AFK never auto-passes destructive migration /
35
- auth-authz change / public-API break / external-contract change / red tests; blocking
39
+ auth-authz change / public-API break / external-contract change; blocking
36
40
  and escalating gates and any open `gate: validating` always pause. `--ship` auto-confirms
37
41
  the **final** type-GO only: nothing else. A change that violates a declared project
38
42
  principle (`.devrites/principles.md`) with no recorded exception pauses too: autocomplete
39
43
  never grants a principle exception on its own (`principles.md`: that's a human decision).
40
- - **Loop budget = the plan's own slice count, not a fixed number.** After `$rite-vet`
44
+ Red checks never advance the loop: autocomplete runs the shared bounded debug recovery, then
45
+ stops as `blocked` if the objective failure remains; it asks only if recovery exposes a
46
+ human-owned decision.
47
+ - **Set the loop budget from the plan's slice count.** After `$rite-vet`
41
48
  (not `$rite-define`: vet may split or add slices, so the count isn't final until then),
42
49
  set the AFK budget to however many slices the plan has, so the loop builds exactly the
43
- task's slices and stops when they're done. `--max-slices N` is an OPTIONAL *lower* safety
44
- cap (partial / babysat run); omit it to run the whole plan. The budget is finite
45
- (= planned slices), so a runaway is still bounded.
46
- - **Best option, recorded.** For each discretionary choice, pick the option the relevant
47
- specialist / reviewer favours and record the rationale. Never silently coin-flip.
48
- - **Strategic review runs, but never auto-grows scope.** After `$rite-spec`, run `$rite-temper`
50
+ planned slices and stops when they are done. `--max-slices N` is an optional lower
51
+ safety cap for a partial run; omit it to run the whole plan. The planned slice count
52
+ keeps the default run finite.
53
+ - **Record each discretionary choice.** Pick the option recommended by the relevant
54
+ specialist or reviewer and record the rationale. Do not choose arbitrarily.
55
+ - **Strategic review runs, but never auto-grows scope.** After `$rite-clarify`, run `$rite-temper`
49
56
  (significance-gated; it skips low-stakes specs in one line). Unattended it auto-applies only
50
57
  `hold-rigor` + `reduce-to-MVP` (these never grow acceptance); **any `expand` is a blocking
51
58
  pause**, and irreversible-risk findings always pause. Autocomplete hardens and may *prune* the
@@ -61,19 +68,22 @@ blocking / escalating gates, and any NO-GO still pause.
61
68
  ## Workflow
62
69
  1. **Orient + parse args.** Run `devrites-engine preamble` for deterministic workspace orientation.
63
70
  The idea + flags: `--ship` / `--yolo` (auto-confirm the final
64
- type-GO), `--max-slices N` (OPTIONAL *lower* safety cap for a partial run; default =
71
+ type-GO), `--max-slices N` (optional lower safety cap for a partial run; default =
65
72
  the plan's slice count, i.e. run all planned slices).
66
- 2. **Clarify up front.** If the idea is underspecified, run `devrites-interview` to
67
- ~95% confidence: the only interactive window. If already clear, skip.
68
- 3. **Arm AFK.** Write `.devrites/AFK` with `allow_gates: [advisory]`; set the slice budget
73
+ 2. **Specify and clarify up front.** Use `devrites-interview`, `$rite-spec`, and
74
+ `$rite-clarify` as one interactive window. Clear specs ask zero questions; Partial/Missing
75
+ coverage never arms AFK. **Completion:** `decision-coverage.md` records `CLEAR`.
76
+ 3. **Arm AFK after clarity.** Require `Decision coverage: CLEAR`, then write `.devrites/AFK`
77
+ with `allow_gates: [advisory]`; set the slice budget
69
78
  from the plan's count after `$rite-vet` (the slice count is only final post-vet), or from
70
79
  an explicit `--max-slices` ([reference/loop.md](reference/loop.md)). validating / blocking / escalating +
71
- irreversible-risk still pause. Also `touch .devrites/CHECKPOINT`: an unattended run is the
72
- case checkpoint mode earns its keep, so each proven slice is committed local-only as
73
- crash-survivable `WIP` ([rite-build/reference/checkpoint.md](../rite-build/reference/checkpoint.md));
80
+ irreversible-risk still pause. Also `touch .devrites/CHECKPOINT`: unattended runs use
81
+ checkpoint mode so each proven slice is committed locally as a crash-survivable `WIP`
82
+ ([rite-build/reference/checkpoint.md](../rite-build/reference/checkpoint.md));
74
83
  `$rite-ship` collapses them into the one feature commit.
75
- 4. **Drive the phases** ([reference/loop.md](reference/loop.md)): `$rite-spec`
76
- **`$rite-temper`**`$rite-define` → **`$rite-vet`** → `$rite-build` (loop until all slices
84
+ 4. **Drive the phases** ([reference/loop.md](reference/loop.md)). The canonical arc is
85
+ `$rite-spec`**`$rite-clarify`** → **`$rite-temper`** → `$rite-define`
86
+ **`$rite-vet`** → `$rite-build` (repeat until all slices
77
87
  built; `devrites-engine tick-afk` each) → `$rite-prove` → `$rite-polish` → `$rite-review` → `$rite-seal`.
78
88
  Run each by Reading its `SKILL.md` and executing its workflow; state is carried by the
79
89
  workspace files, not chat.
@@ -83,12 +93,11 @@ blocking / escalating gates, and any NO-GO still pause.
83
93
  6. **Seal GO → ship.** With `--ship`, proceed to `$rite-ship` and auto-confirm the
84
94
  type-GO. Without it, render the type-GO prompt and stop for the human.
85
95
 
86
- > **Mid-flight discipline.** When tempted to auto-pass a blocking gate "to keep moving",
87
- > answer a material question yourself instead of pausing, or run past red tests: stop.
88
- > Autonomy is for the routine path; the gates exist for everything else.
96
+ > **Mid-flight discipline.** Stop rather than auto-passing a blocking gate, answering a
97
+ > human-owned material question, or continuing past red tests.
89
98
 
90
99
  ## Output
91
- A compact phase-by-phase log, then the final status. **Progress first for the final
100
+ A compact phase log followed by the final status. **Progress first for the final
92
101
  status**: run `devrites-engine progress`, then use the shared typed states from
93
102
  [`devrites-lib/reference/reply-contract.md`](../devrites-lib/reference/reply-contract.md):
94
103
  `Shipped`, `Stopped`, `Awaiting human`, `NO-GO`, or `GO`.
@@ -96,7 +105,7 @@ status**: run `devrites-engine progress`, then use the shared typed states from
96
105
  Keep the log terse:
97
106
  ```
98
107
  Autocomplete: <slug>
99
- spec <done|stopped> · temper <done|skipped|stopped> · define <done|stopped> · vet <done|stopped> · build <n/N|stopped> · prove <done|stopped> · polish <done|stopped> · review <done|stopped> · seal <GO|NO-GO|stopped>
108
+ spec <done|stopped> · clarify <clear|stopped> · temper <done|skipped|stopped> · define <done|stopped> · vet <ready|stopped> · build <n/N|stopped> · prove <done|stopped> · polish <done|stopped> · review <done|stopped> · seal <GO|NO-GO|stopped>
100
109
  ```
101
110
 
102
111
  Final state examples: `Shipped: <feature>`, `Stopped: <reason>`, `Awaiting human: