claude-dev-env 4.2.0 → 7.0.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 (350) hide show
  1. package/.agents/agents/pr-description-writer.md +2 -2
  2. package/.agents/agents/test_agent_frontmatter.py +2 -2
  3. package/.agents/agents/test_pr_description_writer_style.py +1 -3
  4. package/.agents/skills/e-code-review/SKILL.md +12 -12
  5. package/.agents/skills/e-code-review/preflight-proposal.contract.test.mjs +20 -0
  6. package/.agents/skills/e-code-review/reference/fix.md +15 -17
  7. package/.agents/skills/e-code-review/reference/loop.md +35 -39
  8. package/.agents/skills/e-code-review/reference/mode-contract.test.mjs +2 -1
  9. package/.agents/skills/e-code-review/reference/preflight-proposal.md +44 -9
  10. package/.agents/skills/e-code-review/reference/runner-selection.md +13 -14
  11. package/.agents/skills/issue-tracker/SKILL.md +7 -0
  12. package/.agents/skills/pull-request/SKILL.md +216 -0
  13. package/.agents/skills/pull-request/reference/publication-tasks.md +18 -0
  14. package/.agents/skills/pull-request/scripts/github_pr_command_constants/__init__.py +1 -0
  15. package/.agents/skills/pull-request/scripts/github_pr_command_constants/config/__init__.py +1 -0
  16. package/.agents/skills/pull-request/scripts/github_pr_command_constants/config/constants.py +69 -0
  17. package/.agents/skills/pull-request/scripts/pull_request.py +265 -0
  18. package/.agents/skills/pull-request/scripts/recover_legacy_author.py +251 -0
  19. package/.agents/skills/pull-request/scripts/test_github_pr_command_constants.py +58 -0
  20. package/.agents/skills/pull-request/scripts/test_pull_request.py +396 -0
  21. package/.agents/skills/pull-request/scripts/test_recover_legacy_author.py +221 -0
  22. package/.agents/skills/skill-builder/SKILL.md +3 -196
  23. package/.agents/skills/test-runner/SKILL.md +69 -0
  24. package/.agents/skills/test-runner/scripts/preflight_checks.py +365 -0
  25. package/.agents/skills/test-runner/scripts/run_tests.py +316 -0
  26. package/.agents/skills/test-runner/scripts/test_preflight_checks.py +185 -0
  27. package/.agents/skills/test-runner/scripts/test_run_tests.py +281 -0
  28. package/.agents/skills/test-runner/scripts/test_runner_constants/__init__.py +1 -0
  29. package/.agents/skills/test-runner/scripts/test_runner_constants/config/__init__.py +1 -0
  30. package/.agents/skills/test-runner/scripts/test_runner_constants/config/constants.py +96 -0
  31. package/.agents/skills-archived/pr-loop-cloud-transport/reference/identity-and-hooks.md +1 -1
  32. package/_shared/pr-loop/scripts/pr_loop_shared_constants/terminology_sweep_constants.py +6 -0
  33. package/_shared/pr-loop/scripts/terminology_sweep.py +64 -19
  34. package/_shared/pr-loop/scripts/tests/test_terminology_sweep.py +59 -0
  35. package/bin/ever-shipped-skills.mjs +2 -0
  36. package/bin/ever-shipped-skills.test.mjs +8 -0
  37. package/bin/install.agents-home.test.mjs +15 -13
  38. package/bin/install.mjs +37 -1
  39. package/bin/install.policy-lint.test.mjs +78 -0
  40. package/bin/install.prune.test.mjs +149 -20
  41. package/bin/install.pstack-plugin.test.mjs +114 -0
  42. package/bin/install.test.mjs +61 -7
  43. package/bin/refresh-pstack-plugin-skills.test.mjs +211 -0
  44. package/hooks/advisory/pr_done_reminder.py +342 -0
  45. package/hooks/advisory/test_pr_done_reminder.py +249 -0
  46. package/hooks/blocking/bash_post_call_dispatcher.py +53 -6
  47. package/hooks/blocking/code_rules_paired_test.py +22 -15
  48. package/hooks/blocking/pii_prevention_blocker.py +32 -51
  49. package/hooks/blocking/test_bash_post_call_dispatcher.py +55 -17
  50. package/hooks/blocking/test_bash_pre_tool_use_dispatcher.py +1 -4
  51. package/hooks/blocking/test_code_rules_command_dispatch.py +2 -2
  52. package/hooks/blocking/test_code_rules_enforcer_paired_test.py +36 -29
  53. package/hooks/blocking/test_code_rules_js_resume_task_enumeration.py +4 -4
  54. package/hooks/blocking/test_code_rules_js_returns_object_schemaless.py +5 -5
  55. package/hooks/blocking/test_pii_prevention_blocker.py +37 -89
  56. package/hooks/blocking/test_pre_tool_use_dispatcher.py +68 -133
  57. package/hooks/blocking/test_pre_tool_use_dispatcher_native.py +20 -51
  58. package/hooks/blocking/test_precommit_code_rules_gate_native_owner.py +18 -18
  59. package/hooks/gh_post_body_texts.py +195 -0
  60. package/hooks/git-hooks/git_hooks_constants/staged_policy_lint.py +12 -0
  61. package/hooks/git-hooks/pre_commit.py +52 -11
  62. package/hooks/git-hooks/test_installed_policy_lint.py +159 -0
  63. package/hooks/git-hooks/test_native_policy_commit.py +87 -0
  64. package/hooks/git-hooks/test_pre_commit.py +246 -0
  65. package/hooks/hooks.json +1 -16
  66. package/hooks/hooks_constants/bash_post_call_dispatcher_constants.py +14 -2
  67. package/hooks/hooks_constants/bash_pre_tool_use_dispatcher_constants.py +0 -8
  68. package/hooks/hooks_constants/gh_post_body_texts_constants.py +12 -0
  69. package/hooks/hooks_constants/pr_done_reminder_constants.py +98 -0
  70. package/hooks/hooks_constants/pre_tool_use_dispatcher_constants.py +10 -43
  71. package/hooks/hooks_constants/test_bash_post_call_dispatcher_constants.py +17 -7
  72. package/hooks/hooks_constants/test_bash_pre_tool_use_dispatcher_constants.py +0 -7
  73. package/hooks/hooks_constants/test_failure_recorder_constants.py +3 -3
  74. package/hooks/hooks_constants/test_gh_post_body_texts_constants.py +19 -0
  75. package/hooks/hooks_constants/test_pr_done_reminder_constants.py +40 -0
  76. package/hooks/hooks_constants/test_pre_tool_use_dispatcher_constants.py +20 -32
  77. package/hooks/observability/test_failure_recorder.py +1 -1
  78. package/hooks/pyproject.toml +1 -1
  79. package/hooks/test_gh_post_body_texts.py +79 -0
  80. package/package.json +2 -2
  81. package/rules/durable-post-artifacts.md +32 -20
  82. package/rules/gh-cli-conventions.md +23 -13
  83. package/rules/git-workflow.md +21 -8
  84. package/scripts/check.ps1 +0 -1
  85. package/{.agents/skills/run-claude-dev-env/driver.mjs → scripts/ci/installer-lifecycle.mjs} +3 -28
  86. package/scripts/ci/installer-lifecycle.test.mjs +26 -0
  87. package/scripts/ci/windows-installer-lifecycle.ps1 +1 -11
  88. package/scripts/dev_env_scripts_constants/shared_tree_constants.py +4 -5
  89. package/scripts/durable_post_lint.py +206 -0
  90. package/scripts/durable_post_lint_config/config/constants.py +96 -0
  91. package/scripts/durable_post_lint_config/config/test_constants.py +25 -0
  92. package/scripts/policy_lint/adapter_configuration.py +53 -12
  93. package/scripts/policy_lint/adapter_detectors.py +13 -6
  94. package/scripts/policy_lint/adapters.py +7 -4
  95. package/scripts/policy_lint/config/constants.py +5 -0
  96. package/scripts/policy_lint/engine.py +48 -4
  97. package/scripts/policy_lint/model.py +1 -0
  98. package/scripts/policy_lint/registry.py +1 -1
  99. package/scripts/policy_lint/selection.py +2 -1
  100. package/scripts/policy_lint/selection_git.py +2 -0
  101. package/scripts/refresh_pstack_plugin_skills.mjs +200 -0
  102. package/scripts/repository_checks/config/constants.py +0 -5
  103. package/scripts/shared_tree_paths.py +32 -3
  104. package/scripts/test_durable_post_lint.py +332 -0
  105. package/scripts/test_shared_tree_paths.py +33 -0
  106. package/scripts/tests/test_adapter_configuration.py +54 -0
  107. package/scripts/tests/test_policy_lint_rules_archive.py +120 -0
  108. package/scripts/tests/test_policy_lint_rules_engine.py +25 -4
  109. package/scripts/tests/test_policy_lint_rules_installed_loader.py +29 -0
  110. package/scripts/tests/test_policy_lint_rules_registry.py +227 -13
  111. package/scripts/tests/test_policy_lint_selection.py +25 -2
  112. package/scripts/tests/test_policy_lint_selection_native_index.py +30 -0
  113. package/scripts/tests/test_rules.py +3 -7
  114. package/.agents/skills/_shared/pr-loop/.claude/CLAUDE.md +0 -1
  115. package/.agents/skills/_shared/pr-loop/AGENTS.md +0 -1
  116. package/.agents/skills/_shared/pr-loop/audit-contract.md +0 -5
  117. package/.agents/skills/_shared/pr-loop/audit-reply-template.md +0 -5
  118. package/.agents/skills/_shared/pr-loop/code-rules-gate.md +0 -5
  119. package/.agents/skills/_shared/pr-loop/fix-protocol.md +0 -5
  120. package/.agents/skills/_shared/pr-loop/gh-payloads.md +0 -5
  121. package/.agents/skills/_shared/pr-loop/portable-driver.md +0 -149
  122. package/.agents/skills/_shared/pr-loop/post-audit-thread-contract.md +0 -5
  123. package/.agents/skills/_shared/pr-loop/precatch-rubric.md +0 -5
  124. package/.agents/skills/_shared/pr-loop/preflight-proposal.contract.test.mjs +0 -119
  125. package/.agents/skills/_shared/pr-loop/preflight-proposal.md +0 -5
  126. package/.agents/skills/_shared/pr-loop/prompts/.claude/CLAUDE.md +0 -1
  127. package/.agents/skills/_shared/pr-loop/prompts/AGENTS.md +0 -1
  128. package/.agents/skills/_shared/pr-loop/prompts/pr-consistency-audit.xml +0 -324
  129. package/.agents/skills/_shared/pr-loop/scripts/.claude/CLAUDE.md +0 -1
  130. package/.agents/skills/_shared/pr-loop/scripts/AGENTS.md +0 -1
  131. package/.agents/skills/_shared/pr-loop/scripts/RUNTIME_SCRIPTS.md +0 -29
  132. package/.agents/skills/_shared/pr-loop/scripts/_cli_utils.py +0 -22
  133. package/.agents/skills/_shared/pr-loop/scripts/_path_resolver.py +0 -186
  134. package/.agents/skills/_shared/pr-loop/scripts/_xml_utils.py +0 -20
  135. package/.agents/skills/_shared/pr-loop/scripts/audit_category_schema.py +0 -355
  136. package/.agents/skills/_shared/pr-loop/scripts/build_audit_prompt.py +0 -289
  137. package/.agents/skills/_shared/pr-loop/scripts/build_converge_task_list.py +0 -310
  138. package/.agents/skills/_shared/pr-loop/scripts/build_fix_prompt.py +0 -292
  139. package/.agents/skills/_shared/pr-loop/scripts/init_loop_state.py +0 -134
  140. package/.agents/skills/_shared/pr-loop/scripts/portable_converge_driver.py +0 -1646
  141. package/.agents/skills/_shared/pr-loop/scripts/preflight_worktree.py +0 -392
  142. package/.agents/skills/_shared/pr-loop/scripts/select_converge_pacer.py +0 -215
  143. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/.claude/CLAUDE.md +0 -1
  144. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/AGENTS.md +0 -1
  145. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/__init__.py +0 -0
  146. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/audit_category_schema_constants.py +0 -37
  147. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/converge_task_list_constants.py +0 -56
  148. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/handoff_constants.py +0 -45
  149. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/pacer_constants.py +0 -47
  150. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/path_resolver_constants.py +0 -157
  151. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/portable_driver_constants.py +0 -177
  152. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/preflight_constants.py +0 -70
  153. package/.agents/skills/_shared/pr-loop/scripts/teardown_worktrees.py +0 -172
  154. package/.agents/skills/_shared/pr-loop/scripts/test__path_resolver.py +0 -106
  155. package/.agents/skills/_shared/pr-loop/scripts/test_audit_category_schema.py +0 -94
  156. package/.agents/skills/_shared/pr-loop/scripts/test_build_audit_prompt.py +0 -499
  157. package/.agents/skills/_shared/pr-loop/scripts/test_build_converge_task_list.py +0 -140
  158. package/.agents/skills/_shared/pr-loop/scripts/test_build_fix_prompt.py +0 -262
  159. package/.agents/skills/_shared/pr-loop/scripts/test_init_loop_state.py +0 -71
  160. package/.agents/skills/_shared/pr-loop/scripts/test_portable_converge_driver.py +0 -1119
  161. package/.agents/skills/_shared/pr-loop/scripts/test_preflight_worktree.py +0 -287
  162. package/.agents/skills/_shared/pr-loop/scripts/test_select_converge_pacer.py +0 -207
  163. package/.agents/skills/_shared/pr-loop/scripts/test_teardown_worktrees.py +0 -59
  164. package/.agents/skills/_shared/pr-loop/scripts/test_write_handoff.py +0 -201
  165. package/.agents/skills/_shared/pr-loop/scripts/write_audit_outcomes.py +0 -182
  166. package/.agents/skills/_shared/pr-loop/scripts/write_fix_outcomes.py +0 -206
  167. package/.agents/skills/_shared/pr-loop/scripts/write_handoff.py +0 -309
  168. package/.agents/skills/_shared/pr-loop/state-schema.md +0 -5
  169. package/.agents/skills/_shared/pr-loop/worker-spawn.md +0 -5
  170. package/.agents/skills/autoconverge/.claude/CLAUDE.md +0 -1
  171. package/.agents/skills/autoconverge/AGENTS.md +0 -1
  172. package/.agents/skills/autoconverge/SKILL.md +0 -431
  173. package/.agents/skills/autoconverge/reference/.claude/CLAUDE.md +0 -1
  174. package/.agents/skills/autoconverge/reference/AGENTS.md +0 -1
  175. package/.agents/skills/autoconverge/reference/closing-report.md +0 -93
  176. package/.agents/skills/autoconverge/reference/convergence-gates.md +0 -31
  177. package/.agents/skills/autoconverge/reference/convergence.md +0 -219
  178. package/.agents/skills/autoconverge/reference/copilot-findings.md +0 -51
  179. package/.agents/skills/autoconverge/reference/gotchas.md +0 -66
  180. package/.agents/skills/autoconverge/reference/headless-safety.md +0 -44
  181. package/.agents/skills/autoconverge/reference/multi-pr.md +0 -128
  182. package/.agents/skills/autoconverge/reference/self-closing-loop.md +0 -84
  183. package/.agents/skills/autoconverge/reference/stop-conditions.md +0 -127
  184. package/.agents/skills/autoconverge/test_portable_pacer_gate.py +0 -54
  185. package/.agents/skills/autoconverge/workflow/.claude/CLAUDE.md +0 -1
  186. package/.agents/skills/autoconverge/workflow/AGENTS.md +0 -1
  187. package/.agents/skills/autoconverge/workflow/aggregate_runs.py +0 -371
  188. package/.agents/skills/autoconverge/workflow/autoconverge_report_constants/.claude/CLAUDE.md +0 -1
  189. package/.agents/skills/autoconverge/workflow/autoconverge_report_constants/AGENTS.md +0 -1
  190. package/.agents/skills/autoconverge/workflow/autoconverge_report_constants/__init__.py +0 -0
  191. package/.agents/skills/autoconverge/workflow/autoconverge_report_constants/render_report_constants.py +0 -250
  192. package/.agents/skills/autoconverge/workflow/converge.clean-audit.test.mjs +0 -665
  193. package/.agents/skills/autoconverge/workflow/converge.codex-gate.test.mjs +0 -472
  194. package/.agents/skills/autoconverge/workflow/converge.contract.test.mjs +0 -64
  195. package/.agents/skills/autoconverge/workflow/converge.copilot-gate.test.mjs +0 -1009
  196. package/.agents/skills/autoconverge/workflow/converge.fix-progress.test.mjs +0 -107
  197. package/.agents/skills/autoconverge/workflow/converge.fix-recovery.test.mjs +0 -33
  198. package/.agents/skills/autoconverge/workflow/converge.merge-conflict.test.mjs +0 -15
  199. package/.agents/skills/autoconverge/workflow/converge.mjs +0 -3132
  200. package/.agents/skills/autoconverge/workflow/converge.p2-advance.test.mjs +0 -202
  201. package/.agents/skills/autoconverge/workflow/converge.path-aware.test.mjs +0 -47
  202. package/.agents/skills/autoconverge/workflow/converge.precatch.test.mjs +0 -152
  203. package/.agents/skills/autoconverge/workflow/converge.run-input.test.mjs +0 -116
  204. package/.agents/skills/autoconverge/workflow/converge_multi.mjs +0 -169
  205. package/.agents/skills/autoconverge/workflow/converge_multi.run-input.test.mjs +0 -173
  206. package/.agents/skills/autoconverge/workflow/convergence_summary.py +0 -110
  207. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a11d903476b803493.jsonl +0 -2
  208. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a26213978adeef6fb.jsonl +0 -2
  209. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a3def0d15ed9d9110.jsonl +0 -2
  210. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a41f41b1b708ee3b7.jsonl +0 -2
  211. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a758b880abecc3ff7.jsonl +0 -2
  212. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a8897b89656b1bd16.jsonl +0 -2
  213. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-ab1c2d3e4f5a6b7c8.jsonl +0 -2
  214. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-abd463d744a1437bc.jsonl +0 -2
  215. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-ad19d027ae8ee1816.jsonl +0 -2
  216. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/workflows/wf_881252e6-700.json +0 -266
  217. package/.agents/skills/autoconverge/workflow/render_report.py +0 -1024
  218. package/.agents/skills/autoconverge/workflow/test_aggregate_runs.py +0 -134
  219. package/.agents/skills/autoconverge/workflow/test_convergence_summary.py +0 -149
  220. package/.agents/skills/autoconverge/workflow/test_render_report.py +0 -812
  221. package/.agents/skills/hitl/SKILL.md +0 -45
  222. package/.agents/skills/pr-cleanup/SKILL.md +0 -140
  223. package/.agents/skills/pr-cleanup/reference/process-inventory.md +0 -17
  224. package/.agents/skills/pr-cleanup/reference/task-seeds.md +0 -22
  225. package/.agents/skills/pr-name-by-capability/SKILL.md +0 -73
  226. package/.agents/skills/pr-name-by-capability/reference/fetch-commands.md +0 -29
  227. package/.agents/skills/pr-name-by-capability/reference/offense-examples.md +0 -32
  228. package/.agents/skills/pr-name-by-capability/reference/report-template.md +0 -29
  229. package/.agents/skills/pr-name-by-capability/reference/rule-checklist.md +0 -38
  230. package/.agents/skills/pr-name-by-capability/reference/task-seeds.md +0 -10
  231. package/.agents/skills/pr-plain-language-cleanup/SKILL.md +0 -93
  232. package/.agents/skills/pr-refinement/SKILL.md +0 -31
  233. package/.agents/skills/pr-shared-extraction/SKILL.md +0 -177
  234. package/.agents/skills/pr-shared-extraction/reference/examples.md +0 -46
  235. package/.agents/skills/pr-shared-extraction/reference/offense-taxonomy.md +0 -100
  236. package/.agents/skills/pr-small-cl/SKILL.md +0 -52
  237. package/.agents/skills/pr-title-description/SKILL.md +0 -96
  238. package/.agents/skills/prototype/SKILL.md +0 -85
  239. package/.agents/skills/prototype/reference/honest-limitations.md +0 -23
  240. package/.agents/skills/prototype/reference/promotion-tasks.md +0 -23
  241. package/.agents/skills/prototype/scripts/build_sandbox_settings.py +0 -249
  242. package/.agents/skills/prototype/scripts/conftest.py +0 -15
  243. package/.agents/skills/prototype/scripts/launch_sandbox.py +0 -205
  244. package/.agents/skills/prototype/scripts/probe_sandbox_safety.py +0 -311
  245. package/.agents/skills/prototype/scripts/prototype_scripts_constants/__init__.py +0 -1
  246. package/.agents/skills/prototype/scripts/prototype_scripts_constants/config/__init__.py +0 -0
  247. package/.agents/skills/prototype/scripts/prototype_scripts_constants/config/build_sandbox_settings_constants.py +0 -41
  248. package/.agents/skills/prototype/scripts/prototype_scripts_constants/config/launch_sandbox_constants.py +0 -23
  249. package/.agents/skills/prototype/scripts/prototype_scripts_constants/config/probe_sandbox_safety_constants.py +0 -45
  250. package/.agents/skills/prototype/scripts/prototype_scripts_constants/config/prototype_common_constants.py +0 -10
  251. package/.agents/skills/prototype/scripts/test_build_sandbox_settings.py +0 -275
  252. package/.agents/skills/prototype/scripts/test_launch_sandbox.py +0 -303
  253. package/.agents/skills/prototype/scripts/test_probe_sandbox_safety.py +0 -312
  254. package/.agents/skills/prototype/workflows/promotion.md +0 -25
  255. package/.agents/skills/prototype/workflows/sandbox.md +0 -35
  256. package/.agents/skills/rebase/.claude/CLAUDE.md +0 -1
  257. package/.agents/skills/rebase/AGENTS.md +0 -1
  258. package/.agents/skills/rebase/SKILL.md +0 -178
  259. package/.agents/skills/review-router/SKILL.md +0 -51
  260. package/.agents/skills/review-router/reference/route-policy.json +0 -7
  261. package/.agents/skills/review-router/reference/task-seeds.md +0 -1
  262. package/.agents/skills/review-router/scripts/conftest.py +0 -4
  263. package/.agents/skills/review-router/scripts/review_router.py +0 -50
  264. package/.agents/skills/review-router/scripts/review_router_cli.py +0 -211
  265. package/.agents/skills/review-router/scripts/review_router_constants/__init__.py +0 -1
  266. package/.agents/skills/review-router/scripts/review_router_constants/config/__init__.py +0 -0
  267. package/.agents/skills/review-router/scripts/review_router_constants/config/constants.py +0 -13
  268. package/.agents/skills/review-router/scripts/test_review_router.py +0 -23
  269. package/.agents/skills/review-router/scripts/test_review_router_cli.py +0 -47
  270. package/.agents/skills/review-tier/SKILL.md +0 -56
  271. package/.agents/skills/review-tier/reference/task-seeds.md +0 -1
  272. package/.agents/skills/review-tier/reference/tier-policy.json +0 -9
  273. package/.agents/skills/review-tier/scripts/conftest.py +0 -4
  274. package/.agents/skills/review-tier/scripts/review_tier.py +0 -359
  275. package/.agents/skills/review-tier/scripts/review_tier_constants/__init__.py +0 -1
  276. package/.agents/skills/review-tier/scripts/review_tier_constants/config/__init__.py +0 -0
  277. package/.agents/skills/review-tier/scripts/review_tier_constants/config/constants.py +0 -29
  278. package/.agents/skills/review-tier/scripts/test_generation.py +0 -159
  279. package/.agents/skills/review-tier/scripts/test_review_tier.py +0 -33
  280. package/.agents/skills/run-claude-dev-env/SKILL.md +0 -84
  281. package/.agents/skills/session-log/.claude/CLAUDE.md +0 -1
  282. package/.agents/skills/session-log/AGENTS.md +0 -1
  283. package/.agents/skills/session-log/SKILL.md +0 -170
  284. package/.agents/skills/session-log/templates/frontmatter.md +0 -40
  285. package/.agents/skills/session-tidy/.claude/CLAUDE.md +0 -1
  286. package/.agents/skills/session-tidy/AGENTS.md +0 -1
  287. package/.agents/skills/session-tidy/SKILL.md +0 -191
  288. package/.agents/skills/skill-builder/references/.claude/CLAUDE.md +0 -1
  289. package/.agents/skills/skill-builder/references/AGENTS.md +0 -1
  290. package/.agents/skills/skill-builder/references/delegation-map.md +0 -130
  291. package/.agents/skills/skill-builder/references/description-field.md +0 -111
  292. package/.agents/skills/skill-builder/references/deterministic-elements.md +0 -218
  293. package/.agents/skills/skill-builder/references/progressive-disclosure.md +0 -122
  294. package/.agents/skills/skill-builder/references/self-audit-checklist.md +0 -126
  295. package/.agents/skills/skill-builder/references/skill-modularity.md +0 -111
  296. package/.agents/skills/skill-builder/references/skill-types.md +0 -232
  297. package/.agents/skills/skill-builder/references/thariq-x-post-skills.json +0 -33
  298. package/.agents/skills/skill-builder/templates/.claude/CLAUDE.md +0 -1
  299. package/.agents/skills/skill-builder/templates/AGENTS.md +0 -1
  300. package/.agents/skills/skill-builder/templates/gap-analysis.md +0 -87
  301. package/.agents/skills/skill-builder/workflows/.claude/CLAUDE.md +0 -1
  302. package/.agents/skills/skill-builder/workflows/AGENTS.md +0 -1
  303. package/.agents/skills/skill-builder/workflows/improve-skill.md +0 -136
  304. package/.agents/skills/skill-builder/workflows/new-skill.md +0 -179
  305. package/.agents/skills/skill-builder/workflows/polish-skill.md +0 -139
  306. package/.agents/skills/source-command-sr-loop/SKILL.md +0 -82
  307. package/.agents/skills/update/.claude/CLAUDE.md +0 -1
  308. package/.agents/skills/update/AGENTS.md +0 -1
  309. package/.agents/skills/update/SKILL.md +0 -190
  310. package/_shared/pr-loop/AGENTS.md +0 -1
  311. package/_shared/pr-loop/CLAUDE.md +0 -1
  312. package/_shared/pr-loop/audit-contract.md +0 -183
  313. package/_shared/pr-loop/audit-reply-template.md +0 -151
  314. package/_shared/pr-loop/code-rules-gate.md +0 -65
  315. package/_shared/pr-loop/fix-protocol.md +0 -60
  316. package/_shared/pr-loop/gh-payloads.md +0 -75
  317. package/_shared/pr-loop/post-audit-thread-contract.md +0 -51
  318. package/_shared/pr-loop/precatch-rubric.md +0 -66
  319. package/_shared/pr-loop/preflight-proposal.md +0 -56
  320. package/_shared/pr-loop/scripts/post_audit_thread.py +0 -1242
  321. package/_shared/pr-loop/scripts/pr_loop_shared_constants/post_audit_thread_constants.py +0 -199
  322. package/_shared/pr-loop/scripts/tests/test_post_audit_thread.py +0 -1115
  323. package/_shared/pr-loop/scripts/tests/test_post_audit_thread_constants.py +0 -129
  324. package/_shared/pr-loop/state-schema.md +0 -45
  325. package/_shared/pr-loop/worker-spawn.md +0 -189
  326. package/hooks/_gh_pr_author_swap_utils.py +0 -1225
  327. package/hooks/blocking/conventional_pr_title_gate.py +0 -443
  328. package/hooks/blocking/gh_body_arg_blocker.py +0 -176
  329. package/hooks/blocking/gh_pr_author_enforcer.py +0 -487
  330. package/hooks/blocking/gh_pr_author_restore.py +0 -105
  331. package/hooks/blocking/pr_description_writer_gate.py +0 -256
  332. package/hooks/blocking/test_conventional_pr_title_gate.py +0 -640
  333. package/hooks/blocking/test_gh_body_arg_blocker.py +0 -441
  334. package/hooks/blocking/test_gh_pr_author_enforcer.py +0 -1166
  335. package/hooks/blocking/test_gh_pr_author_restore.py +0 -513
  336. package/hooks/blocking/test_gh_pr_author_swap_utils.py +0 -910
  337. package/hooks/blocking/test_pr_description_writer_gate.py +0 -234
  338. package/hooks/blocking/test_preflight_check.py +0 -343
  339. package/hooks/blocking/test_test_preflight_check.py +0 -80
  340. package/hooks/blocking/test_volatile_path_in_post_blocker.py +0 -322
  341. package/hooks/blocking/volatile_path_in_post_blocker.py +0 -461
  342. package/hooks/hooks_constants/conventional_pr_title_gate_constants.py +0 -58
  343. package/hooks/hooks_constants/gh_pr_author_swap_constants.py +0 -76
  344. package/hooks/hooks_constants/pr_description_writer_gate_constants.py +0 -73
  345. package/hooks/hooks_constants/volatile_path_in_post_blocker_constants.py +0 -55
  346. package/hooks/observability/pr_description_writer_spawn_tracker.py +0 -113
  347. package/hooks/observability/test_pr_description_writer_spawn_tracker.py +0 -150
  348. package/hooks/session/gh_pr_author_session_cleanup.py +0 -175
  349. package/hooks/session/test_gh_pr_author_session_cleanup.py +0 -576
  350. package/hooks/test__gh_pr_author_swap_utils.py +0 -333
@@ -6,7 +6,7 @@ tools: Read,Grep,Glob,Bash
6
6
 
7
7
  # PR Description Writer
8
8
 
9
- Write from the current pull request diff and task. Resolve the active managed root and active agents home before reading guides: `~/.claude` is the default root, `CLAUDE_CONFIG_DIR` selects another root, and `--target DIR` takes precedence; the default `.claude` root uses sibling `~/.agents`, while another root uses sibling `<root-name>.agents`. Use `<agents-home>/skills/pr-title-description/SKILL.md` (source fallback: `packages/claude-dev-env/.agents/skills/pr-title-description/SKILL.md`) for required content and shape. Use the current review findings and task guidance for a review comment. Do not assume `~/.claude` or `~/.agents` for a named profile or explicit target.
9
+ Write from the current pull request diff and task. Resolve the active managed root and active agents home before reading guides: `~/.claude` is the default root, `CLAUDE_CONFIG_DIR` selects another root, and `--target DIR` takes precedence; the default `.claude` root uses sibling `~/.agents`, while another root uses sibling `<root-name>.agents`. Use this agent's full-diff behavior standard and drafting steps. Use the current review findings and task guidance for a review comment. Do not assume `~/.claude` or `~/.agents` for a named profile or explicit target.
10
10
 
11
11
  ## Voice
12
12
 
@@ -24,7 +24,7 @@ Before drafting, inventory every independently observable behavior in the full d
24
24
 
25
25
  For each behavior, state the trigger or observer, the Before -> After result, the affected surface/caller when shared, and focused proof. Include important preserved behavior and fallback paths when they help a coder rule a regression in or out. Describe outcomes, not line-by-line implementation, and do not hide multiple behaviors under vague umbrella wording.
26
26
 
27
- For a concrete voice sample only when needed, read `reference/pr-description-illustrative-voice.md` beside this agent. For a concrete verification sample only when needed, read `reference/pr-description-verification.md`. These samples guide the shape and voice; they are not content to copy into unrelated pull requests.
27
+ For a voice sample only when needed, read `<agents-home>/agents/reference/pr-description-illustrative-voice.md` (source fallback: `packages/claude-dev-env/.agents/agents/reference/pr-description-illustrative-voice.md`). For a verification sample only when needed, read `reference/pr-description-verification.md` beside this agent. These samples guide the shape and voice; they are not content to copy into unrelated pull requests.
28
28
 
29
29
  ## Draft the body
30
30
 
@@ -602,8 +602,8 @@ EXPECTED_SOURCE_LINK_PAIRS = {
602
602
  }),
603
603
  "pr-description-writer.md": frozenset({
604
604
  (
605
- "<agents-home>/skills/pr-title-description/SKILL.md",
606
- "packages/claude-dev-env/.agents/skills/pr-title-description/SKILL.md",
605
+ "<agents-home>/agents/reference/pr-description-illustrative-voice.md",
606
+ "packages/claude-dev-env/.agents/agents/reference/pr-description-illustrative-voice.md",
607
607
  ),
608
608
  (
609
609
  "<managed-root>/rules/gh-cli-conventions.md#body-content-goes-in-a-file",
@@ -17,6 +17,7 @@ def test_pr_description_writer_uses_repo_owned_progressive_samples() -> None:
17
17
  assert "only when needed" in agent_text
18
18
  assert "PR #2562" not in agent_text
19
19
  assert "PR #1150" not in agent_text
20
+ assert "skills/pr-title-description" not in agent_text
20
21
 
21
22
 
22
23
  def test_voice_reference_keeps_the_plain_illustrative_shape() -> None:
@@ -48,9 +49,6 @@ def test_verification_leads_with_a_human_visible_check() -> None:
48
49
 
49
50
  def test_full_diff_behavior_standard_is_explicit_in_writer_sources() -> None:
50
51
  all_writer_source_texts = [
51
- (AGENT_DIRECTORY.parent / "skills" / "pr-title-description" / "SKILL.md").read_text(
52
- encoding="utf-8"
53
- ),
54
52
  AGENT_PATH.read_text(encoding="utf-8"),
55
53
  VOICE_REFERENCE_PATH.read_text(encoding="utf-8"),
56
54
  ]
@@ -16,10 +16,10 @@ description: >-
16
16
 
17
17
  Resolve the first matching invocation before the normal refusal and loop rules:
18
18
 
19
- 1. `preflight-proposal` requires `<pr_number>`, `--level <low|medium|xhigh>`, `--base-sha <immutable SHA>`, `--head-sha <immutable SHA>`, and `--worktree <isolated path>`. The caller supplies `low` as the default level; `medium` and `xhigh` are valid selections. Route the selected mode through [reference/preflight-proposal.md](reference/preflight-proposal.md) to establish proposal context. The mode runs `<review_level> --fix loop` locally and returns selected-candidate-ready proposal evidence.
19
+ 1. `preflight-proposal` requires `<pr_number>`, `--level <low|medium|xhigh>`, `--base-sha <immutable SHA>`, `--head-sha <immutable SHA>`, and `--worktree <isolated path>`. Default level is `low`. Follow [reference/preflight-proposal.md](reference/preflight-proposal.md). The mode runs `<review_level> --fix loop` locally and returns selected-candidate-ready proposal evidence.
20
20
  2. Normal mode follows the current level, `--fix`, and `loop` behavior.
21
21
 
22
- The proposal mode applies the canonical proposal contract at `@~/.claude/_shared/pr-loop/preflight-proposal.md`. The local extension selects the review level and records finding outcomes. The downstream owner records selected proposal IDs before reapplication; each new finding receives a new ID.
22
+ Proposal mode selects the review level and records finding outcomes. The downstream owner records selected proposal IDs before reapplication. Each new finding gets a new ID.
23
23
 
24
24
  ## Gotchas
25
25
 
@@ -27,7 +27,7 @@ The proposal mode applies the canonical proposal contract at `@~/.claude/_shared
27
27
  - **Collection reports every real finding.** Keep every CONFIRMED or PLAUSIBLE finding at its assigned severity (`blocker`, `high`, `medium`, `low`, `nit`). Do not drop low or nit findings during collection. Severity or action filtering is a separate consumer stage after the collection record is complete (`scripts/finding_pipeline.py`).
28
28
  - **`medium` favors precision, `xhigh` favors recall.** At `medium` (8 angles) assign severity carefully so a later filter can pick maintainer-action findings. At `xhigh` (10 angles plus a gap sweep) a single non-REFUTED vote carries the finding; do not drop on uncertainty.
29
29
  - **Every retained finding carries `severity` and `verdict`.** Severity is one of `blocker`, `high`, `medium`, `low`, `nit`. Verdict is `CONFIRMED` or `PLAUSIBLE`. Drop REFUTED candidates only; never emit an unclassified retained finding.
30
- - **`--fix` applies findings once.** Load `reference/fix.md` and follow it — it owns the fix agent, the code-rules gate, skip logging, and outcome reporting. Commits are lead-owned; fix agents never commit or push.
30
+ - **`--fix` applies findings once.** Load `reference/fix.md` and follow it. That file owns the fix agent, the code-rules gate, skip logging, and outcome reporting. Commits are lead-owned; fix agents never commit or push.
31
31
  - **`loop` never asks.** A round with bug findings validates them with an advisor, fixes, and re-reviews. Terminals are exactly `clean`, `nits_fixed`, and `advisor_blocked`. There is no reviewed-head count limit; a new head increments the count once, a re-review of the same head does not. Load `reference/loop.md` and follow it.
32
32
  - **`--fix` and `loop` combine.** With both, each loop round runs the level file, and the round's fixing happens inside `reference/loop.md`'s gate sequence, which loads `reference/fix.md` for the mechanics. There is no separate fix pass around the round.
33
33
 
@@ -35,13 +35,13 @@ The proposal mode applies the canonical proposal contract at `@~/.claude/_shared
35
35
 
36
36
  Triggers: `/e-code-review <level> [--fix] [loop]`. `<level>` is `low`, `medium`, or `xhigh`. `--fix` and `loop` are each optional and may be used together.
37
37
 
38
- **Refusal — first match wins:**
38
+ **Refusal. First match wins:**
39
39
 
40
40
  - **No level, or an unknown level.** Respond exactly: `Which effort level — low, medium, or xhigh?`
41
41
 
42
42
  ## Evaluation-backed defaults (e-code-review family)
43
43
 
44
- When the caller asks which level to pick for a known fixture band (easy / medium / demanding scope), use the committed OP-02B evaluation evidence — not an inherited hard-coded preference. Thinking stays on; **effort** is the only cost/latency lever.
44
+ When the caller asks which level to pick for a known fixture band (easy / medium / demanding scope), use the committed OP-02B evaluation evidence. Thinking stays on; **effort** is the only cost/latency lever.
45
45
 
46
46
  | Fixture band | Skill effort | Source |
47
47
  |---|---|---|
@@ -58,7 +58,7 @@ Detail: `reference/effort-evaluation.md`.
58
58
  1. Read `<level>` and the optional `--fix` and `loop` flags. Apply the refusal first.
59
59
  2. Load `reference/low.md`, `reference/medium.md`, or `reference/xhigh.md`. Run that file as one review cycle, ending in its structured findings report.
60
60
  3. If `--fix` is set and `loop` is not set, load `reference/fix.md` and apply it to that cycle's findings. This path has no commit step: the fixes stay uncommitted in the working tree for the user to review and commit.
61
- 4. If `loop` is set, load `reference/loop.md` and follow it with that cycle's findings still unfixed. Round 1's findings are the ones step 2 already produced; from the second round on, the round re-runs that same level file end to end. End to end means the level file's review phases, up to and including its findings report — not its *Looping* section, which hands control to `loop.md` and would re-enter the loop the round is already inside. `loop.md`'s gate sequence owns when the round fixes.
61
+ 4. If `loop` is set, load `reference/loop.md` and follow it with that cycle's findings still unfixed. Round 1's findings are the ones step 2 already produced; from the second round on, the round re-runs that same level file end to end. End to end means the level file's review phases, up to and including its findings report. Skip that file's *Looping* section, which hands control to `loop.md` and would re-enter the loop the round is already inside. `loop.md`'s gate sequence owns when the round fixes.
62
62
  5. Without `--fix` or `loop`, return the cycle findings and stop.
63
63
 
64
64
  ## File index
@@ -66,9 +66,9 @@ Detail: `reference/effort-evaluation.md`.
66
66
  | File | Purpose |
67
67
  |---|---|
68
68
  | `SKILL.md` | Route by level; dispatch `--fix` and `loop` |
69
- | `reference/low.md` | low review procedure — 1 diff pass per target item, no verify |
70
- | `reference/medium.md` | medium review procedure — 8 angles, 1-vote verify |
71
- | `reference/xhigh.md` | xhigh review procedure — 10 angles, 1-vote verify, gap sweep |
69
+ | `reference/low.md` | low review procedure: 1 diff pass per target item, no verify |
70
+ | `reference/medium.md` | medium review procedure: 8 angles, 1-vote verify |
71
+ | `reference/xhigh.md` | xhigh review procedure: 10 angles, 1-vote verify, gap sweep |
72
72
  | `reference/fix.md` | Fix application, code-rules gate, skip logging, outcome reporting |
73
73
  | `reference/loop.md` | Repeat review/fix rounds until clean |
74
74
  | `reference/preflight-proposal.md` | Isolated local review, immutable SHAs, proposal evidence, and mutation boundary |
@@ -85,6 +85,6 @@ Detail: `reference/effort-evaluation.md`.
85
85
 
86
86
  ## Folder map
87
87
 
88
- - `SKILL.md` — route and dispatch.
89
- - `reference/` — level procedures, fix/loop, effort evaluation, runner selection.
90
- - `scripts/` — collect-then-filter finding pipeline, effort evaluation, Grok medium-review module, tests, and `e_code_review_scripts_constants/`.
88
+ - `SKILL.md`: route and dispatch.
89
+ - `reference/`: level procedures, fix/loop, effort evaluation, runner selection.
90
+ - `scripts/`: collect-then-filter finding pipeline, effort evaluation, Grok medium-review module, tests, and `e_code_review_scripts_constants/`.
@@ -0,0 +1,20 @@
1
+ import assert from 'node:assert/strict'
2
+ import { readFileSync } from 'node:fs'
3
+ import { dirname, resolve } from 'node:path'
4
+ import test from 'node:test'
5
+ import { fileURLToPath } from 'node:url'
6
+
7
+ const here = dirname(fileURLToPath(import.meta.url))
8
+ const skill = readFileSync(resolve(here, 'SKILL.md'), 'utf8')
9
+ const contract = readFileSync(resolve(here, 'reference/preflight-proposal.md'), 'utf8')
10
+
11
+ test('e-code-review owns its preflight proposal contract', () => {
12
+ assert.match(skill, /reference\/preflight-proposal\.md/)
13
+ assert.doesNotMatch(skill, /_shared\/pr-loop/)
14
+ assert.match(contract, /caller-supplied isolated worktree/)
15
+ assert.match(contract, /exact `base_sha\.\.\.head_sha` range/)
16
+ assert.match(contract, /immutable proposal identity/)
17
+ assert.match(contract, /selected or dispositioned proposal collection/)
18
+ assert.match(contract, /review_level: low \| medium \| xhigh/)
19
+ assert.match(contract, /outcome: fixed \| no_change_needed \| skipped/)
20
+ })
@@ -12,7 +12,7 @@ For each finding, resume the same Agent-tool agent instance that originally
12
12
  surfaced it. That agent applies all relevant fixes, which you provide guidance
13
13
  on in your resume prompt.
14
14
 
15
- At `low` — and any time the Agent tool is unavailable — no finder agent exists
15
+ At `low`, and any time the Agent tool is unavailable, no finder agent exists
16
16
  to resume. Apply the fixes yourself, sequentially, in this context, holding to
17
17
  every rule below.
18
18
 
@@ -26,7 +26,7 @@ call every other surface in this skill uses:
26
26
  2. If the gate reports violations **on lines this fix already owns** (the files
27
27
  and added lines the fix changed), fix them and re-run the exact same command.
28
28
  3. A violation on a path or added line outside this fix's own work is reported
29
- or skipped — it is not force-fixed into unrelated files. Log each skip with
29
+ or skipped. It is not force-fixed into unrelated files. Log each skip with
30
30
  the path and reason, then continue.
31
31
  4. Repeat until every violation on this fix's own work is clean (or skipped with
32
32
  a logged reason for out-of-scope hits).
@@ -39,15 +39,14 @@ This gate commits nothing. The fix lands in the working tree and stays
39
39
  uncommitted. **Commit ownership is lead-only:** a fix agent, patch worker, or
40
40
  resumed finding agent never runs `git commit` or `git push`. The lead that owns
41
41
  the branch creates the commit after gates pass. The bare code-rules call covers
42
- the merge-base surface and staged added lines only — working-tree-only lines
42
+ the merge-base surface and staged added lines only. Working-tree-only lines
43
43
  enter that scope after the lead stages or commits them.
44
44
 
45
- Under a bare `--fix` — this document invoked without `loop` — nothing
46
- downstream commits either, and that is the intended outcome: a one-shot fix
47
- pass leaves its fixes uncommitted in the working tree for the lead to review
48
- and commit (stage first if you re-run the gate on those lines). Under `loop`,
49
- the round tail in `reference\loop.md` stages and runs required checks; the lead
50
- still owns the commit and push.
45
+ Under a bare `--fix` (this document invoked without `loop`), nothing
46
+ downstream commits either. A one-shot fix pass leaves its fixes uncommitted in
47
+ the working tree for the lead to review and commit (stage first if you re-run
48
+ the gate on those lines). Under `loop`, the round tail in `reference\loop.md`
49
+ stages and runs required checks; the lead still owns the commit and push.
51
50
 
52
51
  ## Skip candidates
53
52
 
@@ -55,16 +54,15 @@ Skip a finding when fixing it would change intended behavior, require changes
55
54
  well outside the reviewed diff, or the finding itself is judged a false
56
55
  positive.
57
56
 
58
- Every logged skip surfaces exactly once, batched together, in a single
59
- consolidated list presented to the user at the very end of the fix pass
60
- — after every other finding has been fixed, marked not-needed, or skipped,
61
- and never before.
57
+ Every logged skip surfaces exactly once, batched together, in a single
58
+ list presented to the user at the end of the fix pass, after every other
59
+ finding has been fixed, marked not-needed, or skipped, and never before.
62
60
 
63
61
  ## Reporting outcomes
64
62
 
65
63
  After fixes land, report the same findings list again through the structured
66
- findings-report call — the mechanism that renders this review's results as a
67
- typed list in the host UI — with each finding now carrying an `outcome`:
64
+ findings-report call, the call that renders this review's results as a typed
65
+ list in the host UI, with each finding now carrying an `outcome`:
68
66
  `fixed`, `no_change_needed` (the finding was wrong or already handled), or
69
67
  `skipped` (real but not applied). Do not repeat the findings as text in the
70
68
  response body; the structured call is the record the host UI reads, and the
@@ -72,8 +70,8 @@ batched skip list from above goes in the prose that follows it.
72
70
 
73
71
  ## If findings are fixed later
74
72
 
75
- Whenever a reported finding is fixed later in the session — the user asks for
76
- the fix, or later work fixes it incidentally — call the structured
73
+ Whenever a reported finding is fixed later in the session, because the user
74
+ asks for the fix or later work fixes it incidentally, call the structured
77
75
  findings-report call again with the same findings, each carrying an
78
76
  `outcome` (`fixed`, `no_change_needed`, or `skipped`). Do not repeat the
79
77
  findings as text. Make that call immediately after the fixes land, before any
@@ -14,18 +14,14 @@ Report progress while you work. Stop for the user only on a terminal outcome bel
14
14
 
15
15
  ## Where fixes come from
16
16
 
17
- A round fixes whether or not `--fix` is set. Gate 2 below applies the round's
18
- fixes on every run, and its three cases read the same way with the flag and
19
- without it. What `--fix` adds is `fix.md`'s mechanics, not permission to fix:
20
- the flag decides where the mechanics come from, never whether a round fixes at
21
- all.
22
-
23
- When `--fix` is also set, the round's fixing happens inside the gate sequence
24
- below. Gate 2 is the only place a round applies a fix, and there is no separate
25
- fix pass sitting around the round. Gate 2 loads `reference\fix.md` (relative to
26
- this skill's folder) for the mechanics — which agent applies each fix, agent
27
- resume, the code-rules gate, skip logging, and outcome reporting — while the
28
- gate sequence decides whether a round fixes, commits, pushes, and re-reviews.
17
+ A round always applies fixes. Gate 2 below is the only place a round applies a
18
+ fix. `--fix` chooses the mechanics. With the flag, Gate 2 loads
19
+ `reference\fix.md` (relative to this skill's folder) for which agent applies
20
+ each fix, agent resume, the code-rules gate, skip logging, and outcome
21
+ reporting. Without the flag, this session applies each fix itself.
22
+
23
+ The gate sequence still decides whether a round fixes, commits, pushes, and
24
+ re-reviews.
29
25
 
30
26
  ## Scope stays narrow
31
27
 
@@ -55,8 +51,8 @@ no advisor call reopens that.
55
51
  `~/.claude/_shared/pr-loop/scripts/code_rules_gate.py --repo-root <repo root>`
56
52
  with no file paths and no `--only-under` prefix. On a violation on lines this
57
53
  round already owns, fix it and re-run the exact same command until clean. A
58
- violation outside the review target is reported or skipped — not force-fixed into
59
- unrelated files — and the skip is logged with path and reason.
54
+ violation outside the review target is reported or skipped, not force-fixed into
55
+ unrelated files, and the skip is logged with path and reason.
60
56
 
61
57
  That bare call gates the git diff since the merge-base (and any staged added
62
58
  lines the gate already includes). Working-tree lines that are neither staged
@@ -76,20 +72,20 @@ A repair diff is new code. From the second round on, the round runs the level
76
72
  file end to end at the new head. End to end means that file's review phases, up
77
73
  to and including its findings report; the round stops there and brings those
78
74
  findings back to the gate sequence below. It does not run the level file's
79
- *Looping* section — that section hands control to this document, and the round
75
+ *Looping* section. That section hands control to this document, and the round
80
76
  is already inside it. The round's scope is the level's own review
81
- target — the diff or path the level gathers up front, called Phase 0 in
82
- `medium.md` and `xhigh.md` — taken against that target's base. A repair edit
77
+ target, the diff or path the level gathers up front, called Phase 0 in
78
+ `medium.md` and `xhigh.md`, taken against that target's base. A repair edit
83
79
  landing outside that target widens the next round's scope to cover it: the next
84
80
  round's review target is the original target **plus** that path, and the round
85
81
  reviews both. A later widening adds to that target the same way.
86
82
 
87
83
  The widened target is what the round hands the level file. When a round runs the
88
- level file end to end, it passes the current review target — the original target
89
- plus every path a widening has since added — as that run's target argument, in
84
+ level file end to end, it passes the current review target (the original target
85
+ plus every path a widening has since added) as that run's target argument, in
90
86
  place of the argument the first round was given. When the first round was given
91
- no target argument, the original target is the item `default-range` — the level
92
- file's own default gather — so the widened target is `default-range` plus every
87
+ no target argument, the original target is the item `default-range`, the level
88
+ file's own default gather, so the widened target is `default-range` plus every
93
89
  added path, and the range the first round reviewed stays in scope. The level
94
90
  file gathers what the round hands it, so a widened path is gathered and reviewed
95
91
  like any other part of the target.
@@ -134,11 +130,11 @@ A broken reader outside the review target does not block the loop and does not
134
130
  widen scope. Hand it off as a reported finding. Two separate things are owed for
135
131
  that hand-off, and they land at different times:
136
132
 
137
- - **The round-scoped record** — what a round produces. Check the reader, record
133
+ - **The round-scoped record.** What a round produces. Check the reader, record
138
134
  its result, and name it in that round's progress report. All three are done
139
135
  inside the round that checks the reader, and nothing outside that round is
140
136
  needed to complete them. This is the record gate 2 reads.
141
- - **The termination-time disclosure** — what terminating requires. The
137
+ - **The termination-time disclosure.** What terminating requires. The
142
138
  ready-for-review message names every broken off-target reader and every
143
139
  skipped finding that still exists, and the pull request body carries the same
144
140
  names when the target is a pull request. A target with no pull request owes
@@ -158,15 +154,15 @@ The loop emits exactly one of these terminals when it stops:
158
154
  Every round does this round's own work first, then runs the three gates below,
159
155
  in order: gate 1, then gate 2, then gate 3.
160
156
 
161
- **This round's work — before the gates.** Record this round's dangerous
157
+ **This round's work, before the gates.** Record this round's dangerous
162
158
  classification and the dangerous-round count as `N of M`; and when a shape-change
163
159
  list is open, check each reader on that list and name each reader with its
164
160
  result, adding any on-target reader that reads the new shape wrong to this
165
161
  round's findings as *A shape change names its readers* directs. Then run the
166
162
  gates.
167
163
 
168
- **Gate 1 — obligations.** Gate 1 is evaluated first in the sequence, and its
169
- answer turns on the round's open obligations alone — the findings are in hand by
164
+ **Gate 1, obligations.** Gate 1 is evaluated first in the sequence, and its
165
+ answer turns on the round's open obligations alone. The findings are in hand by
170
166
  now, and no content they carry changes it. Ask only: does any obligation remain
171
167
  open? Two kinds exist.
172
168
 
@@ -175,17 +171,17 @@ open? Two kinds exist.
175
171
 
176
172
  Gate 1 states its answer and stops there: an obligation remains open, or none
177
173
  does. It states no re-entry, no continuation, and no routing. Gate 3 is the sole
178
- router — every path out of a round passes through it.
174
+ router. Every path out of a round passes through it.
179
175
 
180
- **Gate 2 — findings.** When `--fix` is set, load `reference\fix.md` here and
181
- follow it for the mechanics of every fix this gate applies — the fix agent,
176
+ **Gate 2, findings.** When `--fix` is set, load `reference\fix.md` here and
177
+ follow it for the mechanics of every fix this gate applies: the fix agent,
182
178
  agent resume, the code-rules gate, skip logging, and outcome reporting. When `--fix` is
183
179
  absent, apply each fix in this session yourself, and log each skip in this
184
180
  round's progress report. Then take the one case that matches the round's
185
181
  findings.
186
182
 
187
183
  - Any bug-severity finding: validate each bug with an advisor before touching
188
- code — confirm it's real and confirm the intended fix — then fix every
184
+ code. Confirm it's real and confirm the intended fix, then fix every
189
185
  validated bug and every nit on the review target. A refuted bug removes only
190
186
  itself from the round's work; the nits are fixed either way.
191
187
  - Nits only, with at least one nit present: fix all of them on the review
@@ -196,13 +192,13 @@ Gate 2 then ends by stating one of exactly two outcomes: unresolved findings
196
192
  remain, or none remain. A refuted bug is resolved. A fixed nit is resolved. A
197
193
  fixed validated bug is resolved. A handed-off off-target finding is resolved once
198
194
  this round has made its round-scoped record as *A shape change names its readers*
199
- defines that record — checked, result recorded, named in this round's progress
200
- report — whether or not the problem behind it is solved. Gate 2 reads the record
195
+ defines that record (checked, result recorded, named in this round's progress
196
+ report), whether or not the problem behind it is solved. Gate 2 reads the record
201
197
  and nothing else; the termination-time disclosure belongs to gate 3.
202
198
 
203
- A skipped finding — a finding deliberately not applied, because fixing it would
199
+ A skipped finding, a finding deliberately not applied because fixing it would
204
200
  change intended behavior, would reach beyond the review target, or the finding
205
- itself is judged a false positive — is resolved once its skip is logged in this
201
+ itself is judged a false positive, is resolved once its skip is logged in this
206
202
  round's progress report, naming the finding and the reason it was skipped. That
207
203
  report is the sink every run has, with or without `--fix`. When `--fix` is set,
208
204
  the skip handling `fix.md` carries runs inside this gate and adds to this log
@@ -210,7 +206,7 @@ rather than replacing it.
210
206
 
211
207
  Gate 3 reads that stated outcome, never a case label.
212
208
 
213
- **Gate 3 — exit test.** Resolve the terminal from the table above, then stop or
209
+ **Gate 3, exit test.** Resolve the terminal from the table above, then stop or
214
210
  continue:
215
211
 
216
212
  - zero retained findings and required checks pass → `clean`;
@@ -226,13 +222,13 @@ Also require, for `clean` and `nits_fixed`:
226
222
 
227
223
  Any other combination runs the round tail and re-enters the loop.
228
224
 
229
- Terminating with `clean` or `nits_fixed` carries one further condition — the
225
+ Terminating with `clean` or `nits_fixed` carries one further condition, the
230
226
  termination-time disclosure: the ready-for-review message names every broken
231
227
  off-target reader and every skipped finding that still exists. When the target
232
228
  is a pull request, the pull request body carries the same names; a target with
233
229
  no pull request owes the ready message alone. Every surface this condition
234
- names is written at termination — the ready message always, the pull request
235
- body too when the target is a pull request — so each one is available to the
230
+ names is written at termination, the ready message always, the pull request
231
+ body too when the target is a pull request, so each one is available to the
236
232
  terminating round. A round that cannot name them does not terminate; it runs
237
233
  the round tail and re-enters the loop, the same as any other non-terminating
238
234
  round. With that condition met, post the proof-of-work PR comment when the
@@ -250,7 +246,7 @@ own section above.
250
246
  *Required checks* gives: the bare command, no file paths. When this round
251
247
  produced edits, stage those edits first so they enter the bare gate's scope,
252
248
  then run the checks. When this round produced no edits, run the same checks.
253
- Should those checks produce repairs, this round has produced edits — stage
249
+ Should those checks produce repairs, this round has produced edits. Stage
254
250
  them and re-run the checks.
255
251
 
256
252
  **Commit and push are lead-owned.** Gate 2 and the round tail leave every fix
@@ -33,7 +33,8 @@ function assertReviewLevelExtension() {
33
33
  }
34
34
 
35
35
  function assertProposalHandoffs() {
36
- assert.match(proposalSource, /canonical contract owns the immutable range/)
36
+ assert.match(proposalSource, /This file owns the proposal contract for `e-code-review`/)
37
+ assert.match(proposalSource, /exact `base_sha\.\.\.head_sha` range/)
37
38
  const fixModeSource = sourceBetweenHeadings(
38
39
  fixSource,
39
40
  '## Preflight-proposal mode',
@@ -1,17 +1,37 @@
1
1
  # Review preflight proposal mode
2
2
 
3
- Apply the canonical proposal contract at:
3
+ This file owns the proposal contract for `e-code-review`.
4
4
 
5
- ```text
6
- @~/.claude/_shared/pr-loop/preflight-proposal.md
7
- ```
8
-
9
- Use this review extension when the caller selects `preflight-proposal`:
5
+ Use this review mode when the caller selects `preflight-proposal`:
10
6
 
11
7
  ```text
12
8
  /e-code-review preflight-proposal <pr_number> --level low --base-sha <base_sha> --head-sha <head_sha> --worktree <isolated_worktree>
13
9
  ```
14
10
 
11
+ ## Required inputs
12
+
13
+ | Input | Contract |
14
+ |---|---|
15
+ | `pr_number` | Resolved open pull-request number |
16
+ | `--level` | Resolved review level: `low`, `medium`, or `xhigh` |
17
+ | `--base-sha` | Full immutable base commit SHA |
18
+ | `--head-sha` | Full immutable head commit SHA |
19
+ | `--worktree` | Caller-supplied isolated worktree path |
20
+
21
+ ## Proposal contract
22
+
23
+ 1. Validate every required input before the first review command.
24
+ 2. Run `git rev-parse HEAD` in the supplied worktree and require exact equality with the head SHA.
25
+ 3. Gather changed paths and review scope from the exact `base_sha...head_sha` range. Use the resolved pull-request number for pull-request metadata.
26
+ 4. Run the complete selected review and findings against the immutable range and worktree.
27
+ 5. Keep every review edit and test inside the caller-supplied isolated worktree.
28
+ 6. Create an immutable proposal identity. Use the existing commit SHA for committed proposals. For working-tree edits, use a deterministic diff hash over the baseline `HEAD` SHA, base SHA, head SHA, sorted normalized changed paths, status records, and file bytes.
29
+ 7. Record every changed path, including tracked, untracked, renamed, and deleted paths.
30
+ 8. Record exact tests and outcomes: each test command, exit code, and outcome.
31
+ 9. Return selected-candidate-ready proposal evidence with the proposal ID, isolated worktree path, changed paths, findings, tests, and outcomes.
32
+ 10. Keep commit, push, pull-request body, pull-request comment, pull-request review, pull-request update, merge, rebase, and Ready-state mutations disabled.
33
+ 11. Return the proposal for downstream disposition. The downstream owner adds the proposal ID to its selected or dispositioned proposal collection. Reapplication uses exactly the selected records and their changed paths. Give each later finding a new proposal ID and evidence record.
34
+
15
35
  ## Review extension
16
36
 
17
37
  The caller resolves the review level before invocation and always passes `--level`. Use this mapping:
@@ -27,14 +47,29 @@ The `review_level` evidence mirrors the resolved `--level` value.
27
47
 
28
48
  Run the selected level as `<review_level> --fix loop`. The selected level owns its normal finding and fix rules. Require `HEAD` to equal the supplied head SHA before each round.
29
49
 
30
- Keep Gate 1, Gate 2, the bare code-rules gate, and exact required tests. Extend the canonical evidence record with:
50
+ Keep Gate 1, Gate 2, the bare code-rules gate, and exact required tests.
51
+
52
+ ## Evidence record
31
53
 
32
54
  ```yaml
55
+ mode: preflight-proposal
56
+ pr_number: <resolved PR number>
33
57
  review_level: low | medium | xhigh
58
+ base_sha: <immutable base SHA>
59
+ head_sha: <immutable head SHA>
60
+ proposal_id:
61
+ kind: commit-sha | diff-sha256
62
+ value: <immutable identity>
63
+ isolated_worktree: <caller-supplied path>
64
+ changed_paths:
65
+ - <normalized path>
34
66
  findings:
35
67
  - severity: blocker | high | medium | low | nit
36
68
  verdict: CONFIRMED | PLAUSIBLE
37
69
  outcome: fixed | no_change_needed | skipped
70
+ tests:
71
+ - command: <exact command>
72
+ exit_code: <integer>
73
+ outcome: <exact outcome>
74
+ downstream_selection: required
38
75
  ```
39
-
40
- The canonical contract owns the immutable range, worktree boundary, proposal identity, changed paths, exact tests and outcomes, mutation boundary, and downstream selection.
@@ -1,16 +1,16 @@
1
1
  # Runner selection (medium review)
2
2
 
3
- How `/e-code-review medium` (and loop) should pick a **harness runner** for
4
- finder/verify work. This file is the map; `SKILL.md` only points here.
3
+ How `/e-code-review medium` (and loop) picks a harness runner for finder and
4
+ verify work. `SKILL.md` points here.
5
5
 
6
6
  ## What lives here
7
7
 
8
8
  | Topic | Content |
9
9
  |---|---|
10
- | Goal | One skill surface; many possible runners (Grok, Codex, Claude headless, …) |
10
+ | Goal | One skill surface, many runners (Grok, Codex, Claude headless, and others) |
11
11
  | Today | `scripts/grok_code_review.py` is the Grok medium orchestration module |
12
12
  | Target | A thin selector chooses a runner by availability and task flags |
13
- | Non-goals | Reimplementing every harness inside this skill |
13
+ | Out of scope | Reimplementing every harness inside this skill |
14
14
 
15
15
  ## Today
16
16
 
@@ -21,21 +21,20 @@ finder/verify work. This file is the map; `SKILL.md` only points here.
21
21
 
22
22
  ## Target shape (tracked separately)
23
23
 
24
- 1. **Runner protocol** — shared inputs (diff base, head, angles) and outputs
24
+ 1. **Runner protocol.** Shared inputs (diff base, head, angles) and outputs
25
25
  (candidates, verdicts, severities).
26
- 2. **Detection** — which runners are installed/configured (PATH, skills,
26
+ 2. **Detection.** Which runners are installed or configured (PATH, skills,
27
27
  account chain).
28
- 3. **Selection** — pick one runner without baking a single vendor into
29
- `SKILL.md` process steps.
30
- 4. **Adapters** — thin wrappers: Grok (current module), Codex, Claude, …
28
+ 3. **Selection.** Pick one runner. Keep vendor choice out of `SKILL.md`
29
+ process steps.
30
+ 4. **Adapters.** Thin wrappers: Grok (current module), Codex, Claude, and
31
+ others.
31
32
 
32
- Open issue for implementation work should link this file and keep PRs small
33
- (Google small-CL practice: one concern per PR).
33
+ Keep implementation pull requests small: one concern each. Link this file from
34
+ the tracking issue.
34
35
 
35
36
  ## Related always-on docs
36
37
 
37
- - Skill hub: `../SKILL.md` (levels, fix, loop — not runner internals).
38
+ - Skill hub: `../SKILL.md` (levels, fix, loop).
38
39
  - Preflight proposal: `preflight-proposal.md` (immutable range, local runner, proposal evidence).
39
40
  - Medium procedure: `medium.md`.
40
- - Shared worker spawn (when applicable):
41
- `packages/claude-dev-env/_shared/pr-loop/worker-spawn.md` in the package tree.
@@ -60,6 +60,13 @@ Search open and closed issues on the target repo before create. Open twin -> upd
60
60
 
61
61
  Prefer GitHub MCP. Fall back to `gh` on the same REST endpoints. Full map and `.id` rule: [reference/operation-matrix.md](reference/operation-matrix.md).
62
62
 
63
+ Before issue creation, a full issue body edit, or an issue comment, write the
64
+ body to a UTF-8 file. Resolve the active managed root (`CLAUDE_CONFIG_DIR` when
65
+ set, `~/.claude` otherwise), then run
66
+ `<managed-root>/scripts/durable_post_lint.py`. Use `issue-create`, `issue-edit`,
67
+ or `issue-comment` as the action. Send the server write only after exit code
68
+ `0`.
69
+
63
70
  ## Handoff input
64
71
 
65
72
  Optional issue-candidate JSON from orchestrator or closeout. Full schema and consume path: [reference/handoff-schema.md](reference/handoff-schema.md).