옵션

버그 및 실패한 동작에 대한 진단 루프. 오류, 스택 추적, 회귀, 실패한 테스트, 이슈 트래커 버그, 수정 후 실패로 인해 멈춰버린 조사, 또는 버그 디버깅/수정을 위한 요청에 사용하십시오.

...모든 것을 확장하십시오
13
업데이트 된 시간 2026년 8월 26일

ce-debug 소개

버그의 근본 원인을 찾아서 선택적으로 수정하는 체계적인 디버깅 기술입니다. 오류 디버깅, 테스트 실패 조사, GitHub, Linear 또는 Jira와 같은 이슈 트래커에서 버그 재현, 실패한 수정 시도 후에도 문제가 지속되는 경우(사용자가 스택 트레이스나 오류 메시지를 붙여넣거나 '이것을 디버깅해', '왜 이것이 실패하는지', '이 버그를 수정해'라고 말하는 경우 포함)에 사용됩니다. 그 핵심 원칙은 수정 전에 조사하는 것입니다: 트리거에서 증상까지의 전체 인과 관계를 간격 없이 설명할 수 있을 때까지는 수정안을 제안하지 않으며, '어쨌든 X가 Y로 이어진다'는 것은 간격으로 간주됩니다.

작업은 정의된 실행 흐름을 통해 진행됩니다. 0단계에서는 입력을 분류하며, 트래커가 참조될 경우 이슈 내용을 가져옵니다(GitHub의 경우 제목, 본문, 댓글, 라벨을 포함하는 gh issue view 사용) 및 전체 댓글 스레드를 읽습니다. 나중에 달린 댓글에는 종종 업데이트된 재현 단계나 이전의 실패한 시도가 담겨 있기 때문입니다. 단순 버그의 고속 경로에서는 명백한 한 줄 수정안을 제시할 수 있지만, 편집 전에 '수정 또는 진단' 사용자 선택 게이트를 실행합니다. 1단계에서는 버그를 재현하고, 환경의 정상성을 확인하며(올바른 브랜치, 설치된 종속성, 예상되는 런타임 버전, 필요한 환경 변수, 오래된 빌드 산출물 없음), 관측된 값을 사용하여 증상이 유효한 상태가 처음 무효화된 곳까지 코드 경로를 역추적합니다.

2단계에서는 불확실한 연결부에 대한 예측이 포함된 가설을 수립합니다. 만약 수정이 작동하는 것처럼 보이지만 예측이 틀렸다면, 이는 증상만 찾은 것이지 원인을 찾은 것이 아닙니다. 총기 난사식 디버깅을 피하기 위해 한 번에 하나의 변경만 수행합니다. 3단계에서는 사용자가 선택한 경우에만 수정을 구현하며, 테스트 우선 원칙과 '미커밋 작업 확인 및 기본 브랜치에서 분기 생성을 위한 프롬프트'와 같은 워크스페이스 안전성 검사를 따릅니다. 4단계에서는 구조화된 인수인계 요약을 생성하고 다음 작업을 프롬프트합니다. 전체 과정에서 기본적으로 질문을 하지 않으며, 우선 조사하고 진정한 모호성이 진행을 막을 때만 질문합니다.

FAQ

언제 이 기술을 사용해야 하나요?

오류 디버깅, 테스트 실패 조사, 이슈 트래커에서 버그 재현, 또는 실패한 수정 시도 후 막힌 경우에 사용합니다. '이것을 디버깅해', '왜 이것이 실패하는지'와 같은 구문이나 붙여넣은 스택 트레이스 및 오류 메시지가 입력될 때도 트리거됩니다.

자동으로 수정안을 적용하나요?

사용자가 선택한 경우에만 적용합니다. 진단 후 '지금 수정 / 진단만' 사용자 선택 게이트를 실행하며, 단순 버그의 고속 경로에서도 편집 전에 해당 게이트를 실행합니다. 진단만 선택하면 요약을 작성하고 중지합니다.

어떻게 증상을 근본 원인으로 오해하는 것을 피하나요?

간격 없이 전체 인과 관계를 설명할 수 있을 때까지 수정안을 제안하지 않으며, 불확실한 연결부에 대해서는 반드시 참이어야 하는 것에 대한 예측을 수립합니다. 만약 예측이 틀렸지만 수정이 작동하는 것처럼 보인다면, 이는 증상만 찾은 것이지 원인을 찾은 것이 아니라고 결론 내립니다.

