원클릭으로
spectra-debug
Systematically debug a problem using a four-phase workflow
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Systematically debug a problem using a four-phase workflow
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when 使用者說「自動推」「loop」「幫我把 change 推到 ready」「不在的時候繼續做」、或 routine fire 自動觸發(--unattended)。適用於推進既有 spectra change;NOT for 非 spectra 工作、一次性任務、interval 盲跑命令(用 /loop)、user 在場想逐項拍板(用 /goal)、或想設計新 loop(看 vendor/snippets/loop-engineering cookbook)。
依功能分類變更並逐步完成 commit,遵循 commitlint 規範。Use when 使用者說「commit」「提交」「分批 commit」,或 working tree 有多組 unrelated 變更需要分門別類提交。
Deprecated alias — 已改名 /change-loop(2026-07-05)。Use when 既有 routine 或舊指令仍呼叫 /loop-engineer 時轉發。
Analyze artifact consistency for a change
Implement or resume tasks from a Spectra change
Archive a completed change
| name | spectra-debug |
| description | Systematically debug a problem using a four-phase workflow |
| effort | xhigh |
| license | MIT |
| compatibility | Requires spectra CLI. |
| metadata | {"author":"spectra","version":"1.0","generatedBy":"Spectra"} |
Systematically debug a problem using a four-phase workflow.
This skill enforces debugging discipline. No guessing, no random changes, no "let me try this." Every step is deliberate and evidence-based.
Agent routing: 若 debug 過程需派 codex 跑診斷 / repro,MUST 走 rules/core/agent-routing.codex-watch-protocol.md § Codex 派工的標準流程 + Codex Watch Protocol;禁止 Agent tool with subagent_type: screenshot-review 派視覺 QA(per rules/core/agent-routing.md Routing Table — sonnet wrapper 已多次驗證 self-rationalize)。
Input: The argument after /spectra-debug describes the bug or unexpected behavior. Examples:
/spectra-debug the search returns duplicate results/spectra-debug crash on startup after upgrading/spectra-debug file watcher misses rename eventsMaximum 3 fix attempts per hypothesis in Phase 4 (Fix). Phases 1-3 (Reproduce, Isolate, Root Cause) are investigation — they do not count toward this limit. If your third fix attempt fails:
Do NOT keep trying variations of the same approach. That's a loop, not debugging.
clade fork — prod/staging runtime 症狀先查 evlog:若 bug 來自 prod / staging(壞了、5xx、Toast error、「全部失敗」、變慢),第一個證據動作 MUST 是撈 evlog wide event(path / status / duration_ms / error_json / request.id / user / 時間窗)把症狀釘到具體 request,先於 code grep / codebase-memory / 推測。code 是「可能發生什麼」,evlog 是「實際發生了什麼」。怎麼查見 ~/offline/clade/vendor/snippets/evlog-investigate/ 與 rules/core/evlog-investigate.md。
Before anything else, make the bug happen reliably.
If you can't reproduce it, you can't debug it. Gather more information before proceeding.
Narrow down where the bug lives.
Goal: pinpoint the exact location where behavior diverges from expectation.
Understand WHY it's broken, not just WHERE.
Ask these questions:
Don't stop at the first explanation. Verify your hypothesis:
Now — and only now — fix the bug.
tdd: true is set in .spectra.yaml, fetch TDD instructions via spectra instructions --skill tdd and follow the Red-Green-Refactor cycle| What You're Thinking | What You Should Do |
|---|---|
| "I bet it's this, let me just change it" | Reproduce first. Verify your hypothesis |
| "Let me add some prints everywhere" | Add targeted logging at specific boundaries |
| "It works on my machine" | Find what's different in the failing environment |
| "這是 prod bug,我先看 code 猜原因" | 先撈 evlog wide event;prod root cause 在 evlog 驗證前都是推測 |
| "Let me try reverting this change" | Use git bisect to find the actual cause |
| "The fix is obvious, I don't need a test" | The fix is wrong. Write the test |
| "Let me just restart the service" | That hides the bug. Find the root cause |
| "Maybe if I just clear the cache..." | Understand why the cache was wrong |