code-showcase-systematic-debugging
Teaches your agent to investigate and fix bugs methodically. It focuses on finding the root cause before proposing any solution, preventing future problems.
What it does
This system helps find the root cause of code problems using a 4-step method. It focuses on understanding 'why' an error occurs before attempting to fix it.
When to use it
- ✓When an error appears in the code and you don't know the cause.
- ✓When fixing failures in automated tests.
- ✓To investigate unexpected program behavior.
Example of what to ask your AI
“I'm seeing error X, can you help me find the root cause using the 4-phase methodology?”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The system guides you through 4 phases: root cause investigation, pattern analysis, hypothesis and testing, and finally implementation. It insists on finding the original reason before any fix.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add sickn33/agentic-awesome-skills --skill code-showcase-systematic-debuggingOr download just the file:
curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/code-showcase-systematic-debugging/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Systematic Debugging
When to Use
Use this skill when you need four-phase debugging methodology with root cause analysis. Use when investigating bugs, fixing test failures, or troubleshooting unexpected behavior. Emphasizes NO FIXES WITHOUT ROOT CAUSE FIRST.
Core Principle
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
Never apply symptom-focused patches that mask underlying problems. Understand WHY something fails before attempting to fix it.
The Four-Phase Framework
Phase 1: Root Cause Investigation
Before touching any code:
- Read error messages thoroughly - Every word matters
- Reproduce the issue consistently - If you can't reproduce it, you can't verify a fix
- Examine recent changes - What changed before this started failing?
- Gather diagnostic evidence - Logs, stack traces, state dumps
- Trace data flow - Follow the call chain to find where bad values originate
Root Cause Tracing Technique:
1. Observe the symptom - Where does the error manifest?
2. Find immediate cause - Which code directly produces the error?
3. Ask "What called this?" - Map the call chain upward
4. Keep tracing up - Follow invalid data backward through the stack
5. Find original trigger - Where did the problem actually start?
Key principle: Never fix problems solely where errors appear—always trace to the original trigger.
Phase 2: Pattern Analysis
- Locate working examples - Find similar code that works correctly
- Compare implementations completely - Don't just skim
- Identify differences - What's different between working and broken?
- Understand dependencies - What does this code depend on?
Phase 3: Hypothesis and Testing
Apply the scientific method:
- Formulate ONE clear hypothesis - "The error occurs because X"
- Design minimal test - Change ONE variable at a time
- Predict the outcome - What should happen if hypothesis is correct?
- Run the test - Execute and observe
- Verify results - Did it behave as predicted?
- Iterate or proceed - Refine hypothesis if wrong, implement if right
Phase 4: Implementation
- Create failing test case - Captures the bug behavior
- Implement single fix - Address root cause, not symptoms
- Verify test passes - Confirms fix works
- Run full test suite - Ensure no regressions
- If fix fails, STOP - Re-evaluate hypothesis
Critical rule: If THREE or more fixes fail consecutively, STOP. This signals architectural problems requiring discussion, not more patches.
Red Flags - Process Violations
Stop immediately if you catch yourself thinking:
- "Quick fix for now, investigate later"
- "One more fix attempt" (after multiple failures)
- "This should work" (without understanding why)
- "Let me just try..." (without hypothesis)
- "It works on my machine" (without investigating difference)
Warning Signs of Deeper Problems
Consecutive fixes revealing new problems in different areas indicates architectural issues:
- Stop patching
- Document what you've found
- Discuss with team before proceeding
- Consider if the design needs rethinking
Common Debugging Scenarios
Test Failures
1. Read the FULL error message and stack trace
2. Identify which assertion failed and why
3. Check test setup - is the test environment correct?
4. Check test data - are mocks/fixtures correct?
5. Trace to the source of unexpected value
Runtime Errors
1. Capture the full stack trace
2. Identify the line that throws
3. Check what values are undefined/null
4. Trace backward to find where bad value originated
5. Add validation at the source
"It worked before"
1. Use git bisect to find the breaking commit
2. Compare the change with previous working version
3. Identify what assumption changed
4. Fix at the source of the assumption violation
Intermittent Failures
1. Look for race conditions
2. Check for shared mutable state
3. Examine async operation ordering
4. Look for timing dependencies
5. Add deterministic waits or proper synchronization
Debugging Checklist
Before claiming a bug is fixed:
- Root cause identified and documented
- Hypothesis formed and tested
- Fix addresses root cause, not symptoms
- Failing test created that reproduces bug
- Test now passes with fix
- Full test suite passes
- No "quick fix" rationalization used
- Fix is minimal and focused
…
FAQ
Why is it important to find the root cause before fixing?
Fixing only the symptom can mask the real problem, which might return or cause other errors later. Understanding the root cause ensures a definitive fix.
What are 'red flags'?
These are warning signs indicating you might be skipping important steps, like thinking about quick fixes without understanding the problem or trying multiple unsuccessful fixes.
What should I do if I try to fix it and it fails multiple times?
If you attempt three or more fixes and none work, the system suggests stopping. This might indicate a larger structural issue in the code that needs team discussion.
Details
Original description by the author
Four-phase debugging methodology with root cause analysis. Use when investigating bugs, fixing test failures, or troubleshooting unexpected behavior. Emphasizes NO FIXES WITHOUT ROOT CAUSE FIRST.
Popularity
- GitHub stars
- 48k
- Ranking position
- #2580
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
00-andruia-consultant
Helps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
sickn33/agentic-awesome-skills
007
Lets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
sickn33/agentic-awesome-skills
10-andruia-skill-smith
Helps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
sickn33/agentic-awesome-skills
20-andruia-niche-intelligence
Lets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
sickn33/agentic-awesome-skills
Similar skills
benchmark-optimization-loop
Has your agent improve something's speed in a measured way. It tests multiple versions and chooses the fastest one that still works correctly.
affaan-m/ECC
change-impact
Helps your agent analyze the impact of code changes before making them. It compares the planned vs. actual results afterward, covering paths, data, tests, and documentation. Useful for risky or system-wide changes.
affaan-m/ECC
click-path-audit
Lets your agent trace all user buttons and interactions to find bugs. It finds issues where functions seem to work alone but fail together. Useful when bugs persist even after debugging.
affaan-m/ECC