
performing-systematic-debugging-for-stubborn-problems
Applies a modified Fagan Inspection methodology to systematically resolve persistent bugs and complex issues. Use when multiple previous fix attempts have failed repeatedly, when dealing with intricate system interactions, or when a methodical root cause analysis is needed. Do not use for simple troubleshooting. Triggers after multiple failed debugging attempts on the same complex issue.
- Installs
- 66
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/sammcj/agentic-coding --skill performing-systematic-debugging-for-stubborn-problems- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads performing-systematic-debugging-for-stubborn-problems automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Systematic Debugging with Fagan Inspection
This skill applies a modified Fagan Inspection methodology for systematic problem resolution when facing complex problems or stubborn bugs that have resisted multiple fix attempts.
Process Overview
Follow these four phases sequentially. Do not skip phases or attempt fixes before completing the inspection.
Phase 1: Initial Overview
Establish a clear understanding of the problem before analysis:
- Explain the problem in plain language without technical jargon
- State expected behaviour - what should happen
- State actual behaviour - what is happening instead
- Document symptoms - error messages, logs, observable failures
- Context - when does it occur, how often, under what conditions
Output: A clear problem statement that anyone could understand.
Phase 2: Systematic Inspection
Perform a line-by-line walkthrough as the "Reader" role in Fagan Inspection. Identify defects without attempting to fix them yet - this is pure inspection.
Check against these defect categories:
-
Logic Errors
- Incorrect conditional logic (wrong operators, inverted conditions)
- Loop conditions (infinite loops, premature termination)
- Control flow issues (unreachable code, wrong execution paths)
-
Boundary Conditions
- Off-by-one errors
- Edge cases (empty inputs, null values, maximum values)
- Array/collection bounds
-
Error Handling
- Unhandled exceptions
- Missing validations
- Silent failures (errors caught but not logged)
- Incorrect error recovery
-
Data Flow Issues
- Variable scope problems
- Data transformation errors
- Type mismatches or coercion issues
- State management (stale data, race conditions)
-
Integration Points
- API calls (incorrect endpoints, malformed requests, missing headers)
- Database interactions (query errors, transaction handling)
- External dependencies (version mismatches, configuration issues)
- Timing issues (async/await problems, race conditions)
Think aloud during this phase. For each section of code:
- State what the code is intended to do
- Identify any discrepancies between intent and implementation
- Flag assumptions or unclear aspects
- Use ultrathink to think deeper on complex sections
Output: A categorised list of identified defects with line numbers and specific descriptions.
Phase 3: Root Cause Analysis
After identifying issues, trace back to find the fundamental cause - not just symptoms.
Five Whys Technique:
- Ask "why" repeatedly (at least 3-5 times) to get to the underlying issue
- State each "why" explicitly in your analysis
- Example:
- Why did the API call fail? → Because the request was malformed
- Why was it malformed? → Because the data wasn't serialised correctly
- Why wasn't it serialised? → Because the serialiser expected a different type
- Why did it expect a different type? → Because the schema was updated but code wasn't
- Root cause: Schema versioning mismatch between services
Consider:
- Environmental factors (configuration, dependencies, runtime environment)
- Timing and concurrency (race conditions, async issues)
- Hidden assumptions in the code or system design
- Historical context (recent changes, migrations, updates)
State assumptions explicitly:
- "I'm assuming X because..."
- "This presumes that Y is always..."
- Flag any assumptions that need verification
Output: A clear statement of the root cause, the chain of reasoning that led to it, and any assumptions that need validation.
Phase 4: Solution & Verification
Now propose specific fixes for each identified issue.
For each proposed solution:
- Describe the fix - what code/configuration changes are needed
- Explain why it resolves the root cause - connect it back to Phase 3 analysis
- Consider side effects - what else might this change affect
- Define verification steps - how to confirm the fix works
Verification Planning:
- Specific test cases that would have caught this bug
- Manual verification steps
- Monitoring or logging to add
- Edge cases to validate
Output: A structured list of fixes with verification steps.
Important Guidelines
- Complete each phase thoroughly before moving to the next
- Think aloud - verbalise your reasoning throughout
- State assumptions explicitly rather than making implicit ones
- Flag unclear aspects rather than guessing - if something is uncertain, say so
- Use available tools - read files, search code, run tests, check logs
- Focus on systematic analysis over quick fixes
- Validate flagged aspects - after completing all phases, revisit any unclear points and use the think tool with "ultra" depth if needed to clarify them
Final Output
After completing all four phases, provide:
- Summary of findings - key defects and root cause
- Proposed solutions - prioritised list with rationale
- Verification plan - how to confirm fixes work
- Next steps - unless the user indicates otherwise, proceed to implement the proposed solutions
When This Skill Should NOT Be Used
- For simple, obvious bugs with clear fixes
- When the first debugging attempt is still underway
- For new features (this is for debugging existing code)
- When the problem is clearly environmental (config, infrastructure) and doesn't require code inspection
FAQ
What does the performing-systematic-debugging-for-stubborn-problems skill do?
Applies a modified Fagan Inspection methodology to systematically resolve persistent bugs and complex issues. Use when multiple previous fix attempts have failed repeatedly, when dealing with intricate system interactions, or when a methodical root cause analysis is needed. Do not use for simple troubleshooting. Triggers after multiple failed debugging attempts on the same complex issue.
How do I install performing-systematic-debugging-for-stubborn-problems?
Run npx skills add https://github.com/sammcj/agentic-coding --skill performing-systematic-debugging-for-stubborn-problems in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/performing-systematic-debugging-for-stubborn-problems/ (personal) or .claude/skills/performing-systematic-debugging-for-stubborn-problems/ (project).
Which AI agents can use performing-systematic-debugging-for-stubborn-problems?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is performing-systematic-debugging-for-stubborn-problems safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains performing-systematic-debugging-for-stubborn-problems?
It is published by sammcj in sammcj/agentic-coding. It has 66 recorded installs.
More from sammcj/agentic-coding
critical-thinking-logical-reasoning
sammcj/agentic-coding
Critically analyse the reasoning in written content (articles, blogs, transcripts, reports), not code. Use only when explicitly asked to critically analyse or critique an argument.
writing-documentation-with-diataxis
sammcj/agentic-coding
Applies the Diataxis framework to create or improve technical documentation. Use when being asked to write high quality tutorials, how-to guides, reference docs, or explanations, when reviewing documentation quality, or when deciding what type of documentation to create. Helps identify documentation types using the action/cognition and acquisition/application dimensions.
creating-development-plans
sammcj/agentic-coding
Creates structured development plans with phased task breakdowns, requirements, and QA checklists. Use when the user explicitly asks to create a dev plan, development plan, or document development requirements.
ghostty-config
sammcj/agentic-coding
Open the skill to read its SKILL.md instructions.
code-simplification
sammcj/agentic-coding
Use this skill when you need to review and refactor code to make it simpler, more maintainable, and easier to understand. Helps with identifying overly complex solutions, unnecessary abstractions.
prompt-enhancer
sammcj/agentic-coding
Open the skill to read its SKILL.md instructions.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.