Use this skill when debugging failures, investigating errors, fixing bugs, or when multiple fix attempts have failed. Enforces root cause investigation before any fixes. Triggers on error messages, test failures, "it's not working", or repeated fix attempts.
This skill inherits all available tools. When active, it can use any tool Claude has access to.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
If you've tried 2+ fixes and they haven't worked, STOP. You're guessing, not debugging.
git diff, recent commitsTechnique: Root Cause Tracing
Trace backward through the call stack until you find the original trigger:
1. Observe symptom (error at specific location)
2. Find immediate cause (what code directly causes this?)
3. Ask: What called this?
4. Keep tracing up (what value was passed?)
5. Find original trigger (where did invalid data come from?)
NEVER fix just where the error appears. Trace back to find the original trigger.
When tracing bugs, add logging at EVERY component boundary:
async function processData(input: Data) {
const stack = new Error().stack;
console.error('DEBUG processData:', {
input,
inputType: typeof input,
cwd: process.cwd(),
nodeEnv: process.env.NODE_ENV,
stack,
});
// ... proceed
}
console.error() in tests (not logger - may be suppressed)npm test 2>&1 | grep 'DEBUG processData'Single validation: "We fixed the bug" Multiple layers: "We made the bug impossible"
The Four Layers:
// Layer 1: Entry point
function createProject(name: string, dir: string) {
if (!dir?.trim()) throw new Error('Directory required');
if (!existsSync(dir)) throw new Error('Directory must exist');
}
// Layer 2: Business logic
function initializeWorkspace(projectDir: string) {
if (!projectDir) throw new Error('projectDir required');
}
// Layer 3: Environment guards
async function gitInit(directory: string) {
if (process.env.NODE_ENV === 'test') {
if (!normalized.startsWith(tmpDir)) {
throw new Error('In test: git init only in temp dirs');
}
}
}
// Layer 4: Debug instrumentation
async function gitInit(directory: string) {
logger.debug('About to git init', { directory, cwd, stack });
}