GitHub 또는 기타 트래커에서 버그 세부 정보를 가져올 수 있나요?

네. GitHub의 경우 댓글과 라벨을 포함하는 gh issue view로 이슈를 가져옵니다. Linear, Jira 또는 기타 트래커의 경우 사용 가능한 MCP 도구를 사용하거나 URL을 가져오며, 가져오기가 실패할 경우 내용을 붙여넣도록 요청합니다. 개시 설명뿐만 아니라 전체 댓글 스레드를 읽습니다.

심층 코드 추적 전에 무엇을 확인하나요?

환경의 정상성: 의도하지 않은 미커밋 변경 없이 올바른 브랜치, 설치되고 최신 상태인 종속성, 예상되는 인터프리터/런타임 버전, 필요한 환경 변수, 오래된 빌드 산출물 없음, 그리고 버그가 관련될 가능성이 있는 경우 실행 중인 관련 로컬 서비스입니다.

모든 파일

4 filesreferences/anti-patterns.md6.0 KBViewreferences/defense-in-depth.md2.8 KBViewSKILL.md22.1 KBViewreferences/investigation-techniques.md22.3 KBView

GitHub에서 보기

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). Blank if nothing was provided.

Setup

Run this once at the start of this invocation, before any subagent dispatch, and follow the directives it prints — except where one conflicts with this skill's own rules on asking the user questions, whether those rules are scoped to a non-interactive mode or apply in every mode, in which case this skill's rules win and no blocking question is asked. Run the fence exactly as written, as its own command: do not pipe or filter it (no head, tail, or grep), do not truncate its output, and do not bundle it into a batch with other commands. Its output opens with a === skill context header and ends with CE_CONTEXT_END; if you received one of those lines without the other, the output was truncated — rerun the fence verbatim once. That recovery is the only rerun: otherwise do not rerun it within the same invocation; a later invocation of this or any other skill runs its own. If no Node runtime is available the skill proceeds unchanged.

SKILL_DIR="<absolute path of the directory containing the SKILL.md you just read>";NODE="$(for c in node nodejs; do command -v "$c" >/dev/null 2>&1 && "$c" -e '' >/dev/null 2>&1 && { echo "$c"; break; }; done)";if [ -n "$NODE" ]; then"$NODE" "$SKILL_DIR/scripts/context.mjs" || echo "context script failed; continue with the skill's normal behavior";elseecho "no Node runtime; continue with the skill's normal behavior";fi

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.

Blocking questions

Wherever this skill asks the user something, use the platform's blocking question tool: AskUserQuestion in Claude Code (call ToolSearch with select:AskUserQuestion first if its schema isn't loaded — a pending schema load is not a reason to fall back), request_user_input in Codex, ask_question in Antigravity CLI (agy), ask_user in Pi (needs the pi-ask-user extension). Fall back to numbered options on the host's chat surface only when no blocking tool exists or the call errors. Never silently skip the question, and never end a phase without a response.

Artifact Root

Resolve <root> only when you first compose a <root>/ path — a run that composes none skips this entirely.

Resolve the CE artifact root <root> before composing any artifact path.

  • Read docs_root from <repo-root>/.compound-engineering/config.yaml only (<repo-root> = git rev-parse --show-toplevel). Do not read it from config.local.yaml. Unset -> <root> is docs, exactly as before.
  • Validate a set value: a repo-relative directory whose real, symlink-resolved path stays inside the repo and is neither the repo root nor under .git/. Otherwise stop with an error naming docs_root and the value -- never fall back to docs.
  • Use <root> as the sole artifact location: create it if absent, compose each path as <root>/<subdir> with this skill's own subdirectory, and never also read docs.

Execution Flow

Five phases in order: 0 Triage -> 1 Investigate -> 2 Root Cause -> 3 Fix -> 4 Handoff. Beyond Phase 0's trivial-bug fast-path there is no skipping and no complexity tiers — a hard bug spends longer in each phase, it does not enter fewer.

Read references/investigate.md now and follow it for Phases 0-2 — issue fetching, reproduction, environment sanity and the dirty-tree stash experiment, backward tracing, the tracker/PR-history search, hypothesis grounding, and the escalation table. Only the gates below are stated here.

The issue of record. Whatever the user handed you is where this bug already lives, whichever system that is — a Sentry issue counts as much as a Linear ticket. Carry its identifier and URL through to Phase 4. Input that is only a stack trace, test path, or description means this run has no issue of record. That is an ordinary state, not a gap to fill: ship the fix without one, never open a ticket to manufacture a record, and never ask the user whether to. Phase 1's tracker search reads prior work and never establishes a new home for the bug — an existing ticket for this bug is one to link in Phase 4, never one to create.

