claude-dev-env 1.93.1 → 1.95.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 (262) hide show
  1. package/_shared/advisor/CLAUDE.md +2 -2
  2. package/_shared/advisor/advisor-protocol.md +35 -27
  3. package/_shared/advisor/scripts/config/advisor_scripts_constants/model_tier_run_validator_constants.py +3 -2
  4. package/_shared/advisor/scripts/model_tier_run_validator.py +23 -15
  5. package/_shared/advisor/scripts/tests/test_model_tier_run_validator.py +81 -17
  6. package/_shared/pr-loop/CLAUDE.md +1 -0
  7. package/_shared/pr-loop/audit-contract.md +1 -1
  8. package/_shared/pr-loop/gh-payloads.md +3 -3
  9. package/_shared/pr-loop/post-audit-thread-contract.md +51 -0
  10. package/_shared/pr-loop/scripts/README.md +2 -2
  11. package/_shared/pr-loop/scripts/fix_hookspath.py +47 -12
  12. package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +0 -69
  13. package/_shared/pr-loop/scripts/tests/test_fix_hookspath.py +497 -374
  14. package/_shared/pr-loop/state-schema.md +3 -22
  15. package/bin/CLAUDE.md +11 -2
  16. package/bin/ever-shipped-skills.mjs +70 -0
  17. package/bin/install.mjs +138 -13
  18. package/bin/install.prune.test.mjs +457 -0
  19. package/bin/install.test.mjs +10 -4
  20. package/docs/CODE_RULES.md +1 -1
  21. package/hooks/blocking/CLAUDE.md +2 -0
  22. package/hooks/blocking/code_rules_enforcer.py +4 -0
  23. package/hooks/blocking/code_rules_shared.py +82 -0
  24. package/hooks/blocking/code_rules_test_layout.py +9 -3
  25. package/hooks/blocking/pii_commit_command.py +398 -0
  26. package/hooks/blocking/pii_payload_scan.py +133 -0
  27. package/hooks/blocking/pii_prevention_blocker.py +151 -449
  28. package/hooks/blocking/plain_language_blocker.py +138 -4
  29. package/hooks/blocking/sensitive_file_protector.py +114 -48
  30. package/hooks/blocking/tdd_enforcer.py +9 -2
  31. package/hooks/blocking/test_code_rules_enforcer_scratchpad.py +105 -0
  32. package/hooks/blocking/test_code_rules_shared.py +181 -0
  33. package/hooks/blocking/test_pii_prevention_blocker.py +299 -0
  34. package/hooks/blocking/test_plain_language_blocker_allowlist.py +184 -0
  35. package/hooks/blocking/test_sensitive_file_protector.py +185 -0
  36. package/hooks/blocking/test_tdd_enforcer_scratchpad.py +105 -0
  37. package/hooks/blocking/test_verdict_directory_write_blocker.py +42 -7
  38. package/hooks/hooks_constants/CLAUDE.md +4 -2
  39. package/hooks/hooks_constants/code_rules_path_utils_constants.py +0 -2
  40. package/hooks/hooks_constants/harness_scratchpad_constants.py +17 -0
  41. package/hooks/hooks_constants/local_identity.py +65 -15
  42. package/hooks/hooks_constants/pii_prevention_constants.py +16 -0
  43. package/hooks/hooks_constants/plain_language_blocker_constants.py +5 -0
  44. package/hooks/hooks_constants/pr_description_enforcer_constants.py +1 -1
  45. package/hooks/hooks_constants/sensitive_file_protector_constants.py +42 -0
  46. package/hooks/hooks_constants/test_local_identity.py +68 -0
  47. package/hooks/pyproject.toml +75 -4
  48. package/hooks/validators/CLAUDE.md +1 -1
  49. package/hooks/validators/README.md +2 -0
  50. package/hooks/validators/python_style_checks.py +114 -136
  51. package/hooks/validators/python_style_helpers.py +95 -0
  52. package/hooks/validators/test_python_style_checks.py +0 -164
  53. package/hooks/validators/test_python_style_checks_decorator_gap.py +119 -0
  54. package/hooks/validators/test_python_style_fixes.py +251 -0
  55. package/hooks/validators/test_python_style_helpers.py +125 -0
  56. package/package.json +1 -1
  57. package/rules/CLAUDE.md +1 -0
  58. package/rules/anti-corollary-tests.md +69 -0
  59. package/rules/bdd.md +1 -3
  60. package/rules/code-reviews.md +1 -1
  61. package/rules/gh-paginate.md +1 -1
  62. package/rules/plain-language.md +2 -0
  63. package/scripts/CLAUDE.md +10 -1
  64. package/scripts/Get-SessionAccount.ps1 +210 -0
  65. package/scripts/tests/CLAUDE.md +15 -1
  66. package/scripts/tests/Get-SessionAccount.Tests.ps1 +350 -0
  67. package/skills/CLAUDE.md +6 -27
  68. package/skills/anthropic-plan/SKILL.md +1 -13
  69. package/skills/autoconverge/CLAUDE.md +5 -2
  70. package/skills/autoconverge/SKILL.md +112 -387
  71. package/skills/autoconverge/reference/CLAUDE.md +4 -1
  72. package/skills/autoconverge/reference/closing-report.md +9 -2
  73. package/skills/autoconverge/reference/convergence.md +26 -22
  74. package/skills/autoconverge/reference/headless-safety.md +44 -0
  75. package/skills/autoconverge/reference/multi-pr.md +88 -0
  76. package/skills/autoconverge/reference/self-closing-loop.md +84 -0
  77. package/skills/autoconverge/reference/stop-conditions.md +21 -13
  78. package/skills/autoconverge/workflow/converge.clean-audit.test.mjs +87 -27
  79. package/skills/autoconverge/workflow/converge.contract.test.mjs +40 -10
  80. package/skills/autoconverge/workflow/converge.copilot-gate.test.mjs +179 -47
  81. package/skills/autoconverge/workflow/converge.fix-progress.test.mjs +1 -1
  82. package/skills/autoconverge/workflow/converge.mjs +286 -96
  83. package/skills/bugteam/CLAUDE.md +1 -1
  84. package/skills/bugteam/CONSTRAINTS.md +3 -3
  85. package/skills/bugteam/PROMPTS.md +8 -19
  86. package/skills/bugteam/SKILL.md +13 -14
  87. package/skills/bugteam/reference/CLAUDE.md +1 -1
  88. package/skills/bugteam/reference/README.md +2 -3
  89. package/skills/bugteam/reference/audit-and-teammates.md +2 -2
  90. package/skills/bugteam/reference/copilot-gap-analysis.md +2 -0
  91. package/skills/bugteam/reference/github-pr-reviews.md +56 -38
  92. package/skills/bugteam/reference/team-setup.md +11 -11
  93. package/skills/bugteam/scripts/CLAUDE.md +6 -6
  94. package/skills/bugteam/scripts/README.md +20 -8
  95. package/skills/bugteam/scripts/bugteam_code_rules_gate.py +13 -1463
  96. package/skills/bugteam/scripts/bugteam_fix_hookspath.py +23 -358
  97. package/skills/bugteam/scripts/bugteam_preflight.py +13 -315
  98. package/skills/bugteam/scripts/bugteam_scripts_constants/CLAUDE.md +2 -3
  99. package/skills/bugteam/scripts/test_bugteam_code_rules_gate.py +34 -1053
  100. package/skills/bugteam/scripts/test_bugteam_fix_hookspath.py +30 -347
  101. package/skills/bugteam/scripts/test_bugteam_preflight.py +30 -305
  102. package/skills/closeout/SKILL.md +153 -0
  103. package/skills/closeout/reference/handoff-prompt-template.md +72 -0
  104. package/skills/closeout/reference/issue-body-templates.md +108 -0
  105. package/skills/closeout/reference/pii-redaction-checklist.md +36 -0
  106. package/skills/copilot-finding-triage/SKILL.md +80 -28
  107. package/skills/copilot-finding-triage/reference/tier-rubric.md +70 -11
  108. package/skills/copilot-finding-triage/templates/notification.md +8 -3
  109. package/skills/everything-search/SKILL.md +1 -2
  110. package/skills/grokify/SKILL.md +58 -0
  111. package/skills/grokify/templates/handoff-template.md +92 -0
  112. package/skills/orchestrator/SKILL.md +35 -25
  113. package/skills/orchestrator-refresh/SKILL.md +15 -11
  114. package/skills/pr-converge/CLAUDE.md +1 -1
  115. package/skills/pr-converge/SKILL.md +132 -233
  116. package/skills/pr-converge/reference/convergence-gates.md +102 -66
  117. package/skills/pr-converge/reference/examples.md +37 -25
  118. package/skills/pr-converge/reference/fix-protocol.md +7 -7
  119. package/skills/pr-converge/reference/multi-pr-orchestration.md +10 -4
  120. package/skills/pr-converge/reference/per-tick.md +64 -41
  121. package/skills/pr-converge/reference/state-schema.md +27 -2
  122. package/skills/pr-converge/scripts/CLAUDE.md +8 -0
  123. package/skills/pr-converge/scripts/README.md +4 -3
  124. package/skills/pr-converge/scripts/_pr_converge_path_setup.py +23 -0
  125. package/skills/pr-converge/scripts/check_convergence.py +189 -645
  126. package/skills/pr-converge/scripts/check_convergence_gates.py +235 -0
  127. package/skills/pr-converge/scripts/check_convergence_thread_gates.py +219 -0
  128. package/skills/pr-converge/scripts/conftest.py +8 -0
  129. package/skills/pr-converge/scripts/pr_converge_scripts_constants/CLAUDE.md +1 -0
  130. package/skills/pr-converge/scripts/pr_converge_scripts_constants/convergence_gate_constants.py +36 -0
  131. package/skills/pr-converge/scripts/test__pr_converge_path_setup.py +26 -0
  132. package/skills/pr-converge/scripts/test_check_convergence.py +73 -228
  133. package/skills/pr-converge/scripts/test_check_convergence_contract.py +321 -0
  134. package/skills/pr-converge/scripts/test_check_convergence_gates.py +68 -0
  135. package/skills/pr-converge/scripts/test_check_convergence_thread_gates.py +75 -0
  136. package/skills/pr-fix-protocol/SKILL.md +20 -20
  137. package/skills/privacy-hygiene/SKILL.md +4 -3
  138. package/skills/reviewer-gates/SKILL.md +26 -8
  139. package/skills/session-log/SKILL.md +11 -12
  140. package/skills/session-tidy/SKILL.md +40 -30
  141. package/skills/skill-builder/CLAUDE.md +13 -10
  142. package/skills/skill-builder/SKILL.md +31 -31
  143. package/skills/skill-builder/references/CLAUDE.md +10 -6
  144. package/skills/skill-builder/references/delegation-map.md +13 -4
  145. package/skills/skill-builder/references/description-field.md +113 -0
  146. package/skills/skill-builder/references/self-audit-checklist.md +21 -4
  147. package/skills/skill-builder/references/skill-modularity.md +113 -0
  148. package/skills/skill-builder/references/skill-types.md +4 -0
  149. package/skills/skill-builder/templates/CLAUDE.md +4 -4
  150. package/skills/skill-builder/templates/gap-analysis.md +25 -1
  151. package/skills/skill-builder/workflows/CLAUDE.md +6 -4
  152. package/skills/skill-builder/workflows/improve-skill.md +17 -16
  153. package/skills/skill-builder/workflows/new-skill.md +34 -10
  154. package/skills/skill-builder/workflows/polish-skill.md +59 -43
  155. package/skills/team-advisor/SKILL.md +15 -11
  156. package/skills/usage-pause/SKILL.md +10 -14
  157. package/system-prompts/software-engineer.xml +7 -6
  158. package/hooks/validators/test_verify_paths.py +0 -32
  159. package/hooks/validators/verify_paths.py +0 -57
  160. package/skills/bdd-protocol/CLAUDE.md +0 -26
  161. package/skills/bdd-protocol/SKILL.md +0 -30
  162. package/skills/bdd-protocol/references/CLAUDE.md +0 -10
  163. package/skills/bdd-protocol/references/anti-patterns.md +0 -26
  164. package/skills/bdd-protocol/references/example-mapping.md +0 -23
  165. package/skills/bg-agent/CLAUDE.md +0 -17
  166. package/skills/bg-agent/SKILL.md +0 -69
  167. package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_code_rules_gate_constants.py +0 -55
  168. package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_fix_hookspath_constants.py +0 -26
  169. package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_preflight_constants.py +0 -35
  170. package/skills/caveman/CLAUDE.md +0 -15
  171. package/skills/caveman/SKILL.md +0 -38
  172. package/skills/code/CLAUDE.md +0 -17
  173. package/skills/code/SKILL.md +0 -178
  174. package/skills/deep-research/CLAUDE.md +0 -17
  175. package/skills/deep-research/SKILL.md +0 -80
  176. package/skills/findbugs/CLAUDE.md +0 -20
  177. package/skills/findbugs/SKILL.md +0 -241
  178. package/skills/fixbugs/CLAUDE.md +0 -19
  179. package/skills/fixbugs/SKILL.md +0 -142
  180. package/skills/gh-paginate/CLAUDE.md +0 -18
  181. package/skills/gh-paginate/SKILL.md +0 -84
  182. package/skills/gotcha/CLAUDE.md +0 -33
  183. package/skills/gotcha/SKILL.md +0 -73
  184. package/skills/implement/CLAUDE.md +0 -27
  185. package/skills/implement/SKILL.md +0 -66
  186. package/skills/implement/scripts/CLAUDE.md +0 -22
  187. package/skills/implement/scripts/append_note.py +0 -133
  188. package/skills/implement/scripts/implement_scripts_constants/CLAUDE.md +0 -22
  189. package/skills/implement/scripts/implement_scripts_constants/__init__.py +0 -0
  190. package/skills/implement/scripts/implement_scripts_constants/notes_constants.py +0 -12
  191. package/skills/implement/scripts/test_append_note.py +0 -191
  192. package/skills/log-audit/CLAUDE.md +0 -20
  193. package/skills/log-audit/SKILL.md +0 -66
  194. package/skills/log-audit/reference/CLAUDE.md +0 -9
  195. package/skills/log-audit/reference/charter.md +0 -52
  196. package/skills/log-audit/scripts/CLAUDE.md +0 -27
  197. package/skills/log-audit/scripts/cluster_recurrences.py +0 -261
  198. package/skills/log-audit/scripts/collect_log_window.py +0 -199
  199. package/skills/log-audit/scripts/log_audit_constants/CLAUDE.md +0 -12
  200. package/skills/log-audit/scripts/log_audit_constants/__init__.py +0 -0
  201. package/skills/log-audit/scripts/log_audit_constants/cluster_recurrences_constants.py +0 -23
  202. package/skills/log-audit/scripts/log_audit_constants/collect_log_window_constants.py +0 -24
  203. package/skills/log-audit/scripts/log_audit_constants/mine_copilot_findings_constants.py +0 -49
  204. package/skills/log-audit/scripts/mine_copilot_findings.py +0 -302
  205. package/skills/log-audit/scripts/test_cluster_recurrences.py +0 -160
  206. package/skills/log-audit/scripts/test_collect_log_window.py +0 -111
  207. package/skills/log-audit/scripts/test_mine_copilot_findings.py +0 -126
  208. package/skills/logifix/CLAUDE.md +0 -36
  209. package/skills/logifix/SKILL.md +0 -69
  210. package/skills/logifix/scripts/CLAUDE.md +0 -16
  211. package/skills/logifix/scripts/logifix.ps1 +0 -205
  212. package/skills/monitor-open-prs/CLAUDE.md +0 -34
  213. package/skills/monitor-open-prs/SKILL.md +0 -88
  214. package/skills/monitor-open-prs/scripts/CLAUDE.md +0 -17
  215. package/skills/monitor-open-prs/scripts/discover_open_prs.py +0 -69
  216. package/skills/monitor-open-prs/scripts/test_discover_open_prs.py +0 -149
  217. package/skills/monitor-open-prs/test_skill_contract.py +0 -27
  218. package/skills/post-audit-findings/SKILL.md +0 -80
  219. package/skills/pr-consistency-audit/CLAUDE.md +0 -34
  220. package/skills/pr-consistency-audit/SKILL.md +0 -116
  221. package/skills/pr-consistency-audit/reference/CLAUDE.md +0 -16
  222. package/skills/pr-consistency-audit/reference/detection-rules.md +0 -96
  223. package/skills/pr-consistency-audit/reference/illustrations.md +0 -78
  224. package/skills/pr-review-responder/CLAUDE.md +0 -35
  225. package/skills/pr-review-responder/EXAMPLES.md +0 -590
  226. package/skills/pr-review-responder/PRINCIPLES.md +0 -533
  227. package/skills/pr-review-responder/README.md +0 -168
  228. package/skills/pr-review-responder/SKILL.md +0 -203
  229. package/skills/pr-review-responder/TESTING.md +0 -350
  230. package/skills/pr-scope-resolve/SKILL.md +0 -45
  231. package/skills/pre-compact/CLAUDE.md +0 -24
  232. package/skills/pre-compact/SKILL.md +0 -134
  233. package/skills/qbug/CLAUDE.md +0 -40
  234. package/skills/qbug/SKILL.md +0 -387
  235. package/skills/qbug/test_qbug_skill_audit_schema.py +0 -152
  236. package/skills/qbug/test_qbug_skill_post_fix_audit.py +0 -103
  237. package/skills/refine/CLAUDE.md +0 -44
  238. package/skills/refine/SKILL.md +0 -262
  239. package/skills/refine/templates/CLAUDE.md +0 -17
  240. package/skills/refine/templates/implementation-notes-template.html +0 -56
  241. package/skills/refine/templates/plan-template.md +0 -60
  242. package/skills/research-mode/CLAUDE.md +0 -35
  243. package/skills/research-mode/SKILL.md +0 -53
  244. package/skills/structure-prompt/CLAUDE.md +0 -42
  245. package/skills/structure-prompt/SKILL.md +0 -44
  246. package/skills/structure-prompt/reference/CLAUDE.md +0 -28
  247. package/skills/structure-prompt/reference/adversarial-tuning.md +0 -62
  248. package/skills/structure-prompt/reference/block-classification.md +0 -27
  249. package/skills/structure-prompt/reference/canonical-case.md +0 -48
  250. package/skills/structure-prompt/reference/citation-depth.md +0 -70
  251. package/skills/structure-prompt/reference/cleanup.md +0 -33
  252. package/skills/structure-prompt/reference/constraints.md +0 -33
  253. package/skills/structure-prompt/reference/directives.md +0 -37
  254. package/skills/structure-prompt/reference/examples.md +0 -72
  255. package/skills/structure-prompt/reference/instantiation.md +0 -51
  256. package/skills/structure-prompt/reference/output-contract.md +0 -72
  257. package/skills/structure-prompt/reference/per-category.md +0 -23
  258. package/skills/structure-prompt/reference/persona.md +0 -38
  259. package/skills/structure-prompt/reference/research.md +0 -33
  260. package/skills/structure-prompt/reference/structure.md +0 -28
  261. package/skills/verified-build/CLAUDE.md +0 -33
  262. package/skills/verified-build/SKILL.md +0 -33
