Find, triage, and fix bugs with or without user input. Autonomously scan codebases, produce an issues list, implement a fix, create a fix branch, commit via semantic-commit, and open a PR with gh.
Prereqs:
rg available on PATH for codebase scanning.git and gh available on PATH, and gh auth status succeeds.Inputs:
Outputs:
references/ISSUES_TEMPLATE.md), a fix branch, commits, and a GitHub PR.Exit codes:
Failure modes:
rg/git/gh) or insufficient repo permissions.$AGENT_HOME/skills/automation/find-and-fix-bugs/scripts/render_issues_pr.shstart_ref="$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD)"Use this skill when the user asks to find or fix bugs, or when no concrete issue is provided and you are asked to proactively discover issues.
rg to scan for bug-prone patterns (TODO, FIXME, BUG, HACK, XXX, panic, unwrap, throw, catch, console.error, assert).references/ISSUES_TEMPLATE.md.PR-<number>-BUG-## (example: PR-128-BUG-01). If the PR number is not known yet, use PR-<number> as a placeholder
and update after PR creation.references/REPRO_GUIDE.md.rg results are large, process in batches (for example: 20-50 hits per batch).fix/<severity>-<slug> using the fixed severity levels.lint, test, build (npm, pnpm, yarn, or bun)lint, test, buildlint, test, buildlint, test, buildgo test ./..., pytest, cargo test, mvn test, gradle test, dotnet testsemantic-commit-autostage for end-to-end automation (it stages changes); use semantic-commit only when the user has explicitly
staged a reviewed subset.gh pr create and write the body using references/PR_TEMPLATE.md.references/PR_TEMPLATE.md with the same PR title.$AGENT_HOME/skills/automation/find-and-fix-bugs/scripts/render_issues_pr.sh --pr (or --issues) to generate templates quickly.git switch "$start_ref" (or git switch - if you stayed on the fix branch
the whole time).references/ASSISTANT_RESPONSE_TEMPLATE.md as the response format.git-scope output