claude-dev-env 1.93.0 → 1.94.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.
- package/_shared/pr-loop/CLAUDE.md +1 -0
- package/_shared/pr-loop/audit-contract.md +1 -1
- package/_shared/pr-loop/gh-payloads.md +3 -3
- package/_shared/pr-loop/post-audit-thread-contract.md +51 -0
- package/_shared/pr-loop/scripts/README.md +2 -2
- package/_shared/pr-loop/scripts/code_rules_gate.py +127 -13
- package/_shared/pr-loop/scripts/fix_hookspath.py +47 -12
- package/_shared/pr-loop/scripts/pr_loop_shared_constants/code_rules_gate_constants.py +4 -0
- package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +146 -69
- package/_shared/pr-loop/scripts/tests/test_fix_hookspath.py +497 -374
- package/_shared/pr-loop/state-schema.md +3 -22
- package/bin/CLAUDE.md +1 -1
- package/bin/install.mjs +2 -7
- package/bin/install.test.mjs +10 -4
- package/hooks/blocking/CLAUDE.md +2 -0
- package/hooks/blocking/pii_commit_command.py +398 -0
- package/hooks/blocking/pii_payload_scan.py +133 -0
- package/hooks/blocking/pii_prevention_blocker.py +151 -449
- package/hooks/blocking/pii_scanner.py +26 -1
- package/hooks/blocking/test_code_rules_enforcer_dead_config_field.py +2 -2
- package/hooks/blocking/test_pii_prevention_blocker.py +299 -0
- package/hooks/blocking/test_pii_scanner.py +27 -2
- package/hooks/blocking/test_verdict_directory_write_blocker.py +42 -7
- package/hooks/hooks_constants/CLAUDE.md +2 -2
- package/hooks/hooks_constants/code_rules_path_utils_constants.py +0 -2
- package/hooks/hooks_constants/local_identity.py +65 -15
- package/hooks/hooks_constants/pii_prevention_constants.py +20 -8
- package/hooks/hooks_constants/pr_description_enforcer_constants.py +1 -1
- package/hooks/hooks_constants/test_local_identity.py +68 -0
- package/package.json +1 -1
- package/scripts/CLAUDE.md +10 -1
- package/scripts/Get-SessionAccount.ps1 +210 -0
- package/scripts/tests/CLAUDE.md +15 -1
- package/scripts/tests/Get-SessionAccount.Tests.ps1 +350 -0
- package/skills/CLAUDE.md +3 -25
- package/skills/anthropic-plan/SKILL.md +1 -13
- package/skills/autoconverge/CLAUDE.md +5 -2
- package/skills/autoconverge/SKILL.md +112 -387
- package/skills/autoconverge/reference/CLAUDE.md +4 -1
- package/skills/autoconverge/reference/closing-report.md +9 -2
- package/skills/autoconverge/reference/convergence.md +26 -22
- package/skills/autoconverge/reference/headless-safety.md +44 -0
- package/skills/autoconverge/reference/multi-pr.md +88 -0
- package/skills/autoconverge/reference/self-closing-loop.md +84 -0
- package/skills/autoconverge/reference/stop-conditions.md +21 -13
- package/skills/autoconverge/workflow/converge.clean-audit.test.mjs +87 -27
- package/skills/autoconverge/workflow/converge.contract.test.mjs +40 -10
- package/skills/autoconverge/workflow/converge.copilot-gate.test.mjs +179 -47
- package/skills/autoconverge/workflow/converge.fix-progress.test.mjs +1 -1
- package/skills/autoconverge/workflow/converge.mjs +284 -94
- package/skills/bugteam/CLAUDE.md +1 -1
- package/skills/bugteam/CONSTRAINTS.md +3 -3
- package/skills/bugteam/PROMPTS.md +8 -19
- package/skills/bugteam/SKILL.md +13 -14
- package/skills/bugteam/reference/CLAUDE.md +1 -1
- package/skills/bugteam/reference/audit-and-teammates.md +2 -2
- package/skills/bugteam/reference/copilot-gap-analysis.md +2 -0
- package/skills/bugteam/reference/github-pr-reviews.md +56 -38
- package/skills/bugteam/reference/team-setup.md +11 -11
- package/skills/bugteam/scripts/CLAUDE.md +6 -6
- package/skills/bugteam/scripts/README.md +20 -8
- package/skills/bugteam/scripts/bugteam_code_rules_gate.py +13 -1463
- package/skills/bugteam/scripts/bugteam_fix_hookspath.py +23 -358
- package/skills/bugteam/scripts/bugteam_preflight.py +13 -315
- package/skills/bugteam/scripts/bugteam_scripts_constants/CLAUDE.md +2 -3
- package/skills/bugteam/scripts/test_bugteam_code_rules_gate.py +34 -1053
- package/skills/bugteam/scripts/test_bugteam_fix_hookspath.py +30 -347
- package/skills/bugteam/scripts/test_bugteam_preflight.py +30 -305
- package/skills/copilot-finding-triage/SKILL.md +80 -28
- package/skills/copilot-finding-triage/reference/tier-rubric.md +70 -11
- package/skills/copilot-finding-triage/templates/notification.md +8 -3
- package/skills/everything-search/SKILL.md +1 -2
- package/skills/grokify/SKILL.md +58 -0
- package/skills/grokify/templates/handoff-template.md +92 -0
- package/skills/orchestrator/SKILL.md +12 -8
- package/skills/orchestrator-refresh/SKILL.md +3 -3
- package/skills/pr-converge/SKILL.md +132 -233
- package/skills/pr-converge/reference/convergence-gates.md +102 -66
- package/skills/pr-converge/reference/examples.md +37 -25
- package/skills/pr-converge/reference/fix-protocol.md +7 -7
- package/skills/pr-converge/reference/multi-pr-orchestration.md +10 -4
- package/skills/pr-converge/reference/per-tick.md +64 -41
- package/skills/pr-converge/reference/state-schema.md +27 -2
- package/skills/pr-converge/scripts/CLAUDE.md +8 -0
- package/skills/pr-converge/scripts/README.md +4 -3
- package/skills/pr-converge/scripts/_pr_converge_path_setup.py +23 -0
- package/skills/pr-converge/scripts/check_convergence.py +189 -645
- package/skills/pr-converge/scripts/check_convergence_gates.py +235 -0
- package/skills/pr-converge/scripts/check_convergence_thread_gates.py +219 -0
- package/skills/pr-converge/scripts/conftest.py +8 -0
- package/skills/pr-converge/scripts/pr_converge_scripts_constants/CLAUDE.md +1 -0
- package/skills/pr-converge/scripts/pr_converge_scripts_constants/convergence_gate_constants.py +36 -0
- package/skills/pr-converge/scripts/test__pr_converge_path_setup.py +26 -0
- package/skills/pr-converge/scripts/test_check_convergence.py +73 -228
- package/skills/pr-converge/scripts/test_check_convergence_contract.py +321 -0
- package/skills/pr-converge/scripts/test_check_convergence_gates.py +68 -0
- package/skills/pr-converge/scripts/test_check_convergence_thread_gates.py +75 -0
- package/skills/privacy-hygiene/SKILL.md +8 -7
- package/skills/reviewer-gates/SKILL.md +26 -8
- package/skills/session-log/SKILL.md +11 -12
- package/skills/session-tidy/SKILL.md +40 -30
- package/skills/skill-builder/CLAUDE.md +13 -10
- package/skills/skill-builder/SKILL.md +31 -31
- package/skills/skill-builder/references/CLAUDE.md +10 -6
- package/skills/skill-builder/references/delegation-map.md +13 -4
- package/skills/skill-builder/references/description-field.md +113 -0
- package/skills/skill-builder/references/self-audit-checklist.md +21 -4
- package/skills/skill-builder/references/skill-modularity.md +113 -0
- package/skills/skill-builder/references/skill-types.md +4 -0
- package/skills/skill-builder/templates/CLAUDE.md +4 -4
- package/skills/skill-builder/templates/gap-analysis.md +25 -1
- package/skills/skill-builder/workflows/CLAUDE.md +6 -4
- package/skills/skill-builder/workflows/improve-skill.md +17 -16
- package/skills/skill-builder/workflows/new-skill.md +34 -10
- package/skills/skill-builder/workflows/polish-skill.md +59 -43
- package/skills/usage-pause/SKILL.md +10 -14
- package/skills/bdd-protocol/CLAUDE.md +0 -26
- package/skills/bdd-protocol/SKILL.md +0 -30
- package/skills/bdd-protocol/references/CLAUDE.md +0 -10
- package/skills/bdd-protocol/references/anti-patterns.md +0 -26
- package/skills/bdd-protocol/references/example-mapping.md +0 -23
- package/skills/bg-agent/CLAUDE.md +0 -17
- package/skills/bg-agent/SKILL.md +0 -69
- package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_code_rules_gate_constants.py +0 -55
- package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_fix_hookspath_constants.py +0 -26
- package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_preflight_constants.py +0 -35
- package/skills/caveman/CLAUDE.md +0 -15
- package/skills/caveman/SKILL.md +0 -38
- package/skills/code/CLAUDE.md +0 -17
- package/skills/code/SKILL.md +0 -178
- package/skills/deep-research/CLAUDE.md +0 -17
- package/skills/deep-research/SKILL.md +0 -80
- package/skills/findbugs/CLAUDE.md +0 -20
- package/skills/findbugs/SKILL.md +0 -241
- package/skills/fixbugs/CLAUDE.md +0 -19
- package/skills/fixbugs/SKILL.md +0 -142
- package/skills/gh-paginate/CLAUDE.md +0 -18
- package/skills/gh-paginate/SKILL.md +0 -84
- package/skills/gotcha/CLAUDE.md +0 -33
- package/skills/gotcha/SKILL.md +0 -73
- package/skills/implement/CLAUDE.md +0 -27
- package/skills/implement/SKILL.md +0 -66
- package/skills/implement/scripts/CLAUDE.md +0 -22
- package/skills/implement/scripts/append_note.py +0 -133
- package/skills/implement/scripts/implement_scripts_constants/CLAUDE.md +0 -22
- package/skills/implement/scripts/implement_scripts_constants/__init__.py +0 -0
- package/skills/implement/scripts/implement_scripts_constants/notes_constants.py +0 -12
- package/skills/implement/scripts/test_append_note.py +0 -191
- package/skills/log-audit/CLAUDE.md +0 -20
- package/skills/log-audit/SKILL.md +0 -66
- package/skills/log-audit/reference/CLAUDE.md +0 -9
- package/skills/log-audit/reference/charter.md +0 -52
- package/skills/log-audit/scripts/CLAUDE.md +0 -27
- package/skills/log-audit/scripts/cluster_recurrences.py +0 -261
- package/skills/log-audit/scripts/collect_log_window.py +0 -199
- package/skills/log-audit/scripts/log_audit_constants/CLAUDE.md +0 -12
- package/skills/log-audit/scripts/log_audit_constants/__init__.py +0 -0
- package/skills/log-audit/scripts/log_audit_constants/cluster_recurrences_constants.py +0 -23
- package/skills/log-audit/scripts/log_audit_constants/collect_log_window_constants.py +0 -24
- package/skills/log-audit/scripts/log_audit_constants/mine_copilot_findings_constants.py +0 -49
- package/skills/log-audit/scripts/mine_copilot_findings.py +0 -302
- package/skills/log-audit/scripts/test_cluster_recurrences.py +0 -160
- package/skills/log-audit/scripts/test_collect_log_window.py +0 -111
- package/skills/log-audit/scripts/test_mine_copilot_findings.py +0 -126
- package/skills/logifix/CLAUDE.md +0 -36
- package/skills/logifix/SKILL.md +0 -69
- package/skills/logifix/scripts/CLAUDE.md +0 -16
- package/skills/logifix/scripts/logifix.ps1 +0 -205
- package/skills/monitor-open-prs/CLAUDE.md +0 -34
- package/skills/monitor-open-prs/SKILL.md +0 -88
- package/skills/monitor-open-prs/scripts/CLAUDE.md +0 -17
- package/skills/monitor-open-prs/scripts/discover_open_prs.py +0 -69
- package/skills/monitor-open-prs/scripts/test_discover_open_prs.py +0 -149
- package/skills/monitor-open-prs/test_skill_contract.py +0 -27
- package/skills/post-audit-findings/SKILL.md +0 -80
- package/skills/pr-consistency-audit/CLAUDE.md +0 -34
- package/skills/pr-consistency-audit/SKILL.md +0 -116
- package/skills/pr-consistency-audit/reference/CLAUDE.md +0 -16
- package/skills/pr-consistency-audit/reference/detection-rules.md +0 -96
- package/skills/pr-consistency-audit/reference/illustrations.md +0 -78
- package/skills/pr-fix-protocol/SKILL.md +0 -65
- package/skills/pr-review-responder/CLAUDE.md +0 -35
- package/skills/pr-review-responder/EXAMPLES.md +0 -590
- package/skills/pr-review-responder/PRINCIPLES.md +0 -533
- package/skills/pr-review-responder/README.md +0 -168
- package/skills/pr-review-responder/SKILL.md +0 -203
- package/skills/pr-review-responder/TESTING.md +0 -350
- package/skills/pr-scope-resolve/SKILL.md +0 -45
- package/skills/pre-compact/CLAUDE.md +0 -24
- package/skills/pre-compact/SKILL.md +0 -134
- package/skills/qbug/CLAUDE.md +0 -40
- package/skills/qbug/SKILL.md +0 -387
- package/skills/qbug/test_qbug_skill_audit_schema.py +0 -152
- package/skills/qbug/test_qbug_skill_post_fix_audit.py +0 -103
- package/skills/refine/CLAUDE.md +0 -44
- package/skills/refine/SKILL.md +0 -262
- package/skills/refine/templates/CLAUDE.md +0 -17
- package/skills/refine/templates/implementation-notes-template.html +0 -56
- package/skills/refine/templates/plan-template.md +0 -60
- package/skills/research-mode/CLAUDE.md +0 -35
- package/skills/research-mode/SKILL.md +0 -53
- package/skills/structure-prompt/CLAUDE.md +0 -42
- package/skills/structure-prompt/SKILL.md +0 -44
- package/skills/structure-prompt/reference/CLAUDE.md +0 -28
- package/skills/structure-prompt/reference/adversarial-tuning.md +0 -62
- package/skills/structure-prompt/reference/block-classification.md +0 -27
- package/skills/structure-prompt/reference/canonical-case.md +0 -48
- package/skills/structure-prompt/reference/citation-depth.md +0 -70
- package/skills/structure-prompt/reference/cleanup.md +0 -33
- package/skills/structure-prompt/reference/constraints.md +0 -33
- package/skills/structure-prompt/reference/directives.md +0 -37
- package/skills/structure-prompt/reference/examples.md +0 -72
- package/skills/structure-prompt/reference/instantiation.md +0 -51
- package/skills/structure-prompt/reference/output-contract.md +0 -72
- package/skills/structure-prompt/reference/per-category.md +0 -23
- package/skills/structure-prompt/reference/persona.md +0 -38
- package/skills/structure-prompt/reference/research.md +0 -33
- package/skills/structure-prompt/reference/structure.md +0 -28
- package/skills/verified-build/CLAUDE.md +0 -33
- package/skills/verified-build/SKILL.md +0 -33
package/skills/bugteam/SKILL.md
CHANGED
|
@@ -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.
|
|
61
|
-
|
|
62
|
-
`--skill bugteam`:
|
|
63
|
-
split at the literal `Fix:` heading),
|
|
64
|
-
|
|
65
|
-
(`BUGTEAM_REVIEWER_ACCOUNT`)
|
|
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
|
|
76
|
-
loop
|
|
77
|
-
|
|
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:
|
|
87
|
-
|
|
88
|
-
|
|
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
|
|
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
|
|
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. |
|
|
@@ -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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
46
|
+
## Anchor validation before JSON
|
|
26
47
|
|
|
27
|
-
|
|
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
|
-
|
|
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
|
-
|
|
56
|
+
FIX does not reply until harvest completes. After a successful post:
|
|
34
57
|
|
|
35
|
-
|
|
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
|
-
##
|
|
69
|
+
## Atomic reply + resolve
|
|
38
70
|
|
|
39
|
-
After the fix commit lands, post one reply per finding thread and resolve
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
[`_shared/pr-loop/scripts/`](../../_shared/pr-loop/scripts/)
|
|
10
|
-
|
|
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
|
|
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
|
-
|
|
68
|
-
(
|
|
69
|
-
|
|
70
|
-
|
|
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` |
|
|
10
|
-
| `bugteam_fix_hookspath.py` | Auto-
|
|
11
|
-
| `bugteam_code_rules_gate.py` |
|
|
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` | `
|
|
21
|
-
| `test_bugteam_code_rules_gate.py` | `
|
|
22
|
-
| `test_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 `
|
|
9
|
-
| `bugteam_code_rules_gate.py` |
|
|
10
|
-
| `windows_safe_rmtree.py` |
|
|
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 `
|
|
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
|
-
|
|
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
|
-
|
|
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.
|