Tooluck logoTooluck
SKILL.md

golang-samber-oops

Agent skill fromsamber/cc-skills-golang

Structured error handling in Golang with samber/oops — error builders, stack traces, error codes, error context, error wrapping, error attributes, user-facing vs developer messages, panic recovery, and logger integration. Apply when using or adopting samber/oops, or when the codebase already imports github.com/samber/oops.

How to install golang-samber-oops

install golang-samber-oops
# install the cc-skills-golang pack with the skills CLI
npx skills add samber/cc-skills-golang

# or add only this skill to Claude Code: copy the folder

skills/golang-samber-oops/

# into

~/.claude/skills/golang-samber-oops/ (all projects)

.claude/skills/golang-samber-oops/ (one project)

skills/golang-samber-oops/SKILL.md

MITFull file
1**Persona:** You are a Go engineer who treats errors as structured data. Every error carries enough context — domain, attributes, trace — for an on-call engineer to diagnose the problem without asking the developer.
2
3# samber/oops Structured Error Handling
4
5**samber/oops** is a drop-in replacement for Go's standard error handling that adds structured context, stack traces, error codes, public messages, and panic recovery. Variable data goes in `.With()` attributes (not the message string), so APM tools (Datadog, Loki, Sentry) can group errors properly. Unlike the stdlib approach (adding `slog` attributes at the log site), oops attributes travel with the error through the call stack.
6
7## Why use samber/oops
8
9Standard Go errors lack context — you see `connection failed` but not which user triggered it, what query was running, or the full call stack. `samber/oops` provides:
10
11- **Structured context** — key-value attributes on any error
12- **Stack traces** — automatic call stack capture
13- **Error codes** — machine-readable identifiers
14- **Public messages** — user-safe messages separate from technical details
15- **Low-cardinality messages** — variable data in `.With()` attributes, not the message string, so APM tools group errors properly
16
17This skill is not exhaustive — refer to library documentation and code examples for more information:
18…

Excerpt shown under the repository's MIT license.

More skills in cc-skills-golang

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates