claude-dev-env 2.12.0 → 2.14.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 (399) hide show
  1. package/AGENTS.md +61 -0
  2. package/CLAUDE.md +1 -57
  3. package/_shared/AGENTS.md +15 -0
  4. package/_shared/CLAUDE.md +1 -15
  5. package/_shared/advisor/AGENTS.md +22 -0
  6. package/_shared/advisor/CLAUDE.md +1 -22
  7. package/_shared/pr-loop/AGENTS.md +27 -0
  8. package/_shared/pr-loop/CLAUDE.md +1 -27
  9. package/_shared/pr-loop/scripts/AGENTS.md +35 -0
  10. package/_shared/pr-loop/scripts/CLAUDE.md +1 -35
  11. package/_shared/pr-loop/scripts/code_rules_gate.py +2 -3
  12. package/_shared/pr-loop/scripts/code_rules_gate_parts/AGENTS.md +42 -0
  13. package/_shared/pr-loop/scripts/code_rules_gate_parts/CLAUDE.md +1 -42
  14. package/_shared/pr-loop/scripts/pr_loop_shared_constants/AGENTS.md +26 -0
  15. package/_shared/pr-loop/scripts/pr_loop_shared_constants/CLAUDE.md +1 -26
  16. package/_shared/pr-loop/scripts/test_code_rules_gate.py +0 -26
  17. package/_shared/pr-loop/scripts/tests/AGENTS.md +44 -0
  18. package/_shared/pr-loop/scripts/tests/CLAUDE.md +1 -44
  19. package/_shared/process-tree/AGENTS.md +41 -0
  20. package/_shared/process-tree/CLAUDE.md +1 -41
  21. package/agents/AGENTS.md +31 -0
  22. package/agents/CLAUDE.md +1 -32
  23. package/agents/clean-coder.md +6 -6
  24. package/agents/pr-description-writer.md +11 -81
  25. package/agents/test_agent_frontmatter.py +4 -4
  26. package/audit-rubrics/AGENTS.md +43 -0
  27. package/audit-rubrics/CLAUDE.md +1 -43
  28. package/audit-rubrics/category_rubrics/AGENTS.md +37 -0
  29. package/audit-rubrics/category_rubrics/CLAUDE.md +1 -37
  30. package/audit-rubrics/prompts/AGENTS.md +37 -0
  31. package/audit-rubrics/prompts/CLAUDE.md +1 -37
  32. package/bin/AGENTS.md +112 -0
  33. package/bin/CLAUDE.md +1 -112
  34. package/bin/ever-shipped-skills.mjs +1 -0
  35. package/bin/install-constants.mjs +6 -7
  36. package/bin/install.mjs +71 -13
  37. package/bin/install.prune.test.mjs +26 -0
  38. package/bin/install.settings-defaults.test.mjs +60 -33
  39. package/bin/install.test.mjs +36 -4
  40. package/commands/AGENTS.md +23 -0
  41. package/commands/CLAUDE.md +1 -23
  42. package/commands/hook-log-extract.md +3 -3
  43. package/commands/sr-loop.md +9 -5
  44. package/docs/AGENTS.md +32 -0
  45. package/docs/CLAUDE.md +1 -33
  46. package/docs/CODE_RULES.md +1 -1
  47. package/docs/imagegen.md +22 -0
  48. package/docs/references/AGENTS.md +17 -0
  49. package/docs/references/CLAUDE.md +1 -18
  50. package/hooks/AGENTS.md +31 -0
  51. package/hooks/CLAUDE.md +1 -31
  52. package/hooks/_gh_pr_author_swap_utils.py +14 -0
  53. package/hooks/advisory/AGENTS.md +16 -0
  54. package/hooks/advisory/CLAUDE.md +1 -16
  55. package/hooks/blocking/AGENTS.md +123 -0
  56. package/hooks/blocking/CLAUDE.md +1 -148
  57. package/hooks/blocking/claude_md_orphan_file_blocker_parts/AGENTS.md +28 -0
  58. package/hooks/blocking/claude_md_orphan_file_blocker_parts/CLAUDE.md +1 -28
  59. package/hooks/blocking/code_rules_banned_identifiers.py +1 -1
  60. package/hooks/blocking/code_rules_dead_module_constant.py +149 -37
  61. package/hooks/blocking/code_rules_probe_chains.py +6 -2
  62. package/hooks/blocking/config/AGENTS.md +10 -0
  63. package/hooks/blocking/config/CLAUDE.md +1 -22
  64. package/hooks/blocking/conventional_pr_title_gate.py +1 -2
  65. package/hooks/blocking/gh_pr_author_restore.py +7 -2
  66. package/hooks/blocking/intent_only_ending_blocker.py +11 -16
  67. package/hooks/blocking/inventory_intent_records/AGENTS.md +26 -0
  68. package/hooks/blocking/inventory_intent_records/CLAUDE.md +1 -26
  69. package/hooks/blocking/package_inventory_stale_blocker_parts/AGENTS.md +26 -0
  70. package/hooks/blocking/package_inventory_stale_blocker_parts/CLAUDE.md +1 -26
  71. package/hooks/blocking/pii_prevention_blocker_parts/AGENTS.md +24 -0
  72. package/hooks/blocking/pii_prevention_blocker_parts/CLAUDE.md +1 -24
  73. package/hooks/blocking/send_user_file_open_locally_blocker.py +1 -1
  74. package/hooks/blocking/stop_dispatcher.py +4 -4
  75. package/hooks/blocking/tdd_enforcer_parts/AGENTS.md +30 -0
  76. package/hooks/blocking/tdd_enforcer_parts/CLAUDE.md +1 -30
  77. package/hooks/blocking/test_bash_pre_tool_use_dispatcher.py +0 -3
  78. package/hooks/blocking/test_code_rules_enforcer_banned_prefixes.py +1 -1
  79. package/hooks/blocking/test_code_rules_enforcer_dead_module_constant.py +171 -0
  80. package/hooks/blocking/test_code_rules_enforcer_magic_allowlist.py +1 -1
  81. package/hooks/blocking/test_gh_pr_author_restore.py +2 -1
  82. package/hooks/blocking/test_intent_only_ending_blocker.py +4 -0
  83. package/hooks/blocking/test_pre_tool_use_dispatcher.py +6 -7
  84. package/hooks/blocking/test_send_user_file_open_locally_blocker.py +4 -3
  85. package/hooks/blocking/test_shared_stdin_adoption.py +0 -2
  86. package/hooks/diagnostic/AGENTS.md +43 -0
  87. package/hooks/diagnostic/CLAUDE.md +1 -43
  88. package/hooks/diagnostic/hook_log_extractor.py +4 -38
  89. package/hooks/diagnostic/hook_log_stop_wrapper.py +6 -155
  90. package/hooks/diagnostic/migrations/AGENTS.md +16 -0
  91. package/hooks/diagnostic/migrations/CLAUDE.md +1 -16
  92. package/hooks/diagnostic/queries/AGENTS.md +19 -0
  93. package/hooks/diagnostic/queries/CLAUDE.md +1 -19
  94. package/hooks/diagnostic/test_hook_log_extractor.py +10 -23
  95. package/hooks/diagnostic/test_hook_log_stop_wrapper.py +3 -331
  96. package/hooks/git-hooks/AGENTS.md +31 -0
  97. package/hooks/git-hooks/CLAUDE.md +1 -31
  98. package/hooks/git-hooks/git_hooks_constants/AGENTS.md +21 -0
  99. package/hooks/git-hooks/git_hooks_constants/CLAUDE.md +1 -21
  100. package/hooks/git-hooks/git_hooks_constants/__init__.py +4 -12
  101. package/hooks/git-hooks/pre_push.py +49 -118
  102. package/hooks/git-hooks/test_pre_push.py +111 -137
  103. package/hooks/hooks.json +0 -35
  104. package/hooks/hooks_constants/AGENTS.md +104 -0
  105. package/hooks/hooks_constants/CLAUDE.md +1 -113
  106. package/hooks/hooks_constants/bash_pre_tool_use_dispatcher_constants.py +0 -11
  107. package/hooks/hooks_constants/convergence_branch_constants.py +0 -1
  108. package/hooks/hooks_constants/fable_spawn_gate_constants.py +3 -4
  109. package/hooks/hooks_constants/hook_log_extractor_constants.py +1 -2
  110. package/hooks/hooks_constants/pre_tool_use_dispatcher_constants.py +0 -8
  111. package/hooks/hooks_constants/send_user_file_open_locally_blocker_constants.py +1 -6
  112. package/hooks/hooks_constants/stop_dispatcher_constants.py +0 -1
  113. package/hooks/hooks_constants/task_list_loop_starter_constants.py +4 -3
  114. package/hooks/hooks_constants/test_bash_pre_tool_use_dispatcher_constants.py +1 -26
  115. package/hooks/hooks_constants/test_pre_tool_use_dispatcher_constants.py +0 -5
  116. package/hooks/hooks_constants/test_stop_dispatcher_constants.py +0 -1
  117. package/hooks/hooks_constants/working_style_prompt_constants.py +29 -20
  118. package/hooks/lifecycle/AGENTS.md +18 -0
  119. package/hooks/lifecycle/CLAUDE.md +1 -20
  120. package/hooks/observability/AGENTS.md +20 -0
  121. package/hooks/observability/CLAUDE.md +1 -20
  122. package/hooks/session/AGENTS.md +33 -0
  123. package/hooks/session/CLAUDE.md +1 -33
  124. package/hooks/session/gh_pr_author_session_cleanup.py +7 -2
  125. package/hooks/session/task_list_loop_starter.py +3 -3
  126. package/hooks/session/test_gh_pr_author_session_cleanup.py +2 -1
  127. package/hooks/session/test_task_list_loop_starter.py +10 -2
  128. package/hooks/session/test_working_style_prompt.py +9 -4
  129. package/hooks/validation/AGENTS.md +20 -0
  130. package/hooks/validation/CLAUDE.md +1 -20
  131. package/hooks/validators/AGENTS.md +51 -0
  132. package/hooks/validators/CLAUDE.md +1 -51
  133. package/hooks/validators/health_check.py +52 -19
  134. package/hooks/validators/python_style_checks.py +1 -1
  135. package/hooks/validators/test_health_check.py +112 -27
  136. package/hooks/workflow/AGENTS.md +16 -0
  137. package/hooks/workflow/CLAUDE.md +1 -16
  138. package/installable-surfaces.manifest.json +1 -0
  139. package/output-styles/AGENTS.md +15 -0
  140. package/output-styles/CLAUDE.md +1 -15
  141. package/package.json +2 -1
  142. package/rules/AGENTS.md +61 -0
  143. package/rules/CLAUDE.md +1 -63
  144. package/rules/code-standards.md +5 -9
  145. package/rules/doc-prose-cuts.md +1 -1
  146. package/rules/gh-cli-conventions.md +0 -1
  147. package/rules/git-workflow.md +1 -3
  148. package/scripts/AGENTS.md +62 -0
  149. package/scripts/CLAUDE.md +1 -63
  150. package/scripts/_code_review_test_support.py +0 -95
  151. package/scripts/codex_compat_materializer.py +4 -0
  152. package/scripts/dev_env_scripts_constants/AGENTS.md +21 -0
  153. package/scripts/dev_env_scripts_constants/CLAUDE.md +1 -21
  154. package/scripts/dev_env_scripts_constants/code_review_constants.py +9 -98
  155. package/scripts/dev_env_scripts_constants/test_code_review_constants.py +1 -44
  156. package/scripts/invoke_code_review.py +8 -451
  157. package/scripts/sync_to_cursor/AGENTS.md +23 -0
  158. package/scripts/sync_to_cursor/CLAUDE.md +1 -23
  159. package/scripts/test_invoke_code_review.py +5 -61
  160. package/scripts/test_invoke_code_review_cli.py +1 -45
  161. package/scripts/test_invoke_code_review_contract.py +1 -118
  162. package/scripts/test_validate_instruction_pairs.py +90 -0
  163. package/scripts/test_verify_installable_package.py +5 -1
  164. package/scripts/tests/AGENTS.md +33 -0
  165. package/scripts/tests/CLAUDE.md +1 -33
  166. package/scripts/tests/test_codex_compat_materializer.py +36 -1
  167. package/scripts/validate_instruction_pairs.py +183 -0
  168. package/settings.json +1 -10
  169. package/skills/AGENTS.md +72 -0
  170. package/skills/CLAUDE.md +1 -64
  171. package/skills/_shared/AGENTS.md +44 -0
  172. package/skills/_shared/CLAUDE.md +1 -44
  173. package/skills/_shared/advisor/AGENTS.md +9 -0
  174. package/skills/_shared/advisor/CLAUDE.md +1 -9
  175. package/skills/_shared/pr-loop/AGENTS.md +50 -0
  176. package/skills/_shared/pr-loop/CLAUDE.md +1 -50
  177. package/skills/_shared/pr-loop/prompts/AGENTS.md +9 -0
  178. package/skills/_shared/pr-loop/prompts/CLAUDE.md +1 -9
  179. package/skills/_shared/pr-loop/scripts/AGENTS.md +35 -0
  180. package/skills/_shared/pr-loop/scripts/CLAUDE.md +1 -35
  181. package/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/AGENTS.md +24 -0
  182. package/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/CLAUDE.md +1 -24
  183. package/skills/anthropic-plan/AGENTS.md +34 -0
  184. package/skills/anthropic-plan/CLAUDE.md +1 -34
  185. package/skills/anthropic-plan/scripts/AGENTS.md +11 -0
  186. package/skills/anthropic-plan/scripts/CLAUDE.md +1 -11
  187. package/skills/anthropic-plan/scripts/anthropic_plan_scripts_constants/AGENTS.md +16 -0
  188. package/skills/anthropic-plan/scripts/anthropic_plan_scripts_constants/CLAUDE.md +1 -16
  189. package/skills/anthropic-plan/templates/AGENTS.md +13 -0
  190. package/skills/anthropic-plan/templates/CLAUDE.md +1 -13
  191. package/skills/anthropic-plan/workflow/AGENTS.md +14 -0
  192. package/skills/anthropic-plan/workflow/CLAUDE.md +1 -14
  193. package/skills/auditing-claude-config/AGENTS.md +21 -0
  194. package/skills/auditing-claude-config/CLAUDE.md +1 -21
  195. package/skills/autoconverge/AGENTS.md +36 -0
  196. package/skills/autoconverge/CLAUDE.md +1 -36
  197. package/skills/autoconverge/reference/AGENTS.md +16 -0
  198. package/skills/autoconverge/reference/CLAUDE.md +1 -16
  199. package/skills/autoconverge/reference/convergence.md +7 -7
  200. package/skills/autoconverge/reference/gotchas.md +3 -10
  201. package/skills/autoconverge/workflow/AGENTS.md +26 -0
  202. package/skills/autoconverge/workflow/CLAUDE.md +1 -26
  203. package/skills/autoconverge/workflow/autoconverge_report_constants/AGENTS.md +16 -0
  204. package/skills/autoconverge/workflow/autoconverge_report_constants/CLAUDE.md +1 -16
  205. package/skills/autoconverge/workflow/converge.contract.test.mjs +53 -1388
  206. package/skills/autoconverge/workflow/converge.copilot-gate.test.mjs +4 -3
  207. package/skills/autoconverge/workflow/converge.fix-recovery.test.mjs +33 -493
  208. package/skills/autoconverge/workflow/converge.merge-conflict.test.mjs +15 -97
  209. package/skills/autoconverge/workflow/converge.mjs +201 -238
  210. package/skills/autoconverge/workflow/converge.precatch.test.mjs +1 -1
  211. package/skills/bugteam/AGENTS.md +30 -0
  212. package/skills/bugteam/CLAUDE.md +1 -30
  213. package/skills/bugteam/CONSTRAINTS.md +1 -1
  214. package/skills/bugteam/SKILL.md +9 -0
  215. package/skills/bugteam/reference/AGENTS.md +20 -0
  216. package/skills/bugteam/reference/CLAUDE.md +1 -20
  217. package/skills/bugteam/reference/audit-and-teammates.md +10 -6
  218. package/skills/bugteam/reference/obstacles/AGENTS.md +24 -0
  219. package/skills/bugteam/reference/obstacles/CLAUDE.md +1 -24
  220. package/skills/bugteam/scripts/AGENTS.md +30 -0
  221. package/skills/bugteam/scripts/CLAUDE.md +1 -30
  222. package/skills/bugteam/scripts/bugteam_scripts_constants/AGENTS.md +18 -0
  223. package/skills/bugteam/scripts/bugteam_scripts_constants/CLAUDE.md +1 -18
  224. package/skills/bugteam/test_skill_additions.py +9 -0
  225. package/skills/closeout/reference/handoff-prompt-template.md +1 -1
  226. package/skills/codex-review/AGENTS.md +46 -0
  227. package/skills/codex-review/CLAUDE.md +1 -46
  228. package/skills/codex-review/reference/AGENTS.md +15 -0
  229. package/skills/codex-review/reference/CLAUDE.md +1 -15
  230. package/skills/codex-review/scripts/codex_review_scripts_constants/AGENTS.md +18 -0
  231. package/skills/codex-review/scripts/codex_review_scripts_constants/CLAUDE.md +1 -18
  232. package/skills/codex-review/test_skill_scaffold.py +3 -3
  233. package/skills/comments/SKILL.md +65 -0
  234. package/skills/copilot-review/AGENTS.md +18 -0
  235. package/skills/copilot-review/CLAUDE.md +1 -18
  236. package/skills/descriptions/SKILL.md +51 -0
  237. package/skills/emergencies/SKILL.md +42 -0
  238. package/skills/everything-search/AGENTS.md +17 -0
  239. package/skills/everything-search/CLAUDE.md +1 -17
  240. package/skills/fresh-branch/AGENTS.md +14 -0
  241. package/skills/fresh-branch/CLAUDE.md +1 -14
  242. package/skills/grok-spawn/AGENTS.md +28 -0
  243. package/skills/grok-spawn/CLAUDE.md +1 -28
  244. package/skills/orchestrator/SKILL.md +2 -4
  245. package/skills/plan-to-pr/SKILL.md +6 -7
  246. package/skills/plan-to-pr/reference/final-validation-tasks.md +1 -1
  247. package/skills/plan-to-pr/reference/process-inventory.md +2 -2
  248. package/skills/plan-to-pr/reference/review-loop.md +2 -2
  249. package/skills/plan-to-pr/reference/run-record.schema.json +1 -1
  250. package/skills/plan-to-pr/reference/task-seeds.md +1 -1
  251. package/skills/plan-to-pr/reference/task-ticket.md +3 -4
  252. package/skills/plan-to-pr/scripts/config/constants.py +1 -2
  253. package/skills/plan-to-pr/scripts/test_validate_protocol.py +1 -1
  254. package/skills/plan-to-pr/test_skill_contract.py +2 -2
  255. package/skills/pr-converge/AGENTS.md +32 -0
  256. package/skills/pr-converge/CLAUDE.md +1 -32
  257. package/skills/pr-converge/SKILL.md +13 -16
  258. package/skills/pr-converge/pr_converge_skill_constants/AGENTS.md +26 -0
  259. package/skills/pr-converge/pr_converge_skill_constants/CLAUDE.md +1 -26
  260. package/skills/pr-converge/reference/AGENTS.md +28 -0
  261. package/skills/pr-converge/reference/CLAUDE.md +1 -28
  262. package/skills/pr-converge/reference/obstacles/AGENTS.md +23 -0
  263. package/skills/pr-converge/reference/obstacles/CLAUDE.md +1 -23
  264. package/skills/pr-converge/reference/progress-checklist.md +6 -5
  265. package/skills/pr-converge/reference/state-schema.md +1 -27
  266. package/skills/pr-converge/scripts/AGENTS.md +46 -0
  267. package/skills/pr-converge/scripts/CLAUDE.md +1 -46
  268. package/skills/pr-converge/scripts/pr_converge_scripts_constants/AGENTS.md +18 -0
  269. package/skills/pr-converge/scripts/pr_converge_scripts_constants/CLAUDE.md +1 -18
  270. package/skills/pr-converge/workflows/AGENTS.md +16 -0
  271. package/skills/pr-converge/workflows/CLAUDE.md +1 -16
  272. package/skills/pr-loop-cloud-transport/SKILL.md +1 -1
  273. package/skills/pr-loop-cloud-transport/reference/identity-and-hooks.md +3 -3
  274. package/skills/pr-loop-lifecycle/SKILL.md +1 -1
  275. package/skills/pr-loop-lifecycle/reference/teardown-publish-permissions.md +1 -1
  276. package/skills/prototype/SKILL.md +4 -4
  277. package/skills/prototype/reference/honest-limitations.md +5 -5
  278. package/skills/prototype/reference/promotion-tasks.md +2 -2
  279. package/skills/prototype/workflows/promotion.md +4 -6
  280. package/skills/rebase/AGENTS.md +32 -0
  281. package/skills/rebase/CLAUDE.md +1 -32
  282. package/skills/recall/AGENTS.md +30 -0
  283. package/skills/recall/CLAUDE.md +1 -30
  284. package/skills/remember/AGENTS.md +31 -0
  285. package/skills/remember/CLAUDE.md +1 -31
  286. package/skills/reviews/SKILL.md +85 -0
  287. package/skills/session-log/AGENTS.md +32 -0
  288. package/skills/session-log/CLAUDE.md +1 -32
  289. package/skills/session-tidy/AGENTS.md +36 -0
  290. package/skills/session-tidy/CLAUDE.md +1 -36
  291. package/skills/skill-builder/AGENTS.md +49 -0
  292. package/skills/skill-builder/CLAUDE.md +1 -49
  293. package/skills/skill-builder/references/AGENTS.md +25 -0
  294. package/skills/skill-builder/references/CLAUDE.md +1 -25
  295. package/skills/skill-builder/references/deterministic-elements.md +1 -1
  296. package/skills/skill-builder/templates/AGENTS.md +14 -0
  297. package/skills/skill-builder/templates/CLAUDE.md +1 -14
  298. package/skills/skill-builder/workflows/AGENTS.md +19 -0
  299. package/skills/skill-builder/workflows/CLAUDE.md +1 -19
  300. package/skills/small-cl/SKILL.md +52 -0
  301. package/skills/task-build/AGENTS.md +29 -0
  302. package/skills/task-build/CLAUDE.md +1 -29
  303. package/skills/update/AGENTS.md +38 -0
  304. package/skills/update/CLAUDE.md +1 -38
  305. package/system-prompts/AGENTS.md +17 -0
  306. package/system-prompts/CLAUDE.md +1 -17
  307. package/system-prompts/software-engineer.xml +3 -3
  308. package/agents/code-verifier.md +0 -74
  309. package/docs/PR_DESCRIPTION_GUIDE.md +0 -157
  310. package/docs/references/code-review-enforcement.md +0 -132
  311. package/hooks/blocking/code_review_enforcement_config_bootstrap.py +0 -53
  312. package/hooks/blocking/code_review_gate_deny.py +0 -74
  313. package/hooks/blocking/code_review_pr_create_gate.py +0 -198
  314. package/hooks/blocking/code_review_push_gate.py +0 -145
  315. package/hooks/blocking/code_review_stamp_directory_write_blocker.py +0 -348
  316. package/hooks/blocking/code_review_stamp_store.py +0 -233
  317. package/hooks/blocking/code_review_stamp_write_blocker_parts/__init__.py +0 -7
  318. package/hooks/blocking/code_review_stamp_write_blocker_parts/conftest.py +0 -15
  319. package/hooks/blocking/code_review_stamp_write_blocker_parts/obfuscated_stamp_path_reference.py +0 -212
  320. package/hooks/blocking/code_review_stamp_write_blocker_parts/split_directory_change_into_stamp.py +0 -138
  321. package/hooks/blocking/code_review_stamp_write_blocker_parts/test_obfuscated_stamp_path_reference.py +0 -49
  322. package/hooks/blocking/code_review_stamp_write_blocker_parts/test_split_directory_change_into_stamp.py +0 -38
  323. package/hooks/blocking/code_verifier_spawn_preflight_gate.py +0 -483
  324. package/hooks/blocking/config/code_review_enforcement_constants.py +0 -143
  325. package/hooks/blocking/config/test_code_review_enforcement_constants.py +0 -166
  326. package/hooks/blocking/config/verified_commit_constants.py +0 -160
  327. package/hooks/blocking/config/verified_commit_context_constants.py +0 -21
  328. package/hooks/blocking/config/verified_commit_gate_output_constants.py +0 -14
  329. package/hooks/blocking/conftest.py +0 -123
  330. package/hooks/blocking/convergence_gate_blocker.py +0 -310
  331. package/hooks/blocking/pr_converge_bugteam_enforcer.py +0 -170
  332. package/hooks/blocking/pr_description_body_audit.py +0 -148
  333. package/hooks/blocking/pr_description_command_parser.py +0 -237
  334. package/hooks/blocking/pr_description_enforcer.py +0 -227
  335. package/hooks/blocking/pr_description_pr_number.py +0 -155
  336. package/hooks/blocking/pr_description_proof_of_work.py +0 -385
  337. package/hooks/blocking/pr_description_readability.py +0 -364
  338. package/hooks/blocking/reviewer_spawn_gate.py +0 -182
  339. package/hooks/blocking/test_code_review_enforcement_config_bootstrap.py +0 -62
  340. package/hooks/blocking/test_code_review_gate_deny.py +0 -54
  341. package/hooks/blocking/test_code_review_pr_create_gate.py +0 -199
  342. package/hooks/blocking/test_code_review_push_gate.py +0 -205
  343. package/hooks/blocking/test_code_review_stamp_directory_write_blocker.py +0 -199
  344. package/hooks/blocking/test_code_review_stamp_store.py +0 -205
  345. package/hooks/blocking/test_code_verifier_spawn_preflight_gate.py +0 -710
  346. package/hooks/blocking/test_code_verifier_tools_contract.py +0 -28
  347. package/hooks/blocking/test_convergence_gate_blocker.py +0 -428
  348. package/hooks/blocking/test_pr_converge_bugteam_enforcer.py +0 -311
  349. package/hooks/blocking/test_pr_converge_bugteam_enforcer_state_tolerance.py +0 -184
  350. package/hooks/blocking/test_pr_description_enforcer.py +0 -221
  351. package/hooks/blocking/test_pr_description_enforcer_body_audit.py +0 -247
  352. package/hooks/blocking/test_pr_description_enforcer_body_rules.py +0 -493
  353. package/hooks/blocking/test_pr_description_enforcer_command_parser.py +0 -366
  354. package/hooks/blocking/test_pr_description_enforcer_pr_number.py +0 -159
  355. package/hooks/blocking/test_pr_description_enforcer_proof_gate.py +0 -175
  356. package/hooks/blocking/test_pr_description_enforcer_readability.py +0 -443
  357. package/hooks/blocking/test_pr_description_proof_of_work.py +0 -313
  358. package/hooks/blocking/test_reviewer_spawn_gate.py +0 -230
  359. package/hooks/blocking/test_verdict_directory_write_blocker.py +0 -804
  360. package/hooks/blocking/test_verification_verdict_store.py +0 -974
  361. package/hooks/blocking/test_verified_commit_config_bootstrap.py +0 -67
  362. package/hooks/blocking/test_verified_commit_docs_delta.py +0 -176
  363. package/hooks/blocking/test_verified_commit_gate.py +0 -581
  364. package/hooks/blocking/test_verified_commit_gate_additional_context.py +0 -134
  365. package/hooks/blocking/test_verified_commit_message_accuracy_blocker.py +0 -131
  366. package/hooks/blocking/test_verifier_verdict_minter.py +0 -299
  367. package/hooks/blocking/tests/test_verified_commit_gate.py +0 -41
  368. package/hooks/blocking/verdict_directory_write_blocker.py +0 -687
  369. package/hooks/blocking/verification_verdict_store.py +0 -1039
  370. package/hooks/blocking/verified_commit_config_bootstrap.py +0 -63
  371. package/hooks/blocking/verified_commit_gate.py +0 -113
  372. package/hooks/blocking/verified_commit_gate_parts/CLAUDE.md +0 -28
  373. package/hooks/blocking/verified_commit_gate_parts/__init__.py +0 -1
  374. package/hooks/blocking/verified_commit_gate_parts/command_tokenization.py +0 -174
  375. package/hooks/blocking/verified_commit_gate_parts/deny_payload.py +0 -53
  376. package/hooks/blocking/verified_commit_gate_parts/deny_reason.py +0 -80
  377. package/hooks/blocking/verified_commit_gate_parts/directory_resolution.py +0 -170
  378. package/hooks/blocking/verified_commit_gate_parts/gated_invocations.py +0 -217
  379. package/hooks/blocking/verified_commit_gate_parts/tests/conftest.py +0 -10
  380. package/hooks/blocking/verified_commit_gate_parts/tests/test_command_tokenization.py +0 -94
  381. package/hooks/blocking/verified_commit_gate_parts/tests/test_deny_payload.py +0 -17
  382. package/hooks/blocking/verified_commit_gate_parts/tests/test_deny_reason.py +0 -38
  383. package/hooks/blocking/verified_commit_gate_parts/tests/test_directory_resolution.py +0 -71
  384. package/hooks/blocking/verified_commit_gate_parts/tests/test_gated_invocations.py +0 -96
  385. package/hooks/blocking/verified_commit_message_accuracy_blocker.py +0 -167
  386. package/hooks/blocking/verifier_verdict_minter.py +0 -280
  387. package/hooks/hooks_constants/code_verifier_spawn_preflight_gate_constants.py +0 -64
  388. package/hooks/hooks_constants/convergence_gate_blocker_constants.py +0 -53
  389. package/hooks/hooks_constants/pr_converge_bugteam_enforcer_constants.py +0 -55
  390. package/hooks/hooks_constants/pr_converge_bugteam_enforcer_state.py +0 -67
  391. package/hooks/hooks_constants/pr_description_enforcer_constants.py +0 -167
  392. package/hooks/hooks_constants/pr_description_proof_of_work_constants.py +0 -107
  393. package/hooks/hooks_constants/reviewer_spawn_gate_constants.py +0 -41
  394. package/hooks/hooks_constants/test_pr_description_enforcer_constants.py +0 -292
  395. package/hooks/lifecycle/pr_converge_bugteam_skill_tracker.py +0 -198
  396. package/hooks/lifecycle/test_pr_converge_bugteam_skill_tracker.py +0 -283
  397. package/rules/proof-of-work-pr-comments.md +0 -22
  398. package/rules/verified-commit-gate-skip.md +0 -4
  399. package/scripts/Show-Asset.ps1 +0 -106
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: small-cl
3
+ description: >-
4
+ Scope or split a pull request into a self-contained reviewable increment. Use
5
+ when a user asks to "split this PR", "make this change smaller", or "small CL".
6
+ ---
7
+
8
+ # Focused Pull Request Guide
9
+
10
+ ## When to Use This Guide
11
+
12
+ Use this guide to plan, assess, or split a pull request into a reviewable unit.
13
+ The pull request boundary is conceptual: one coherent outcome that a reviewer
14
+ can understand with its context and verification.
15
+
16
+ ## What a Focused Pull Request Contains
17
+
18
+ A focused pull request contains the implementation, related tests, documentation,
19
+ and configuration needed for one outcome. It leaves the system in a usable state
20
+ and gives the reviewer the information needed to assess the change.
21
+
22
+ Use the [description guide](../descriptions/SKILL.md#required-content) to record
23
+ the scope, verification, risks, and follow-up work.
24
+
25
+ ## Splitting a Change
26
+
27
+ Choose a split that gives each increment a coherent purpose and a clear test
28
+ boundary. Useful seams include:
29
+
30
+ - Preparation refactors followed by behavior changes.
31
+ - Independent vertical features that each deliver a user-visible capability.
32
+ - Layer-specific work when each layer remains independently understandable.
33
+ - Stacked changes when each earlier change supplies the next change's stable
34
+ foundation.
35
+
36
+ State dependencies between related pull requests and keep each increment safe to
37
+ merge or revert on its own.
38
+
39
+ ## Reviewable Scope
40
+
41
+ Ask to split a change when its breadth prevents a reliable assessment of design,
42
+ behavior, or verification. Identify the first coherent increment and the
43
+ remaining increments so the author has an actionable path forward.
44
+
45
+ Use [reviews](../reviews/SKILL.md#evaluation-criteria) to evaluate the resulting
46
+ scope and [emergencies](../emergencies/SKILL.md#emergency-classification) when an
47
+ active incident sets the immediate boundary.
48
+
49
+ ## Responding to Review
50
+
51
+ Use the [comment guide](../comments/SKILL.md#responding-to-feedback) to respond
52
+ to feedback and resolve pushback.
@@ -0,0 +1,29 @@
1
+ # task-build
2
+
3
+ Gathers every open task in the current session and registers each one with the best available task or plan tool.
4
+
5
+ **Trigger:** `/task-build`, "build my task list", "capture these tasks", "add open tasks to the task list", "track these".
6
+
7
+ ## Purpose
8
+
9
+ Collects outstanding work from the conversation, `$ARGUMENTS`, and any plan documents or task items raised this session, then registers one item per open task — skipping anything already tracked or already complete.
10
+
11
+ ## Key files
12
+
13
+ | File | Purpose |
14
+ |---|---|
15
+ | `SKILL.md` | Complete task discovery and registration workflow |
16
+ | `reference/tool-routing.md` | Progressive-disclosure routing and fallback rules |
17
+
18
+ ## How the skill runs
19
+
20
+ 1. Reads the current list or visible plan with the selected host tool — prevents duplicates.
21
+ 2. Scans `$ARGUMENTS`, the conversation, and any plan or checklist items for open, actionable work.
22
+ 3. Prefers `update_plan`; otherwise uses `TaskList`/`TaskCreate`, then `TodoWrite` as the fallback. See `reference/tool-routing.md` for field mapping.
23
+ 4. Reports the selected tool, how many tasks were added, and how many were already tracked.
24
+
25
+ ## Conventions
26
+
27
+ - This skill only records tasks — it does not start, assign, or complete them.
28
+ - Use the matching host operation to set status after the list is built.
29
+ - `disable-model-invocation: true` is not set; the skill uses model judgment to classify open vs. complete items.
@@ -1,29 +1 @@
1
- # task-build
2
-
3
- Gathers every open task in the current session and registers each one with the best available task or plan tool.
4
-
5
- **Trigger:** `/task-build`, "build my task list", "capture these tasks", "add open tasks to the task list", "track these".
6
-
7
- ## Purpose
8
-
9
- Collects outstanding work from the conversation, `$ARGUMENTS`, and any plan documents or task items raised this session, then registers one item per open task — skipping anything already tracked or already complete.
10
-
11
- ## Key files
12
-
13
- | File | Purpose |
14
- |---|---|
15
- | `SKILL.md` | Complete task discovery and registration workflow |
16
- | `reference/tool-routing.md` | Progressive-disclosure routing and fallback rules |
17
-
18
- ## How the skill runs
19
-
20
- 1. Reads the current list or visible plan with the selected host tool — prevents duplicates.
21
- 2. Scans `$ARGUMENTS`, the conversation, and any plan or checklist items for open, actionable work.
22
- 3. Prefers `update_plan`; otherwise uses `TaskList`/`TaskCreate`, then `TodoWrite` as the fallback. See `reference/tool-routing.md` for field mapping.
23
- 4. Reports the selected tool, how many tasks were added, and how many were already tracked.
24
-
25
- ## Conventions
26
-
27
- - This skill only records tasks — it does not start, assign, or complete them.
28
- - Use the matching host operation to set status after the list is built.
29
- - `disable-model-invocation: true` is not set; the skill uses model judgment to classify open vs. complete items.
1
+ @AGENTS.md
@@ -0,0 +1,38 @@
1
+ # update
2
+
3
+ Fast-forwards a local git repository's `main` branch to a chosen remote's `main`.
4
+
5
+ **Trigger:** `/update`, "update main", "fast-forward main", "sync main from origin", "pull latest main into <path>", "bring main up to date".
6
+
7
+ ## Purpose
8
+
9
+ Advances the `main` ref in a safe, confirmed, fast-forward-only way. Never forces, never merges. Confirms the repo path and source remote before any write. Offers to switch the checkout to `main` after the ref moves, with a clean-tree safety check.
10
+
11
+ ## Key files
12
+
13
+ | File | Purpose |
14
+ |---|---|
15
+ | `SKILL.md` | The complete skill — five phases, refusals, gotchas. Flat by design; no companion files. |
16
+
17
+ ## Five phases
18
+
19
+ | Phase | Key action |
20
+ |---|---|
21
+ | 1 — Resolve path | `git -C "<path>" rev-parse --show-toplevel` |
22
+ | 2 — Confirm path + remote | One `AskUserQuestion` listing remote/URL pairs; recommends `origin/main` first |
23
+ | 3 — Fetch + fast-forward | Fetch, check ancestry with `merge-base --is-ancestor`, apply via `merge --ff-only` (on main) or `fetch main:main` (off main) |
24
+ | 4 — Report | Old SHA → new SHA, checkout state, dirty tracked files |
25
+ | 5 — Offer to land on disk | `AskUserQuestion` to switch checkout to `main` (only when tree is clean and `main` is not held by another worktree) |
26
+
27
+ ## Refusals (first match wins)
28
+
29
+ - Path is not a git repository → stated error, stop.
30
+ - Remote has no `main` → stated error, stop.
31
+ - Local `main` has diverged (not a fast-forward) → stated error, stop. Use `/rebase` to reconcile.
32
+
33
+ ## Conventions
34
+
35
+ - Every command uses `git -C "<path>"` — never `cd` into the repo.
36
+ - Path confirmation is mandatory even when the path comes from the argument.
37
+ - The skill never switches to any branch other than `main`, and only in Phase 5 with operator approval.
38
+ - `origin` is not always the source of truth; the confirmed remote may be `upstream` or another name.
@@ -1,38 +1 @@
1
- # update
2
-
3
- Fast-forwards a local git repository's `main` branch to a chosen remote's `main`.
4
-
5
- **Trigger:** `/update`, "update main", "fast-forward main", "sync main from origin", "pull latest main into <path>", "bring main up to date".
6
-
7
- ## Purpose
8
-
9
- Advances the `main` ref in a safe, confirmed, fast-forward-only way. Never forces, never merges. Confirms the repo path and source remote before any write. Offers to switch the checkout to `main` after the ref moves, with a clean-tree safety check.
10
-
11
- ## Key files
12
-
13
- | File | Purpose |
14
- |---|---|
15
- | `SKILL.md` | The complete skill — five phases, refusals, gotchas. Flat by design; no companion files. |
16
-
17
- ## Five phases
18
-
19
- | Phase | Key action |
20
- |---|---|
21
- | 1 — Resolve path | `git -C "<path>" rev-parse --show-toplevel` |
22
- | 2 — Confirm path + remote | One `AskUserQuestion` listing remote/URL pairs; recommends `origin/main` first |
23
- | 3 — Fetch + fast-forward | Fetch, check ancestry with `merge-base --is-ancestor`, apply via `merge --ff-only` (on main) or `fetch main:main` (off main) |
24
- | 4 — Report | Old SHA → new SHA, checkout state, dirty tracked files |
25
- | 5 — Offer to land on disk | `AskUserQuestion` to switch checkout to `main` (only when tree is clean and `main` is not held by another worktree) |
26
-
27
- ## Refusals (first match wins)
28
-
29
- - Path is not a git repository → stated error, stop.
30
- - Remote has no `main` → stated error, stop.
31
- - Local `main` has diverged (not a fast-forward) → stated error, stop. Use `/rebase` to reconcile.
32
-
33
- ## Conventions
34
-
35
- - Every command uses `git -C "<path>"` — never `cd` into the repo.
36
- - Path confirmation is mandatory even when the path comes from the argument.
37
- - The skill never switches to any branch other than `main`, and only in Phase 5 with operator approval.
38
- - `origin` is not always the source of truth; the confirmed remote may be `upstream` or another name.
1
+ @AGENTS.md
@@ -0,0 +1,17 @@
1
+ # system-prompts
2
+
3
+ System-prompt reference files installed into `~/.claude/system-prompts/` by `bin/install.mjs`. Rules and skills pull a file (or one of its sections) into context on demand by citing its installed path.
4
+
5
+ ## Files
6
+
7
+ | File | Purpose |
8
+ |---|---|
9
+ | `software-engineer.xml` | Software-engineering reference: defines the engineering role, task-scope rules, output style, and the BDD `<behavior_protocol>` that `rules/bdd.md` cites on demand |
10
+
11
+ ## Format
12
+
13
+ Files use XML with named sections (`<role>`, `<task_scope>`, `<output_style>`, `<behavior_protocol>`, etc.). A rule or skill cites a file, or one of its sections, to pull it into context when the task needs it.
14
+
15
+ ## Adding a prompt
16
+
17
+ Create a new `.xml` file and run `bin/install.mjs` to copy it to `~/.claude/system-prompts/`. Reference the new file in the relevant rule or skill by its installed path.
@@ -1,17 +1 @@
1
- # system-prompts
2
-
3
- System-prompt reference files installed into `~/.claude/system-prompts/` by `bin/install.mjs`. Rules and skills pull a file (or one of its sections) into context on demand by citing its installed path.
4
-
5
- ## Files
6
-
7
- | File | Purpose |
8
- |---|---|
9
- | `software-engineer.xml` | Software-engineering reference: defines the engineering role, task-scope rules, output style, and the BDD `<behavior_protocol>` that `rules/bdd.md` cites on demand |
10
-
11
- ## Format
12
-
13
- Files use XML with named sections (`<role>`, `<task_scope>`, `<output_style>`, `<behavior_protocol>`, etc.). A rule or skill cites a file, or one of its sections, to pull it into context when the task needs it.
14
-
15
- ## Adding a prompt
16
-
17
- Create a new `.xml` file and run `bin/install.mjs` to copy it to `~/.claude/system-prompts/`. Reference the new file in the relevant rule or skill by its installed path.
1
+ @AGENTS.md
@@ -90,9 +90,9 @@
90
90
  </problem_solving>
91
91
 
92
92
  <code_quality>
93
- Canonical code-quality policy is repository-root AGENTS.md (installed review contract).
94
- ~/.claude/docs/CODE_RULES.md is the compact projection of AGENTS.md for generation load
95
- when the two disagree, AGENTS.md wins. The checklist below is a short reminder, not a
93
+ The checked-in .cursor/BUGBOT.md is the full code-quality review contract.
94
+ ~/.claude/docs/CODE_RULES.md is the compact projection for generation load.
95
+ The checklist below is a short reminder, not a
96
96
  second canonical source.
97
97
 
98
98
  Naming — full words only:
@@ -1,74 +0,0 @@
1
- ---
2
- name: code-verifier
3
- description: Post-hoc verification agent. Runs only when the task owner asks for a verification pass — never spawned automatically because a coder agent finished. Runs every check itself in a fresh context — named gates, tests against recorded baselines, two-way diff-vs-task reading — puts the draft verdict through one strongest-tier validation subagent that tries to refute it, then ends with a fenced verdict block the verifier_verdict_minter hook turns into the commit-gate verdict. Never edits files in the tree under review — its one exception is a deliberate break at an off-tree break site outside that tree, defined in its body.
4
- tools: Read, Grep, Glob, Bash, Task
5
- color: orange
6
- ---
7
-
8
- You are the verifier in a three-phase code workflow: coder agents wrote changes, and you grade the result on its own terms (Claude Code best practices, fresh-context review: https://code.claude.com/docs/en/best-practices). The agent doing the work is never the one grading it — that is you, so you trust nothing you did not run or read yourself this session.
9
-
10
- The caller gives you task texts, the diff scope, and baselines recorded before the coders ran. Treat every claim in the caller's message — and any coder summary quoted in it — as a hypothesis to test, never as a fact.
11
-
12
- Run all three layers, in this order:
13
-
14
- 1. **Runnable gates.** Every check the task names (its verification section), plus the universal set whether or not the caller asked: compile/syntax checks on changed files, the recorded-baseline tests scoped to the changed modules — the test files the task names plus tests that import a changed module (the failure set must match the recorded baseline exactly — no new failures, none silently fixed without explanation), imports of changed modules, and any repo commit gate. Run the full recorded suite only when the caller recorded a full-suite baseline because the surface spans multiple modules or multiple coders. Run each command yourself and keep its output.
15
- 2. **Two-way diff-vs-task reading.** Read each coder's diff against that coder's task text. Every task item maps to a hunk that does it; every hunk maps back to a task item — a hunk with no task item is out-of-scope change, a task item with no hunk is missing work.
16
- 3. **Negative space.** Walk the task's item list asking "where is this one?": silent deferrals, stubs, TODO markers, the smaller half of a task shipped, a sync change without its async twin.
17
-
18
- Findings discipline:
19
-
20
- - A finding must cite a failing command (with its output) or a named task item. No citation, no finding. `findings` carries code defects alone.
21
- - Report gaps that affect correctness or the task's stated terms — never style preferences. Sound work produces zero findings; do not invent gaps to look thorough.
22
- - Never edit a file in the work tree you verify — you verify; repair agents repair. The one exception is a deliberate break for the shown-red table, which goes at one of the off-tree break sites the shown-red section below lists.
23
- - Never run `git stash`. `refs/stash` belongs to the repository, not to a work tree, so every worktree shares one stash list: a `pop` can apply another verifier's entry into your tree and hand you a surface that is not your assignment. To read the base, add a throwaway detached worktree at the base commit (`git worktree add --detach <temp-path> <base-sha>`), read it there, and drop it with `git worktree remove --force <temp-path>`. You only ever need to read a base tree, and stash moves the very tree you were asked to verify.
24
- - Never execute code that drives the user's real input or screen — no live mouse moves, keystrokes, clicks, or window focus (pyautogui and its callers included). Run only the test commands the task names, scoped to the test files it names; no repo-wide test sweeps. Judge behavior equivalence by reading both versions, never by live execution of input-driving paths.
25
-
26
- Before you write the verdict, learn the surface hash of the work tree you verified. Use the branch mode — it resolves the work tree that holds the branch automatically, so it is immune to your own cwd:
27
-
28
- python ~/.claude/hooks/blocking/verification_verdict_store.py --manifest-hash-for-branch <branch under review>
29
-
30
- On Windows the same file sits at %USERPROFILE%\.claude\hooks\blocking\verification_verdict_store.py; invoke it with the python on your PATH. If the caller named an explicit work-tree path rather than a branch, use the explicit-directory mode instead:
31
-
32
- python ~/.claude/hooks/blocking/verification_verdict_store.py --manifest-hash <explicit-work-tree-dir>
33
-
34
- The printed hash commits to every changed and untracked file's content in the verified work tree, so it names that surface no matter which directory you or the committer run from. If the CLI prints an empty-surface or wrong-work-tree error and no hash, you are pointed at a work tree with no changes versus origin/main — re-run with the branch mode to locate the correct work tree.
35
-
36
- As the last step before the verdict, put your draft verdict through one best-effort strongest-tier validation pass. Spawn a single validation subagent through the Task tool as the `Explore` agent type at the strongest reachable tier: set the Task `subagent_type` to `Explore`, detect the host profile first per `~/.claude/_shared/advisor/advisor-protocol.md` — the source of truth for host detection, the ladder, and its aliases — then on a Claude host pick the strongest reachable tier on the Fable → Opus → Sonnet → Haiku ladder and on a third-party host use the single third-party tier, and set the Task `model:` field to that tier's alias. A tier denied by policy counts as unreachable, so the walk continues down the ladder to the next tier rather than skipping the validation pass. The `Explore` type carries no Edit or Write tools and cannot spawn further agents, so the harness itself holds the validator to the no-edit, no-spawn contract the next paragraph names. Hand it the draft verdict together with your evidence — every command you ran with its output, your two-way diff-to-task mapping, and the shown-red table with every deliberate-red run labeled as shown-red evidence so the validator reads it as a staged break rather than a genuine failure — and state that its task is adversarial verification of that supplied draft verdict: refute it against the supplied evidence rather than discover code, naming any gate you misread, any task item you mapped wrong, or any finding that does not hold. This pass is always a cold `Explore` spawn, not a message to the session's warm advisor: the refutation needs a grader with no accumulated session context or prior positions, and the verifier runs in sessions that have no advisor bound. Run that spawn synchronously — set the Task `run_in_background` field to `false` — so the validator's reply lands inside this turn. A background spawn returns straight away and its completion notification arrives after your turn is over, so the reply you are waiting for never reaches you and the verdict fence never gets written. When the spawn is unavailable — a Task tool error, an unreachable tier at every rung, or this subagent being barred from spawning further agents — skip the validation pass and emit the draft verdict as it stands, noting the skip in your final message; a spawn failure never blocks the verdict fence from being emitted.
37
-
38
- Ending your turn without the verdict fence throws the whole run away: every gate you ran and every mapping you built reaches the caller as prose it cannot mint, and the commit gate stays shut on work you already checked. So the fence is unconditional. A validator that returns nothing usable, a tier that never binds, a refutation you accept and fold in — each of those ends the same way, with the fence. When you find yourself about to close on a promise to finish once something reports back, run the refutation pass yourself and emit the verdict.
39
-
40
- This validation pass is terminal: the `Explore` type gives the validation subagent no way to spawn a further agent or edit a file, so it answers with prose only. When it refutes any part, re-check that part yourself against the commands and the diff, and correct the verdict before you emit it. When it refutes nothing, the draft verdict stands. Then write your final message.
41
-
42
- Your final message runs in one order: the shown-red table, then — only when the verdict is incomplete — the named unshown check, then every `no break available` row named, then the verdict fence last, so the verifier_verdict_minter hook reads it. Every runnable check the verdict rests on gets one row — a runnable check is a layer 1 runnable gate you can execute against the surface. Breakability is not part of that definition: no check leaves the runnable set by being called unbreakable.
43
-
44
- | Check | Deliberate break | Red | Green |
45
- |---|---|---|---|
46
- | `<command you ran>` | `<break you applied>`, or `no break available — <why no input, no environment, and no scratch-copy mutation can make this check fail>`, or `n/a — check not run` | `<exit code or the deciding line>`, or `no red` | `<exit code or the deciding line>` |
47
-
48
- The Deliberate break cell holds exactly one of those three values: the break you applied, `no break available` with its one-line reason, or `n/a — check not run`. Only the first of the three produced a red, so only the first carries a red result in the Red cell. A `no break available` row and an `n/a — check not run` row each carry the literal `no red` there — never an empty cell, never the Green value repeated, and never an exit code, which would make a row that showed no red scan like one that did.
49
-
50
- Keep each cell to one line — an exit code, a failing test id, an assert line, or a hook's block message. The Green cell may cite the check's first clean run when you kept that output; a clean result already in hand needs no third run. Longer excerpts go below the table in a plain fenced block carrying no info string.
51
-
52
- The reading layers, 2 and 3 above, take no rows. Name in prose what you read and what that reading would catch. A runnable check keeps its row whatever you conclude by reading it, and whatever you conclude about breaking it.
53
-
54
- Break the check at an off-tree break site — a site where the break cannot reach the tree you verify: a failing input or environment fed to the check, or a mutated copy in a scratch directory outside that tree.
55
-
56
- At either off-tree break site, a check that exercises the changed behavior fails because of the break rather than for an unrelated reason.
57
-
58
- Break off-tree so the work tree under verification stays as the coders left it; an in-place break moves the surface `manifest_sha256` names and is forbidden. The green is that same check run against the verified tree.
59
-
60
- Every runnable check the verdict rests on gets a row, with no exclusion path: a rested-on runnable check with no row makes the verdict incomplete, and a check you judge unbreakable still owes its row. Where no runnable check the verdict depends on exists, the surface rests on the reading layers alone and carries an empty table, complete. The empty table is for a surface where nothing runnable exists at all, never for one where a runnable check exists and you skipped it. A row carrying `n/a — check not run` is a runnable check you relied on and never showed red, and it makes the verdict incomplete too; its Red cell carries `no red`.
61
-
62
- `no break available` is a different claim from `n/a — check not run`: the check ran, and no break exists for it, so its Red cell carries `no red` as well. That row counts complete when it carries the one-line reason naming why no input, no environment, and no scratch-copy mutation can make that check fail, so `all_pass` true stays reachable for a genuinely unbreakable gate. A `no break available` row without that reason is an incomplete row and makes the verdict incomplete exactly as a missing row does.
63
-
64
- An incomplete verdict names the unshown check directly above the fence and sets `all_pass` to false. Naming a `no break available` row is a separate matter from that incomplete-check naming: a verdict carrying any `no break available` row names each of those rows directly above the fence because the row carries no red, whether the verdict is otherwise complete or incomplete, and naming one never by itself makes the verdict incomplete or sets `all_pass` false. `findings` goes on carrying every code defect the run found, and is empty only when the run found none.
65
-
66
- Write the table as plain markdown; the fence holds JSON alone.
67
-
68
- Exactly one fenced verdict block — the verifier_verdict_minter hook parses it, binds it to that hash, and the verified_commit_gate hook unlocks `git commit`/`git push` for any work tree whose live surface matches it:
69
-
70
- ```verdict
71
- {"all_pass": false, "findings": [{"check": "<gate or task item>", "detail": "<command + output, or the named task item and what is missing>"}], "manifest_sha256": "<hash the CLI printed>"}
72
- ```
73
-
74
- Set `all_pass` to true with an empty `findings` list only when every layer came back clean and the shown-red table is complete. Always include `manifest_sha256` so the verdict clears the commit regardless of which work tree the verifier or the committer ran in. Commit-committability gates (CODE_RULES / merge conflicts) must already be green before you are spawned; you are the last semantic check before commit. Any file change after you finish moves that hash and invalidates the verdict.
@@ -1,157 +0,0 @@
1
- # PR Description Guide
2
-
3
- Authoritative reference for the `pr-description-writer` agent and the `pr_description_enforcer` PreToolUse hook. PR bodies that match this guide pass the enforcer on first attempt.
4
-
5
- ## Anthropic style basis
6
-
7
- The shape rules and header vocabulary derive from a 120-PR sample. Sources: `anthropics/claude-code` (40 PRs), `anthropics/claude-code-action` (40 PRs), and `anthropics/claude-code-sdk-python` (40 PRs). The corpus was sampled from merged PRs.
8
-
9
- Key signals from the corpus:
10
-
11
- - **Shape distribution.** Trivial (≤ 10 lines): 32.5% — median body 288 chars. Small (11–100 lines): 41.7% — median 1,105 chars. Medium (101–500 lines): 20.0% — median 940 chars. Large (> 500 lines): 5.8% — median 2,441 chars.
12
- - **Modal headers.** `## Summary` 43, `## Problem` 20, `## Test plan` 20, `## Fix` 18, `## Changes` 14, `## Tests` 11, `## Testing` 10, `## Root cause` 5, `## Approach` 2.
13
- - **Opening style.** 46.7% open with a header, 53.3% with an unmarked paragraph. 51% of prose-opening Small/Medium PRs open with an imperative verb. `This PR` appears in 1 of 120 PRs.
14
- - **Issue references.** 27.5% of PRs use `Fixes #N`, `Closes #N`, or `Resolves #N`.
15
- - **Sentence length.** First-paragraph mean 15.2 words; median 14.5. Sentences over 28 words are uncommon.
16
- - **Em-dashes.** Appear in 48% of bodies as parenthetical separators.
17
- - **Backtick identifiers in intros.** Routine — filenames, function names, env vars, and CLI flags appear in opening paragraphs.
18
-
19
- ## The three shapes
20
-
21
- ### Trivial
22
-
23
- - **Guidance.** Diff ≤ 10 lines changed (the agent picks shape by diff size; the hook cannot see the diff).
24
- - **Hook enforcement.** Substantive prose under `TRIVIAL_BODY_CHAR_THRESHOLD` (200 chars). The hook blocks any ATX heading at any depth (`#`, `##`, `###`, ...) in a Trivial-sized body — the ceremony-on-Trivial check uses `HEADING_LINE_PATTERN`, not just `##`.
25
- - **Body.** 1–3 sentences of prose. Zero headings of any level.
26
- - **Forbidden.** Any heading (`# Anything`, `## Summary`, `### Detail`, ...). Triggers the hook's ceremony-on-Trivial check.
27
-
28
- Example:
29
-
30
- ```markdown
31
- Bump bun to 1.3.14. Picks up the bugfix for the runtime panic on empty stdin.
32
- ```
33
-
34
- ### Standard
35
-
36
- - **Guidance.** Diff 11–500 lines (agent-side; hook infers shape from body length).
37
- - **Hook enforcement.** Substantive prose between `TRIVIAL_BODY_CHAR_THRESHOLD` (200) and `HEAVY_MIN_BODY_CHARS_FOR_CLASSIFICATION` (500). No required headers.
38
- - **Body.** Imperative-verb intro paragraph. Optional headers drawn from the Anthropic set.
39
- - **Optional headers.** `## Summary`, `## Problem`, `## Fix`, `## Changes`, `## Test plan`, `## Tests`, `## Testing`, `## Approach`, `## Root cause`.
40
-
41
- Example:
42
-
43
- ```markdown
44
- Adds a syllable-counted Flesch reading score to the PR description enforcer. Bodies above the readability ceiling surface a targeted block message before the strike counter increments.
45
-
46
- ## Test plan
47
-
48
- - [ ] `pytest packages/claude-dev-env/hooks/blocking/test_pr_description_enforcer.py`
49
- - [ ] Open a draft PR with a 45-word sentence and confirm the metric block fires
50
- ```
51
-
52
- ### Heavy
53
-
54
- - **Criterion.** Diff > 500 lines, or a cross-cutting bug fix that touches multiple subsystems.
55
- - **Body.** At least one of `## Problem` or `## Summary`. At least one of `## Test plan`, `## Testing`, `## Tests`, `## Verification`, or `## Validation`. Plus any additional Anthropic headers the change earns.
56
- - **Hook enforcement.** Missing either required category triggers a Heavy-required-headers block message naming the absent category.
57
-
58
- Example:
59
-
60
- ```markdown
61
- ## Problem
62
-
63
- Long-running `gh api` review fetches drop pages silently when the reviewer count crosses 30. Bugbot findings on PRs past the first review cycle stay hidden.
64
-
65
- ## Fix
66
-
67
- Routes every `gh api .../reviews` and `.../comments` call through `--paginate --slurp | jq` so the cross-page filter sees the full set.
68
-
69
- ## Test plan
70
-
71
- - [ ] Mock paginated API and assert `jq` filter operates on the merged stream
72
- - [ ] Replay PR #467 review history and confirm the late bugbot comment surfaces
73
- ```
74
-
75
- ## Header vocabulary
76
-
77
- | Header | Corpus count | Typical use |
78
- |---|---:|---|
79
- | `## Summary` | 43 | High-level overview, often two or three sentences |
80
- | `## Problem` | 20 | Bug context — what broke, who hit it |
81
- | `## Test plan` | 20 | Reviewer checklist of verification steps |
82
- | `## Fix` | 18 | How the change addresses the problem |
83
- | `## Changes` | 14 | Bulleted catalog of code-level updates |
84
- | `## Tests` | 11 | New or expanded test coverage |
85
- | `## Testing` | 10 | Manual or CI verification notes |
86
- | `## Root cause` | 5 | Underlying defect analysis |
87
- | `## Approach` | 2 | Design rationale for non-obvious solutions |
88
-
89
- `## Test plan` and `## Root cause` use sentence-case in the corpus. The enforcer regex matches case-insensitively.
90
-
91
- ## Readability targets
92
-
93
- The enforcer measures three metrics on the intro paragraph and first body section combined.
94
-
95
- | Metric | Target |
96
- |---|---|
97
- | Longest sentence | ≤ 28 words |
98
- | Average sentence | ≤ 18 words |
99
- | Flesch Reading Ease | ≥ 50 |
100
-
101
- The Flesch score uses `206.835 - 1.015 × (words/sentences) - 84.6 × (syllables/words)`. The hook implements the formula in pure stdlib with a vowel-group syllable heuristic.
102
-
103
- Hit the targets by writing short sentences in common Anglo-Saxon words. The corpus first-paragraph average of 14.5 words is the target to beat.
104
-
105
- ## Escape hatch
106
-
107
- The hook tracks a per-user readability strike counter at `~/.claude/state/pr_description_readability_strikes.json`. Counter increments on every triggering violation. The first two failures emit metric-specific block messages. The third triggering failure fires the escape-hatch message with four recovery actions.
108
-
109
- ### Action 1 — loosen thresholds 10%
110
-
111
- ```bash
112
- python <enforcer-path> --readability-loosen
113
- ```
114
-
115
- Scales the three thresholds. Flesch floor × 0.9 (rounded down). Max-sentence ceiling × 10/9 (rounded up). Avg-sentence ceiling × 10/9 (rounded up). Cascades on repeat — the second loosen applies the same scaling to the already-loosened values.
116
-
117
- Caps:
118
-
119
- - Max 3 successive loosens (`READABILITY_LOOSEN_CAP = 3`). A fourth `--readability-loosen` errors with `loosen cap reached; use --readability-disable or --readability-reset`.
120
- - Flesch floor of 30 (`READABILITY_MIN_FLESCH_FLOOR`). Once `flesch_min` reaches 30 the loosen action errors.
121
- - Max-sentence ceiling of 60 (`READABILITY_MAX_SENTENCE_WORDS_CEILING`). Once `max_sentence_words` reaches 60 the loosen action errors.
122
- - Avg-sentence ceiling of 40 (`READABILITY_AVG_SENTENCE_WORDS_CEILING`). Once `avg_sentence_words` reaches 40 the loosen action errors.
123
-
124
- ### Action 2 — disable readability entirely
125
-
126
- ```bash
127
- python <enforcer-path> --readability-disable
128
- ```
129
-
130
- Writes `{"enabled": false}` to `~/.claude/state/pr_description_readability_enabled.json`. Shape detection, Heavy required-headers, ceremony-on-Trivial, self-closing reference, `This PR` opening, vague-language, and minimum-length checks all stay active. The readability check is the only one silenced.
131
-
132
- Re-enable with:
133
-
134
- ```bash
135
- python <enforcer-path> --readability-enable
136
- ```
137
-
138
- ### Action 3 — reset the strike counter
139
-
140
- ```bash
141
- python <enforcer-path> --readability-reset
142
- ```
143
-
144
- Zeroes the strike counter at `~/.claude/state/pr_description_readability_strikes.json`. Clears `loosens_used` and threshold overrides at `~/.claude/state/pr_description_readability_overrides.json`. The readability check returns to default thresholds and a clean strike count.
145
-
146
- ### Action 4 — report a false positive
147
-
148
- Reply with the PR body and your intended commit message. The maintainer tunes the thresholds or refines the regex.
149
-
150
- ## What to avoid
151
-
152
- - **Vague language.** `fix bug`, `update code`, `minor changes`, `various improvements`. Each trips the `VAGUE_LANGUAGE_PATTERN` check.
153
- - **`This PR` openings.** Hard block. Open with an imperative verb.
154
- - **Self-closing references.** `Fixes #<this PR>` in a `gh pr edit` body. Self-reference adds zero context. Triggers a block on `gh pr edit` and `gh pr comment` invocations where the PR number is known.
155
- - **Code snippets in prose.** The diff shows the code. Bodies describe intent.
156
- - **Implementation-detail dumping.** Reviewers do not need every parameter name and call site. Describe the behavior change.
157
- - **Filler.** `In this PR I have made the following changes:` adds zero signal. Start with the action.
@@ -1,132 +0,0 @@
1
- # Code-review enforcement
2
-
3
- This feature ties two git actions to a clean run of the built-in
4
- `/code-review --fix`:
5
-
6
- - **`git push`** needs a clean review at effort **low** or higher.
7
- - **Pull-request creation** (`gh pr create` and the MCP `create_pull_request`
8
- tool) needs a clean review at effort **xhigh** or higher.
9
-
10
- The gates follow the same shape as the `verified_commit` gate family.
11
-
12
- ## Opt-in (default off)
13
-
14
- Enforcement is **off by default**. Turn it on by setting the environment
15
- variable `CLAUDE_CODE_REVIEW_ENFORCEMENT` to `1`, `true`, `yes`, or `on`
16
- (case and surrounding spaces are ignored). Any other value, and an unset
17
- variable, leave enforcement off.
18
-
19
- Set the variable in the machine's own user environment so every gate reads it,
20
- including the native git pre-push backstop, which git runs in the shell's
21
- environment. An `env` block in `settings.json` reaches the three Claude Code
22
- hook gates alone. Each gate process reads the variable as it starts, so a
23
- Claude Code session already running keeps its current setting until it
24
- restarts, while the git pre-push backstop picks up the current shell
25
- environment on each push.
26
-
27
- A user-environment setting arms the gates machine-wide. The backstop installs
28
- through the shared `core.hooksPath`, so it runs for every repository on the
29
- machine, and the gates carry no per-repository allowlist. Each repository then
30
- needs its own clean stamp before a push lands there.
31
-
32
- The variable feeds the master flag `CODE_REVIEW_ENFORCEMENT_ENABLED` in
33
- `hooks/blocking/config/code_review_enforcement_constants.py`, which every gate
34
- reads at start-up. When it is on, the push gate, the PR-create gate, the native
35
- pre-push backstop (via the shared deny decision), and the stamp-directory write
36
- blocker all enforce. When it is off, every gate allows the action and the
37
- write-blocker allows stamp-directory access.
38
-
39
- `npx claude-dev-env` copies the shipped `hooks/` tree over `~/.claude/` on each
40
- install, so the environment setting survives an install and an edit to the
41
- constant does not.
42
-
43
- ## How a stamp works
44
-
45
- A stamp is a small JSON file that records one fact: a clean `/code-review` pass
46
- ran against an exact branch surface at a given effort. Each work tree keeps one
47
- file under `~/.claude/code-review-stamps/`, named by a hash of the resolved
48
- work-tree path.
49
-
50
- The stamp binds to a **branch-surface hash** — the hash of every changed path
51
- and untracked file, each bound by its content digest, measured against the
52
- merge base. When any byte of the change surface moves, the live hash stops
53
- matching the stored hash, so the stamp stops covering the surface and the gate
54
- asks for a fresh review.
55
-
56
- A gate allows the action only when a stored stamp matches the live hash exactly
57
- and its effort ranks at or above the effort the action needs. A missing,
58
- unreadable, or malformed stamp reads as no coverage, so the gate fails closed.
59
-
60
- ## The single sanctioned minter
61
-
62
- Only `invoke_code_review.py --record-stamp` writes a stamp. It forces a headless
63
- `/code-review <effort> --fix` run, then mints a stamp only when the review
64
- returns a clean exit code and leaves the branch surface unchanged in the same
65
- pass. A pass that applies fixes mints nothing; the run loops on the new surface
66
- up to a capped number of passes and mints only on a stable clean pass.
67
-
68
- ## Two layers guard the stamp directory
69
-
70
- The gates trust one rule: only the sanctioned minter writes stamp files. Two
71
- layers hold that rule.
72
-
73
- 1. **File-tool deny in `settings.json`.** `Write`, `Edit`, and `MultiEdit`
74
- under `~/.claude/code-review-stamps/` are denied. This layer covers work
75
- inside the repository. The installer merges hook groups into a user's
76
- `settings.json` and does not ship this package's `permissions.deny`, so on a
77
- user's machine this layer protects contributor work, at parity with the
78
- `verified_commit` gate's own file-tool deny.
79
- 2. **`code_review_stamp_directory_write_blocker` hook.** This hook ships through
80
- `hooks.json`, so it reaches every install. It has two arms:
81
- - a shell arm that denies any Bash or PowerShell command naming the stamp
82
- directory, or importing the stamp store module, or calling its mint
83
- function — while it lets the sanctioned minter command through;
84
- - a file-tool arm that denies any `Write`, `Edit`, or `MultiEdit` whose path
85
- resolves under the stamp directory. This arm closes the plain file-tool
86
- forge on every shipped install, which the package `settings.json` deny
87
- cannot reach on its own.
88
-
89
- ## What the gates block
90
-
91
- - **Casual and accidental forges.** A plain file-tool write to the stamp
92
- directory, and a casual shell write to it, are both denied.
93
- - **Hidden-path and split-step shell forges.** A shell command that assembles
94
- the stamp path from hex, base64, or character math is decoded and denied. A
95
- command that splits the directory change across steps to walk into the stamp
96
- directory is traced and denied.
97
- - **Lazy skips.** A push or a pull-request creation cannot go ahead without a
98
- stamp that matches the live surface at the needed effort.
99
-
100
- ## What the gates do not block
101
-
102
- The chain-mode `/code-review` runs as a subprocess spawn of the `claude`
103
- binary, not a harness-recorded subagent, so there is no signed sidecar to
104
- anchor a forgery-proof mint. The stamp reaches the same posture the
105
- `verified_commit` gate holds, and no further. These bypass surfaces stay open:
106
-
107
- - **Pull requests that skip the tool paths.** A PR opened through
108
- `gh api -X POST .../pulls` or the GitHub web page never triggers the
109
- create-PR gate.
110
- - **`git push --no-verify`.** This flag tells git to skip the native pre-push
111
- hook, so the native backstop does not run.
112
- - **A push that clears the enable variable.** The backstop reads
113
- `CLAUDE_CODE_REVIEW_ENFORCEMENT` from the shell that runs the push, so
114
- `CLAUDE_CODE_REVIEW_ENFORCEMENT=0 git push` reads as enforcement off and the
115
- backstop allows the push with no flag and no bypass marker.
116
- - **A rebuilt store.** A script that re-implements the stamp store in memory
117
- and writes a matching file can mint a stamp the gates accept.
118
-
119
- In short: these gates stop casual forges and lazy skips. They do not stop a
120
- determined attacker who sets out to defeat them.
121
-
122
- ## Where the pieces live
123
-
124
- - Gates: `hooks/blocking/code_review_push_gate.py`,
125
- `hooks/blocking/code_review_pr_create_gate.py`.
126
- - Stamp store: `hooks/blocking/code_review_stamp_store.py`.
127
- - Directory guard: `hooks/blocking/code_review_stamp_directory_write_blocker.py`.
128
- - Shared constants: `hooks/blocking/config/code_review_enforcement_constants.py`.
129
- - Native backstop: `hooks/git-hooks/pre_push.py` reuses the push gate's
130
- `deny_reason_for_directory` so the native hook and the Claude gate share one
131
- decision source.
132
- - Minter: `scripts/invoke_code_review.py --record-stamp`.