refactor-whats-wrong
What's Wrong? — Systematic Root-Cause Debugging — refactor-chain · DEBUG lane
Bundle: refactor-chain (self-diagnosing, self-healing fix-it pipeline).
Phase: do-the-work (debug) · Prerequisite: diagnose (harness classified the case as debug/whats-wrong) · Next: review gate → docs → ship.
Adaptivity / conditional: repo-agnostic; conditional DAG tactics activate only when an Airflow dags/ directory (or an apache-airflow dependency) is detected by the harness signal airflow-dags.
Purpose
Find the true origin of a reproducible bug and fix it there — not where the error happens to surface. This skill runs a disciplined loop: reproduce the failure reliably, form one hypothesis at a time, design the smallest probe that would confirm or refute it, and trace the symptom backward along an evidence chain until you reach the earliest broken assumption. Only then do you fix, and only then do you verify the fix against the original reproduction.
When to use
- Something that used to work now fails, or fails only in certain conditions. Triggers: "why is this broken", "it stopped working", "regression".
- A concrete error, crash, or failing test. Triggers: "it throws X", "it crashes when I click Y", "this test fails".
- The bug is (or can be made) reproducible. If it is not yet reproducible, Phase 1 makes it so before anything else.
- Not for: performance-only complaints (use
refactor-web-performance), memory growth over time (userefactor-code-memory), or "add a new feature" requests (out of scope for refactor-chain).