Prevents the classic Go footguns: nil interface traps, append aliasing, defer in loops, silent integer truncation, and map concurrent writes. Triggers whenever you're writing or reviewing code that touches pointers, interfaces, slices, maps, or numeric conversions. The advice is dense and practical, covering things like the full slice expression to prevent shared backing arrays, why typed nil pointers aren't equal to nil in interfaces, and using sync.Once for lazy init. Worth invoking during code review or anytime you're debugging a mysterious panic. Pairs well with the golang-concurrency and golang-lint skills from the same author for complete coverage.

skills.sh installs
42.2K
GitHub stars
3.8K
last updated
Aug 21, 2026

Install

$ npx -y skills add samber/cc-skills-golang --skill golang-safety --agent claude-code

Installs into .claude/skills of the current project.

Files

Persona: You are a defensive Go engineer. You treat every untested assumption about nil, capacity, and numeric range as a latent crash waiting to happen.

Go Safety: Correctness & Defensive Coding

Prevents programmer mistakes — bugs, panics, and silent data corruption in normal (non-adversarial) code. Security handles attackers; safety handles ourselves.

Best Practices Summary

Sponsors

Details

Repository
github.com/samber/cc-skills-golang
Categories
Marketing & SEO, Go, Design & UI/UX
First seen
Apr 16, 2026

More from samber/cc-skills-golang

All 47
1pexoai avatarpexo-agentpexoai/pexo-skillsAI video generation skill with auto model selection across Seedance 2, Kling 3.0, HappyHorse, and 10+ models. Produces finished multi-shot videos (5–120s) from 40.6Kskills.sh installs
2limrun-inc avatarlimrun-android-emulatorlimrun-inc/skillsDrive an app running on a Limrun cloud Android emulator: install an APK, launch and terminate apps with crash reports, tap, type, read the UI element tree, scre40.2Kskills.sh installs
3heygen-com avatarstyle-samplingheygen-com/hyperframesMake a new episode in a proven video style - Collage Explainer, Finance Explainer, Animated Science Explainer, 3D Brand Explainer, 3D True Crime - on the person38.8Kskills.sh installs
4jakubkrehel avatarbetter-colorsjakubkrehel/skillsOKLCH color space and color usage for web projects. Convert hex/rgb/hsl to oklch, generate palettes, check contrast, handle gamut boundaries, theme with Tailwin38.4Kskills.sh installs
5firecrawl avatarfirecrawl-website-design-clonefirecrawl/firecrawl-workflowsExtract any website's design system into an agent-ready DESIGN.md using Firecrawl scrape evidence. Use when the user wants colors, fonts, spacing, components, l33.5Kskills.sh installs
6firecrawl avatarfirecrawl-dashboard-reportingfirecrawl/firecrawl-workflowsPull metrics from analytics dashboards and internal web tools with Firecrawl browser. Use when the user needs dashboard reporting, cross-platform metric summari31.9Kskills.sh installs