bugfix
Skill39 starsChanged 18 days agoApache-2.0View on GitHub
Autonomous test-driven bug fixing with iterative fix-verify loops
- Commits and pushes
34 other projects use a version of this.
Adopted by
Most recently taken up by
- isanchez-aguilar/relayrace-aitheir own version, first seen Nov 8, 2026
- icarloscornejo/doertheir own version, first seen Nov 7, 2026
- ClaireAll/skillstheir own version, first seen Nov 5, 2026
- bhoon716/skill-forgetheir own version, first seen Nov 2, 2026
- Snowflake-Labs/coco-skillstheir own version, first seen Nov 1, 2026
- irahardianto/awesome-agvtheir own version, first seen Nov 1, 2026
Used with
Projects with it also use feature, refactor and 6 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
bradtraversySkillfeature
Manage current feature workflow - start, review, explain or complete
Also in 7 projects that use this
GitHubSkillrefactor
Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.
Also in 6 projects that use this
SentrySkillspec
Produce a verified spec — problem, desired outcome, and acceptance criteria — before building. Use when given a GitHub/Linear issue link, when starting from a fuzzy in-conversation idea, or asked to "figure out what to do" / "scope this" / "what should I build" — whenever the *what* isn't yet pinned down. Grills the ambiguities, checks the premise against the code, and produces acceptance criteria you sign off on — then hands to design-first.
Also in 4 projects that use this
BlockSkillplan
Draft a TDD, PRD, or lightweight plan in the conversation without committing it.
Also in 4 projects that use this
SentrySkillreview
Fixture review skill.
Also in 6 projects that use this
Microsoft AzureSkilldocs
Also in 3 projects that use this
Other versions34 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 34
- alibaba/MNN★ 16ksame name
- SparkDevNetwork/Rock★ 701same name
- oasm-platform/open-asm★ 272same name
- atelier-fashion/adlc-toolkit★ 173same name
- team-attention/hoyeon★ 173same name
- irahardianto/awesome-agv★ 157same name
- Snowflake-Labs/coco-skills★ 49same name
- dan-the-dev/xp-developer-skills★ 31same name
- ecodelearn/template-claude-code-open★ 25same name
- ConfabulousDev/confab-web★ 15same name
24 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adoptSkill
- bulk-auditSkill
- canonical-auditSkill
- claims-auditSkill
- commitSkill
- dead-code-reviewSkill
- deploySkill
- implementSkill
- issueSkill
- parallelSkill
- researchSkill
- research-to-issuesSkill
- secreviewSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 10 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 31 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
Maximum 5 iterations: If not fixed after 5 attempts, stop and escalate to user.
- Distinctive: line 112
Add new features or "improvements"
- Distinctive: line 114
Add extensive error handling "just in case"
- Distinctive: line 119
Use existing patterns from the codebase
- Distinctive: line 120
Follow CLAUDE.md guidelines (SSOT config, no hardcoding, etc.)
- Distinctive: line 269
After tests pass locally, verify the fix works on remote server:
- Distinctive: line 288
Create separate GitHub issues for them
- Distinctive: line 289
Do NOT fix them in this iteration
- Distinctive: line 295
Ask user how to proceed
- Distinctive: line 319
Search for: Hardcoded IPs, ports, passwords
- Very specific: line 323
Search for: from src. imports
- Very specific: line 339
Search for: Old API paths (/api/v1/, /api/control/)
“Common” is measured: kept by at least 6 in 10 of the 31 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Autonomous Bug-Fixing Pipeline
Systematically debug and fix issues using a test-driven loop: analyze error → hypothesize root cause → implement minimal fix → verify → repeat until all tests pass.
When to Use This
Good use cases:
- Failing test suite (unit, integration, E2E)
- Reproducible runtime errors with clear error messages
- Regression bugs caught by CI/CD
- 500 errors with stack traces in logs
- Performance degradations with measurable metrics
Bad use cases:
- Intermittent/flaky failures (need manual investigation first)
- Issues without clear reproduction steps
- Architectural problems requiring design decisions
- Security vulnerabilities requiring user approval
Input Requirements
You must provide ONE of:
- GitHub issue URL or number - e.g.,
/bugfix 123or/bugfix https://github.com/mrveiss/AutoBot-AI/issues/123 - Error log or stack trace - paste directly
- Failing test command - e.g.,
pytest tests/test_redis.py::test_connection
Autonomous Fix Loop
Maximum 5 iterations. If not fixed after 5 attempts, stop and escalate to user.
Iteration N (repeat until tests pass)
Step 1: Run Tests & Capture Failure
# For Python backend
python -m pytest tests/ -x -v --tb=short 2>&1 | tee /tmp/test_output.txt
# For TypeScript frontend
cd autobot-user-frontend && npm test 2>&1 | tee /tmp/test_output.txt
# For specific test file
python -m pytest tests/test_specific.py -v --tb=long 2>&1 | tee /tmp/test_output.txtCapture:
- Which test(s) failed
- Error message and type
- Stack trace (full traceback)
- Line numbers where failure occurred
Step 2: Analyze Failure & Form Hypothesis
Read the error output carefully:
FAILED tests/redis_test.py::test_connection - ConnectionRefusedError: [Errno 111] Connection refused
File "/opt/autobot/autobot_shared/redis_client.py", line 45, in get_redis_client
client = redis.Redis(host=host, port=port)Form a 1-2 sentence hypothesis:
Example hypotheses:
- "Redis host is hardcoded to 'localhost' instead of using SSOT config"
- "Database migration for column 'user_id' hasn't been applied"
- "Frontend API client is calling old /api/v1/ instead of /api/v2/"
- "Async function not being awaited in sync context"
- "Import path still uses old 'from src.' instead of colocated structure"
State your hypothesis in this format:
🔍 Iteration N Hypothesis:
[Your 1-2 sentence hypothesis]
Root cause: [specific file:line]
Expected fix: [what needs to change]Step 3: Investigate Root Cause
Read relevant source files:
# Read the file mentioned in stack trace
Read: /opt/autobot/autobot_shared/redis_client.py
# Search for related code
Grep: "redis.Redis" in autobot_shared/
Glob: "**/*redis*.py"
# Check recent changes
git log --oneline -10 -- path/to/file.pyVerify your hypothesis:
- Does the code match what you expected?
- Are there related issues in nearby code?
- Was this broken by a recent change?
Step 4: Implement Minimal Fix
CRITICAL: Make the SMALLEST possible change to fix the specific failure.
❌ Do NOT:
- Refactor surrounding code
- Add new features or "improvements"
- Fix unrelated issues
- Add extensive error handling "just in case"
- Reorganize imports or file structure
✅ DO:
- Fix ONLY the specific issue causing the test failure
- Use existing patterns from the codebase
- Follow CLAUDE.md guidelines (SSOT config, no hardcoding, etc.)
- Preserve existing functionality
Example fixes:
# WRONG: Over-engineered fix
def get_redis_client():
try:
config = load_config_with_fallback()
if config.redis.host:
host = config.redis.host
else:
host = os.getenv("REDIS_HOST", "localhost")
except Exception as e:
logger.error(f"Config error: {e}")
host = "localhost"
# ... 20 more lines
# RIGHT: Minimal fix
def get_redis_client():
from autobot_shared.ssot_config import config
return redis.Redis(host=config.redis.host, port=config.redis.port)Use Edit tool for existing files:
Edit(
file_path="autobot_shared/redis_client.py",
old_string='client = redis.Redis(host="localhost", port=6379)',
new_string='client = redis.Redis(host=config.redis.host, port=config.redis.port)'
)Step 5: Re-run Tests
# Run the SAME test command as Step 1
python -m pytest tests/ -x -v --tb=short 2>&1 | tee /tmp/test_output.txtAnalyze results:
If tests PASS: → Go to Step 6 (Commit)
If tests FAIL with SAME error:
- Your fix didn't address the root cause
- Re-read error message carefully
- Form a NEW hypothesis
- Loop back to Step 2 (Iteration N+1)
If tests FAIL with DIFFERENT error:
- Good! You fixed the original issue
- But introduced a new issue or uncovered another bug
- Form hypothesis for the NEW error
- Loop back to Step 2 (Iteration N+1)
Step 6: Commit the Fix (only when tests pass)
git add <files-you-changed>
git commit -m "fix: <concise description of what was broken> (#issue-number)
Root cause: <1 sentence explaining the bug>
Fix: <1 sentence explaining the solution>
- Fixed: <specific error that was happening>
- Changed: <what you modified>
- Tests: <which tests now pass>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>"
# Verify commit
git log -1 --stat
git diff # Should be emptyAfter Fix Loop Completes
Success Path (tests pass within 5 iterations)
Report to user:
✅ Bug fixed successfully in N iterations
Root Cause:
[1-2 sentence explanation of what was actually broken]
Fix Applied:
[1-2 sentence explanation of what you changed]
Files Changed:
- path/to/file1.py (+3, -1)
- path/to/file2.py (+5, -2)
Iterations Needed: N of 5
Test Results:
✅ All tests passing
✅ No new failures introduced
✅ Changes committed
Next Steps:
- Review the commit if needed
- Push the branch: git push origin <branch>
- Create PR or merge to mainFailure Path (5 iterations exhausted, tests still failing)
Report to user:
❌ Unable to fix bug automatically after 5 iterations
Current Status:
[What error is still happening]
Hypotheses Tried:
1. [First hypothesis] - Result: [what happened]
2. [Second hypothesis] - Result: [what happened]
...
5. [Fifth hypothesis] - Result: [what happened]
Remaining Issue:
[What's still broken and why it's complex]
Recommendation:
This bug requires manual investigation because:
- [Reason 1: e.g., "Root cause spans multiple files"]
- [Reason 2: e.g., "Architecture decision needed"]
- [Reason 3: e.g., "Test failures are intermittent"]
Files to Investigate:
- path/to/file1.py:45 (where error originates)
- path/to/file2.py:120 (related code)
Suggested Next Steps:
1. [Specific action user should take]
2. [Another specific action]Deployment Verification (if applicable)
If the bug was discovered in production:
After tests pass locally, verify the fix works on remote server:
# Deploy using /deploy skill
/deploy main
# Verify the original error is gone
ssh autobot@172.16.168.20 "journalctl -u autobot-backend --since '1 hour ago' | grep 'ConnectionRefusedError' || echo 'Error is gone'"
# Hit the affected endpoint
curl -s http://172.16.168.20:8001/api/health | jq
# Check for new errors
ssh autobot@172.16.168.20 "journalctl -u autobot-backend --since '1 minute ago' | grep -i error || echo 'No new errors'"Guardrails
If you notice related bugs during fixing:
- Create separate GitHub issues for them
- Do NOT fix them in this iteration
- Stay focused on the single failing test
If the fix requires architectural changes:
- STOP after iteration 2
- Explain why architecture decision is needed
- Ask user how to proceed
If tests are flaky (pass/fail randomly):
- STOP after iteration 1
- Report that tests are flaky
- Recommend investigating test stability first
If multiple unrelated tests are failing:
- Pick the FIRST failure only
- Fix it completely
- Then run this skill again for the next failure
Success Criteria
✅ All tests passing (or at least the originally failing test) ✅ No new test failures introduced ✅ Fix is minimal (no refactoring, no feature additions) ✅ Root cause identified and documented ✅ Changes committed with clear message ✅ Deployment verified (if production bug)
Common Bug Patterns & Quick Fixes
Pattern: Hardcoded IP/config
- Search for: Hardcoded IPs, ports, passwords
- Fix: Use
from autobot_shared.ssot_config import config
Pattern: Stale import paths
- Search for:
from src.imports - Fix: Use colocated imports (file next to file)
Pattern: Missing database migration
- Run:
alembic upgrade head - Check:
alembic current
Pattern: Async/await mismatch
- Error: "coroutine was never awaited"
- Fix: Add
awaitor useasyncio.run()
Pattern: Missing dependency
- Error: "ModuleNotFoundError"
- Fix: Check if package is in requirements.txt and installed in venv
Pattern: Wrong endpoint URL
- Search for: Old API paths (
/api/v1/,/api/control/) - Fix: Update to current API paths
Performance Tracking
Track your bugfix pipeline performance:
Session Stats:
- Bugs fixed: N
- Average iterations per bug: M
- Success rate: X%
- Most common root causes: [list]Store in memory MCP after each session.
Example Session
User: /bugfix 845
[Iteration 1]
🔍 Hypothesis: Redis connection using hardcoded localhost instead of SSOT config
Root cause: autobot_shared/redis_client.py:45
Expected fix: Import and use config.redis.host
[Implements minimal fix]
[Re-runs tests]
❌ FAILED - Different error now: "redis.exceptions.AuthenticationError"
[Iteration 2]
🔍 Hypothesis: Redis password not being passed to connection
Root cause: Same file, missing password parameter
Expected fix: Add password=config.redis.password
[Implements fix]
[Re-runs tests]
✅ PASSED - All tests passing
✅ Bug fixed successfully in 2 iterations
Root Cause:
Redis client was using hardcoded localhost and missing password parameter
Fix Applied:
Updated redis_client.py to use SSOT config for host, port, and password
Files Changed:
- autobot_shared/redis_client.py (+2, -1)
Iterations Needed: 2 of 5Does 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.

