01
It starts by itself
PR changes Go files. Runs in GitHub Actions or Claude Code routine.
- ↻ PR changes Go files
pull_request paths: **/*.go
No swallowed or double-logged errors.
Install the Golang Error Handling skill and make it a habit: follow https://gethabit.dev/skills/samber/golang-error-handling.md
43K installs4K starsMIT licenceSource on GitHub ↗

Golang Error Handling
by samber · 43K installs
The skill
The golang error handling skill teaches Go developers idiomatic error handling: wrapping with %w, errors.Is and errors.As, errors.Join, sentinel and custom errors, panic and recover, and structured logging with slog.
Only when you ask.
The habit
No swallowed or double-logged errors.
↻ Runs by itselfPR changes Go files
When does it start? How does it check its work? What does it remember?
Stops after one pull request per run.
The agent lists changed Go functions that create, wrap, log or return errors.
It checks errors.New and fmt.Errorf use, lowercase messages and sentinel versus custom types.
It checks %w inside the code, %v at system boundaries, and errors.Is or errors.As for inspection.
It finds log-and-return pairs, swallowed errors and errors discarded with _.
It flags panic for expected cases and logging without slog.
It runs golangci-lint and the tests, comments findings and logs them.
It writes only in its own folder and asks you before anything goes out.
Read both lists. If the left one sounds like you, the Golang Error Handling skill helps.
An error is either logged or returned, never both, so logs do not fill with duplicates.
Yes. Audit mode uses up to 5 sub-agents, one per error category. This loop uses review mode on each PR.
No. The skill suggests samber/oops for production errors that need stack traces, but the checks work without it.
Copy the prompt at the top into your agent. It installs the skill from samber/cc-skills-golang and sets up the habit. Or run npx skills add samber/cc-skills-golang --skill golang-error-handling.
Yes. It is published under MIT. Habit is free too.
Install the Golang Error Handling skill and make it a habit: follow https://gethabit.dev/skills/samber/golang-error-handling.md
All samber skills →More code skills →
Works in
Made by samber, published under MIT. Habit links to the original and never changes it. Is this your skill?