go-error-handling
Go-specific error handling strategy. Teaches developers how to wrap, match, and propagate errors across packages properly.
Install
mkdir -p .claude/skills/go-error-handling && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10023" && unzip -o skill.zip -d .claude/skills/go-error-handling && rm skill.zipInstalls to .claude/skills/go-error-handling
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when writing Go code that returns, wraps, or handles errors — choosing between sentinel errors, custom types, and fmt.Errorf (%w vs %v), structuring error flow, or deciding whether to log or return. Also use when propagating errors across package boundaries or using errors.Is/As, even if the user doesn't ask about error strategy. Does not cover panic/recover patterns (see go-defensive).Key capabilities
- →Detect error handling anti-patterns using bash scripts
- →Implement error wrapping with fmt.Errorf and %w
- →Define sentinel errors and custom error types
- →Structure error flow with early returns
- →Propagate errors across package boundaries
How it works
The skill provides scripts to identify anti-patterns like naked returns and string comparisons, while enforcing the use of %w for wrapping and error interface returns.
Inputs & outputs
When to use go-error-handling
- →Wrapping errors for context
- →Defining custom error types
- →Checking for error strategies in Go
About go-error-handling
Outlines best practices for using errors.Is/As and fmt.Errorf %w for wrapping. It provides scripts to detect anti-patterns and rules for consistent error definitions in Go projects.
Use when writing Go code that returns, wraps, or handles errors — choosing between sentinel errors, custom types, and fmt.Errorf (%w vs %v), structuring error flow, or deciding whether to log or return. Also use when propagating errors across package boundaries or using errors.Is/As, even if the use
When not to use it
- →Handling panic or recover patterns
- →When Go version is below 1.13
Prerequisites
Limitations
- →Does not cover panic/recover patterns
- →Requires Go 1.13+ for specific wrapping features
How it compares
Unlike manual error checking, this workflow enforces consistent wrapping strategies and detects anti-patterns through automated script analysis.
Compared to similar skills
go-error-handling side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| go-error-handling (this skill) | 0 | 1mo | Review | Intermediate |
| bubbletea | 42 | 8mo | No flags | Beginner |
| golang-performance | 4 | 6mo | Review | Advanced |
| gentleman-trainer | 2 | 7mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by Rain-kl
View all by Rain-kl →You might also like
bubbletea
hmans
Browse Bubbletea TUI framework documentation and examples. Use when working with Bubbletea components, models, commands, or building terminal user interfaces in Go.
golang-performance
MadAppGang
Use when profiling Go applications (pprof), running benchmarks, optimizing memory/CPU usage, or debugging performance bottlenecks in production Go code.
gentleman-trainer
Gentleman-Programming
Vim Trainer RPG system patterns for Gentleman.Dots. Trigger: When editing files in installer/internal/tui/trainer/, adding exercises, modules, or game mechanics.
generate-subsystem-skills
llama-farm
Generate specialized skills for each subsystem in the monorepo. Creates shared language skills and subsystem-specific checklists for high-quality AI code generation.
bump-go-dependencies
docker
Update direct Go module dependencies one by one, validating each bump with tests and linter, committing individually, and producing a summary table for a PR description
cli-skills
llama-farm
CLI best practices for LlamaFarm. Covers Cobra, Bubbletea, Lipgloss patterns for Go CLI development.