Diagnose
Skill shode666/claude-skill-shode-house/skills/workflow/diagnose
[WHAT] Structured debugging methodology — บังคับ reproduce → isolate → fix → prevent ก่อน "ลอง fix"; ห้าม patch โดยไม่มี root cause. [AUDIENCE] Chris (review) + Quinn (test) + Dave (implement) — เปิดเมื่อมี bug/perf. [WHEN] ทันทีที่ user รายงาน bug; ก่อน propose fix; ก่อน dev-gate; ก่อน incident escalation (ถ้าไม่ใช่ prod outage). [TRIGGER] /shode-house:diagnose, "พัง", "ไม่ทำงาน", "ช้า", "ทำไมถึง", "bug", "error", "debug", "perf issue", "ผิดปกติ", "root cause analysis", "RCA".From its SKILL.md
npx -y skills add shode666/claude-skill-shode-house --skill diagnoseAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.4 KB, as published. Nobody here has run it
Diagnose (structured debugging)
Inspired by mattpocock/skills (engineering/diagnose) — adapted for shode-house
Owner: Chris (review) + Quinn (test) + Dave (implement) — เปิด skill นี้เมื่อมี bug/perf
หลักการ
No fix without diagnosis — ห้าม patch โดยไม่เข้าใจ root cause; "ลองเปลี่ยนดู" = anti-pattern
4 Steps
1. Reproduce (🔴 ห้ามข้าม)
- Minimal repro — input น้อยที่สุดที่ trigger bug
- ระบุ: environment, data, user action, expected vs actual
- ถ้า reproduce ไม่ได้ → STOP — ขอ stack trace / log / video / steps จาก user
- Flaky bug = treat as bug (ไม่ใช่ "บางครั้ง")
Bug: payment คำนวณผิด
Repro:
- Env: staging
- Input: amount=99.99, vat=7%, discount=10%
- Expected: 96.34
- Actual: 96.33
- Steps: 1. login → 2. add cart → 3. apply coupon → 4. checkout
2. Isolate
- Bisect — หาจุดที่พัง (git bisect, binary search ใน flow)
- Hypothesis — เขียนสมมติฐาน 2-3 ข้อ + วิธีพิสูจน์
- Eliminate — ตัด layer ออกทีละชั้น (UI? API? business logic? DB? external?)
- Add log/print เฉพาะจุดสงสัย — ลบหลังเสร็จ
- Diff — code ก่อน-หลัง / config / data / version
3. Fix (เข้าใจก่อนแก้)
- Root cause ≠ symptom — ถ้าแก้แล้ว bug อื่นโผล่ = ไม่ใช่ root cause
- Smallest change ที่ fix ได้
- Test ก่อน fix — เขียน test ที่ fail (red) → fix → green
- Comment "why" ถ้า fix ไม่ obvious
4. Prevent
- Regression test — bug นี้ห้ามกลับมา
- Update doc ถ้า docs ทำให้เข้าใจผิด
- Postmortem ถ้า production incident (timeline + root cause + action item)
- Spread learning — pattern นี้อาจมีจุดอื่น → grep + fix หมด
Hand-off pattern
Diagnose finished →
- Chris: review fix + write regression unit test
- Quinn: integration test เผื่อ pattern อื่น
- Aaron: monitoring/alert ถ้าเป็น infra
- Domain Expert: ถ้า business rule ผิด
ห้าม
- ห้าม fix โดยไม่ reproduce
- ห้าม "ลองเปลี่ยน" โดยไม่มี hypothesis
- ห้าม ship fix โดยไม่มี regression test
- ห้าม blame engineer (postmortem blameless)
- ห้าม revert โดยไม่เข้าใจว่า revert ทำอะไร
Skill composition (where to go next)
| Situation | Next skill | Reason |
|---|---|---|
| Bug อยู่ใน production, มี customer impact หรือ SLO burn | → incident | Reggie IC + war room + blameless postmortem (diagnose ไม่มี comms/severity) |
| Diagnosis เสร็จ → จะเขียน fix code | → dev-gate | TDD red-green-refactor + 7-gate (diagnose ไม่บังคับ TDD) |
| Bug เกิดเพราะ test gap | → automate-test | เพิ่ม regression coverage + CI gate (close the hole) |
| Bug ใน frontend (visual/a11y) | → ui-test | Playwright + axe + visual diff (diagnose ไม่มี UI tooling) |
| Bug เกี่ยวกับ security vuln | → secure | Sentinel STRIDE + abuse case (diagnose ไม่ classify threat) |