@@ -158,25 +158,14 @@ cd into `<worktree_path>` before any git or file operation.
158
158
  --findings-json <path>
159
159
  ```
160
160
 
161
- The script POSTs a single review with `event=APPROVE` on CLEAN
162
- (the request event; GitHub stores it as `state=APPROVED`; empty
163
- `comments[]`, body documents "no findings") or
164
- `event=REQUEST_CHANGES` on DIRTY (one inline anchored comment per
165
- finding; each becomes its own resolvable thread on the PR). It
166
- handles retries internally (1s / 4s / 16s backoff across four
167
- attempts). Exit codes:
168
-
169
- - `0` — review posted; the new review's `html_url` is on stdout.
170
- Capture this URL as the parent review URL.
171
- - `1` — user input error (bad arguments, malformed findings JSON,
172
- missing template).
173
- - `2` — retry exhaustion. Hard blocker; halt and exit
174
- `error: post_audit_thread retry exhausted` without retrying and
175
- without falling back to a flat issue comment. There is no
176
- fallback path — a hard blocker on the audit-posting path is a
177
- halt condition.
178
-
179
- Exit 0 emits the new review's `html_url` on stdout. Extract the
161
+ The event handling, retry backoff, and exit-code table are the
162
+ shared contract in
163
+ [`../../_shared/pr-loop/post-audit-thread-contract.md`](../../_shared/pr-loop/post-audit-thread-contract.md).
164
+ For bugteam, an exit `2` (retry exhaustion) is a hard blocker: halt
165
+ and exit `error: post_audit_thread retry exhausted` without retrying
166
+ and without falling back to a flat issue comment.
167
+
168
+ Harvest the parent review URL from stdout, then extract the
180
169
  numeric review id from that URL's `#pullrequestreview-<id>` suffix
