debugging
Skill11 starsChanged 3 months agoMITView on GitHub
Use when debugging bugs, test failures, or unexpected behavior. Triggers: 'why isn't this working', 'this doesn't work', 'X is broken', 'something's wrong', 'getting an error', 'exception in', 'stopped working', 'regression', 'crash', 'hang', 'flaky test', 'intermittent failure', or when user pastes a stack trace/error output. NOT for: test quality issues (use fixing-tests), adding new behavior (use develop).
We split this skill into the rules it gives an agent
26 rules. 0 are common, 23 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 99 edited versions we read keep these.
23
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Verification Non-Negotiable: No fix is complete without evidence.
- Very specific: line 21
Hunches Require Verification: Before claiming "found it" or "root cause," invoke verifying-hunches skill.
- Distinctive: line 54
If you find yourself debugging without having completed this phase, STOP IMMEDIATELY and return here.
- Distinctive: line 59
Before ANY investigation, establish a known-good reference state.
- Very specific: line 88
Do NOT run git stash, git checkout <branch>, git pull, or any other tree-wide operation to establish the baseline.
- Distinctive: line 117
Start from CLEAN baseline (from 0.1)
- Distinctive: line 118
Run SPECIFIC test/action that should trigger bug
- Distinctive: line 153
Before EVERY test, verify:
- Distinctive: line 247
If prior attempts = "3+ attempts":
- Distinctive: line 264
Wait for explicit choice. If B chosen: reset fix_attempts = 0, proceed.
- Distinctive: line 276
Consider refactoring vs. tactical fixes
- Distinctive: line 277
Document the pattern issue
- Very specific: line 310
Hunch Interception: When you feel like saying "I found it," "this is the issue," or "I think I see what's happening" - STOP.
- Distinctive: line 314
Isolated Testing Mandate: Before running ANY experiment or test:
- Distinctive: line 318
Test ONE theory at a time
- Distinctive: line 319
STOP on reproduction - do not continue investigating
- Distinctive: line 346
When user explicitly requests skipping methodology:
- Distinctive: line 392
Check cache age: When created? Has lockfile changed since?
- Distinctive: line 393
Test cache bypass: Run with cache disabled to isolate
- Distinctive: line 394
Invalidation strategy: Document proper invalidation
- Distinctive: line 427
No new failures introduced
- Distinctive: line 448
Test on unknown code state (always know what you're testing)
- Distinctive: line 465
Test multiple theories simultaneously (no isolation)
- Distinctive: line 466
Run experiments without designed repro test (action without design)
- Distinctive: line 495
If NO to any item, go back and complete it.
- Distinctive: line 498
After each debugging session, verify:
“Common” is measured: kept by at least 6 in 10 of the 99 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Debugging
<ROLE>Senior Debugging Specialist. Reputation depends on finding root causes, not applying band-aids.</ROLE>
Invariant Principles
- Baseline Before Investigation: Establish clean, known-good state BEFORE any debugging. No baseline = no debugging.
- Prove Bug Exists First: Reproduce the bug on clean baseline before ANY investigation or fix attempts. No repro = no bug.
- Triage Before Methodology: Classify symptom. Simple bugs get direct fixes; complex bugs get structured methodology.
- 3-Fix Rule: Three failed attempts require architectural review, not more tactical fixes.
- Verification Non-Negotiable: No fix is complete without evidence. Always invoke Phase 4 Verification after claiming resolution.
- Track State: Fix attempts AND code state accumulate across methodology invocations. Always know what state you're testing.
- Evidence Over Intuition: "I think it's fixed" is not verification.
- Hunches Require Verification: Before claiming "found it" or "root cause," invoke
verifying-hunchesskill. Eureka is hypothesis until tested. - Isolated Testing: One theory, one test, full stop. No mixing theories, no "trying things," no chaos. Invoke
isolated-testingskill before ANY experiment execution.
Entry Points
| Invocation | Triage | Methodology | Verification |
debugging | Yes | Selected from triage | Auto |
debugging --scientific | Skip | Scientific | Auto |
debugging --systematic | Skip | Systematic | Auto |
scientific-debugging skill | Skip | Scientific | Manual |
systematic-debugging skill | Skip | Systematic | Manual |
Session State
fix_attempts: 0 // Tracks attempts in this session
current_bug: null // Symptom description
methodology: null // "scientific" | "systematic" | null
baseline_established: false // Is clean baseline confirmed?
bug_reproduced: false // Has bug been reproduced on clean baseline?
code_state: "unknown" // "clean" | "modified" | "unknown"Reset on: new bug, explicit request, verified fix.
Phase 0: Prerequisites
<CRITICAL>
**THIS PHASE IS MANDATORY.** Cannot proceed to triage or investigation without completing Phase 0.If you find yourself debugging without having completed this phase, STOP IMMEDIATELY and return here.
</CRITICAL>
0.1 Establish Clean Baseline
Before ANY investigation, establish a known-good reference state.
BASELINE CHECKLIST:
[ ] What is the "clean" state? (upstream main, last known working commit, fresh install)
[ ] Can I reach that clean state?
[ ] What does "working correctly" look like on clean state?
[ ] Have I tested clean state to confirm it works?If working with external code (upstream repo, dependency):
Reach the clean state WITHOUT mutating the current working tree. The checkout may hold
uncommitted work you did not author — the operator's, or another agent's — and
git stash, git checkout, and git pull all act tree-wide.
git fetch origin # Updates origin/main, no working-tree effect
git worktree add ../baseline-check origin/main # Clean state, separate directory
# Build/run in ../baseline-check and verify expected behavior worksTo compare a single file against its committed content, read it; do not mutate:
git show HEAD:<path> # Prints committed content, leaves the tree untouched<CRITICAL>
Do NOT run `git stash`, `git checkout <branch>`, `git pull`, or any other tree-wide
operation to establish the baseline. If a baseline genuinely requires mutating this
working tree, STOP and ask via AskUserQuestion, stating which uncommitted changes are
at risk (`git status --porcelain -uall`) and whether they are recoverable.
</CRITICAL>Record the baseline:
BASELINE ESTABLISHED:
- Reference: [commit SHA / version / state description]
- Verified working: [yes/no + what you tested]
- Date: [timestamp]Set baseline_established = true, code_state = "clean" in session state.
0.2 Prove Bug Exists
<CRITICAL>
**HARD GATE: Cannot investigate or fix a bug you haven't reproduced.**"Someone reported X" is not reproduction. "I think I saw Y" is not reproduction. "The code looks wrong" is not reproduction.
Reproduction means: You personally observed the failure, on a known code state, with a specific test.
</CRITICAL>
Reproduction requirements:
- Start from CLEAN baseline (from 0.1)
- Run SPECIFIC test/action that should trigger bug
- Observe ACTUAL failure (error message, wrong output, crash)
- Record EXACT steps and output
BUG REPRODUCTION:
- Code state: [clean baseline from 0.1]
- Steps to reproduce:
1. [exact step]
2. [exact step]
3. [exact step]
- Expected: [what should happen]
- Actual: [what actually happened - paste output]
- Reproduced: [YES / NO]Set bug_reproduced = true in session state on successful reproduction.
If bug does NOT reproduce on clean baseline:
BUG NOT REPRODUCED on clean baseline.
Options:
A) The bug doesn't exist (or is already fixed)
B) Reproduction steps are incomplete
C) Bug is environment-specific
DO NOT proceed to investigation. Either:
- Refine reproduction steps
- Check if bug was already fixed
- Investigate environment differences0.3 Code State Tracking
Before EVERY test, verify:
CODE STATE CHECK:
- Am I on clean baseline? [yes/no]
- What modifications exist? [list changes]
- Is this the state I INTEND to test? [yes/no]<FORBIDDEN>
- Testing without knowing code state
- Making changes and forgetting what you changed
- Assuming you're on clean state without verifying
- "Let me try this change" without recording it
- Running `git stash`, `git checkout <branch>`, or any tree-wide operation to reach a baseline, without explicit user confirmation
</FORBIDDEN>Phase 1: Triage
<analysis>
Before debugging, assess:
1. What is the exact symptom?
2. Is it reproducible?
3. What methodology fits this symptom type?
</analysis>1.1 Gather Context
Ask via AskUserQuestion:
AskUserQuestion({
questions: [
{
question: "What's the symptom?",
header: "Symptom",
options: [
{ label: "Clear error with stack trace", description: "Error message points to specific location" },
{ label: "Test failure", description: "One or more tests failing" },
{ label: "Unexpected behavior", description: "Code runs but does wrong thing" },
{ label: "Intermittent/flaky", description: "Sometimes works, sometimes doesn't" },
{ label: "CI-only failure", description: "Passes locally, fails in CI" }
]
},
{
question: "Can you reproduce it reliably?",
header: "Reproducibility",
options: [
{ label: "Yes, every time" },
{ label: "Sometimes" },
{ label: "No, happened once" },
{ label: "Only in CI" }
]
},
{
question: "How many fix attempts already made?",
header: "Prior attempts",
options: [
{ label: "None yet" },
{ label: "1-2 attempts" },
{ label: "3+ attempts" }
]
}
]
})1.2 Simple Bug Detection
ALL must be true:
- Clear error with specific location
- Reproducible every time
- Zero prior attempts
- Error directly indicates fix (typo, undefined variable, missing import)
If SIMPLE:
This appears to be a straightforward bug:
[Error]: [specific error message]
[Location]: [file:line]
[Fix]: [obvious fix]
Applying fix directly without methodology.
[Apply fix]
[Proceed to Phase 4 Verification]Otherwise: Proceed to 1.3
1.3 Check 3-Fix Rule
If prior attempts = "3+ attempts":
<THREE_FIX_RULE_WARNING>
You've attempted 3+ fixes without resolving this issue.
Tactical fixes cannot solve architectural problems.
Options:
A) Stop - conduct architecture review with human
B) Continue (type "I understand the risk, continue")
C) Escalate to human architect
D) Create spike ticket
</THREE_FIX_RULE_WARNING>Wait for explicit choice. If B chosen: reset fix_attempts = 0, proceed.
Signs of architectural problem (stop and reassess when present):
- Each fix reveals issues elsewhere
- "Massive refactoring" required
- New symptoms appear with each fix
- Pattern feels fundamentally unsound
Actions when 3-fix rule triggered:
- Fractal exploration: Invoke
fractal-thinkingwith intensityexploreand seed: "Why does [symptom] persist after [N] fix attempts targeting [root causes]?" Invoke when stuck generating new hypotheses after 2+ disproven theories. Use synthesis to produce new hypothesis families. - Question architecture (not just implementation)
- Discuss with human before more fixes
- Consider refactoring vs. tactical fixes
- Document the pattern issue
Phase 2: Methodology Selection
| Symptom | Reproducibility | Route To |
| Intermittent/flaky | Sometimes/No | Scientific |
| Unexpected behavior | Sometimes/No | Scientific |
| Clear error | Yes | Systematic |
| Test failure | Yes | Systematic |
| CI-only failure | Passes locally | CI Investigation |
| Any + 3 attempts | Any | Architecture review |
Test failures: Offer fixing-tests skill as alternative (handles test quality, green mirage):
Test failure detected. Options:
A) fixing-tests skill (Recommended for test-specific issues)
- Handles test quality issues, green mirage detection
B) systematic debugging
- Better when test reveals production bugPresent recommendation with rationale. Respect user choice; warn if user picks B for a test-quality issue (not a production bug) or A when the test is exposing real production behavior.
Phase 3: Execute Methodology
Invoke selected methodology:
/scientific-debuggingfor hypothesis-driven investigation/systematic-debuggingfor root cause tracing
<CRITICAL>
**Hunch Interception:** When you feel like saying "I found it," "this is the issue," or "I think I see what's happening" - STOP. Invoke `verifying-hunches` skill before claiming discovery. Every eureka is a hypothesis until tested.
</CRITICAL><CRITICAL>
**Isolated Testing Mandate:** Before running ANY experiment or test:
1. Invoke `isolated-testing` skill
2. Design the complete repro test BEFORE execution
3. Get approval (unless autonomous mode)
4. Test ONE theory at a time
5. STOP on reproduction - do not continue investigatingChaos indicators (STOP if you catch yourself):
- "Let me try..." / "Maybe if I..." / "What about..."
- Making changes without a designed test
- Testing multiple theories simultaneously
- Continuing after bug reproduces
</CRITICAL>
After Each Fix Attempt
def after_fix_attempt(succeeded: bool):
fix_attempts += 1
if succeeded:
invoke_phase4_verification()
else:
if fix_attempts >= 3:
show_three_fix_warning()
else:
print(f"Fix attempt {fix_attempts} failed.")
print("Returning to investigation with new information...")If "Just Fix It" Chosen
When user explicitly requests skipping methodology:
Proceeding with direct fix (methodology skipped).
WARNING: Lower success rate and higher rework risk.
[Attempt fix]
[Increment fix_attempts]
[If fails, return to Phase 2 with updated count]CI Investigation Branch
<RULE>Use when: passes locally, fails in CI; or CI-specific symptoms (cache, env vars, runner limits).</RULE>
CI Symptom Classification
| Symptom | Likely Cause | Path |
| Works locally, fails CI | Environment parity | Environment diff |
| Flaky only in CI | Resource constraints/timing | Resource analysis |
| Cache-related errors | Stale/corrupted cache | Cache forensics |
| Permission/access errors | CI secrets/credentials | Credential audit |
| Timeout failures | Runner limits | Performance triage |
| Dependency resolution fails | Lock file or registry | Dependency forensics |
Environment Diff Protocol
- Capture CI environment (from logs or CI config):
- Runtime versions (Node/Python/etc)
- OS and architecture
- Environment variables (redact secrets)
- Working directory structure
- Compare to local:
| Variable | Local | CI | Impact | |----------|-------|----|--------| - Identify parity violations: Version mismatches, missing env vars, path differences
Cache Forensics
- Identify cache keys: How is cache keyed? (lockfile hash, branch, manual)
- Check cache age: When created? Has lockfile changed since?
- Test cache bypass: Run with cache disabled to isolate
- Invalidation strategy: Document proper invalidation
Resource Analysis
| Constraint | Symptom | Mitigation |
| Memory limit | OOM killer, exit 137 | Reduce parallelism, larger runner |
| CPU throttling | Timeouts, slow tests | Reduce parallelism, increase timeout |
| Disk space | "No space left" | Clean artifacts, smaller images |
| Network limits | Registry timeouts | Mirrors, retry logic |
CI-Specific Checklist
[ ] Reproduced exact CI runtime version locally
[ ] Compared environment variables (CI vs local)
[ ] Tested with cache disabled
[ ] Checked runner resource limits
[ ] Verified secrets/credentials are set
[ ] Confirmed network access (registries, APIs)
[ ] Checked for CI-specific code paths (CI=true, etc.)
[ ] After identifying cause: fix in CI config OR add local reproduction instructions
[ ] Document the environment requirement
[ ] Add CI parity check to README/CLAUDE.mdPhase 4: Verification
<CRITICAL>Auto-invoke Phase 4 Verification after EVERY fix claim. Not optional.</CRITICAL>
Verification confirms:
- Original symptom no longer occurs
- Tests pass (if applicable)
- No new failures introduced
If verification succeeds:
If verification fails:
Verification failed. Bug not resolved.
[Show what failed]
Returning to debugging...
[Increment fix_attempts, check 3-fix rule, continue]Anti-Patterns
<FORBIDDEN>
**Phase 0 violations:**
- Skip baseline establishment (no clean reference state)
- Investigate without reproducing bug first (prove it exists!)
- Test on unknown code state (always know what you're testing)
- Forget what modifications you've made
- Assume you're on clean state without verifying
- Stash or discard uncommitted changes to reach a baseline instead of using a separate worktreeInvestigation violations:
- Skip verification after fix claim
- Ignore 3-fix warning
- "Just fix it" for complex bugs without warning
- Exceed 3 attempts without architectural discussion
- Apply fix without understanding root cause
- Claim "it works now" without evidence
Methodology violations:
- Say "I found it" or "root cause is X" without invoking verifying-hunches
- Rediscover same theory after it was disproven (check hypothesis registry)
- "Let me try" / "maybe if I" / "what about" (chaos debugging)
- Test multiple theories simultaneously (no isolation)
- Run experiments without designed repro test (action without design)
- Continue investigating after bug reproduces (stop on reproduction)
Winging it:
- Debugging without loading this skill
- Skipping phases because "it's obvious"
- Making elaborate fixes before proving bug exists
</FORBIDDEN>
Self-Check
Before starting investigation:
[ ] Phase 0 completed (baseline + reproduction)
[ ] Clean baseline established and recorded
[ ] Bug reproduced on clean baseline with specific steps
[ ] Code state is known and trackedBefore completing debug session:
[ ] Fix attempts tracked throughout session
[ ] 3-fix rule checked if attempts >= 3
[ ] Phase 4 Verification invoked after fix
[ ] User informed of session outcome
[ ] If methodology skipped, warning was shown
[ ] Code returned to clean state (or changes documented)If NO to any item, go back and complete it.
<reflection>
After each debugging session, verify:
- Root cause was identified (not just symptom addressed)
- Fix was verified with evidence
- 3-fix rule was respected
</reflection><FINAL_EMPHASIS> Evidence or it didn't happen. Three strikes and you're questioning architecture, not code. Verification is not optional - it's how professionals work. </FINAL_EMPHASIS>
Other versions110 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 110
- tursodatabase/turso★ 25ksame name
- JetBrains/intellij-community★ 21ksame name
- DetachHead/rebased★ 6.3ksame name
- mrgoonie/claudekit-skills★ 2.2ksame name
- JetBrains/MPS★ 1.7ksame name
- danieleteti/delphimvcframework★ 1.4ksame name
- glommer/pgmicro★ 1.2ksame name
- karrioapi/karrio★ 799same name
- rapidaai/voice-ai★ 750same name
- i-am-manware/Manware-s-AI-Learning-Toolkit★ 717same name
100 more not listed
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.
Used alongsideProjects with it also use Problem-Solving Techniques, media-processing and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
truongtv22SkillProblem-Solving Techniques
Apply systematic problem-solving techniques for complexity spirals (simplification cascades), innovation blocks (collision-zone thinking), recurring patterns (meta-pattern recognition), assumption constraints (inversion exercise), scale uncertainty (scale game), and dispatch when stuck. Techniques derived from Microsoft Amplifier project patterns adapted for immediate application.
Also in 4 projects that use this
mrgoonieSkillmedia-processing
Process multimedia files with FFmpeg (video/audio encoding, conversion, streaming, filtering, hardware acceleration) and ImageMagick (image manipulation, format conversion, batch processing, effects, composition). Use when converting media formats, encoding videos with specific codecs (H.264, H.265, VP9), resizing/cropping images, extracting audio from video, applying filters and effects, optimizing file sizes, creating streaming manifests (HLS/DASH), generating thumbnails, batch processing images, creating composite images, or implementing media processing pipelines. Supports 100+ formats, hardware acceleration (NVENC, QSV), and complex filtergraphs.
Also in 6 projects that use this
JetBrainsSkillssr
Guide for using Structural Search and Replace in IntelliJ. Use when creating or modifying SSR inspections or search patterns.
Also in 3 projects that use this
mrgoonieSkillweb-frameworks
Build modern full-stack web applications with Next.js (App Router, Server Components, RSC, PPR, SSR, SSG, ISR), Turborepo (monorepo management, task pipelines, remote caching, parallel execution), and RemixIcon (3100+ SVG icons in outlined/filled styles). Use when creating React applications, implementing server-side rendering, setting up monorepos with multiple packages, optimizing build performance and caching strategies, adding icon libraries, managing shared dependencies, or working with TypeScript full-stack projects.
Also in 6 projects that use this
DevNewbie1826Skillremove-ai-slops
Remove AI-generated code slop from branch changes or an explicit file list while preserving behavior. Use when asked to remove slop, clean AI code, deslop, clean up generated code, strip slop, or review generated-code cleanup. Start by locking behavior with regression tests, then use the category and workflow references.
Also in 3 projects that use this
DevNewbie1826Skillprogramming
MUST USE for work on Python, Rust, TypeScript, or Go source files and project manifests. Triggers: write or edit code; new project; Go HTTP service (gin lane); Bubble Tea TUI; CJK IME; Connect-Go RPC; sqlc or pgx; branded IDs; exhaustive matching; unsafe Rust; Miri; oversized file; refactoring; logging, log levels, structured logging, or observability; arena, allocator, bumpalo, const fn, const generics, compile-time programming, zero-allocation APIs, bitfields, repr, scope guards, errdefer-style cleanup, Zig-like patterns, zero-copy parsing, packed data, or FFI; Rust public API design or macros.
Also in 3 projects that use this
- +6 more from mrgoonie
In this repository65 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- documentation-updatesSkill
- spellbook-auditingSkill
- advanced-code-reviewSkill
- adversarial-reviewSkill
- agent2agentSkill
- analyzing-domainsSkill
- analyzing-skill-usageSkill
- assembling-contextSkill
- async-await-patternsSkill
- auditing-green-mirageSkill
- autonomous-modeSkill
- branch-contextSkill
- code-reviewSkill
- creating-issues-and-pull-requestsSkill
- dedupeSkill
- deep-researchSkill
- dehallucinationSkill
- design-explorationSkill
- designing-workflowsSkill
- developSkill
- devils-advocateSkill
- dispatching-parallel-agentsSkill
- distilling-prsSkill
- documenting-projectsSkill
- documenting-toolsSkill
- emotional-stakesSkill
- enforcing-code-qualitySkill
- estimating-ticketsSkill
- executing-plansSkill
- fact-checkingSkill
- finding-dead-codeSkill
- finishing-a-development-branchSkill
- fixing-testsSkill
- fractal-thinkingSkill
- gathering-requirementsSkill
- generating-diagramsSkill
- instruction-engineeringSkill
- isolated-testingSkill
- managing-artifactsSkill
- merging-worktreesSkill
- opportunity-awarenessSkill
- optimizing-instructionsSkill
- polish-repoSkill
- reflexionSkill
- requesting-code-reviewSkill
- resolving-merge-conflictsSkill
- reviewing-design-docsSkill
- reviewing-impl-plansSkill
- reviewing-prsSkill
- rounding-up-worktree-sessionsSkill
- sharpening-promptsSkill
- smart-readingSkill
- test-driven-developmentSkill
- testing-strategySkill
- tooling-discoverySkill
- using-git-worktreesSkill
- using-lsp-toolsSkill
- using-skillsSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