The trivial-bug fast-path (cause readable from the input, one-line fix, no deep tracing) still runs Phase 2's fix-choice gate before editing: it saves investigation ceremony, not the user's choice over whether to apply a fix.

Choosing the regression test. The regression test for a confirmed defect belongs wherever existing coverage already owns that behavior: start from the tests that exist rather than from a new file. Read references/fix.md for the homes and the naming rule before writing Phase 2's recommendation, not only before Phase 3's edits. A test that fails because the change deliberately reverses the behavior it asserts does not have a wrong expectation — that is the divergent case below, deferred rather than updated.

Phase 2 gate: present, then ask

Causal chain gate: do not proceed to Phase 3 until you can explain the full chain — trigger through every step to the observed symptom — with no gaps. "Somehow X leads to Y" is a gap. Only the user can authorize proceeding on a best-available hypothesis when investigation is stuck.

Once the root cause is confirmed, write the findings as a user-visible block: the causal chain with file:line references; the proposed fix and the files it changes; which tests to use, add, modify, or strengthen, and whether existing tests should have caught this; and any related ticket or PR and how it shapes the recommendation — if an open PR already fixes this, lead with that link instead of a fresh fix.

Same-turn presentation before the gate: do not open the fix-choice question until that findings block has been written in full — in this turn or the immediately preceding assistant message. The blocking question tool renders only its own stem on modal harnesses, so a question fired on "root cause confirmed" alone leaves the user choosing with none of the causal chain in front of them. Naming the options is not presenting the findings, and a promise to explain after the choice is too late.

Then ask (per Blocking questions) which path to take. Do not assume the user wants action now; the test recommendations are part of the diagnosis either way.

  1. Fix it now — proceed to Phase 3
  2. Diagnosis only — I'll take it from here — skip the fix, write Phase 4's summary, end the skill
  3. Rethink the design (ce-brainstorm) — only when the bug cannot be fixed within the current design: the root cause is a wrong responsibility or interface rather than wrong logic, the requirements themselves are wrong, or every candidate fix is a workaround around an assumption that no longer holds. Size alone is not a design problem.

mode:pipeline: do not ask. Proceed to Phase 3 and apply a convergent fix; a divergent fix — one that would reverse a deliberate contract/behavior/product decision, including a "failing" test that asserts intended behavior — is deferred, not applied, per references/pipeline-mode.md. Never route to ce-brainstorm here; a design problem becomes a needs-human residual.

Phase 3: Fix

If the user chose "Diagnosis only," skip to Phase 4's summary. If they chose "Rethink the design," control has transferred to ce-brainstorm and this skill ends.

Read references/fix.md before editing any file — the test-first sequence, the failed-fix rule, and the defense-in-depth and post-mortem triggers. Two rules decide whether the fix may start at all, so they stay here:

  • Branch. Check git status; if the user has unstaged work in files that need modification, confirm before editing. If the current branch is the default branch, create a feature branch without asking — derive a name from the bug, git checkout -b <name>, and say which branch you moved to. Detect the default by comparing against main, master, or git rev-parse --abbrev-ref origin/HEAD with its origin/ prefix stripped — the raw output is origin/<name>, so an unstripped comparison never matches.
  • Record the pre-fix scope: current HEAD, whether git status --short is clean, and any pre-existing changed files. Then keep a list of fix-owned files (the tests and implementation changed for this bug) as you work. Phase 4 answers both of its questions from this record and cannot reconstruct it afterwards.

Phase 4: Handoff

mode:pipeline — skip this entire interactive handoff. No polish/review tail, no residual questions, no preview, no learning-capture offer. Commit and push the convergent fix per references/pipeline-mode.md, then emit that reference's structured return as the final output. Divergent / needs-human items are deferred there (open thread or the caller's run-report comment — never a PR-body section). The rest of this section is the interactive path only.

Structured summary — always write this first:

## Debug Summary**Problem**: [What was broken]**Root Cause**: [Full causal chain, with file:line references]**Recommended Tests**: [Tests to add/modify to prevent recurrence, with specific file and assertion guidance]**Fix**: [What was changed — or "diagnosis only" if Phase 3 was skipped]**Prevention**: [Test coverage added; defense-in-depth if applicable]**Confidence**: [High/Medium/Low]

