debug-systematic
Skill101 starsChanged 9 months agoMITView on GitHub
Systematic 4-phase debugging methodology for complex, intermittent, or mysterious issues. Use when investigating bugs, race conditions, or unexplained failures.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- aprameyak/coding-skillstheir own version, first seen Oct 2, 2026
- rainforest888/raincodetheir own version, first seen Aug 12, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- rainforest888/raincode★ 9same name
- aprameyak/coding-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository180 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- accessibility-a11ySkill
- agent-accessibility-expertSkill
- agent-android-developerSkill
- agent-api-designerSkill
- agent-api-integration-specialistSkill
- agent-audio-engineerSkill
- agent-auth-specialistSkill
- agent-blockchain-developerSkill
- agent-brand-strategistSkill
- agent-browser-extension-developerSkill
- agent-cli-developerSkill
- agent-cloud-architectSkill
- agent-code-explainerSkill
- agent-compliance-engineerSkill
- agent-cpp-expertSkill
- agent-database-expertSkill
- agent-data-engineerSkill
- agent-desktop-developerSkill
- agent-devsecops-engineerSkill
- agent-django-fastapi-expertSkill
- agent-documentation-writerSkill
- agent-e2e-test-specialistSkill
- agent-email-specialistSkill
- agent-embedded-developerSkill
- agent-event-driven-architectSkill
- agent-flutter-developerSkill
- agent-game-developerSkill
- agent-go-expertSkill
- agent-graphic-designerSkill
- agent-graphql-architectSkill
- agent-i18n-specialistSkill
- agent-kotlin-expertSkill
- agent-macos-developerSkill
- agent-microservices-architectSkill
- agent-migration-specialistSkill
- agent-ml-engineerSkill
- agent-mobile-architectSkill
- agent-mobile-release-managerSkill
- agent-monetization-expertSkill
- agent-motion-designerSkill
- agent-next-js-expertSkill
- agent-observability-engineerSkill
- agent-payment-billing-specialistSkill
- agent-product-analytics-specialistSkill
- agent-product-managerSkill
- agent-pwa-specialistSkill
- agent-python-expertSkill
- agent-realtime-specialistSkill
- agent-rust-expertSkill
- agent-seo-specialistSkill
- agent-serverless-specialistSkill
- agent-startup-advisorSkill
- agent-svelte-expertSkill
- agent-teamsSkill
- agent-technical-writerSkill
- agent-test-generatorSkill
- agent-ux-researcherSkill
- agent-video-producerSkill
- agent-vue-nuxt-expertSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 14 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
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 15
Goal: Create reliable reproduction steps before ANY investigation.
- Distinctive: line 19
Document exact steps to trigger the bug
- Distinctive: line 23
Test on different environments to isolate variables
- Distinctive: line 27
When did it last work correctly?
- Distinctive: line 65
Create minimal reproduction case
- Distinctive: line 72
Use fresh installs to eliminate pollution
- Distinctive: line 86
Predict: If hypothesis is correct, what else would be true?
- Distinctive: line 87
Test: Verify predictions with evidence
- Distinctive: line 121
Review fix for side effects: - read the callers, inputs, and error paths it touches
- Distinctive: line 124
Write a failing test that captures the bug only when the user asked for tests.
- Distinctive: line 135
Add guards/validation at boundaries
- Distinctive: line 137
Document gotchas for other developers
- Distinctive: line 138
Consider if architectural change prevents similar bugs
- Distinctive: line 155
Verify assumptions with evidence
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Systematic Debugging Protocol
A disciplined, evidence-based approach to debugging that prevents guessing and ensures root cause discovery.
The 4-Phase Protocol
Phase 1: REPRODUCE (Establish Ground Truth)
Goal: Create reliable reproduction steps before ANY investigation.
Actions:
- Document exact steps to trigger the bug
- Record environment specifics (OS, versions, config, memory, network)
- Determine frequency: Always? Sometimes? Specific conditions?
- Capture exact error messages, stack traces, screenshots
- Test on different environments to isolate variables
Key Questions:
- When did it last work correctly?
- What changed since then? (code, deps, config, infrastructure)
- Is it environment-specific?
- Is it data-specific?
- Is it timing-specific?
Output: Clear reproduction steps that reliably trigger the issue.
Phase 2: ISOLATE (Narrow the Scope)
Goal: Reduce the search space from "entire codebase" to "specific component."
Techniques:
Binary Search:
- Identify two points: working state and broken state
- Test the midpoint
- Recurse into the broken half
- Continue until the change is identified
Git Bisect (for regressions):
git bisect start
git bisect bad HEAD
git bisect good <known-good-commit>
# Git will checkout commits for testing
# After each test:
git bisect good # or git bisect bad
# Continue until culprit foundCode Elimination:
- Comment out sections to isolate the problem
- Create minimal reproduction case
- Strip away everything non-essential
Environment Isolation:
- Exercise the failing path in isolation (minimal reproduction; a unit test only when the user asked for tests)
- Compare working vs broken environments
- Use fresh installs to eliminate pollution
Output: "The bug is in [specific component/function/line range]"
Phase 3: DIAGNOSE (Understand Root Cause)
Goal: Know exactly WHY the bug occurs, not just WHERE.
Scientific Method:
- Observe: What exactly is happening?
- Hypothesize: Why might this be happening?
- Predict: If hypothesis is correct, what else would be true?
- Test: Verify predictions with evidence
- Iterate: Refine hypothesis based on results
Logging Strategy:
// Add strategic logging at boundaries
console.log("[DEBUG] Function entry:", { input, state });
console.log("[DEBUG] After processing:", { result, sideEffects });
console.log("[DEBUG] Function exit:", { returnValue });Common Root Causes:
| Symptom | Likely Causes |
| Works locally, fails in CI | Environment differences, timing, resources |
| Intermittent failure | Race condition, flaky network, resource contention |
| Works then stops working | State mutation, memory leak, cache poisoning |
| Wrong data | Type coercion, encoding, timezone, precision |
| Silent failure | Swallowed exception, async error, missing await |
Output: Clear explanation of the root cause with evidence.
Phase 4: FIX & VERIFY (Resolve and Prevent)
Goal: Fix the issue and prevent regression.
Fix Process:
- Implement minimal fix - change as little as possible
- Check for similar patterns - same bug elsewhere?
- Review fix for side effects - read the callers, inputs, and error paths it touches
- Document the fix - why it happened, how to prevent
Write a failing test that captures the bug only when the user asked for tests.
Verification Checklist:
- Review shows the Phase 3 root cause is addressed, not just the symptom
- The output the fix already produces (the reproduction, the command that did the work) confirms it
- Fix works in all affected environments
- No new warnings or errors introduced
Prevention:
- Add guards/validation at boundaries
- Improve error messages for easier future debugging
- Document gotchas for other developers
- Consider if architectural change prevents similar bugs
Debugging Anti-Patterns
DO NOT:
- Guess and hope (change things randomly)
- Assume you know the problem without evidence
- Trust comments/docs over actual code behavior
- Debug production with print statements you'll forget to remove
- Fix the symptom instead of the root cause
- Make multiple changes at once
DO:
- Verify assumptions with evidence
- Change one thing at a time
- Log actual values, not what you expect
- Trust the code over documentation
- Take breaks when stuck (fresh eyes help)
Quick Reference
1. REPRODUCE → Can I reliably trigger this?
2. ISOLATE → Where exactly is it failing?
3. DIAGNOSE → Why is it failing?
4. FIX → How do I fix it permanently?Output Template
## Bug Investigation: [Title]
### Reproduction
- Steps to reproduce
- Environment details
- Frequency
### Isolation
- Search method used
- Scope narrowed to
### Root Cause
- What's actually wrong
- Why it happens
- Evidence
### Fix
- Code changes made
- What review confirmed, and what it couldn't
### Prevention
- How to prevent similar bugs
- Documentation updatesDoes 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.

