debug

Solid

Systematic debugging that finds the root cause before changing any code — collect symptoms, trace the code path, check what changed, reproduce deterministically, form a testable hypothesis, then fix the cause (not the symptom) and prove it with a regression test. Use when the user reports a bug, a crash, a failing test, or says "debug", "why is this happening", "root cause".

Code & Development 73 stars 34 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 84/100

Stars 20%
62
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Debug: root cause before fix **The iron law: no fix without a root cause first.** Patching a symptom you don't understand turns one bug into whack-a-mole — every blind fix makes the next bug harder to find. Find why it breaks, then fix that. ## Phase 1: Investigate Gather evidence before forming any hypothesis. 1. **Collect the symptoms.** Read the exact error, stack trace, and the steps that trigger it. If you don't have enough to reproduce, ask the user one precise question at a time — don't guess your way forward. 2. **Trace the code path.** From the symptom, work backward toward possible causes: `Grep` for the call sites, `Read` the logic. Understand what the code actually does before theorizing about why it's wrong. 3. **Check what changed.** `git log --oneline -20 -- <affected files>` and read the recent diffs. If it worked before, the cause is almost certainly in a change — a regression narrows the search to the diff. 4. **Reproduce it deterministically.** Get to a command or test that fails every time. If you can't reproduce it reliably, you don't yet understand it — gather more evidence before going further. An intermittent bug reproduced is half solved. End Phase 1 with one sentence: **"Root cause hypothesis: …"** — a specific, testable claim about what is wrong and why, not a vague area of suspicion. ## Phase 2: Test the hypothesis - Confirm the cause directly: a failing assertion, a log at the suspect line, a minimal snippet t...

Details

Author
genai-io
Repository
genai-io/san
Created
1 years ago
Last Updated
today
Language
Go
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category