Skill / SKILL.md

Go Defensive Coding

eduardo-sl/go-agent-skills

Prevent panics, silent corruption, and subtle runtime bugs in Go: typed-nil interfaces, slice aliasing, integer overflow on conversion, float comparison, defer in loops, defensive copying at API boundaries, and zero-value design. Use when hardening code against crashes, reviewing for nil-safety, converting between numeric types, or deciding what to copy at a package boundary. Trigger examples: "nil pointer panic", "why is my error not nil", "slice aliasing", "integer overflow", "compare floats", "defer in a loop", "defensive copy", "make this crash-proof". Not for: data races and goroutine lifecycle (go-concurrency-review), injection and auth (go-security-audit), a panic that already happened (go-troubleshooting).
2 views 90 repository stars 0 commentsUpdated Nov 28, 2026
Overview

Prevent panics, silent corruption, and subtle runtime bugs in Go: typed-nil interfaces, slice aliasing, integer overflow on conversion, float comparison, defer in loops, defensive copying at API boundaries, and zero-value design. Use when hardening code against crashes, reviewing for nil-safety, converting between numeric types, or deciding what to copy at a package boundary. Trigger examples: "nil pointer panic", "why is my error not nil", "slice aliasing", "integer overflow", "compare floats", "defer in a loop", "defensive copy", "make this crash-proof". Not for: data races and goroutine lifecycle (go-concurrency-review), injection and auth (go-security-audit), a panic that already happened (go-troubleshooting).

Installation & variants

Download the repository, including the skill’s supporting files.

git clone -- 'https://github.com/eduardo-sl/go-agent-skills' skill-source

Use the complete skill-source/skills/(safety)/go-defensive-coding directory with your client’s skill installer.

  • skills/(safety)/go-defensive-coding

    main · SKILL.md

    Open installation source

    Source directory recorded from the imported repository path

Source directory skills/(safety)/go-defensive-coding

Compatibility & requirements

Declared compatibility

Designed for Claude Code or similar AI coding agents working on Go projects. Requires the Go toolchain. golangci-lint and gosec are optional, for enforcing the rules below.

Declared tools

Read Edit Write Glob Grep Bash(go:*) Bash(gofmt:*) Bash(golangci-lint:*) Bash(gosec:*)

Source instructions
Read source instructions

Open to load source instructions

Original SKILL.md

Open to load the original file

Source & validation
Source status
Awaiting source check
Format validation
Format valid
Checked at
Pending source check
Content SHA-256
a9ece0f76b88f75dec97349a43afdbc32604d10bb2b1c420516be4e92fb418b2
Discussion
Comments Be the First to Comment

Please log in to comment

    No comments yet

Related skills