選項

結構化除錯流程 — 重現、隔離、診斷及修復。可透過錯誤訊息或堆疊追蹤觸發此流程,例如「這在預備環境中運作正常,但在生產環境中卻不行」、「部署後出現故障」,或是當行為與預期不符且原因不明時。

...展開全部
52
更新時間 2026-07-03

關於debug

「debug 」技能旨在引導使用者,當軟體行為出現異常、不明或退化時,透過結構化的debug流程進行排查。 此技能適用於出現錯誤訊息、堆疊追蹤或意外行為,且問題無法立即診斷的情境。透過將debug流程劃分為明確的階段,它能協助使用者以系統化方式從觀察症狀逐步推導至找出根本原因,而非僅憑猜測。

此技能遵循四步驟方法論:重現、隔離、診斷與修復。在重現階段,重點在於釐清預期行為與實際行為的差異,並建立可靠的重現步驟。隔離階段則透過檢視近期變更(例如部署、設定更新或依賴項變更),同時分析日誌與錯誤輸出,以鎖定受影響的元件。 在診斷階段,此流程著重於建立並驗證假設、追蹤執行路徑,以及找出潛在的根本原因,而非僅停留在表面症狀。最後,修復階段則著重於提出修正方案,同時考量副作用,並建議進行預防性測試以避免回歸問題。

這項技能主要針對經常需排除生產環境與開發環境問題的開發人員、DevOps 工程師、品質保證(QA)測試人員以及系統可靠性工程師。它在以下情境中特別有用:部署回歸、特定環境的錯誤(例如預備環境與生產環境的差異),或是近期變更後出現的無法解釋的故障。 透過落實嚴謹的debug流程架構,可減少試錯式debug操作,並提升事件處理工作流程的一致性。

常見問題

要使用這項debug技能,我應該提供什麼樣的輸入?

您應提供錯誤訊息、堆疊追蹤、異常行為的描述、重現步驟,或相關背景資訊(例如最近的變更或日誌)。資訊越精確,debugging 流程的成效就越高。

此技能是否需要存取外部工具或連接器?

若已連接監控系統、版本控制或專案追蹤工具等可用連接器,本技能可選擇性地加以利用。不過,僅憑您提供的描述、日誌及背景資訊,本技能仍可正常運作。

這項技能不適用於哪類問題?

本技能不適用於純粹的理論性問題或一般性說明。它專注於診斷並解決具有可觀察異常行為的具體軟體問題。

在 GitHub 上查看

/debug

If you see unfamiliar placeholders or need to check which tools are connected, see CONNECTORS.md.

Run a structured debugging session to find and fix issues systematically.

Usage

/debug $ARGUMENTS

How It Works

┌─────────────────────────────────────────────────────────────────┐│                       DEBUG                                        │├─────────────────────────────────────────────────────────────────┤│  Step 1: REPRODUCE                                                ││  ✓ Understand the expected vs. actual behavior                   ││  ✓ Identify exact reproduction steps                             ││  ✓ Determine scope (when did it start? who is affected?)        ││                                                                    ││  Step 2: ISOLATE                                                   ││  ✓ Narrow down the component, service, or code path             ││  ✓ Check recent changes (deploys, config changes, dependencies) ││  ✓ Review logs and error messages                                ││                                                                    ││  Step 3: DIAGNOSE                                                  ││  ✓ Form hypotheses and test them                                 ││  ✓ Trace the code path                                           ││  ✓ Identify root cause (not just symptoms)                      ││                                                                    ││  Step 4: FIX                                                       ││  ✓ Propose a fix with explanation                                ││  ✓ Consider side effects and edge cases                          ││  ✓ Suggest tests to prevent regression                           │└─────────────────────────────────────────────────────────────────┘

What I Need From You

Tell me about the problem. Any of these help:

  • Error message or stack trace
  • Steps to reproduce
  • What changed recently
  • Logs or screenshots
  • Expected vs. actual behavior

Output

## Debug Report: [Issue Summary]### Reproduction- **Expected**: [What should happen]- **Actual**: [What happens instead]- **Steps**: [How to reproduce]### Root Cause[Explanation of why the bug occurs]### Fix[Code changes or configuration fixes needed]### Prevention- [Test to add]- [Guard to put in place]

If Connectors Available

If ~~monitoring is connected:

  • Pull logs, error rates, and metrics around the time of the issue
  • Show recent deploys and config changes that may correlate

If ~~source control is connected:

  • Identify recent commits and PRs that touched affected code paths
  • Check if the issue correlates with a specific change

If ~~project tracker is connected:

  • Search for related bug reports or known issues
  • Create a ticket for the fix once identified

Tips

  1. Share error messages exactly — Don't paraphrase. The exact text matters.
  2. Mention what changed — Recent deploys, dependency updates, and config changes are top suspects.
  3. Include context — "This works in staging but not prod" or "Only affects large payloads" narrows things fast.

所有檔案

1 個檔案

安裝 debug

請下載並將技能檔案解壓縮至您的 .claude/skills/ 目錄中。

下載 ZIP

複製儲存庫並將技能檔案複製到您的專案中。

git clone https://github.com/anthropics/knowledge-work-plugins/blob/main/engineering/skills/debug/SKILL.md # Copy SKILL.md to your .claude/skills/ directory

複製 複製
快速設定: 將技能資料夾複製到 .claude/skills/,Claude 會自動偵測並使用該技能

相關技能

Verification & Quality Assurance
更新時間 2026-06-29
base44-cli
更新時間 2026-06-29
klingai-upgrade-migration
更新時間 2026-07-03
Railway CLI Management
更新時間 2026-07-02
OR