181
170
  (the trailing URL fragment, the part after `#`). Then harvest child-comment URLs
182
171
  **and PR review thread node ids** via
@@ -57,12 +57,12 @@ First match wins; respond with the quoted line exactly and stop:
57
57
 
58
58
  Every internal audit pass (CLEAN or DIRTY) ends with one posted GitHub PR
59
59
  review; the mandate applies whether bugteam runs inside `/pr-converge` or
60
- standalone. Apply the `post-audit-findings` skill
61
- ([../post-audit-findings/SKILL.md](../post-audit-findings/SKILL.md)) with
62
- `--skill bugteam`: it covers the findings-JSON mapping (the `failure_mode`
63
- split at the literal `Fix:` heading), the anchored-vs-unanchored partition,
64
- the `post_audit_thread.py` invocation, the self-PR reviewer toggle
65
- (`BUGTEAM_REVIEWER_ACCOUNT`), the exit codes, and the id harvest.
60
+ standalone. Run the shared posting helper
61
+ [`_shared/pr-loop/scripts/post_audit_thread.py`](../../_shared/pr-loop/scripts/post_audit_thread.py)
62
+ with `--skill bugteam`: map findings to the review-comment JSON (the
63
+ `failure_mode` split at the literal `Fix:` heading), partition anchored from
64
+ unanchored comments, honor the self-PR reviewer toggle
65
+ (`BUGTEAM_REVIEWER_ACCOUNT`) and the exit codes, and harvest the ids.
66
66
 
67
67
  Bugteam-only obligations:
68
68
 
@@ -72,9 +72,9 @@ Bugteam-only obligations:
72
72
  thread_node_id}` triple into `loop_comment_index` (per-loop scope; see
73
73
  [reference/team-setup.md](reference/team-setup.md) § Loop state block) so
74
74
  the matching FIX action owns the reply-and-resolve unit.
75
- - Exit 2 from `post_audit_thread.py` is a hard blocker: the lead halts the
76
- loop and exits `error: post_audit_thread retry exhausted` without
77
- retrying.
75
+ - Exit-code policy: the bugteam row in
76
+ [`../../_shared/pr-loop/post-audit-thread-contract.md`](../../_shared/pr-loop/post-audit-thread-contract.md)
77
+ § Per-caller policy.
78
78
 
79
79
  ## Progress checklist
80
80
 
@@ -83,10 +83,9 @@ Bugteam-only obligations:
83
83
  [ ] Step 1: PR scope resolved
84
84
  [ ] Step 2: loop state set
85
85
  [ ] Step 3: cycle complete (converged | cap reached | stuck | error)
86
- [ ] Step 4: working tree clean
87
- [ ] Step 4.5: PR description rewritten (or skip warning logged)
88
- [ ] Step 5: project permissions revoked
89
- [ ] Step 6: final report printed
86
+ [ ] Step 4: apply pr-loop-lifecycle Close
87
+ Skill({skill: "pr-loop-lifecycle", args: "--skill bugteam close"})
88
+ (see pr-loop-lifecycle/SKILL.md "How callers invoke this")
90
89
  ```
91
90
 
92
91
  ## First invocation of a session
@@ -104,7 +103,7 @@ end-to-end mental model before starting Step 0.
104
103
  | `--bugbot-retrigger` flag behavior | [reference/team-setup.md](reference/team-setup.md) |
105
104
  | AUDIT action and code-rules pre-audit gate, pre-cycle walk, cycle decision tree | [reference/audit-and-teammates.md](reference/audit-and-teammates.md) |
106
105
  | FIX action and verify-push semantics | [reference/audit-and-teammates.md](reference/audit-and-teammates.md) |
