ce-debug
Debug and Fix
Find the root cause of a failure, then — when the user chooses to — fix it with test-first discipline.
Done when: the causal chain from trigger to symptom is stated with no gaps and file:line evidence, and either a verified fix has been handed off (PR, commit, or the user's chosen stop) or a diagnosis-only summary has been delivered. Escalate rather than persist: 2-3 hypotheses exhausted without confirmation, or 3 failed fix attempts, means diagnose why instead of trying again — that is the smart escalation references/investigate.md describes. One hypothesis, one change at a time; changing several to see what helps is shotgun debugging.
<bug_description> is whatever this skill was invoked with — a failure description, a mode: token, or an issue reference (#123, org/repo#123, an issue URL) — from the user or from a calling skill (ce-babysit-pr / lfg in mode:pipeline pass the failing jobs and log tails; lfg's defect route passes mode:return-to-caller and the user's own reference). Blank if nothing was provided.
Mode
Default is interactive: investigate, run the Phase 2 fix-choice gate, then the Phase 4 handoff.
mode:pipeline (set by an orchestrator such as ce-babysit-pr or lfg): run fully non-interactively and never call the blocking-question tool. Strip the token from <bug_description>, then read references/pipeline-mode.md and follow it — it overrides every "ask the user" point with a conservative default, replaces the Phase 2 fix-gate with "fix convergent bugs, defer divergent ones", and replaces the Phase 4 handoff with a structured return whose status is exactly one of fixed-and-pushed | fixed-not-pushed | diagnosed-no-fix | flaky-infra | needs-human. The caller branches on those exact spellings, so never rename, abbreviate, or add to them.
mode:return-to-caller (set by lfg on its defect route): run non-interactively, but the caller owns everything after the fix. Strip the token, then read references/return-to-caller.md and follow it — it keeps Phases 0-3 and the convergent-or-defer fix boundary, applies the Phase 3 branch rule so the fix lands on a feature branch, commits the fix-owned files without pushing, skips the post-fix polish and review steps, and returns a structured result whose status is exactly one of fixed | diagnosed-no-fix | needs-human | blocked. The same spelling rule applies.