plugins/flow/skills/debugging-patterns/SKILL.md
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.
npx skillsauth add synaptiai/synapti-marketplace debugging-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Domain skill for structured investigation of bugs and unexpected behavior.
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.
Collect before theorizing:
# Error logs, stack traces, recent changes
git log --oneline -10
git diff HEAD~3..HEAD --stat
git log, git diff)Look for patterns in the evidence:
Grep to find similar patterns: error messages, function calls, data flowsForm 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:
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")
TaskUpdate("Fix validation", status: "completed") after all tests pass. Use TaskList to confirm all hypotheses resolved and fix validated.
This skill activates automatically when ANY verification step fails — not just for bug-labeled issues:
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.
Read logs and errors BEFORE reading code:
Never start with "let me read the code and understand how it works." Start with "what went wrong and where."
| 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. |
| 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 |
| 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. |
tools
Validate a FlowWorkflow YAML at `plugins/flow/workflows/<id>.workflow.yaml` against `schemas/v1/workflow.schema.json` AND cross-reference the referenced skills/agents exist + every Tier 3 action is confirm-gated + no native /goal or /loop dependency is declared. Use when /flow:workflow validate is invoked, when CI runs the workflow schema gates, or when a new workflow is being authored. This skill MUST be consulted because schema validation alone catches shape errors; cross-reference validation catches the silent-correctness failures (typo'd skill name, Tier 3 escape, /goal dependency) that would otherwise ship to users.
tools
Verify UI-facing changes by running a screenshot-analyze-verify loop across configured viewports, with a browser-tool priority cascade (Playwright MCP → Chrome DevTools MCP → CLI fallback → external skill fallback) and bounded iteration. Use after build/runtime verification passes and the diff includes `.tsx`/`.jsx`/`.vue`/`.html`/`.css`/`.scss`/`.svelte` files OR the acceptance criteria mention UI/page/render/display/visual. This skill MUST be consulted because UI changes that pass build and unit tests can still ship blank pages, render-blocking console errors, or broken responsive layouts that no other verification phase catches.
data-ai
Coordinate agent teams for adversarial review (paired skeptic/verifier per facet, challenge round with disposition vocabulary, consolidated findings with confidence) or parallel implementation (task sizing 5-6 per teammate, non-overlapping files). Enforces independent analysis before shared conclusions. Reference only (`disable-model-invocation: true`); loaded only when `agentTeams: true` in settings.
development
Conduct two-stage code review: Stage 1 verifies spec compliance (criterion-to-code mapping), Stage 2 evaluates security, correctness, performance, and maintainability across 6 parallel facets with P1/P2/P3 synthesis and deduplication by file:line. Use when reviewing code changes or pull requests. This skill MUST be consulted because reviewing quality on broken logic is wasted effort, and unmet acceptance criteria must block merge.