debug-scientifically
Skill2 starsChanged 3 months agoMITView on GitHub
Fix bugs by forming and testing hypotheses instead of guessing. Use when a test fails, a stack trace appears, or behavior is wrong and the cause is unknown.
In this repository5 other files it gives its agents.
- commit-surgeonSkill
- no-slopSkill
- pr-describerSkill
- security-sweepSkill
- test-firstSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
If you cannot reproduce it on demand, you cannot know when it is fixed.
- Distinctive: line 20
Test that hypothesis cheaply: Add a log, a breakpoint, or an assertion that would prove it true or false.
- Distinctive: line 22
Confirm or discard, then repeat: If the evidence kills your hypothesis, form a new one.
- Distinctive: line 29
Change one thing at a time: If you edit five things and it works, you have learned nothing and probably introduced two new bugs.
- Distinctive: line 41
Remove debug logs and temporary code.
- Distinctive: line 42
Add a regression test so this exact bug cannot return silently.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Debug Scientifically
Random edits until the error disappears is not debugging, it is gambling. Treat every bug as a hypothesis to be confirmed or killed with evidence.
The loop
- Reproduce first. Find the smallest, most reliable way to trigger the bug. If you cannot reproduce it on demand, you cannot know when it is fixed. Write a failing test or a one-line repro command before touching anything.
- Read the actual error. The full stack trace, the exact message, the line number. Do not skim. The answer is often literally printed.
- State one hypothesis. "The value is null because the API returns 204 with no body." Make it specific and falsifiable.
- Test that hypothesis cheaply. Add a log, a breakpoint, or an assertion that would prove it true or false. Change one variable at a time.
- Confirm or discard, then repeat. If the evidence kills your hypothesis, form a new one. Do not keep a theory the data contradicts.
- Fix the cause, not the symptom. A null check that hides a bad upstream value is a symptom patch. Trace to the origin.
Guardrails
- Change one thing at a time. If you edit five things and it works, you have learned nothing and probably introduced two new bugs.
- Question your assumptions. The bug is usually in the code you are sure is correct. Verify inputs, versions, config, and environment, not just logic.
- Bisect when lost. Comment out half the suspect code, or use
git bisect, to cut the search space in half each step. - Keep a scratch trail. Note what you tried and what it proved, so you do not test the same dead hypothesis twice.
Before declaring victory
- Reproduce the original failure one more time to confirm it is gone.
- Remove debug logs and temporary code.
- Add a regression test so this exact bug cannot return silently.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

