with one click
debug
系統性 debug 工作流:捕捉錯誤、分析日誌、關聯跨系統 pattern,產出有根因與修復驗證的報告。適用於 bug、test 失敗、生產異常。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
系統性 debug 工作流:捕捉錯誤、分析日誌、關聯跨系統 pattern,產出有根因與修復驗證的報告。適用於 bug、test 失敗、生產異常。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | debug |
| description | 系統性 debug 工作流:捕捉錯誤、分析日誌、關聯跨系統 pattern,產出有根因與修復驗證的報告。適用於 bug、test 失敗、生產異常。 |
| disable-model-invocation | true |
| context | fork |
# 查看最近哪些變更可能引起問題
git log --oneline -10
git diff HEAD~3
# 搜尋日誌中的錯誤模式
grep -rn "error\|Error\|ERROR" logs/ 2>/dev/null | tail -20
# 執行測試並捕捉輸出
npm test 2>&1 | tail -50 # Node.js
pytest -x --tb=short 2>&1 # Python
cargo test 2>&1 | tail -50 # Rust
go test ./... 2>&1 # Go
# 最近的錯誤與上下文
grep -B 5 -A 10 "ERROR" /var/log/app.log
# 統計錯誤類型頻率
grep -oE "Error: [^:]*" app.log | sort | uniq -c | sort -rn
# 某時段的錯誤
awk '/2026-04-18 14:/ && /ERROR/' app.log
# 找出高頻錯誤
grep "ERROR" app.log | cut -d']' -f2 | sort | uniq -c | sort -rn | head -20
# 錯誤 spike 分析
grep "ERROR" app.log | cut -d' ' -f1-2 | uniq -c | sort -rn
| Pattern | 指向 | 行動 |
|---|---|---|
| NullPointer / undefined | 缺少 null check | 加入防衛性驗證 |
| Timeout | 依賴服務慢 | 加 timeout + retry |
| Connection refused | 服務未啟動 | 檢查 health endpoint |
| OOM | 記憶體洩漏 | 用 profiler 找洩漏點 |
| Rate limit | 請求過多 | 加 backoff + 佇列 |
-- 某 endpoint 的錯誤頻率
SELECT endpoint, count(*) as errors
FROM logs
WHERE level = 'ERROR' AND time > NOW() - INTERVAL '1 hour'
GROUP BY endpoint ORDER BY errors DESC;
-- 用 request_id 跨服務追蹤
SELECT service, message, time
FROM logs
WHERE request_id = 'req-xxxxx'
ORDER BY time;
## Debug Report
**Issue:** [一句話描述問題]
**Root Cause:** [實際根因]
### Evidence
- [找到的具體證據 1]
- [找到的具體證據 2]
### Fix
[程式碼或設定的最小修復]
### Verification
[如何確認修復有效:指令或測試]
### Prevention
[如何預防此問題再次發生]
分析 claude.com/blog 的新文章,提取可操作洞察並更新 workspace 設定。手動調用。
分析當前專案的 Claude Code session 資料,產出 context 效率報告(模型用量、工具效率、委派比例、TodoWrite 使用率)。搭配 context-management.md 使用。
冷啟新 session:掃描 codebase 結構並讀取 README,快速建立專案 context。適合在陌生 repo 或新 session 開始時使用。
追蹤並計算當前 session 的 Token 使用量和花費(USD)。產出前後對比報告,幫助使用者了解 workspace 優化的實際效益。
研究外部 Claude Code best practice 來源(GitHub repos、官方 docs、blog),對比現有 workspace 做 gap analysis,產出可操作建議清單。
大型功能開發前,讓 Claude 用 AskUserQuestionTool 深度訪問你(技術、UI/UX、風險、取捨),產出完整 spec,再開新 session 執行。適合在複雜功能實作前、需求模糊時、或開始新專案架構設計時使用。