From debugging
Systematic debugging framework with root cause investigation, tracing, defense-in-depth validation, and verification. Use when: 'bug', 'test failure', 'unexpected behavior', 'error', 'not working', 'broken', before proposing fixes, when encountering any technical issue
How this skill is triggered — by the user, by Claude, or both
Slash command
/debugging:debuggingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST**
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
If you haven't completed root cause investigation, you cannot propose fixes.
Use for ANY technical issue:
Use this ESPECIALLY when:
| Phase | Key Activities | Success Criteria |
|---|---|---|
| 1. Root Cause | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
| 2. Pattern | Find working examples, compare | Identify differences |
| 3. Hypothesis | Form theory, test minimally | Confirmed or new hypothesis |
| 4. Implementation | Create test, fix, verify | Bug resolved, tests pass |
If you notice yourself considering:
ALL of these mean: STOP. Return to Phase 1.
If 3+ fixes failed: Question the architecture (not just symptoms)
# Layer 1: Workflow
echo "=== Secrets available in workflow: ==="
echo "VAR: ${VAR:+SET}${VAR:-UNSET}"
# Layer 2: Build script
echo "=== Env vars in build script: ==="
env | grep VAR || echo "VAR not in environment"
# Layer 3: Target script
echo "=== State at execution: ==="
./script.sh --verbose
# Reveals: Which layer fails
// Before problematic operation
async function operation(param: string) {
const stack = new Error().stack;
console.error('DEBUG operation:', {
param,
cwd: process.cwd(),
env: process.env.NODE_ENV,
stack,
});
await doRiskyThing(param);
}
// Layer 1: Entry validation
function createThing(path: string) {
if (!path || path.trim() === '') {
throw new Error('path cannot be empty');
}
// Layer 2: Business logic
if (!existsSync(path)) {
throw new Error(`path does not exist: ${path}`);
}
// Layer 3: Environment guard
if (process.env.NODE_ENV === 'test') {
if (!path.startsWith(tmpdir())) {
throw new Error('Test operations must use temp dir');
}
}
// Layer 4: Debug instrumentation
logger.debug('Creating thing', { path, caller: new Error().stack });
// Now safe to proceed
}
This skill works with:
From debugging sessions:
The Bottom Line:
This is non-negotiable.
npx claudepluginhub ggprompts/my-plugins --plugin debugging<!-- AUTO-GENERATED by export-plugins.py — DO NOT EDIT -->
Enforces systematic root cause investigation for bugs, test failures, and unexpected behavior through four phases: investigation, pattern analysis, hypothesis testing, and implementation.
Enforces four-phase debugging (root cause investigation, pattern analysis, hypothesis testing, implementation) for bugs, test failures, performance issues, and unexpected behavior before any fixes.