wasintoh/toh-framework/debug-protocol
Claude Code and agent skill by wasintoh/toh-framework
- community
Checking that the SKILL.md file is still in the repository.
Evidence-first debugging in 5 stages — REPRODUCE, EVIDENCE, DIAGNOSE, FIX, PROVE. Never touch code before the root cause is stated with evidence; fix the source, not the symptom; hand dead-end investigations to the root-cause-debugger agent. Use for any bug, error, crash, regression, unexpected behavior, or /toh-fix work.
Install
npx vskill@latest install wasintoh/toh-framework/debug-protocolSKILL.md
🔧 Debug Protocol Skill
Purpose: Evidence-first debugging — หา root cause ด้วยหลักฐาน ไม่เดา ไม่กดอาการVersion: 2.0.0Updated: 2026-07-14
🎯 Core Idea
กฎเหล็ก: อย่าแตะโค้ดจนกว่าจะบอก root cause ได้พร้อมหลักฐาน ถ้าร่องรอยตัน → ส่งงานสืบสวนให้ agent root-cause-debugger
Protocol — 5 Stages
1. REPRODUCE — ทำให้พังซ้ำก่อน
ทำให้ bug เกิดบนเจตนา ก่อนคิดแก้. รู้ path / action / ข้อมูลที่ทำให้พัง แล้วเห็นมันพังจริง ทำซ้ำไม่ได้ = แก้ไม่ได้ → บอกตรงๆ แล้วขอ steps / env / data เพิ่ม
2. EVIDENCE — เก็บหลักฐาน (ห้ามเดา)
- อ่าน error + stack trace เต็มๆ — ไฟล์/บรรทัด/call chain
git log/git diff— อะไรเพิ่งเปลี่ยน (bug ใหม่ = โค้ดใหม่ ~80%)- ตาม data flow ด้วย log/debugger จริง — ค่ามาจากไหน หายที่จุดไหน
3. DIAGNOSE — differential diagnosis
สมมุติฐาน 2–3 ข้อ + หลักฐานสนับสนุน/หักล้างแต่ละข้อ → เลือกข้อที่หลักฐานชี้ ไม่ใช่ข้อที่แก้ง่ายสุด ถาม "ทำไม" ต่อจนถึงต้นตอ
4. FIX — แก้ที่ต้นตอ
แก้ root cause จุดเดียว. defensive guard ตรงจุดอาการเสริมได้ แต่ guard ≠ การแก้ — ต้นตอต้องหาย
5. PROVE — พิสูจน์ว่าหาย
รันเส้นทางเดิมที่พังซ้ำ + เส้นทางข้างเคียง แล้วค่อยรายงาน
🛠 Technique: Targeted Logging
log ค่า ตรงจุดก่อนพัง และ log shape จริง ของข้อมูล — อย่าเดาว่าหน้าตาเป็นยังไง
ถามให้ตรง: ตอน render มีข้อมูลไหม? เป็น array จริงไหม? key ที่โค้ดอ้างถึงมีอยู่จริงไหม?
🛠 Technique: git bisect — หา commit ที่ทำพัง
Bug ใหม่ = โค้ดใหม่. binary search หา commit ต้นเหตุ:
Manual bisect (ถ้าไม่มี tag good): git log --oneline → checkout กลางๆ → ทดสอบ → ขยับ เจาะลึก commit ต้องสงสัย: git log -p <file> / git diff <commit>~..<commit> -- <file>
🛠 Technique: Differential Diagnosis
เขียน hypothesis แข่งกัน แล้วใช้หลักฐาน ตัดทิ้ง ทีละข้อ:
หลักฐานเป็นตัวเลือก hypothesis ไม่ใช่ความง่ายในการแก้
🎨 Debug Patterns: CSS / Layout
Symptom → สืบหาสาเหตุ → พิสูจน์ (ไม่ใช่แปะ fix สำเร็จรูป)
Scroll เกิน / white space ด้านล่าง
- สืบ: parent มี fixed height + child มี padding/margin ไหม? มี element ไหน overflow?
- พิสูจน์: DevTools → เลื่อน inspect หา element ที่สูงเกิน viewport จริง → ค่อยแก้ที่ตัวนั้น
- สาเหตุพบบ่อย:
h-screen+ padding พร้อมกัน, flex item ขาดmin-h-0,position: fixedหลุด flow
Element ไม่อยู่ที่ที่คาด
- สืบ: เป็น flow / flex / grid / absolute? parent เป็น positioning context ไหม?
- พิสูจน์: ใส่ outline ชั่วคราว (
outline: 1px solid red) กับ element + parent เพื่อเห็น box จริง
⚙️ Debug Patterns: JavaScript / Async
Function เหมือนไม่ทำงาน
- สืบ: ถูกเรียกจริงไหม? args ที่เข้ามาคืออะไร? state ก่อน/หลังต่างไหม?
- พิสูจน์:
console.logต้นฟังก์ชัน — ถ้าไม่ขึ้น = ปัญหาอยู่ที่ "การเรียก" (event binding:onClick={fn()}vsonClick={fn}) ไม่ใช่ในฟังก์ชัน
ค่าไม่อัพเดท / เป็น undefined
- สืบ: await ครบไหม? Promise reject เงียบไหม? useEffect dependency ตรงไหม?
- พิสูจน์: log ค่าที่ทุก step ของ chain — หาจุด แรก ที่ค่าผิด นั่นคือต้นตอ ไม่ใช่จุดที่ throw
🚫 Anti-Patterns
🔗 Integration
| Skill | ใช้ร่วมกันยังไง | |
|---|---|---|
error-handling | debug สำหรับ error ที่ auto-fix ไม่ได้ | |
engineer-harness | รายงานผล: Problem → Root cause → Fix → Proof → Prevention | |
agent root-cause-debugger | delegate การสืบสวนเมื่อร่องรอยตัน |
💡 When to Use
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/skills/debug-protocol/SKILL.md
Popularity
- Repository stars
- 75
- Repository forks
- 17
- Repository npm downloads, 7 days
- 4
- 7-day trend score
- 29
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 18 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/wasintoh/toh-framework/debug-protocol)