bugteam
Open pull request audit–fix until convergence: CODE_RULES gate, clean-room audit (`code-quality-agent`, opus) and fix (`clean-coder`, opus), per-loop GitHub reviews, 20-audit cap; grant then revoke `.claude/**`. AUDIT, FIX, and standards-fix route through `resolve_worker_spawn.py` (headless tiers or Agent-tool fallback). Triggers: '/bugteam', 'run the bug team', 'auto-fix the PR until clean', 'loop audit and fix'.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 7
- Forks
- 1
01 前言 Front Matter
- name
- bugteam
- description
- Open pull request audit–fix until convergence: CODE_RULES gate, clean-room audit (`code-quality-agent`, opus) and fix (`clean-coder`, opus), per-loop GitHub reviews, 20-audit cap; grant then revoke `.claude/**`. AUDIT, FIX, and standards-fix route through `resolve_worker_spawn.py` (headless tiers or Agent-tool fallback). Triggers: '/bugteam', 'run the bug team', 'auto-fix the PR until clean', 'loop audit and fix'.
02 资源文件 43
- 参考文档CONSTRAINTS.md3.3 KB
- 参考文档EXAMPLES.md2.0 KB
- 参考文档PROMPTS.md18.3 KB
- 参考文档reference/audit-and-teammates.md17.7 KB
- 参考文档reference/copilot-gap-analysis.md37.8 KB
- 参考文档reference/design-rationale.md1.5 KB
- 参考文档reference/github-pr-reviews.md3.8 KB
- 参考文档reference/obstacles/audit-assign-ids.md416 B
- 参考文档reference/obstacles/audit-capture-excerpts.md448 B
- 参考文档reference/obstacles/audit-walk-categories.md513 B
- 参考文档reference/obstacles/audit-write-xml.md433 B
- 参考文档reference/obstacles/fix-append-summary.md427 B
- 参考文档reference/obstacles/fix-apply-fixes.md401 B
- 参考文档reference/obstacles/fix-git-add-commit.md416 B
- 参考文档reference/obstacles/fix-git-push.md376 B
- 参考文档reference/obstacles/fix-post-reply.md431 B
- 参考文档reference/obstacles/fix-publish-summary.md442 B
- 参考文档reference/obstacles/fix-py-compile.md402 B
- 参考文档reference/obstacles/fix-read-files.md382 B
- 参考文档reference/obstacles/fix-resolve-thread.md432 B
- 参考文档reference/obstacles/fix-test-suite.md404 B
- 参考文档reference/obstacles/fix-violation-count.md407 B
- 参考文档reference/obstacles/fix-write-xml.md423 B
- 参考文档reference/README.md2.3 KB
- 参考文档reference/team-setup.md9.2 KB
- 脚本scripts/bugteam_code_rules_gate.py944 B
- 脚本scripts/bugteam_fix_hookspath.py1.3 KB
- 脚本scripts/bugteam_preflight.py1.0 KB
- 脚本scripts/bugteam_scripts_constants/__init__.py—
- 脚本scripts/bugteam_scripts_constants/probe_code_rules_enforcer_check_constants.py397 B
- 脚本scripts/bugteam_scripts_constants/reflow_skill_md_constants.py503 B
- 脚本scripts/bugteam_scripts_constants/windows_safe_rmtree_constants.py251 B
- 脚本scripts/probe_code_rules_enforcer_check.py3.6 KB
- 脚本scripts/README.md4.0 KB
- 脚本scripts/reflow_skill_md.py9.7 KB
- 脚本scripts/test_bugteam_code_rules_gate.py1.4 KB
- 脚本scripts/test_bugteam_fix_hookspath.py1.3 KB
- 脚本scripts/test_bugteam_preflight.py1.2 KB
- 脚本scripts/test_probe_code_rules_enforcer_check.py2.3 KB
- 脚本scripts/test_windows_safe_rmtree.py3.3 KB
- 脚本scripts/windows_safe_rmtree.py3.1 KB
- 参考文档sources.md3.3 KB
- 脚本test_skill_additions.py1002 B
03 SKILL.md 正文
Bugteam
Audit–fix until convergence. Bugfind: code-quality-agent, fresh process or
fresh agent context each loop, auditing all A–Q categories via the
worker-spawn dispatcher. Bugfix and standards-fix: clean-coder via the same
dispatcher (role clean-coder; tier 2 pins model opus). Hard cap: 20 audit
loops. Grant .claude/** at start, revoke always at end.
The audit agent loads the A–Q category rubrics from
$HOME/.claude/audit-rubrics/{category_rubrics,prompts}/ alongside
PROMPTS.md and produces a single outcome XML per loop.
Transport check (before any GitHub step)
Run command -v gh; when it succeeds, run gh auth status; once the PR
scope is resolved, run gh api repos/<owner>/<repo> --jq .permissions.push
and take true as the pass. When any check fails, run the
pr-loop-cloud-transport skill first and route every gh operation in this
skill through its substitution matrix.
Judgment guides
Use the review guide to decide whether a changed behavior is a finding. Use the comment guide for posted findings and replies, the description guide for final PR context, the emergency guide for active incidents, and the small-change guide when the diff needs a narrower review boundary.
Pre-flight
python "${CLAUDE_SKILL_DIR}/scripts/bugteam_preflight.py"
Auto-remediation runs automatically when core.hooksPath is the failing check;
other failures require manual fix before Step 0. Full detail:
reference/team-setup.md § Pre-flight.
Refusals
First match wins; respond with the quoted line exactly and stop:
- Disabled via environment. When
CLAUDE_REVIEWS_DISABLEDcontains the tokenbugteam(comma-separated, case-insensitive, whitespace-tolerant):/bugteam is disabled via CLAUDE_REVIEWS_DISABLED.The pre-flight script also exits 7 in this case so any caller invoking it directly halts on the same signal. Gate semantics live in thereviewer-gatesskill (../reviewer-gates/SKILL.md). - No PR or upstream diff.
No PR or upstream diff. /bugteam needs a target. - Dirty tree.
Uncommitted changes detected. Stash, commit, or revert before /bugteam. - Missing subagents (tier 2 only). Before a tier-2 Agent-tool spawn,
confirm
code-quality-agentandclean-coderexist. Else:Required subagent type <name> not installed. /bugteam needs both code-quality-agent and clean-coder available.Headless tiers rely on the preflight's agent-definition-file check instead.
Audit posting
Every internal audit pass (CLEAN or DIRTY) ends with one posted GitHub PR
review; the mandate applies whether bugteam runs inside /pr-converge or
standalone. Run the shared posting helper
_shared/pr-loop/scripts/post_audit_thread.py
with --skill bugteam: map findings to the review-comment JSON (the
failure_mode split at the literal Fix: heading), partition anchored from
unanchored comments, honor the self-PR reviewer toggle
(BUGTEAM_REVIEWER_ACCOUNT) and the exit codes, and harvest the ids.
Bugteam-only obligations:
- The lead runs the posting step; the FIX teammate waits for the harvested ids before replying or resolving.
- Record each harvested
{finding_comment_id, finding_comment_url, thread_node_id}triple intoloop_comment_index(per-loop scope; see reference/team-setup.md § Loop state block) so the matching FIX action owns the reply-and-resolve unit. - Exit-code policy: the bugteam row in
../../_shared/pr-loop/post-audit-thread-contract.md§ Per-caller policy.
Progress checklist
[ ] Step 0: project permissions granted
[ ] Step 1: PR scope resolved
[ ] Step 2: loop state set
[ ] Step 3: cycle complete (converged | cap reached | stuck | error)
[ ] Step 4: apply pr-loop-lifecycle Close
Skill({skill: "pr-loop-lifecycle", args: "--skill bugteam close"})
(see pr-loop-lifecycle/SKILL.md "How callers invoke this")
First invocation of a session
Read reference/team-setup.md, then reference/audit-and-teammates.md, then reference/github-pr-reviews.md for an end-to-end mental model before starting Step 0.
Match situation, read spoke
| Situation | Read |
|---|---|
| Pre-flight, project permissions, PR scope, loop state, run-name / temp-dir | reference/team-setup.md |
--bugbot-retrigger flag behavior |
reference/team-setup.md |
| AUDIT action and code-rules pre-audit gate, pre-cycle walk, cycle decision tree | reference/audit-and-teammates.md |
| FIX action and verify-push semantics | reference/audit-and-teammates.md |
| Posting the end-of-pass audit review (APPROVE on CLEAN, REQUEST_CHANGES with inline anchored comments on DIRTY) | § Audit posting, which runs _shared/pr-loop/scripts/post_audit_thread.py |
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) |
reference/github-pr-reviews.md |
| Teardown, PR description rewrite composed by the lead, permission revoke, final report | ../pr-loop-lifecycle/reference/teardown-publish-permissions.md |
| Spawn-prompt XML, A–Q category bindings, outcome XML schemas | PROMPTS.md |
| Per-category audit content (sub-buckets, decision criteria, ready-to-send Variant C templates) | $HOME/.claude/audit-rubrics/{category_rubrics,prompts}/ |
| Invariants and design rationale | CONSTRAINTS.md, reference/design-rationale.md |
| Audit-contract finding shape (Shape A / B), Haiku secondary, post-fix self-audit | ../../_shared/pr-loop/audit-contract.md |
| Exit-scenario examples (converged, cap-reached, stuck, refusal, mixed-outcome) | EXAMPLES.md |
| Doc URLs and verbatim quotes | sources.md |
| Historical Copilot gap analysis (superseded) | reference/copilot-gap-analysis.md |
Folder map
SKILL.md— this hub.reference/— workflow detail per situation.scripts/— utility scripts executed, not loaded as primary context.PROMPTS.md— spawn XML, A–Q category bindings, outcome schemas.CONSTRAINTS.md— invariants.EXAMPLES.md— exit scenarios.sources.md— doc URLs and verbatim quotes.~/.claude/audit-rubrics/— installed bynpx claude-dev-envfrompackages/claude-dev-env/audit-rubrics/; the audit agent reads all A–Q rubrics undercategory_rubrics/and prompts underprompts/. Required at audit time alongsidePROMPTS.md.
04 同仓库更多 Skills
update
Fast-forwards a local repository's main branch to a remote's main after confirming the repo path and source remote through AskUserQuestion. Use when the user says '/update', 'update main', 'fast-forward main', 'sync main from origin', 'pull latest main into <path>', or 'bring main up to date'.
source-command-sr-loop
Converging cleanup loop: repeat /simplify until clean, then repeat /code-review --fix until clean
skill-builder
Skill lifecycle: classify, scaffold, write via the skill-writer-agent, self-audit, compose sub-skills, polish description triggers, enforce deterministic scripts. Triggers: build a skill, new skill workflow, improve this skill, optimize skill description, skill development lifecycle, skill modularity, skill composition, description trigger catalog, deterministic skill scripts.
session-tidy
Audit, clean, and consolidate session logs in the Obsidian vault. Fixes format drift, resolves orphaned next-steps, updates stale statuses, and generates project rollup summaries. Use when session logs feel cluttered or before starting a new project milestone. Triggers on '/session-tidy', 'tidy sessions', 'clean up session logs', 'session audit'.
session-log
Logs a session report as an HTML page, tracks vault context, extracts decisions, and outputs a /rename command. Use for /session-log, 'journal this session', 'log this work', 'session report', 'summarize/log/record this session', 'save session', 'capture session', or 'document what we did'.
run-claude-dev-env
Build, install, run, and test the claude-dev-env installer. Use when asked to run claude-dev-env, install the Claude Code config into ~/.claude, drive the installer, smoke-test it against a sandbox, or run its test suite.