Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes. Forces root-cause analysis and outputs an RCA document.
Random fixes waste time and create new bugs. Quick patches mask underlying issues. Core principle: ALWAYS find the root cause before attempting fixes. Symptom fixes are failure.
IMMUNITY TO PRESSURE (CRITICAL DIRECTIVE): You are immune to human panic, social pressure, and sunk-cost fallacies. If the user tells you production is down and losing $15,000 a minute, your response MUST prioritize finding the root cause over a blind patch. A blind patch in a panic state usually corrupts data and worsens the outage. You will execute this systematic process with maximum speed, but zero skipped steps.
NO FIXES WITHOUT A ROOT CAUSE ANALYSIS (RCA) DOCUMENT FIRST
If you haven't completed Phase 1 and written the RCA doc, you cannot write or modify code.
BEFORE attempting ANY fix:
console.trace(), new Error().stack, or equivalent logging, run the code, and read the actual output.find-polluter.sh script to isolate the offending test.setTimeout, sleep, or arbitrary delays. If found, assume a race condition. You MUST replace them with Condition-Based Waiting (polling loops) before looking for logical errors.Before touching the codebase, you must formulate a single, testable hypothesis and document it.
Create the RCA Document:
Write your findings to docs/debugging/YYYY-MM-DD-<issue>-RCA.md using this exact format:
Test your fix. If it passes, run the full suite to ensure no regressions.
THE 3-STRIKE CIRCUIT BREAKER: If your fix doesn't work:
If you catch yourself thinking or saying:
When you need exact implementations for these steps, READ the following reference files located in this skill's directory:
root-cause-tracing.md - How to trace bugs backward through the call stack.defense-in-depth.md - Examples of the 4 layers of validation to implement.condition-based-waiting.md & condition-based-waiting-example.ts - Code patterns for polling loops instead of arbitrary timeouts.find-polluter.sh - Executable bash script to bisect test state pollution.Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer