debug-runtime
Use if chasing a reproducible runtime bug or repeated failed fixes with a 4-phase root-cause pass.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use if chasing a reproducible runtime bug or repeated failed fixes with a 4-phase root-cause pass.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | debug-runtime |
| description | Use if chasing a reproducible runtime bug or repeated failed fixes with a 4-phase root-cause pass. |
Language-agnostic systematic debugging. Four mandatory phases before any fix: Investigation → Pattern analysis → Hypothesis testing → Implementation. Works on any runtime, any language. Hands off to a structured user-driven reframe pause after three failed fixes.
Use when one of these is true:
Do NOT use this skill when:
audit-completionBoundary with a structured reframe pause: three failed fixes routes here to a structured user-driven reframe pause with the handoff template. After a structured reframe pause returns, re-enter debug-runtime at Phase 2 with the new framing — never Phase 1.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
An untested fix is a guess dressed as work. A guess that appears to succeed is the worst case — it masks the real mechanism, which returns later as a different symptom.
| Phase | Goal | Exit gate |
|---|---|---|
| 1 — Investigation | Define and reproduce the failure | Symptom card + 10/10 repro + copy-pasteable evidence |
| 2 — Pattern analysis | Identify candidate mechanisms | 1–3 ranked candidates with evidence per row |
| 3 — Hypothesis testing | Confirm one mechanism by falsification | One candidate confirmed by an experiment that could have failed |
| 4 — Implementation | Apply the narrowest fix and verify | Phase 1 repro passes 10/10 + regression guard committed |
Goal: state the failure precisely, reproduce it deterministically, capture evidence a stranger could read.
references/bisection-strategies.md for input-space bisection before continuing.Red flags → restart this phase: "it happens sometimes" (repro not 10/10); "some config mismatch" (no concrete values); "the code looks wrong" (guessing, not observing).
Goal: 1–3 candidate mechanisms, each evidence-backed.
references/root-cause-tracing.md — walk from the symptom frame to the earliest frame where state was still correct.Red flags → back to Phase 1: evidence gap appears (missing log/trace/value); only one candidate is possible (force a second — single-candidate is over-commitment).
Goal: prove or disprove one candidate with an experiment designed to fail if the hypothesis is wrong.
references/instrumentation.md, references/bisection-strategies.md.Red flags → back to Phase 2: the "confirmation" also fits a different mechanism (experiment was not falsifying); product code changed mid-experiment; partial confirmation accepted "because it kind of matched."
Goal: narrowest fix that restores the broken assumption, verified, with a regression guard.
references/defense-in-depth.md to pick the layer (entry / logic / env guard / instrumentation).sleep(n) patterns using references/condition-based-waiting.md.audit-completion — verify nothing else in scope was broken. See references/integration.md for the handoff format.Red flags → back to Phase 3: the repro still fails (hypothesis was wrong, not just the fix); the regression guard passes without the fix (guard does not test the mechanism); new symptoms appear (blast radius widened).
First-class routing table — consult when a phase goes sideways.
| Situation | Stay or route | Destination | Why |
|---|---|---|---|
| Phase 1: repro is not 10/10, need wider frame | Stay | references/bisection-strategies.md (input-space bisection) | Inline technique |
| Phase 2: only "it feels like X" as evidence | Route | a structured reframe pause (workflows/bug-tracing.md) | Stronger reasoning loop re-grounds the investigation |
| Phase 3: 2–3 candidates look equally plausible | Route | a structured reframe pause foundations / evidence-and-falsification | Stronger evidence framework before the experiment |
| Phase 3: "confirmation" also fits a different mechanism | Stay | Back to Phase 2; design the distinguishing test | Do not hand off |
| Fail #1 (first fix didn't stick) | Stay | Re-open Phase 2 inline | Pattern was wrong |
| Fail #2 (second fix didn't stick) | Stay | Re-open Phase 1 inline | Symptom or repro was incomplete |
| Fail #3 — stop fixing | Route | a structured user-driven reframe pause; template in references/integration.md | Architecture-shaped; re-enter Phase 2 after return |
| Phase 4: fix applied, verification passed | Route | audit-completion | Audit for related-but-forgotten scope |
| "Bug" is a design disagreement, not a bug | Don't start | a structured reframe pause | Not a runtime failure |
| No way to run code (env/repo missing) | Don't start | Ask user for a repro, or exit | Phase 1 cannot complete |
Full decision tree with edge cases: references/integration.md.
A "failed fix" = a hypothesis-driven change that did not make Phase 1's repro pass, OR made it pass but introduced a regression. Compilation errors unrelated to the hypothesis do not count.
references/escalation.md and references/integration.md. After a structured reframe pause returns, re-enter at Phase 2 with the new framing.The rule is load-bearing under pressure. Verbatim excuses agents generate to skip it: references/rationalizations.md.
Full set + pressure-scenario sidebars: references/rationalizations.md.
| Rationalization | Counter |
|---|---|
| "Just try this fix and see." | "See" = evidence. Write the falsification prediction before editing. |
| "The senior engineer already diagnosed it." | Their Phase 1 is not yours. Reproduce and read the evidence yourself. |
| "Sunk cost — 4 hours in, can't restart." | The 4 hours are evidence the current path is dead. Restart Phase 1. |
| "We don't have time for root cause — production is down." | Cost of a blind fix that regresses = cost of the outage × 2. |
| "The tests pass now, so it's fixed." | Passing tests without a regression guard prove nothing durable. Add the guard. |
| "I see the issue." (no mechanism stated) | Say the mechanism out loud, or the mechanism has not been seen. |
| "This is an emergency — rules off." | Rules are especially on under pressure. Emergencies multiply the cost of skipping. |
Full list: references/voice.md.
Forbidden phrases: "probably just a quick fix" / "let me just try" / "I know what this is" (without a named mechanism) / "this feels like last time".
Required forms: "Phase 1 symptom card: …" / "Phase 2 candidates: …" / "Phase 3 falsification prediction: …" / "Verification result: …".
| File | Read when |
|---|---|
scripts/find-polluter.md | Test-pollution bisection — documents scripts/find-polluter.sh usage, runner selectors, caveats, expected output |
| File | Read when |
|---|---|
references/workflow-deep.md | The phase block here is too thin — need long worked examples (Node test pollution, Python race, Rust lifetime) |
references/root-cause-tracing.md | Phase 2 — walk backward from symptom frame to earliest-correct-state frame |
references/condition-based-waiting.md | Replace sleep(n) with polling-with-timeout; routes to references/waiting/<lang>.md |
references/defense-in-depth.md | Phase 4 — choose which layer (entry / logic / env guard / instrumentation) the fix belongs at |
references/bisection-strategies.md | "Fails in CI only" / "worked last week" / "only with feature X" / intermittent without code change |
references/instrumentation.md | Phase 2–3 — print/log/stack-trace patterns per language |
references/escalation.md | Any failed fix — 3-fails protocol, pressure sidebars, handoff format |
references/integration.md | Unsure whether to stay in-skill or route to a structured reframe pause / audit-completion |
references/rationalizations.md | The urge to skip Phase 1 or Phase 3 — counter table + 5 pressure scenarios |
references/voice.md | Writing progress updates — forbidden phrases and required forms |
references/cross-runtime.md | Running on a non-Claude runtime — ask-user-tool lookup for the 3-fails handoff |
| File | Language / framework |
|---|---|
references/waiting/typescript.md | Jest / Vitest |
references/waiting/python.md | pytest + asyncio |
references/waiting/rust.md | tokio + cancellation tokens |
references/waiting/go.md | stdlib testing.T polling |
references/waiting/swift.md | XCTest + async/await |
references/waiting/ruby.md | RSpec + timeout gems |
references/waiting/java.md | JUnit 5 + awaitility |
| File | Scenario |
|---|---|
references/pressure-tests/academic.md | Calm baseline — method works without pressure |
references/pressure-tests/pressure-financial.md | $15k/min outage — time pressure vs. Iron Law |
references/pressure-tests/pressure-sunk-cost.md | 4 hours in — restart vs. one-more-try |
references/pressure-tests/pressure-authority.md | Senior engineer says X — verify independently or defer |
Before declaring a bug fixed, produce these artifacts in order. Do not batch them to the end — each must be visible in the session transcript.
Root cause: <frame / boundary / layer> — <violated assumption>
Mechanism: <X caused Y because Z>
Narrowest fix location: <file/function/layer>
audit-completion handoff, or "close and ship"| Do this | Not that |
|---|---|
| Reproduce 10/10 before theorizing | Form a hypothesis, then try to reproduce |
| Phases 1–3 are read-only on product code | Edit product code while "investigating" |
| Write the false-case prediction before running the experiment | Decide what "confirms" the hypothesis after running |
| Cite a trace/log/diff/test/config for every claim | "It seems like…" / "I think it's…" |
| Fail #1–#2 → re-open prior phases; Fail #3 → route to a structured reframe pause (Interactive) | Try fix #4, #5, #6 |
| Add a regression guard before declaring done | "The tests pass, shipping" |
| Treat the senior's diagnosis as a candidate, not a verdict | Skip Phase 1 because "they already figured it out" |
debug-runtime as the next step (no infinite regress). State which phase to re-enter.Recovery moves:
references/bisection-strategies.md); do not proceed with a flaky repro.references/integration.md; do not retry.Before declaring done, confirm:
audit-completion (or explicit "close and ship")Use if driving agent-browser for webpage interaction, screenshots, @ref snapshots, tabs, UI verification, CDP attach, Steel Browser, or cloud providers (Browser Use, Browserbase, Browserless, Kernel).
Use if verifying claimed-done work or auditing session/plan/branch completion with evidence.
Use if creating, redesigning, or merging a Claude skill, with research before writing SKILL.md.
Use skill if you are running repeatable Codex reviews across lenses or branches, optionally verifying and fixing confirmed findings in isolated worktrees.
Use if running deep multi-file research over 5+ entities or a market — wave-dispatched corpus.
Use if finishing a project — review and merge every branch/worktree into main, retire dead branches.