systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
Use when an HTML UI beats terminal text — collecting structured answers (decision trees, multi-select, code/SQL fields), showing visual comparisons or mockups, running interactive demos, or presenting decisions for approval. A local browser companion renders markdown+YAML screens and streams the user's answers back. Use when: many questions at once, layout/visual choices, mockup or diagram feedback, config wizard, demo review, approve/revise decisions. Skip: a single quick question (use AskUserQuestion or plain text).
Use when you have a spec or requirements for a multi-step task, before touching code
Use when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
Use when you have a written implementation plan to execute in a separate session with review checkpoints
| name | systematic-debugging |
| description | Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes |
亂修耗時,且生新bug。速補掩真疾。
核心原則: 修前必尋根因。治症非修,乃敗。
違其字即違其意。
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
未完 Phase 1,不得提修。
用於任何技術問題:
尤當於:
不可跳過即使:
每階段必完方可進次。
修前:
細讀錯誤訊息
穩定復現
察近變更
多組件系統採證
當系統多層(CI → build → signing、API → service → database):
修前,加診斷 instrumentation:
For EACH component boundary:
- Log what data enters component
- Log what data exits component
- Verify environment/config propagation
- Check state at each layer
Run once to gather evidence showing WHERE it breaks
THEN analyze evidence to identify failing component
THEN investigate that specific component
例(多層):
# Layer 1: Workflow
echo "=== Secrets available in workflow: ==="
echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
# Layer 2: Build script
echo "=== Env vars in build script: ==="
env | grep IDENTITY || echo "IDENTITY not in environment"
# Layer 3: Signing script
echo "=== Keychain state: ==="
security list-keychains
security find-identity -v
# Layer 4: Actual signing
codesign --sign "$IDENTITY" --verbose=4 "$APP"
此揭: 何層斷(secrets → workflow ✓、workflow → build ✗)
追資料流
當錯深藏 call stack:
詳見 root-cause-tracing.md(本目錄,完整回溯技術)。
簡版:
修前尋式:
尋可用範例
比對參考
辨差異
明依賴
科學法:
成單一假說
最小測試
驗後再進
不知之時
修根因,非症:
立失敗測例
superpowers:test-driven-development skill 寫真失敗測單修實作
驗修
若修不效
三修皆敗:質問架構
示架構問題之兆:
止,質根本:
與 your human partner 論,方可再試
此非假說敗,乃架構誤。
若察己念:
皆意:止。返 Phase 1。
若 3+ 修敗: 質架構(見 Phase 4.5)
察此等改向:
見此:止。返 Phase 1。
| Excuse | Reality |
|---|---|
| 「疾簡,無需流程」 | 簡疾亦有根因。流程於簡 bug 亦速。 |
| 「急,無暇流程」 | 系統化比亂修快。 |
| 「先試此,後察」 | 首修定式。始即正。 |
| 「確修效後再寫測」 | 未測之修不定。測先證之。 |
| 「多修並行省時」 | 無法辨何效。生新 bug。 |
| 「參考過長,吾變其式」 | 半解必生 bug。完讀之。 |
| 「吾見題,修之」 | 見症 ≠ 明根因。 |
| 「再一修」(2+敗後) | 3+ 敗 = 架構問題。質式,勿再修。 |
| Phase | Key Activities | Success Criteria |
|---|---|---|
| 1. Root Cause | 讀錯、復現、察變、採證 | 明何與為何 |
| 2. Pattern | 尋可用例,比對 | 辨差異 |
| 3. Hypothesis | 立說,最小測 | 證或新說 |
| 4. Implementation | 立測、修、驗 | bug 解,測過 |
若系統察揭疾實為環境、時序、外部所致:
然: 95% 之「無根因」實為察不完。
本目錄內技術,皆系統化 debugging 之支:
root-cause-tracing.md — 回溯 bug 穿 call stack 尋原觸發defense-in-depth.md — 尋根因後於多層加 validationcondition-based-waiting.md — 以條件輪詢替任意 timeout相關 skills:
From debugging sessions: