AGENT SKILL

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

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_DISABLED contains the token bugteam (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 the reviewer-gates skill (../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-agent and clean-coder exist. 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 into loop_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 by npx claude-dev-env from packages/claude-dev-env/audit-rubrics/; the audit agent reads all A–Q rubrics under category_rubrics/ and prompts under prompts/. Required at audit time alongside PROMPTS.md.

04 同仓库更多 Skills

jl-cmd-projects
jl-cmd-projects/claude-dev-env

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'.

★ 7
jl-cmd-projects
jl-cmd-projects/claude-dev-env

source-command-sr-loop

Converging cleanup loop: repeat /simplify until clean, then repeat /code-review --fix until clean

★ 7
jl-cmd-projects
jl-cmd-projects/claude-dev-env

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.

★ 7
jl-cmd-projects
jl-cmd-projects/claude-dev-env

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'.

★ 7
jl-cmd-projects
jl-cmd-projects/claude-dev-env

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'.

★ 7
jl-cmd-projects
jl-cmd-projects/claude-dev-env

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.

★ 7