LogoAwesome Skills
  • Search
  • Category
  • Tag
  • Blog
LogoAwesome Skills
LogoAwesome Skills

Discover Open-Source Agent Skills for AI Coding Assistants

Product

  • Search
  • Category
  • Tag
  • Blog

Resources

  • Claude Skill Docs
  • Antigravity Skills Docs

Tools

  • Claude Code
  • OpenCode
  • Cursor
  • Codex
  • Antigravity

Company

  • Privacy Policy
  • Terms of Service
  • Sitemap

©2026 Awesome Skills. All rights reserved.

Privacy PolicyTerms
Back to Skills

golang-safety

Defensive Golang coding to prevent panics, silent data corruption, and subtle runtime bugs. Use when encountering nil panics, append aliasing, map concurrent access, float comparison pitfalls, or zero-value design questions. Also use when reviewing code for nil-safety, numeric conversion overflow, resource lifecycle issues (defer in loops), or defensive copying of slices and maps.

1,747stars112forksUpdated 5/20/2026
Code Review#defensive-coding#runtime-errors#nil-safety#golang#code-safety#code-review

Security Assessment

Safe(100/100)
Security Score100/100

About golang-safety

The `golang-safety` skill is designed to help developers write defensive and reliable Go code, preventing common runtime errors such as panics, silent data corruption, and subtle logic bugs. It focuses on areas where Go's language semantics can lead to unexpected behavior, including nil pointer handling, slice and map aliasing, concurrent map access, float comparison issues, and zero-value design pitfalls. By emphasizing defensive coding practices, this skill aims to reduce crashes and unintended side effects in normal, non-adversarial code. It complements security-focused approaches by addressing mistakes programmers may make themselves rather than attacks from outside sources.

Key features of the skill include guidance on using generics safely, performing type assertions without risk, understanding the nuances of nil interfaces, ensuring safe slice and map operations, returning defensive copies from exported functions, and correctly managing resource lifecycles using `defer` and `sync.Once`. It also provides best practices for integer and float arithmetic, designing useful zero values, and handling concurrency safely. The skill is compatible with Golang projects and AI coding agents like Claude Code, helping developers catch common pitfalls before they become runtime issues.

This skill is particularly useful for Go engineers, code reviewers, and anyone maintaining production-grade Go code who wants to enforce safety and correctness. It is ideal when encountering nil-related panics, subtle bugs in slice or map handling, numeric conversion overflow risks, or challenges in designing zero-value-safe data structures. Users seeking to improve code robustness and prevent latent crashes in their Go applications will find this skill valuable, especially when reviewing or refactoring code for safety and reliability.

FAQ

How do I use the golang-safety skill?

Invoke the skill when writing or reviewing Go code to check for nil-safety, slice/map aliasing, numeric conversion issues, and other common runtime pitfalls. Follow the provided best practices to prevent crashes and data corruption.

Which environments is this skill compatible with?

The skill is designed for use with Claude Code or similar AI coding agents, and it is intended for Golang projects. It requires the Go binary to be available.

Are there any limitations or prerequisites?

The skill assumes familiarity with Go and its runtime behaviors. It does not handle adversarial security issues and focuses on programmer errors. It also requires that Go is installed and available in the environment.

Does the skill modify code automatically?

The skill provides guidance, best practices, and examples, but it does not inherently modify code. It can be used alongside tools that read, edit, or lint Go code.

Can I use this skill for concurrency issues?

Yes, the skill includes guidance on safe initialization with `sync.Once` and handling concurrent map access, helping prevent race conditions and data corruption.

All Files

4 files
SKILL.md9.8 KB
View
references/slice-map-safety.md5.1 KB
View
evals/evals.json47.2 KB
View
references/nil-safety.md4.7 KB
View

Install golang-safety

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

samber/cc-skills-golang

Related Skills

short-form-video

14

multi-asset-morning-briefing

7,907

content-strategy

2,901

doherty-threshold

2,901