If Phase 3 was skipped, stop after the summary — the user already said they were taking it from here. Do not prompt.

If Phase 3 ran, read references/post-fix-handoff.md now and follow it before routing below. It owns this phase's quality tail — the contextual-override checks, the skip-for-mechanical-fixes rule, the scoping that keeps ce-simplify-code and ce-code-review off unrelated branch work, residual handling, the ## Post-Fix Quality block, and the learning-capture criteria — and none of that appears in this body. The routing below names which action fires, never the scope rules that make it safe, so it cannot be improvised from. Skipping the read ships an unreviewed fix, lets review reach into unrelated branch work, and strands accepted findings in the session.

Routing

Land the fix without carrying along anything the user did not offer up — not into a commit, not into a push, not into a PR. Do not ask whether to open a PR; permission is not the gate. Two questions decide the handoff, answered from the pre-fix scope Phase 3 recorded rather than inferred from how the branch came to exist. Fire the action itself via the platform's skill-invocation primitive — never merely tell the user to type a command.

1. What may go into the commit — the fix-owned files and nothing else. This is a constraint on whichever skill commits in question 2, never an action of its own. It holds on every route, remote or not. Do not commit here.

  • No fix-owned file carried pre-existing edits: those files are the commit scope, passed to whichever skill commits.
  • A fix-owned file already carried the user's edits: no commit separates them (ce-commit groups at file level and never splits a file). Ask (per Blocking questions) before anything commits: commit that file including their edits, leave the fix uncommitted, or stop. Only the first answer continues — the other two end the handoff, so question 2 never runs and nothing commits; say what was left and why. Every option loses something the agent cannot choose on the user's behalf, which is why this question survives. Phase 3's confirmation covered editing the file, never committing the user's edits with the fix.

2. Who commits, and whether it ships. Exactly one of these runs.

  • Ships — the pre-fix tree was clean, nothing on the branch is work the user has not already offered, and origin is PR-capable: somewhere gh can actually open a PR. Establish those however fits the repo in front of you. Two facts make it less obvious than it looks.

    • ce-commit-push-pr pushes the whole branch, and its PR spans every commit on it, not just your fix — so the question is about the branch, not your diff. It also pushes before creating the PR, so a remote gh cannot open a PR against leaves the branch published with no PR.
    • Already pushed is not already offered. Commits in an open PR are under review, so they are offered and this run updates that PR rather than opening a second one; commits pushed for backup or to trigger CI are not, and a first PR would publish them. Compare against the remote rather than a local ref — a local branch, including the default branch Phase 3 may have branched off, can itself be ahead of what was pushed.

    If you cannot establish all three, take the local route instead; that is the safe direction, and the preview is not a substitute for it. Otherwise preview what will be committed, on what branch, and whether a PR opens or updates, then invoke the ce-commit-push-pr skill with branding:on. It commits under question 1's scope, so do not commit first. The preview is a statement, not a question. Surface the resulting PR URL.

  • Stays local — any of those fails. Invoke the ce-commit skill under question 1's scope and push nothing. Say in one line what stayed local and why, and that you will push and open the PR on request. Do not ask first — a local commit is reversible.

  • Not a git repo — nothing commits. Stop after the summary and the quality block.

Contextual override ("don't open PRs from skills", "commit only", "stop after the fix") — follow what the user said, and Stop here without committing when that is what they asked for. A vague tonal cue is not an override.

After a PR is open — apply the reference's learning-capture criteria; if the user accepts, invoke the ce-compound skill, then commit the learning doc to the same branch and push so the open PR picks it up.

모든 파일

0개 파일

ce-debug 설치

스킬 파일을 다운로드하여 .claude/skills/ 디렉토리에 추출하세요.

ZIP 다운로드

저장소를 클론하고 스킬 파일을 프로젝트에 복사하세요.

git clone https://github.com/EveryInc/compound-engineering-plugin/blob/main/skills/ce-debug/SKILL.md # Copy SKILL.md to your .claude/skills/ directory

복사 복사
빠른 설정: 스킬 폴더를 .claude/skills/에 복사하면 Claude가 자동으로 감지하고 사용합니다

관련 스킬

github-project-management
업데이트 된 시간 2026년 6월 29일
using-git-worktrees
업데이트 된 시간 2026년 6월 29일
readme-blueprint-generator
업데이트 된 시간 2026년 7월 5일
finishing-a-development-branch
업데이트 된 시간 2026년 6월 29일
OR