| name | bug-fix-iteration |
| description | Systematic approach to fixing bugs reported via pasted logs. Prevents the agent from making broad changes that introduce regressions when only a targeted fix is needed. [GENERATED BY MOTIF — review and customize] |
Bug Fix Iteration
Systematic approach to fixing bugs reported via pasted logs. Prevents the agent from making broad changes that introduce regressions when only a targeted fix is needed.
When to Use
- User pastes error logs, stack traces, or console output
- User says 'it's still broken' or 'that didn't work'
- Especially when: previous fix attempt didn't resolve the issue
- Don't skip when: the error seems 'obvious' -- still follow the process
Instructions
- Read the pasted logs carefully
- identify the exact error message and location
- If error is ambiguous, ask the user one clarifying question before proceeding
- Check if this is a known issue pattern (same file/component as previous bugs)
- Propose a targeted fix that addresses only the specific error
- Do NOT refactor or modify unrelated code in the same change
- Apply the fix
- Ask user to test and report back
- If fix doesn't work after 2 attempts, step back and investigate root cause more broadly
Best Practices
- Read the entire error message, not just the first line
- Fix one thing at a time -- don't bundle multiple changes
- Avoid: Don't refactor code that isn't related to the bug
- Always ask the user to verify the fix worked
Common Pitfalls
| Problem | Solution |
|---|
| Agent modifies unrelated code, causing new bugs | Only touch files directly related to the reported error |
| Agent proposes sweeping refactor instead of targeted fix | Fix the bug first; propose refactoring separately if needed |
| Going in circles with the same fix approach | After 2 failed attempts, investigate root cause from a different angle |
Key Constraints
- Never modify files unrelated to the reported bug
- Always ask the user to verify after applying a fix
- After 2 failed fix attempts, change your investigation approach