Debugging patterns
Skill synaptiai/synapti-marketplace/plugins/flow/skills/debugging-patterns
The Synapti Marketplace is a curated collection of Claude Code plugins designed for AI-augmented development + advanced analytical and research tasks. Each plugin provides specialized agents, skills, and commands that extend Claude Code's capabilities in specific domains.
npx -y skills add synaptiai/synapti-marketplace --skill debugging-patternsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Isolate root causes through structured evidence gathering, pattern analysis, hypothesis testing (max 3 at a time, highest confidence first), and fix validation with a reproducing test before implementation. Use when any verification step fails, tests break, or debugging a reported bug. This skill MUST be consulted because symptom-fixing creates new bugs, and unbounded hypothesis testing causes tunnel vision; root cause must be proven before any fix attempt.
SKILL.md
6.0 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it
Debugging Patterns
Domain skill for structured investigation of bugs and unexpected behavior.
Iron Law
ALWAYS FIND ROOT CAUSE BEFORE ATTEMPTING FIXES. Symptom fixes are failure.
A fix that doesn't address root cause creates a new bug later. Every. Single. Time.
Four-Phase Investigation
1. Gather Evidence
Collect before theorizing:
# Error logs, stack traces, recent changes
git log --oneline -10
git diff HEAD~3..HEAD --stat
- Read error messages and stack traces FULLY — don't skim
- Check logs in chronological order around the failure
- Note what changed recently (
git log,git diff) - Reproduce the error — if you can't reproduce it, you can't verify the fix
2. Pattern Analysis
Look for patterns in the evidence:
- When does it fail vs succeed? (inputs, timing, environment)
- What's different between working and broken states?
- Is the error consistent or intermittent?
- Use
Grepto find similar patterns: error messages, function calls, data flows
3. Hypothesis Testing
Form and test hypotheses systematically. Use TaskCreate for each hypothesis:
TaskCreate("Hypothesis 1: {theory}", "Confidence: High\nTest: {specific test}\nEvidence: {what points here}")
TaskCreate("Hypothesis 2: {theory}", "Confidence: Medium\nTest: {specific test}\nEvidence: {what points here}")
TaskCreate("Hypothesis 3: {theory}", "Confidence: Low\nTest: {specific test}\nEvidence: {what points here}")
| # | Hypothesis | Confidence | Test | Result |
|---|---|---|---|---|
| 1 | {theory} | High/Med/Low | {specific test} | {outcome} |
| 2 | {theory} | High/Med/Low | {specific test} | {outcome} |
| 3 | {theory} | High/Med/Low | {specific test} | {outcome} |
For each hypothesis: TaskUpdate(status: "in_progress") before testing, TaskUpdate(status: "completed") after — whether confirmed or disproven. Record the result.
Rules:
- Maximum 3 hypotheses at a time (more means insufficient evidence — go back to phase 1)
- Test highest confidence first
- Test ONE at a time — never change two things simultaneously
- A disproven hypothesis is progress, not failure
4. Fix Validation
Write a test that reproduces the bug BEFORE fixing. If the test doesn't fail, you haven't found the bug.
TaskCreate("Fix validation", "Write reproducing test, implement fix, verify no regressions")
TaskUpdate("Fix validation", status: "in_progress")
- Write failing test that captures the bug behavior
- Verify the test fails for the right reason
- Implement the fix
- Verify the test passes
- Run full test suite — no regressions
TaskUpdate("Fix validation", status: "completed") after all tests pass. Use TaskList to confirm all hypotheses resolved and fix validated.
Verification Failure Mode
This skill activates automatically when ANY verification step fails — not just for bug-labeled issues:
- Build failure: Read error output, fix, rebuild
- Test failure: Read test output, trace to root cause, fix
- Server start failure: Read logs, fix configuration or code, retry
- Smoke test failure: Read response, trace to handler, fix
- E2E failure: Read failure screenshot/logs, trace to root cause, fix
- Visual verification failure: Read screenshot, identify rendering issue, fix
Streamlined investigation: read error fully, form 1-2 hypotheses, fix and re-verify. No elaborate investigation needed for clear error messages — just fix and move on.
Log-First Methodology
Read logs and errors BEFORE reading code:
- Start at the error — read the full error message and stack trace
- Trace backward — follow the data flow from error to origin
- Check boundaries — inputs, API responses, config values at each step
- Only then read code — now you know WHERE to look
Never start with "let me read the code and understand how it works." Start with "what went wrong and where."
Stop Conditions
| Trigger | Action |
|---|---|
| 3+ failed fix attempts | Stop fixing forward. The problem is architectural. Return to EXPLORE. |
| Can't explain current behavior | Don't guess. Investigate more. Add logging, add assertions. |
| Tunnel vision (>30 min on one theory) | Step back. List what you KNOW vs what you ASSUME. |
| Fix works but you can't explain WHY | Revert. An unexplained fix is a time bomb. |
Cognitive Bias Awareness
| Bias | Symptom | Antidote |
|---|---|---|
| Confirmation bias | Only looking for evidence that confirms your theory | Actively seek DISCONFIRMING evidence |
| Anchoring | First theory dominates even after disproof | Write down ALL hypotheses before testing any |
| Recency bias | Blaming the last change | Check if the bug existed before the last change: git stash && test |
| Complexity bias | Assuming an elaborate cause | Check the simple things first: typos, wrong variable, off-by-one |
Rationalization Prevention
| Excuse | Response |
|---|---|
| "I know what's wrong" | Then prove it with evidence. If you're right, it takes 30 seconds. |
| "Quick fix, then proper fix later" | Later never comes. Fix root cause now. |
| "It works on my machine" | Then the bug is in environment differences. Investigate THAT. |
| "Let me just add a try-catch" | That's hiding the bug, not fixing it. Find the root cause. |
| "It's probably a race condition" | Probably? Prove it. Add timing logs, reproduce it reliably. |