Skip to content
Back to skills

Investigate Bug

ASecurity

Use when something is broken, a test fails unexpectedly, an error appears, or the user reports a bug or says something "doesn't work". Finds the root cause before changing code, instead of guessing at fixes.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentsgit

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add spar-ai-app/spar --skill investigate-bug --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Investigate Bug?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Investigate Bug
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/spar-ai-app-investigate-bug/badge)](https://www.skillsdirectory.com/skills/spar-ai-app-investigate-bug)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: investigate-bug
description: Use when something is broken, a test fails unexpectedly, an error appears, or the user reports a bug or says something "doesn't work". Finds the root cause before changing code, instead of guessing at fixes.
---

# Find the root cause, then fix it once

Guess-and-check fixes pile up junk and hide the real bug. Don't change code until you can explain why it fails.

1. **Reproduce it.** Get the exact error, steps, input and environment. If the user gave a transcript or screenshot, read it fully. If you can't reproduce it, say so and gather more evidence (logs, a debug print, a minimal script) rather than guessing.
2. **Write a failing test** that captures the bug, when it's testable. It must fail before the fix.
3. **Trace to the cause.** Follow the data from input to the wrong output. Read the actual code paths; check recent changes with `git log -p` on the files involved. State the root cause in one or two sentences.
4. **Three-strike rule.** If two fixes haven't worked, stop. Re-read the evidence, list what you've assumed, and test those assumptions before a third attempt. Revert failed attempts so they don't linger.
5. **Fix the cause, not the symptom.** No special cases that hide the error, no swallowing exceptions, no retry loops around a deterministic bug.
6. **Verify.** The new test passes, the full checks pass, and the original steps no longer reproduce it.
7. **Look for siblings.** Search for the same mistake elsewhere and fix those too.
8. **Record it.** Add one line to `docs/LESSONS.md` if the cause was a wrong assumption another agent could repeat.

Tell the user in plain words: what was wrong, why, and what you changed.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.