Skip to content
Back to skills

Debug

ASecurity

Find the root cause of a bug, a failing test or unexpected behaviour before changing any code, then fix it with a regression test. Use on "ça marche pas", "bug", "pourquoi ça plante", "this test fails", or after a fix that did not hold.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
developmentgit

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add Sycatle/senior-mode --skill debug --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Debug?

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

Security grade badge for Debug
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sycatle-debug-57c25761/badge)](https://www.skillsdirectory.com/skills/sycatle-debug-57c25761)

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: debug
description: Find the root cause of a bug, a failing test or unexpected behaviour before changing any code, then fix it with a regression test. Use on "ça marche pas", "bug", "pourquoi ça plante", "this test fails", or after a fix that did not hold.
invocation: explicit
---

# Debug

**No fix without a root cause.** Reproduce, explain why it happens, then change the code.

A fix for a symptom moves the bug somewhere you are not looking. It also teaches nothing: the same cause
comes back in the next feature. Guessing feels faster, and it is, until the third guess. The pressure to
"just try something" is strongest exactly when the cause is least understood.

## Steps

1. **Reproduce it.** Find the smallest input or sequence that shows the bug every time, ideally as a
   failing test. Done when you can make it happen on demand. A bug you cannot reproduce is not ready to
   be fixed: gather evidence (logs, versions, the exact input) instead.
2. **Read what it says.** The full error, the first stack frame in your code, the log lines just before.
   The answer is in the error message more often than anyone admits.
3. **Find what changed.** When it used to work: `git log`, `git bisect`, the dependency or config that
   moved. A working version next to a broken one narrows the search faster than reading code.
4. **Form one hypothesis and test it.** "X is null because Y returns early when Z": predict what you will
   see, then look (a log line, a debugger, an assertion). One variable at a time. Done when the evidence
   confirms the cause, not when the theory sounds right.
5. **Fix the cause** with a regression test that fails before the fix and passes after (the `tdd` loop).
   Then run everything (`verify`): a fix that breaks something else is not a fix.
6. **Say what it was**, in a sentence or two: the cause, why it happened, why the fix holds. If the same
   mistake could exist elsewhere, look, and say what you found.

## When to stop and step back

Three hypotheses in and still wrong: stop patching. You are probably missing a fact about how the system
works, not looking at the wrong line. Re-read the code path from the entry point, write down what you
know for certain versus what you assume, and question the assumptions first. If the cause turns out to
be a design problem, say so, and propose it as a ticket rather than burying it under a workaround.

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 development →

Comments

Loading comments…

Newsletter

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