go-defensive
Use when hardening Go code at API boundaries: copy slices/maps on entry and return, defer cleanup, verify interface compliance at compile time, model time with time.Time/time.Duration, design enum zero values, prefer crypto/rand, and inject clocks for testability. Apply proactively when reviewing for robustness. Error-handling strategy: see go-error-handling.
- Version
- 0.1.0
- License
- MIT
- Compatibility
- Designed for Claude Code or similar AI coding agents. `crypto/rand.Text` examples assume Go 1.24+.
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-defensive/SKILL.md
- skills/go-defensive/references/boundary-copying.md
- skills/go-defensive/references/must-and-panic.md
- skills/go-defensive/references/time-and-enums.md
Every link opens the file at its source, pinned to the revision this page describes.