一键导入
debug-tips
Debug 經驗知識庫查詢工具。偵測調查卡住的行為訊號,並從知識庫中查詢相關的除錯提示。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Debug 經驗知識庫查詢工具。偵測調查卡住的行為訊號,並從知識庫中查詢相關的除錯提示。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
在 4 個 Rails 專案(sf_project / jv_project / core_web / e_trading)跑 local dev 指令——console、server、rspec、migrate、rake、bundle。這些指令一律「進 Tilt 起的 web container」跑,不在 host 直接跑。Use when 要對這些 rails 專案開 console、跑 rspec、跑 migration / rake / bundle,或 local server(sf.local / jv.local / core.local / et.local)連不上要排查時。
資料遷移工具,從 Production 安全地遷移資料到 Local/Staging 環境。自動清理敏感資料,硬編碼禁止反向遷移。
Archive Claude Code telemetry logs to dated files (YYYY-MM-DD~YYYY-MM-DD.json). Use when user wants to archive, rotate, or save telemetry logs.
Generates optimized prompts for any AI tool. Use when writing, fixing, improving, or adapting a prompt for LLM, Cursor, Midjourney, image AI, video AI, coding agents, or any other AI tool.
BA 報告撰寫指引。在撰寫、審查或修改 BA 報告(-ba.md)時使用。確保 BA 報告使用純業務語言,不包含任何技術術語。
AWS EC2 operations including checking service status, viewing logs, server health monitoring, and production/staging environment management. Use when user asks to check/view/查看 production/staging servers, service status/狀態/狀況, logs/日誌, or perform remote operations like deployment and database backup.
| name | debug-tips |
| description | Debug 經驗知識庫查詢工具。偵測調查卡住的行為訊號,並從知識庫中查詢相關的除錯提示。 |
| version | 1.0.0 |
協助開發者在除錯過程中,利用過去累積的經驗快速定位和解決問題。
此 Skill 會在以下情況被觸發:
/debug-tips {症狀描述}根據以下行為訊號判斷(不打分,純行為偵測):
IF 重複嘗試相同方法失敗 >= 3 次
→ 觸發知識庫查詢
IF 已執行 10+ 次工具呼叫但 task JSON 仍無 investigation.rootCause
→ 觸發知識庫查詢
IF 調查方向不斷切換(嘗試了 3+ 個不同方向都沒結果)
→ 觸發知識庫查詢
OTHERWISE
→ 繼續當前調查
根據當前任務的 fix profile 或症狀,確定問題類型:
| Profile | 資料夾 | 典型症狀 |
|---|---|---|
| ui | debug-knowledge/ui/ | 頁面顯示異常、JS 錯誤、CSS 問題 |
| data | debug-knowledge/data/ | 資料不一致、DB 錯誤、遷移問題 |
| worker | debug-knowledge/worker/ | 背景任務失敗、Queue 問題 |
| performance | debug-knowledge/performance/ | 慢查詢、記憶體問題、N+1 |
| integration | debug-knowledge/integration/ | API 錯誤、第三方服務問題 |
| alert | debug-knowledge/alert/ | 監控警報、日誌異常 |
| security | debug-knowledge/security/ | 權限問題、認證失敗 |
# 讀取 tag 分類法
cat debug-knowledge/tag-taxonomy.yml
# 列出該類型的所有 tips
ls debug-knowledge/{type}/
# 讀取相關 tip 檔案
cat debug-knowledge/{type}/{tip_file}.yml
匹配策略(優先順序):
Tag 匹配(最快):
tags 欄位進行集合交集關鍵字匹配:比對 identification.keywords
症狀匹配:比對 identification.symptoms
錯誤訊息匹配:比對 identification.error_patterns
情境匹配:比對 identification.typical_context
Tag 匹配算法:
score = 0
for each tag_category in [error_pattern, domain, layer, technology]:
task_tags = extract_tags_from_task(task, tag_category)
tip_tags = tip.tags[tag_category]
matched = intersection(task_tags, tip_tags)
weight = priority_weights[tag_category]
score += len(matched) * exact_match_score * weight
if score >= threshold:
return tip as matched
Tag 提取規則(從任務 JSON):
| 任務欄位 | 提取的 Tag 類別 |
|---|---|
domain | domain |
context.modifiedFiles | layer(根據路徑判斷) |
context.background | error_pattern(關鍵字提取) |
type + fix profile | fix_profile |
找到匹配的 tip 後,輸出:
┌──────────────────────────────────────────────────────┐
│ 💡 Debug Tips 建議 │
├──────────────────────────────────────────────────────┤
│ │
│ 📍 匹配到的已知問題:{tip.title} │
│ 📁 來源:debug-knowledge/{type}/{file}.yml │
│ │
│ 🔍 問題根源: │
│ {tip.root_cause.summary} │
│ │
│ 📋 建議調查路徑: │
│ 1. {investigation_path.steps[0].action} │
│ 2. {investigation_path.steps[1].action} │
│ 3. ... │
│ │
│ ⚠️ 避免: │
│ • {investigation_path.anti_patterns[0]} │
│ │
│ 🔧 解決方案摘要: │
│ {solution.proper_fix.description} │
│ │
└──────────────────────────────────────────────────────┘
如果沒有找到匹配的 tip:
┌──────────────────────────────────────────────────────┐
│ 📭 未找到匹配的 Debug Tips │
├──────────────────────────────────────────────────────┤
│ │
│ 這可能是一個新的問題類型。 │
│ │
│ 建議: │
│ 1. 繼續系統性調查 │
│ 2. 解決後將經驗記錄到知識庫 │
│ │
│ 記錄位置: │
│ debug-knowledge/{type}/{描述性檔名}.yml │
│ │
│ 範本位置: │
│ debug-knowledge/tip-template.yml │
│ │
└──────────────────────────────────────────────────────┘
coder agent 處理 fix 類型任務時,以下行為會自動觸發知識庫查詢:
| 規則 | 偵測條件 | 動作 |
|---|---|---|
| 重複失敗 | 相同方法失敗 >= 3 次 | 查詢 tips |
| 長時間無進展 | 工具呼叫 >= 10 次且無 rootCause | 查詢 tips |
| 方向不明 | 嘗試 3+ 個不同方向都沒結果 | 查詢 tips |
當 coder agent 處理 fix 類型任務時:
investigation.rootCause 和 investigation.reproduction,編輯程式碼會被 confidence-gate.sh 阻擋解決新問題後,使用範本建立新的 tip:
# 複製範本
cp debug-knowledge/tip-template.yml \
debug-knowledge/{type}/{描述性名稱}.yml
# 編輯填入內容
命名慣例:
2fa-local-user-mismatch.yml、n-plus-one-eager-loading.yml/debug-tips 2FA 登入失敗
/debug-tips N+1 查詢效能問題
/debug-tips Sidekiq 任務卡住
Skill 會: