go-error-handling
Use when writing, wrapping, inspecting, or logging Go errors. Covers strategy choice (sentinel vs typed vs opaque), wrapping with %w/%v, errors.Is/As/Join, the log-or-return rule, error strings, and panic/recover boundaries. Apply proactively whenever a function returns or accepts an error, even if the user has not asked about error handling.
- Version
- 0.1.0
- License
- MIT
- Compatibility
- Designed for Claude Code or similar AI coding agents. Requires Go 1.20+ for errors.Join. Wrapping (%w, errors.Is/As) requires Go 1.13+.
Pinned to revision 121b47cd4371, so it is the text this page describes rather than whatever the author pushed since.
Pre-approved tools experimental
Experimental field. Support varies between clients, so this list is what the author declared, not what your client will enforce.
- Read
- Edit
- Write
- Glob
- Grep
- Bash(go:*)
- Bash(golangci-lint:*)
Files
- skills/go-error-handling/SKILL.md
- skills/go-error-handling/references/strategy-decision.md
- skills/go-error-handling/references/typed-nil-trap.md
- skills/go-error-handling/references/wrapping-vs-shadowing.md
Every link opens the file at its source, pinned to the revision this page describes.