Skip to content
GitHub

Build it

Fix a bug

Find the cause of a bug, fix it with the smallest change, and keep a test that stops it coming back.

Give your agent the bug report, and it reproduces the problem before it changes any code. Naming the bug-fix skill makes the routine fire every time.

Give the agent whatever signal you have, such as a stack trace, a log line, or a user report:

Use the bug-fix skill to fix the duplicate charge when an order retry times out.

The agent will not write a fix until it can make the bug fail on demand, with a failing test, steps that fail every time, or a captured error. If you cannot reproduce it, it stops and asks instead of guessing.

Ask for the test next if the agent has not already written it:

Write a test that fails because of this bug, and show me it failing.

The test checks what the code should do, not how it does it, and it stays in your suite as the regression test. Do not delete it once it passes.

Ask for the root cause before any change:

Where does this bug start, and could the same mistake exist elsewhere?

The agent answers where the defect lives, when it began, and whether the same pattern shows up in other places. It puts the answers in the commit message.

Ask for the fix:

Make the smallest change that turns the test green.

The agent changes only what the named bug needs. It refuses to hide the symptom with a catch-all handler, a retry, or a flag that turns the broken path off. Cleanups you notice along the way go in their own pull requests.

Run your lint, type, and test commands, then open the pull request, as the development workflow describes. The agent writes the commit as fix(<scope>): <subject>, with the root cause in its body, following the coding conventions. For a fix that touches several files, ask it to run the build loop so independent reviewers read the diff; why the loop works this way.

Next, review the pull request.