107
- | Posting the end-of-pass audit review (APPROVE on CLEAN, REQUEST_CHANGES with inline anchored comments on DIRTY) | [§ Audit posting](#audit-posting), which applies [../post-audit-findings/SKILL.md](../post-audit-findings/SKILL.md) |
106
+ | Posting the end-of-pass audit review (APPROVE on CLEAN, REQUEST_CHANGES with inline anchored comments on DIRTY) | [§ Audit posting](#audit-posting), which runs [`_shared/pr-loop/scripts/post_audit_thread.py`](../../_shared/pr-loop/scripts/post_audit_thread.py) |
108
107
  | Posting per-finding fix replies via GitHub MCP `add_reply_to_pull_request_comment` (rendered with the unified template at [`_shared/pr-loop/audit-reply-template.md`](../../_shared/pr-loop/audit-reply-template.md)) | [reference/github-pr-reviews.md](reference/github-pr-reviews.md) |
109
108
  | Teardown, PR description rewrite composed by the lead, permission revoke, final report | [../pr-loop-lifecycle/reference/teardown-publish-permissions.md](../pr-loop-lifecycle/reference/teardown-publish-permissions.md) |
110
109
  | Spawn-prompt XML, A–P category bindings, outcome XML schemas | [PROMPTS.md](PROMPTS.md) |
@@ -7,7 +7,7 @@ Expanded workflow detail for the `bugteam` skill. Load a file from this director
7
7
  | File | Purpose |
8
8
  |---|---|
9
9
  | `README.md` | Index of all files in this directory with one-line domain summaries. |
10
- | `team-setup.md` | Permissions grant, PR scope resolution (applies the `pr-scope-resolve` skill), run name, temp dir, and loop state. |
10
+ | `team-setup.md` | Permissions grant, PR scope resolution, run name, temp dir, and loop state. |
11
11
  | `audit-and-teammates.md` | Pre-audit CODE_RULES gate, full cycle numbering, AUDIT and FIX action detail. |
12
12
  | `github-pr-reviews.md` | Per-loop review posting, `jq`+`gh api` payloads, inline anchors, fallbacks, REST endpoints. |
13
13
  | `design-rationale.md` | Why clean-room subagents, when `/bugteam` applies, refusal reasons. |
@@ -22,8 +22,7 @@ The `pre-push-review` skill was retired. Its mechanical checks are now covered a
22
22
 
23
23
  - **`/qbug`** — a full PR audit-fix cycle that spawns subagents, runs multiple audit loops, and produces a structured report. It is NOT a lightweight pre-push gate. Do not use `/qbug` as a substitute for `git push` (the hook fires automatically). Use `/qbug` when you want a thorough multi-loop review of a PR before requesting human review.
24
24
 
25
- References updated:
26
- - `skills/pr-review-responder/SKILL.md` — Rule 6 and checklist item updated to reference the git pre-push hook
27
- - `commands/plan.md` — Phase 5 step 10 updated to reference the git pre-push hook
25
+ References:
26
+ - `hooks/git-hooks/pre_push.py` — the git pre-push hook that runs the CODE_RULES gate over the commits about to be pushed
28
27
  - `hooks/github-action/pre-push-review.yml` — deleted (workflow no longer needed)
29
28
  - `hooks/github-action/test_workflow.py` — deleted alongside the workflow
@@ -153,7 +153,7 @@ Agent(
153
153
 
154
154
  The teammate sees only the latest audit’s findings — each `Agent` call starts with a fresh context window; prior-loop findings, fix history, and chat stay in the lead.
155
155
 
156
- Pass finding comment URL, comment id, and thread node id for each finding (from `loop_comment_index`) in the XML prompt so the teammate owns both the reply and the thread resolution. After commit, the teammate posts one reply per finding using the unified template at [`../../../_shared/pr-loop/audit-reply-template.md`](../../../_shared/pr-loop/audit-reply-template.md) — the full header / horizontal rule / `<action_heading> ✅` / explanation / anchored-bullet / closing-paragraph skeleton, with `<status_line>` set per the path (`Fixed in <short_sha>` for `status=fixed`, `Could not address this loop` for `status=could_not_address`, `Hook blocked the fix commit` for `status=hook_blocked`). Per-thread reply and `resolve_thread` are atomic; the mechanics follow the `pr-fix-protocol` skill ([`../../pr-fix-protocol/SKILL.md`](../../pr-fix-protocol/SKILL.md)), which frames the shared 13-step sequence in [`../../../_shared/pr-loop/fix-protocol.md`](../../../_shared/pr-loop/fix-protocol.md) (step 12 carries the exact reply-and-resolve sequence). Same identity model as bugfind: teammate posts; lead waits.
156
+ Pass finding comment URL, comment id, and thread node id for each finding (from `loop_comment_index`) in the XML prompt so the teammate owns both the reply and the thread resolution. After commit, the teammate posts one reply per finding using the unified template at [`../../../_shared/pr-loop/audit-reply-template.md`](../../../_shared/pr-loop/audit-reply-template.md) — the full header / horizontal rule / `<action_heading> ✅` / explanation / anchored-bullet / closing-paragraph skeleton, with `<status_line>` set per the path (`Fixed in <short_sha>` for `status=fixed`, `Could not address this loop` for `status=could_not_address`, `Hook blocked the fix commit` for `status=hook_blocked`). Per-thread reply and `resolve_thread` are atomic; the mechanics follow the shared 13-step sequence in [`../../../_shared/pr-loop/fix-protocol.md`](../../../_shared/pr-loop/fix-protocol.md) (step 12 carries the exact reply-and-resolve sequence). Same identity model as bugfind: teammate posts; lead waits.
157
157
 
158
158
  After replies, the teammate writes outcome XML (schema in [`../PROMPTS.md`](../PROMPTS.md)).
159
159
 
@@ -161,7 +161,7 @@ After replies, the teammate writes outcome XML (schema in [`../PROMPTS.md`](../P
161
161
 
162
162
  Same self-termination model as bugfind. Missing notification → hard blocker.
163
163
 
164
- `approve: false` → `error: bugfix teammate refused shutdown` → Step 4 then 5.
164
+ `approve: false` → `error: bugfix teammate refused shutdown` → Step 4 (`pr-loop-lifecycle` Close).
165
165
 
166
166
  Substitute placeholders from `last_findings` into the fix prompt per [`../PROMPTS.md`](../PROMPTS.md). The spawn XML includes TaskCreate/self_audit_checklist for task tracking — the FIX subagent MUST create tasks before starting.
167
167
 
@@ -1,5 +1,7 @@
1
1
  # Copilot gap analysis
2
2
 
3
+ > **Of-record gate location:** skill-local `bugteam_code_rules_gate.py` is a thin re-export. The of-record implementation is `_shared/pr-loop/scripts/code_rules_gate.py`.
4
+
3
5
  > **Status: HISTORICAL — patch plan partially superseded.**
4
6
  >
5
7
  > This file documents the read-only investigation that motivated the K–N rubric addendum and the Step 2.6 / Step 3.5 standards-review phases. **The audit-rubric portion of the patch plan was reverted in [PR #292](https://github.com/jl-cmd/claude-dev-env/pull/292):** PROMPTS.md no longer carries the K–N addendum or the `<copilot_derived_addendum_source>` block, and SKILL.md no longer runs the Step 2.6 / Step 3.5 standards-review phases.
@@ -1,13 +1,15 @@
1
- # GitHub PR comments
1
+ # GitHub PR comments (bugteam-only)
2
2
 
3
- Per-loop pull-request reviews and post-fix replies use two distinct transports:
3
+ Transport, exit codes, retry/backoff, and payload shapes live in
4
+ [`../../../_shared/pr-loop/gh-payloads.md`](../../../_shared/pr-loop/gh-payloads.md)
5
+ and
6
+ [`post_audit_thread.py`](../../../_shared/pr-loop/scripts/post_audit_thread.py).
7
+ Read those for how the review POST runs; this file covers only bugteam lead and
8
+ FIX behavior around that transport.
4
9
 
5
- - **Per-loop audit review** posted via [`post_audit_thread.py`](../../../_shared/pr-loop/scripts/post_audit_thread.py). One review per audit pass. `APPROVE` on CLEAN (the request event; GitHub stores it as `state=APPROVED`; body documents "no findings", zero inline comments). `REQUEST_CHANGES` on DIRTY (one inline anchored comment per finding; each becomes its own resolvable thread).
6
- - **Fix replies** — posted via the GitHub MCP `add_reply_to_pull_request_comment` after the fix commit lands. The reply body uses the unified template at [`../../../_shared/pr-loop/audit-reply-template.md`](../../../_shared/pr-loop/audit-reply-template.md); reply and `resolve_thread` are atomic per thread.
10
+ ## Lead posts the audit review
7
11
 
8
- ## Per-loop audit review (post_audit_thread.py)
9
-
10
- Run the script at the end of every audit pass:
12
+ The lead runs `post_audit_thread.py` at the end of every audit pass:
11
13
 
12
14
  ```
13
15
  python "${CLAUDE_SKILL_DIR}/../../_shared/pr-loop/scripts/post_audit_thread.py" \
@@ -20,23 +22,55 @@ python "${CLAUDE_SKILL_DIR}/../../_shared/pr-loop/scripts/post_audit_thread.py"
20
22
  --findings-json <path>
21
23
  ```
22
24
 
23
- Capture `<head_sha>` via `git rev-parse HEAD` in the subagent cwd immediately before this call so the review attaches to the commit the audit actually scoped.
25
+ Capture `<head_sha>` via `git rev-parse HEAD` in the subagent cwd immediately
26
+ before this call so the review attaches to the commit the audit actually scoped.
27
+
28
+ - **CLEAN** — `APPROVE` event (GitHub stores `state=APPROVED`); body documents
29
+ "no findings"; empty findings list (`[]`); zero inline comments.
30
+ - **DIRTY** — `REQUEST_CHANGES`; one inline anchored comment per finding (each
31
+ becomes its own resolvable thread).
32
+
33
+ ## Findings JSON (Shape A `Fix:` split)
34
+
35
+ `--findings-json` is a JSON list of
36
+ `{path, line, side, severity, description, fix_summary}`. Build it from the
37
+ merged Shape A findings: finding `file` → `path`. Each finding's `failure_mode`
38
+ carries the full audit-to-fix handoff text per
39
+ [`agents/code-quality-agent.md`](../../../agents/code-quality-agent.md); split
40
+ `failure_mode` at the literal `Fix:` heading so the failure narrative becomes
41
+ `description` and the suffix beginning at `Fix:` (including the trailing
42
+ `Validation:` clause) becomes `fix_summary`. When a finding's `failure_mode`
43
+ omits the `Fix:` heading, write the full text to BOTH `description` and
44
+ `fix_summary`. Set `side="RIGHT"` for every entry.
24
45
 
25
- `--findings-json` points to a JSON file whose root is a list of objects shaped `{path, line, side, severity, description, fix_summary}`. Build it from the merged Shape A findings: finding `file` → `path`. Each finding's `failure_mode` carries the full audit-to-fix handoff text per [`agents/code-quality-agent.md`](../../../agents/code-quality-agent.md); split `failure_mode` at the literal `Fix:` heading so the failure narrative becomes `description` and the suffix beginning at `Fix:` (including the trailing `Validation:` clause) becomes `fix_summary`. When a finding's `failure_mode` omits the `Fix:` heading, write the full text to BOTH `description` and `fix_summary` so the script's body template (`INLINE_COMMENT_BODY_TEMPLATE` in [`packages/claude-dev-env/_shared/pr-loop/scripts/pr_loop_shared_constants/post_audit_thread_constants.py`](../../../_shared/pr-loop/scripts/pr_loop_shared_constants/post_audit_thread_constants.py)) renders coherently. Set `side="RIGHT"` for every entry. On CLEAN the list is empty (`[]`); on DIRTY the list carries one entry per finding.
46
+ ## Anchor validation before JSON
26
47
 
27
- The script handles retries internally 1s / 4s / 16s backoff across four attempts (one initial plus three retries). Exit codes:
48
+ Validate `(path, line)` against the captured diff before adding a finding to the
49
+ findings JSON. GitHub rejects the entire review POST when any inline comment
50
+ targets a line missing from the diff at `--commit`. Findings without a diff
51
+ anchor stay out of the JSON; surface them in the calling skill's user-facing
52
+ output so the audit pass still completes.
28
53
 
29
- - `0` review posted; the new review's `html_url` is on stdout.
30
- - `1` — user input error (bad arguments, malformed findings JSON, missing template).
31
- - `2` — retry exhaustion. Hard blocker; the lead exits `error: post_audit_thread retry exhausted` without retrying and without falling back to a flat issue comment.
54
+ ## FIX waits for harvest (`loop_comment_index`)
32
55
 
33
- Harvest the parent review URL from stdout, then extract the numeric review id from the URL's `#pullrequestreview-<id>` suffix (the trailing URL fragment of `html_url`, the part after `#`). Fetch child-comment URLs via `pull_request_read(method="get_review_comments", owner=<owner>, repo=<repo>, pullNumber=<N>)` filtered to that review id. That same response carries each comment's PR review thread node id (e.g. `PRRT_kwDOxxx`) — capture it alongside the numeric comment id. Match children to findings in the order they appear in the findings JSON, and store the mapping as `loop_comment_index[finding_id]` carrying both `finding_comment_id` (numeric) and `thread_node_id` (`PRRT_kwDOxxx`) for the FIX step to reply against and resolve.
56
+ FIX does not reply until harvest completes. After a successful post:
34
57
 
35
- The script reads its body skeleton from [`../../../_shared/pr-loop/audit-reply-template.md`](../../../_shared/pr-loop/audit-reply-template.md) at runtime, so the template doc remains the single source of truth for the body shape edits there propagate without restarting the caller.
58
+ 1. Read the parent review URL from stdout; extract the numeric review id from
59
+ the `#pullrequestreview-<id>` suffix.
60
+ 2. Fetch child comments via
61
+ `pull_request_read(method="get_review_comments", ...)` filtered to that
62
+ review id.
63
+ 3. Capture each comment's PR review thread node id (`PRRT_kwDOxxx`) alongside
64
+ the numeric comment id.
65
+ 4. Match children to findings in findings-JSON order; store
66
+ `loop_comment_index[finding_id]` with `finding_comment_id` (numeric) and
67
+ `thread_node_id` (`PRRT_kwDOxxx`).
36
68
 
37
- ## Fix reply (MCP)
69
+ ## Atomic reply + resolve
38
70
 
39
- After the fix commit lands, post one reply per finding thread and resolve the thread atomically.
71
+ After the fix commit lands, post one reply per finding thread and resolve that
72
+ thread as one atomic action. Do not yield to the lead between the two calls. Do
73
+ not batch all replies before any resolves.
40
74
 
41
75
  ```
42
76
  mcp__plugin_github_github__add_reply_to_pull_request_comment(
@@ -46,13 +80,7 @@ mcp__plugin_github_github__add_reply_to_pull_request_comment(
46
80
  commentId=<finding_comment_id>,
47
81
  body="<reply body using unified template>"
48
82
  )
49
- ```
50
-
51
- The reply body uses the unified template from [`../../../_shared/pr-loop/audit-reply-template.md`](../../../_shared/pr-loop/audit-reply-template.md). Per-status `<status_line>` / `<action_heading>` values live in [`../PROMPTS.md`](../PROMPTS.md) § FIX execution step 8.
52
-
53
- Immediately after the reply call returns, resolve the same thread:
54
83
 
55
- ```
56
84
  mcp__plugin_github_github__pull_request_review_write(
57
85
  method="resolve_thread",
58
86
  owner="<owner>",
@@ -62,18 +90,8 @@ mcp__plugin_github_github__pull_request_review_write(
62
90
  )
63
91
  ```
64
92
 
65
- `<thread_node_id>` is the PR review thread node ID (`PRRT_kwDOxxx`) harvested above when calling `get_review_comments`, distinct from the numeric comment ID used in the reply call. See [obstacles/fix-resolve-thread.md](obstacles/fix-resolve-thread.md) for the full identifier-shape rationale.
66
-
67
- The two calls form one atomic per-thread action. Do not yield to the lead between them. Do not batch all replies before any resolves.
68
-
69
- ## Anchor validation
70
-
71
- GitHub's reviews endpoint rejects the entire POST if any inline comment in `comments[]` targets a line not present in the diff at `--commit`. Validate `(path, line)` against the captured diff before adding a finding to the findings JSON. Findings without a diff anchor stay out of the JSON; surface them in the calling skill's user-facing output instead so the audit pass still completes.
72
-
73
- ## GitHub MCP tools used
74
-
75
- - `add_reply_to_pull_request_comment` — fix replies on existing review comments.
76
- - `pull_request_review_write` (`method="resolve_thread"`) — thread resolution after the reply lands; called atomically with the reply.
77
- - `pull_request_read` (`method="get_review_comments"`) — harvest child-comment ids/urls after the script's parent review posts.
78
-
79
- Reference: https://github.com/github/github-mcp-server.
93
+ Reply body template:
94
+ [`../../../_shared/pr-loop/audit-reply-template.md`](../../../_shared/pr-loop/audit-reply-template.md).
95
+ Per-status `<status_line>` / `<action_heading>` values live in
96
+ [`../PROMPTS.md`](../PROMPTS.md) § FIX execution step 8. Identifier-shape
97
+ rationale: [obstacles/fix-resolve-thread.md](obstacles/fix-resolve-thread.md).
@@ -4,10 +4,12 @@
4
4
 
5
5
  ### Utility scripts
6
6
 
7
- Bugteam-specific utilities (preflight, fix_hookspath, grant, revoke) live in
8
- the skill-local [`scripts/`](../scripts/) directory. Shared utilities remain in
9
- [`_shared/pr-loop/scripts/`](../../_shared/pr-loop/scripts/) (run, do not paste
10
- into context). Utility scripts are **executed**, not loaded as primary context
7
+ Skill-path thin entries for preflight and fix_hookspath live in the skill-local
8
+ [`scripts/`](../scripts/) directory and delegate to package shared
9
+ [`_shared/pr-loop/scripts/`](../../_shared/pr-loop/scripts/). Shared homes for
10
+ grant, revoke, and code_rules_gate also live under `_shared/pr-loop/scripts/`
11
+ (run, do not paste into context). Utility scripts are **executed**, not loaded
12
+ as primary context
11
13
  ([`sources.md`](../sources.md) § Progressive disclosure and utility scripts).
12
14
 
13
15
  ```bash
@@ -60,16 +62,14 @@ python "${CLAUDE_SKILL_DIR}/../../_shared/pr-loop/scripts/grant_project_claude_p
60
62
 
61
63
  The script reads `Path.cwd()` and writes idempotent allow rules into `~/.claude/settings.json`. Run from the project root. If it fails (non-zero exit), surface the error and stop — do not proceed without the grant.
62
64
 
63
- This is the **first** action of every `/bugteam` invocation, before any subagent spawn. The corresponding revoke runs at Step 5 regardless of how the cycle exits.
65
+ This is the **first** action of every `/bugteam` invocation, before any subagent spawn. The matching revoke runs inside Step 4 (`pr-loop-lifecycle` Close) regardless of how the cycle exits.
64
66
 
65
67
  ## Step 1 — Resolve PR scope (detail)
66
68
 
67
- Apply the `pr-scope-resolve` skill
68
- ([../../pr-scope-resolve/SKILL.md](../../pr-scope-resolve/SKILL.md)) with
69
- caller `bugteam`. Its resolution ladder hands back `owner`, `repo`, `number`,
70
- `head_ref`, `base_ref`, `url`, and `head_sha`; when no PR and no upstream
71
- diff exist, respond exactly `No PR or upstream diff. /bugteam needs a
72
- target.` and stop.
69
+ Resolve the PR scope for caller `bugteam`: from the current branch's open PR
70
+ (or an explicit PR argument), capture `owner`, `repo`, `number`, `head_ref`,
71
+ `base_ref`, `url`, and `head_sha`; when no PR and no upstream diff exist,
72
+ respond exactly `No PR or upstream diff. /bugteam needs a target.` and stop.
73
73
 
74
74
  Capture `<owner>/<repo>`, head branch, base branch, PR number, PR URL. This scope persists across every loop — `/bugteam` runs to completion from the single up-front confirmation.
75
75
 
@@ -6,9 +6,9 @@ Python scripts executed by the bugteam lead or teammates at runtime. These are n
6
6
 
7
7
  | File | Purpose |
8
8
  |---|---|
9
- | `bugteam_preflight.py` | Run pytest and optional `pre-commit` before the first loop. Skips pytest when `BUGTEAM_PREFLIGHT_SKIP=1` or no test files exist. |
10
- | `bugteam_fix_hookspath.py` | Auto-remediate a stale `core.hooksPath` override, set the canonical global value, re-run preflight. |
11
- | `bugteam_code_rules_gate.py` | Run `validate_content` from `code_rules_enforcer.py` on PR-scoped files. Exit 1 on mandatory rule failures. |
9
+ | `bugteam_preflight.py` | Skill-path thin entry for shared `_shared/pr-loop/scripts/preflight.py`. Skips pytest when `BUGTEAM_PREFLIGHT_SKIP=1` or no test files exist. |
10
+ | `bugteam_fix_hookspath.py` | Skill-path thin entry for shared `_shared/pr-loop/scripts/fix_hookspath.py`. Auto-remediates a stale `core.hooksPath` override. |
11
+ | `bugteam_code_rules_gate.py` | Thin skill-path entry; re-exports shared `_shared/pr-loop/scripts/code_rules_gate.py` (of record). |
12
12
  | `windows_safe_rmtree.py` | Remove a directory tree on Windows by stripping ReadOnly attributes and retrying on failure. |
13
13
  | `probe_code_rules_enforcer_check.py` | Load `code_rules_enforcer.py` and invoke a named check function against a fixture file. |
14
14
  | `reflow_skill_md.py` | Reflow the bugteam SKILL.md body to fit line-length limits. |
@@ -17,9 +17,9 @@ Python scripts executed by the bugteam lead or teammates at runtime. These are n
17
17
 
18
18
  | File | Tests |
19
19
  |---|---|
20
- | `test_bugteam_preflight.py` | `bugteam_preflight.py` |
21
- | `test_bugteam_code_rules_gate.py` | `bugteam_code_rules_gate.py` |
22
- | `test_bugteam_fix_hookspath.py` | `bugteam_fix_hookspath.py` |
20
+ | `test_bugteam_preflight.py` | Smoke for thin wrap; behavioral suite is `_shared/pr-loop/scripts/tests/test_preflight.py` |
21
+ | `test_bugteam_code_rules_gate.py` | Smoke for thin wrap; behavioral suite is `_shared/pr-loop/scripts/tests/test_code_rules_gate.py` |
22
+ | `test_bugteam_fix_hookspath.py` | Smoke for thin wrap; behavioral suite is `_shared/pr-loop/scripts/tests/test_fix_hookspath.py` |
23
23
  | `test_probe_code_rules_enforcer_check.py` | `probe_code_rules_enforcer_check.py` |
24
24
  | `test_windows_safe_rmtree.py` | `windows_safe_rmtree.py` |
25
25
 
@@ -4,14 +4,16 @@ Scripts in this directory are **executed** by the lead or teammates. They are no
4
4
 
5
5
  | Script | Purpose |
6
6
  |--------|---------|
7
- | `bugteam_preflight.py` | Run pytest (when configured) and optional `pre-commit` before `/bugteam`. |
8
- | `bugteam_fix_hookspath.py` | Auto-remediate a stale local `core.hooksPath` override, set canonical global value, re-run `bugteam_preflight.py`. Invoked by Claude when preflight reports a `core.hooksPath` failure. |
9
- | `bugteam_code_rules_gate.py` | Run `validate_content` from `code-rules-enforcer.py` on PR-scoped files (`git diff` vs merge-base). Exit `1` if any mandatory rule fails. Invoked **before each audit**; the fixer clears it before the auditor runs. |
10
- | `windows_safe_rmtree.py` | Recursively remove a directory tree on Windows by stripping ReadOnly attributes and retrying the failing syscall. Invoked from SKILL.md Step 4 to delete `<run_temp_dir>` after teardown. |
7
+ | `bugteam_preflight.py` | Run pytest (when configured) and optional `pre-commit` before `/bugteam`. Skill-path thin entry; implementation lives at package shared `_shared/pr-loop/scripts/preflight.py`. |
8
+ | `bugteam_fix_hookspath.py` | Auto-remediate a stale local `core.hooksPath` override, set canonical global value, re-run preflight. Skill-path thin entry; implementation lives at package shared `_shared/pr-loop/scripts/fix_hookspath.py`. Invoked by Claude when preflight reports a `core.hooksPath` failure. |
9
+ | `bugteam_code_rules_gate.py` | Thin skill-path entry that re-exports shared `_shared/pr-loop/scripts/code_rules_gate.py`. **Not the pre-audit gate of record** invoke the shared script for live pre-audit (see `reference/audit-and-teammates.md`). |
10
+ | `windows_safe_rmtree.py` | Windows-safe recursive directory removal (strips ReadOnly, retries). Standalone helper with unit tests; run-temp teardown is `skills/_shared/pr-loop/scripts/teardown_worktrees.py` under `pr-loop-lifecycle` Close. |
11
11
  | `probe_code_rules_enforcer_check.py` | Dynamically load `~/.claude/hooks/blocking/code_rules_enforcer.py` and invoke a named check function against a fixture file. Used by the historical Copilot gap-analysis investigation as a verification shape (see `reference/copilot-gap-analysis.md`). |
12
12
 
13
13
  ## `bugteam_preflight.py`
14
14
 
15
+ Skill-path thin entry; implementation lives at `_shared/pr-loop/scripts/preflight.py`.
16
+
15
17
  From the repository root:
16
18
 
17
19
  ```bash
@@ -25,6 +27,8 @@ python "${CLAUDE_SKILL_DIR}/scripts/bugteam_preflight.py"
25
27
 
26
28
  ## `bugteam_fix_hookspath.py`
27
29
 
30
+ Skill-path thin entry; implementation lives at `_shared/pr-loop/scripts/fix_hookspath.py`.
31
+
28
32
  From the repository root:
29
33
 
30
34
  ```bash
@@ -35,13 +39,21 @@ python "${CLAUDE_SKILL_DIR}/scripts/bugteam_fix_hookspath.py"
35
39
  - Sets `git config --global core.hooksPath ~/.claude/hooks/git-hooks` when the global value is unset or non-canonical.
36
40
  - Refuses to run (exit non-zero) when `~/.claude/hooks/git-hooks` does not exist on disk — install via `npx claude-dev-env .` first.
37
41
  - Idempotent: a second invocation is a clean no-op.
38
- - Re-runs `bugteam_preflight.py --no-pytest` and propagates its exit code.
42
+ - Re-runs package-shared `preflight.py --no-pytest` and propagates its exit code.
39
43
 
40
44
  The bugteam SKILL invokes this automatically when preflight stderr indicates a `core.hooksPath` failure, so Claude does not surface the error to the user.
41
45
 
42
- ## `bugteam_code_rules_gate.py`
46
+ ## `bugteam_code_rules_gate.py` (thin skill-path entry)
47
+
48
+ Skill-path thin entry; re-exports `main` from package-shared `_shared/pr-loop/scripts/code_rules_gate.py`.
49
+
50
+ **Not the pre-audit gate of record.** The live pre-audit gate is the package-shared script:
51
+
52
+ ```bash
53
+ python "${CLAUDE_SKILL_DIR}/../../_shared/pr-loop/scripts/code_rules_gate.py" --base origin/<baseRefName>
54
+ ```
43
55
 
44
- From the repository root (same merge-base rules as the PR head vs base default `--base origin/main`):
56
+ See `reference/audit-and-teammates.md`. Keep this wrap for callers that still invoke the skill-local path.
45
57
 
46
58
  ```bash
47
59
  python "${CLAUDE_SKILL_DIR}/scripts/bugteam_code_rules_gate.py"
@@ -53,4 +65,4 @@ Optional explicit files instead of `git diff`:
53
65
  python "${CLAUDE_SKILL_DIR}/scripts/bugteam_code_rules_gate.py" path/to/a.py path/to/b.ts
54
66
  ```
55
67
 
56
- This loads `validate_content` from `hooks/blocking/code-rules-enforcer.py` inside `claude-dev-env` (same logic as the PreToolUse hook). Exit `0` = mandatory checks pass on scanned files; exit `1` = violations printed to stderr.
68
+ Both the wrap and the shared script load `validate_content` from `hooks/blocking/code_rules_enforcer.py` inside `claude-dev-env` (same logic as the PreToolUse hook). Exit `0` = mandatory checks pass on scanned files; exit `1` = violations printed to stderr.