The debugging skill I use to let my AI agents fix bugs on their own.
It walks a coding agent (Claude Code, Codex, or anything that reads Agent Skills) through four steps:
- Reproduce the bug with real production data. The agent gets the data that caused the bug, either from a branch of your production database or from an export of the affected records. It then starts a local dev instance on that data and reproduces the bug through the app.
- Fix forward, and prove it. The agent writes down what "fixed" means, makes the change, and replays the same repro in the running app, not just the unit tests. It sends you screenshots and a screen recording of the fix working.
- Verify on staging (optional). The agent deploys the fix to a staging environment connected to a database branch and runs the whole check again.
- Merge, or hand off. Depending on your risk tolerance, the agent merges on its own when it's confident, or tags you to review the proof first.
Claude Code (all projects):
git clone https://github.com/YourAverageTechBro/agent-debugging-skill ~/.claude/skills/agent-debuggingCodex and other agents that read ~/.agents/skills:
git clone https://github.com/YourAverageTechBro/agent-debugging-skill ~/.agents/skills/agent-debuggingFor a single project, clone it into that repo's .claude/skills/agent-debugging instead.
Ask your agent to fix a bug ("users can't check out with one item in the cart, fix it"), or invoke the skill directly with /agent-debugging. On the first run, it asks how to start your app locally, how it can get production data, and whether it may merge on its own. Then it offers to save the answers to AGENTS.md or CLAUDE.md, so it doesn't have to ask again.
The skill never writes to the production database. It reads production only through a branch, a snapshot, or read-only credentials, masks personal data it doesn't need, and keeps production data out of git. Read SKILL.md for the full rules.
MIT