autonomous-bug-fix
Skill54 starsChanged 6 months agoMITView on GitHub
Reproduces, diagnoses, fixes, and verifies bugs unaided.
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- architecture-sketchingSkill
- behavioral-foundationSkill
- brainstormingSkill
- codebase-onboardingSkill
- code-reviewSkill
- debuggingSkill
- demand-eleganceSkill
- derive-nfr-from-driverSkill
- derive-security-from-riskSkill
- dispatching-parallel-agentsSkill
- durable-workSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- plan-before-codeSkill
- pr-workflowSkill
- receiving-code-reviewSkill
- refactoringSkill
- requesting-code-reviewSkill
- requirements-elicitationSkill
- safety-guardrailsSkill
- security-auditSkill
- self-improvementSkill
- subagent-strategySkill
- test-writingSkill
- traceability-gateSkill
- using-git-worktreesSkill
- using-superpowersSkill
- verify-before-doneSkill
- template-skillSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 9 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
Read access to the failing component (use glob / grep to locate it).
- Very specific: line 58
Run the failing path via the powershell tool.
- Distinctive: line 60
If you can't reproduce:
- Distinctive: line 62
Check for environment-specific behavior (OS, Node/Python version).
- Distinctive: line 63
Look for race conditions or state-dependent paths.
- Distinctive: line 64
Ask the user for clarification only as a last resort, and only with specific questions.
- Distinctive: line 68
Read the error message and stack trace before doing anything else — they exist for a reason.
- Distinctive: line 77
Stop at the root cause, not the first thing that looks suspicious.
- Distinctive: line 85
Add a regression test that fails without the fix and passes with it.
- Very specific: line 86
Check whether the same root cause exists elsewhere (grep for the pattern).
- Distinctive: line 93
Run the full test suite. No regressions.
- Distinctive: line 98
If verification fails after your fix:
- Very specific: line 107
DO NOT: ask the user "which file is it in?" or "how do I run the tests?" Use grep/glob/view/powershell to discover it.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Autonomous Bug Fix Skill
Walks the agent through the full reproduce → diagnose → fix → verify cycle on its own, without asking the user for navigation help, log-reading instructions, or test commands. Does NOT cover net-new feature work — for that use plan-before-code and executing-plans.
When to Use
- User reports a bug, regression, or unexpected behavior.
- CI is red on a branch you own.
- An error or warning appears in logs.
- A previously working feature stopped working.
- The user says "this is broken," "it doesn't work," or similar.
Prerequisites
- Read access to the failing component (use
glob/grepto locate it). - The
powershelltool to run tests,git, and reproduction commands. - A clean working tree on a feature branch (use
using-git-worktreesif needed). verify-before-doneskill loaded — you'll invoke it at the end.
How to Run
1. Reproduce → locate the code, run the failing path, confirm with evidence.
2. Diagnose → trace from symptom to root cause; check recent changes.
3. Fix → minimal change at the root cause + a regression test.
4. Verify → re-run reproduction + full suite via `verify-before-done`.Quick Reference
| Phase | Action | Tool |
| Find code | Search by symbol or file pattern | grep, glob |
| Read code | Inspect the failing path | view |
| Reproduce | Run failing command/test | powershell |
| Diagnose | Recent changes / blame | powershell → git log -20 --oneline, git blame <path> |
| Edit | Minimal, root-cause fix | edit |
| Add test | Regression test | create or edit under tests/ |
| Verify | Re-run reproduction + full suite | powershell, then verify-before-done |
Procedure
Step 1: Reproduce
Find the relevant code yourself — grep for the symbol, glob for the path. Do not ask the user "which file is this in?"
Run the failing path via the powershell tool. If no failing test exists, write a minimal one that captures the bug. Confirm reproduction with concrete evidence (stack trace, exit code, log line).
If you can't reproduce:
- Check for environment-specific behavior (OS, Node/Python version).
- Look for race conditions or state-dependent paths.
- Ask the user for clarification only as a last resort, and only with specific questions.
Step 2: Diagnose Root Cause
Read the error message and stack trace before doing anything else — they exist for a reason. Trace from the user-visible symptom back to the root cause:
# via the `powershell` tool
git log -20 --oneline
git blame path/to/suspect.ts
git diff HEAD~5 -- path/to/suspect.tsStop at the root cause, not the first thing that looks suspicious. "Why did this break?" — not "what broke?"
Step 3: Fix at the Root
Edit with precision via the edit tool:
- Change only what needs to change. Bigger diffs hide bigger bugs.
- Fix the root cause, never the symptom. Swallowing an exception is not a fix.
- Add a regression test that fails without the fix and passes with it.
- Check whether the same root cause exists elsewhere (
grepfor the pattern). If yes, fix those too or log them intasks/lessons.mdfor follow-up.
Step 4: Verify
Hand off to the verify-before-done skill:
- Re-run the reproduction. The error must be gone.
- Run the full test suite. No regressions.
- Record evidence in
tasks/todo.mdunder the task.
Step 5: Rollback If Verification Fails
If verification fails after your fix:
- Reset the working tree (
git checkout -- .orgit stashviapowershell). - Log the failed attempt in
tasks/lessons.mdwith the root-cause analysis you had. - Re-plan with a different approach via
plan-before-code. - Never push broken code hoping someone catches it later.
Pitfalls
- DO NOT ask the user "which file is it in?" or "how do I run the tests?" Use
grep/glob/view/powershellto discover it. - DO NOT apply a band-aid (catch-and-swallow, ignore the warning). Fix the root cause.
- DO NOT fix the symptom. A login button that fails because of a missing provider is a provider bug, not a button bug.
- DO NOT skip the regression test. Without one, the bug comes back in 3 months.
- DO NOT push without verification. An unverified fix is often worse than no fix.
- DO NOT abandon failed attempts silently. Log them in
tasks/lessons.md.
Verification
- Reproduction was confirmed with concrete evidence before any fix.
- Root cause is identified in writing (in commit message or
tasks/todo.md). - Regression test added that fails on
mainand passes on the branch. verify-before-donechecklist passed.- If similar patterns exist elsewhere, they are fixed or logged.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

