Fix a Bug

Find the root cause before anyone touches the code.

You start withAn error or a failing test you can make happen again
You end withThe proven root cause, a quick check and the fix to make in Cursor
Step 1

Use Cursor

Its agent reads the project, edits the code and runs the tests.

Open Cursor

Save it as error.log. Ask Cursor's agent to rerun the failing command and save the whole output, stack trace included, to error.log in your project.

Step 2

Give your agent the Systematic Debugging skill

Makes the agent find the root cause before it proposes a fix.

The skill is in this folder, at skill/systematic-debugging. Copy it into your agent's skills folder, or install it from its maker:

/plugin install superpowers@claude-plugins-official

Save it as debug-notes.md. Paste the trace, code and steps from debug-notes.md into {{Error message and stack trace}}, {{Relevant code}} and {{What you were doing}}.

Step 3

Run the Debugging for Errors and Stack Traces prompt

The root cause, a quick way to confirm it and the fix, from your stack trace.

Any capable chat assistant can debug a pasted stack trace; a coding agent that can run your code and read the whole project helps when the cause sits outside the files you paste.