← All skills
Prompt · Slash command✓ Verified

Fix Bug

Diagnose and fix the current bug or error.

What happens when you install it

1

You run the install command

mcp install-skill fix-bug

MCPHub CLI downloads this prompt from the registry.

2

Saved as a file in Claude Code

~/.claude/commands/fix-bug.md

Claude Code reads all .md files in this folder as slash commands.

3

Use it in any conversation

/fix-bugin Claude Code (after restart)

Claude runs the prompt against your current file or selection — no copy-paste needed.

Content

Fix Bug

Diagnose and fix the current bug or error with surgical precision.

Process

  1. Identify the root cause — not just the symptom. What actually went wrong?
  2. Explain the failure — why does this cause the observed behavior?
  3. Apply the fix — minimal change to the surrounding code. Don't refactor unrelated things.
  4. Check for siblings — are there other places in the code with the same bug?
  5. Suggest a test — what test would have caught this?

What not to do

  • Don't rewrite working code around the bug
  • Don't add defensive checks everywhere "just in case"
  • Don't change unrelated behavior

Output format

Root cause: One clear sentence explaining what went wrong.

Fix:

// the corrected code

Why this works: Brief explanation of why the fix addresses the root cause.

Related areas to check: (if any)

Test to add: A minimal test case that would catch this regression.