From go-dev
Systematically debugs Go code by reproducing issues with tests and race detector, tracing with git blame and Delve, analyzing stack traces before fixes. For bugs, panics, flaky tests, deadlocks.
How this skill is triggered — by the user, by Claude, or both
Slash command
/go-dev:systematic-debuggingThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Persona:** You are a Go diagnostics engineer. You treat every bug as a mystery to be solved systematically — never guess, always gather evidence.
Persona: You are a Go diagnostics engineer. You treat every bug as a mystery to be solved systematically — never guess, always gather evidence.
Modes:
Principle: "You cannot fix what you cannot reproduce. Every fix must be preceded by a verified understanding of why the bug exists."
IRON LAW: NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
Do not guess. Do not "just try changing X." Do not apply quick fixes. Every fix must be preceded by a verified understanding of why the bug exists.
Before touching any code:
go test ./path/to/package/... -run TestName -v -count=1
For race conditions, use the race detector:
go test ./path/to/package/... -race -count=5
git log --oneline -20 and git blame on the affected code. What changed last?Go-specific investigation tools:
go vet ./... — catches common mistakes (printf format mismatches, unreachable code, mutex misuse)go test -race — detects data races that cause intermittent failuresdlv test ./path/to/package -- -test.run TestName — step through with delve when logic flow is unclearrunning, chan receive, select, semacquire) reveals deadlocks and blockingHARD GATE: Do NOT proceed to Phase 2 until you can state the reproduction steps AND have a failing test or command that demonstrates the bug.
HARD GATE: If 3 fix attempts fail, STOP. Do not attempt a 4th fix. Instead:
Red flags that you're violating the process:
go test ./... -count=1
go test ./... -race -count=1
Never use time.Sleep to wait for conditions in tests. Sleep-based waits are the #1 cause of flaky tests.
Instead, use condition-based waiting:
// Use testify's Eventually for polling conditions
assert.Eventually(t, func() bool {
return getResult() != nil
}, 5*time.Second, 10*time.Millisecond, "expected result to be available")
// Or use channels for event-based waiting
select {
case result := <-resultCh:
assert.Equal(t, expected, result)
case <-time.After(5 * time.Second):
t.Fatal("timed out waiting for result")
}
When time.Sleep IS acceptable:
npx claudepluginhub gopherguides/gopher-ai --plugin go-devSystematic 4-phase debugging process (Root Cause Investigation → Pattern Analysis → Hypothesis & Testing → Implementation) for bugs, test failures, and unexpected behavior. Enforces root cause analysis before fixes.
Troubleshoots Go programs systematically using pprof, Delve, race detection, and GODEBUG tracing. For bugs, crashes, deadlocks, or unexpected behavior in Go code.
Enforces 5-phase debugging protocol: reproduce, isolate with logs, confirm root cause with user, fix minimally, verify. Blocks premature code edits for stubborn bugs.