skills/workflow/systematic-debugging/SKILL.md
Use when encountering any bug, test failure, build error, or unexpected behavior — before proposing fixes or making changes.
npx skillsauth add faysilalshareef/dotnet-ai-kit systematic-debuggingInstall 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.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
If you haven't completed Phase 1, you cannot propose fixes.
Violating the letter of this process is violating the spirit of debugging.
Use for ANY technical issue:
dotnet test reports failures)dotnet build fails)Use this ESPECIALLY when:
Complete each phase before proceeding to the next.
BEFORE attempting ANY fix:
1. Read Error Messages Carefully
---> System.InvalidOperationException)2. Reproduce Consistently
dotnet test --filter "TestName"?3. Check Recent Changes
git diff — what changed since it last worked?git log --oneline -10 — recent commits4. Gather Evidence in Multi-Layer Systems
For .NET solutions with multiple projects/layers:
For EACH layer boundary:
- What data enters this layer?
- What data exits this layer?
- Are DI registrations correct at each level?
- Is configuration propagating correctly?
Run once to gather evidence showing WHERE it breaks.
THEN investigate that specific layer.
5. Trace Data Flow
1. Find Working Examples
2. Compare Against References
rules/3. Identify Differences
1. Form Single Hypothesis
2. Test Minimally
3. Verify
1. Create Failing Test
dotnet test --filter "BugReproTest")2. Implement Single Fix
3. Verify Fix
dotnet build clean?4. If Fix Doesn't Work — Count Your Attempts
If 3 or more fixes have failed, the problem is probably architectural.
Signals of an architectural problem:
STOP and question fundamentals:
.NET-Specific Escalation Examples:
Discuss with the user before attempting more fixes.
| Excuse | Reality | |--------|---------| | "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. | | "Emergency, no time for process" | Systematic is FASTER than guess-and-check thrashing. | | "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. | | "I see the problem, let me fix it" | Seeing symptoms is not understanding root cause. | | "The error message tells me what to fix" | Error messages show symptoms, not always causes. | | "I'll write a test after confirming fix" | Untested fixes don't stick. Test first. | | "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. | | "One more fix attempt" (after 2+) | 3+ failures = architectural problem. Stop. | | "It worked in another project" | This project has different constraints. Investigate this context. |
All of these mean: STOP. Return to Phase 1.
| Phase | Key Activities | Done When | |-------|---------------|-----------| | 1. Root Cause | Read errors, reproduce, check changes, trace data | Understand WHAT and WHY | | 2. Pattern | Find working examples, compare differences | Know what's different | | 3. Hypothesis | Form theory, test one variable | Confirmed or new theory | | 4. Implementation | Create test, fix, verify | Bug resolved, all tests green |
Find the root cause. Then fix it. Never guess.
data-ai
Use when about to claim work is complete, fixed, passing, or ready — before committing, creating PRs, or moving to the next task. Requires running verification commands and confirming output before making any success claims.
development
Use when checkpointing, wrapping up, or handing off an AI-assisted development session.
development
Use when following the Specification-Driven Development lifecycle from plan through ship.
development
Use when receiving code review feedback from CodeRabbit, PR reviewers, or human reviewers — before implementing any suggested changes.