Skip to main content
The /debug command activates systematic debugging mode for investigating issues, errors, or unexpected behavior. It applies the systematic-debugging skill to methodically identify and fix problems.

When to use this

Bug reports

Something isn’t working as expected

Error messages

You’re seeing errors and need to understand why

Unexpected behavior

The application behaves differently than intended

Performance issues

Slowness or performance degradation

How it works

The debugging workflow follows a systematic 4-phase approach:
1

Gather information

  • Error message and stack trace
  • Reproduction steps
  • Expected vs actual behavior
  • Recent changes
2

Form hypotheses

  • List possible causes
  • Order by likelihood
  • Identify what to test
3

Investigate systematically

  • Test each hypothesis
  • Check logs and data flow
  • Use elimination method
4

Fix and prevent

  • Apply the fix
  • Explain root cause
  • Add prevention measures (tests, validation)

Output format

You’ll receive a detailed debugging report:

1. Symptom

What’s happening (the observable problem)

2. Information Gathered

  • Error: [error message]
  • File: [filepath]
  • Line: [line number]

3. Hypotheses

  1. ❓ Most likely cause
  2. ❓ Second possibility
  3. ❓ Less likely cause

4. Investigation

Testing hypothesis 1: [What was checked] → [Result]

5. Root Cause

🎯 Explanation of why this happened

6. Fix

Before/after code comparison with the solution

7. Prevention

🛡️ How to prevent this in the future (tests, validation, etc.)

Usage examples

/debug login not working
Investigate authentication issues
/debug API returns 500
Analyze server errors systematically
/debug form doesn't submit
Trace form submission problems
/debug data not saving
Investigate persistence issues

Key principles

Ask before assuming: The debugger will gather full context before making guesses.
Test hypotheses: Uses systematic elimination rather than random guessing.
Explain why: Focuses on understanding the root cause, not just fixing symptoms.
Prevent recurrence: Adds tests and validation to prevent the bug from returning.
  • /test - Generate tests to prevent bugs
  • /enhance - Apply fixes and improvements

Build docs developers (and LLMs) love