From debug-agent
Use when writing, reviewing, or fixing Go code — goroutines, channels, select, sync, context, errgroup; data races, deadlocks, goroutine leaks; error wrapping with %w, errors.Is/As, sentinel and typed errors; interfaces, generics, functional options; go.mod, go test -race, go vet, golangci-lint, govulncheck, dlv. Symptoms: "race detected", "all goroutines are asleep - deadlock", panic, leaking goroutines, nil-pointer deref.
How this skill is triggered — by the user, by Claude, or both
Slash command
/debug-agent:goThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Idiomatic, concurrent, evidence-verified Go (1.21+). This SKILL.md is a slim
Idiomatic, concurrent, evidence-verified Go (1.21+). This SKILL.md is a slim index — load the reference for the task at hand.
panic only for
programmer errors._shared/clean-code.md — self-explaining code; Go exception: exported-
identifier doc comments are idiomatic, keep those; add no other comments._shared/evidence-first.md — observe before you fix._shared/dependency-hygiene.md — Go specifics below.| Task | Read |
|---|---|
| Interfaces, generics, options, package layout, idioms/anti-patterns | references/design-patterns.md |
| Goroutines, channels, select, sync, context, worker pools, errgroup | references/concurrency.md |
Error wrapping, errors.Is/As, sentinel/typed errors, panic boundaries | references/errors-structure.md |
Debug a crash/race/deadlock/hang with dbga + dlv | references/debugging.md |
On setup or when touching deps, audit (run), then suggest (don't auto-run):
go list -u -m all # audit: what's outdated
govulncheck ./... # audit: known vulnerabilities
Suggest-only (present, let the developer run): go get -u ./..., go mod tidy.
See _shared/dependency-hygiene.md for the audit-then-suggest discipline.
gofmt -l . # must print nothing
go vet ./...
golangci-lint run
go test -race ./... # race detector on
You have dbga — an evidence-first debugger for Python/Go/Node over DAP — and
the debug-agent skill. When code crashes, hangs, produces wrong output, or you
need live runtime state, DO NOT guess from source. Gather evidence:
dbga diagnose --lang go --cwd <module dir> -- go run <main> → triage a crash
to the deepest user framedbga session start --lang go --cwd <module dir> --break-at file.go:line -- <main>
then dbga session eval --expr "<x>" → inspect live statedebug-agent skill for the full evidence-first loop.Concurrency bugs first: go test -race ./.... Validate against real use flows
and verify the fix at the original fault before declaring it done. Details and
dlv recipes in references/debugging.md.
npx claudepluginhub niradler/dbga --plugin debug-agentCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.