Agent skill

Goerr Error Handling

by secmon-lab in secmon-lab/warren

Write Go error handling code using the goerr library. An agent skill from secmon-lab/warren.

Apache-2.0Auto-check passedDevelopment

Install Goerr Error Handling

skills CLI
$ npx skills add secmon-lab/warren --skill goerr-error-handling -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install secmon-lab/warren goerr-error-handling --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/secmon-lab/warren.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/goerr-error-handling .claude/skills/goerr-error-handling && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
goerr-error-handling
GitHub stars
134
Token cost
~1.2k tokens
SKILL.md length
289 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
Apache-2.0

At a glance

Write Go error handling code using the goerr library. An agent skill from secmon-lab/warren.

  • Works in 3 steps: Locate goerr documentation → Choose the right function → Apply best practices
  • Creating errors
  • SKILL.md covers Step 1: Locate goerr…, Step 2: Choose the right…, Step 3: Apply best practices and Quick Reference
  • Calls go

What it does

Goerr Error Handling is an agent skill from secmon-lab/warren. Write Go error handling code using the goerr library. Use when creating errors, wrapping errors, adding context, or handling errors in Go code that uses goerr.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Error handling. The repository describes itself as: AI-powered security alert management that reduces noise and accelerates response time. The licence is Apache-2.0.

When your agent uses it

  • Creating errors
  • Wrapping errors
  • Handling errors in Go code that uses goerr

Example prompts

  • “/goerr-error-handling”

Requirements

  • Pre-approved tools (allowed-tools): Read, Bash(go:*)

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Locate goerr documentation
  2. Choose the right function
  3. Apply best practices

What it can do on your machine

Read from SKILL.md and the folder at commit e9c3607. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Bash(go:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • go

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Goerr Error Handling loads about 1.2k tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 289 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~45
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from secmon-lab/warren at commit e9c3607, republished under its Apache-2.0 licence (© secmon-lab). 289 words, ~1,187 tokens.

Download SKILL.mdSave it as .claude/skills/goerr-error-handling/SKILL.md (or your agent's skills folder).
name
goerr-error-handling
description
Write Go error handling code using the goerr library. Use when creating errors, wrapping errors, adding context, or handling errors in Go code that uses goerr.
allowed-tools
Read, Bash(go:*)

Error Handling with goerr

When writing Go error handling code, use the goerr library for enhanced errors with stack traces, contextual values, and structured logging support.

Step 1: Locate goerr documentation

First, find where goerr is installed and read its documentation:

bash
GOERR_DIR=$(go list -m -f '{{.Dir}}' github.com/m-mizutani/goerr/v2 2>/dev/null)

If goerr is available, read the relevant documentation from $GOERR_DIR/:

  • README.md - Full feature overview, code examples, and API reference
  • docs/migration.md - Migration guide from pkg/errors, standard errors, or goerr v1
  • examples/ - Working example programs for each feature

Step 2: Choose the right function

SituationUseNOT
Create a new errorgoerr.New("msg")errors.New("msg") or fmt.Errorf("msg")
Wrap an existing errorgoerr.Wrap(err, "msg")fmt.Errorf("msg: %w", err)
Add context without changing messagegoerr.With(err, goerr.V("k", v))goerr.Wrap(err, err.Error(), goerr.V("k", v))
Simple key-value contextgoerr.V("key", value)Building context into message string
Type-safe contextgoerr.TV(typedKey, value)goerr.V() when type safety matters
Categorize errorsgoerr.T(tagValue)Sentinel errors for categories
Shared context across errorsgoerr.NewBuilder(opts...)Repeating same options everywhere
Collect multiple errorsgoerr.Append(errs, err)Manual slice management
Define sentinel errorsgoerr.New("msg", goerr.ID("ERR_X"))errors.New("msg")
Extract goerr.Errorgoerr.Unwrap(err)errors.As(err, &goErr)
Extract goerr.Errorsgoerr.AsErrors(err)errors.As(err, &goErrs)
Check error taggoerr.HasTag(err, tag)Manual unwrap + check

Step 3: Apply best practices

Error messages should describe what failed, not why
go
// Good
goerr.Wrap(err, "failed to save user")

// Bad - "why" belongs in context values
goerr.Wrap(err, fmt.Sprintf("failed to save user %s due to timeout", userID))
Use context values for structured data, not string interpolation
go
// Good
goerr.Wrap(err, "query failed",
    goerr.V("table", "users"),
    goerr.V("user_id", userID))

// Bad
goerr.Wrap(err, fmt.Sprintf("query on table users failed for user %s", userID))
Define typed keys at package level for critical values
go
var (
    UserIDKey = goerr.NewTypedKey[string]("user_id")
    CountKey  = goerr.NewTypedKey[int]("count")
)

err := goerr.New("error", goerr.TV(UserIDKey, "user123"))
if userID, ok := goerr.GetTypedValue(err, UserIDKey); ok {
    // userID is guaranteed to be string
}
Define tags and sentinel errors at package level
go
var (
    TagNotFound   = goerr.NewTag("not_found")
    TagValidation = goerr.NewTag("validation")
)

var (
    ErrNotFound = goerr.New("not found", goerr.ID("ERR_NOT_FOUND"))
    ErrInvalid  = goerr.New("invalid input", goerr.ID("ERR_INVALID"))
)
Use Builder for shared context in a scope
go
func (s *Service) process() error {
    eb := goerr.NewBuilder(
        goerr.V("user_id", s.userID),
        goerr.V("request_id", s.reqID))

    if err := s.validate(); err != nil {
        return eb.Wrap(err, "validation failed")
    }
    if err := s.save(); err != nil {
        return eb.Wrap(err, "save failed")
    }
    return nil
}
Use Unstack() for helper functions
go
func newDomainError(msg string, opts ...goerr.Option) *goerr.Error {
    return goerr.New(msg, opts...).Unstack()
}
Use slog integration for structured logging
go
logger.Error("operation failed", slog.Any("error", err))
// Automatically includes message, values, tags, and stack trace

Quick Reference

Error creation: goerr.New, goerr.Wrap, goerr.With

Options: goerr.Value / goerr.V, goerr.TypedValue / goerr.TV, goerr.Tag / goerr.T, goerr.ID

Extraction: goerr.Unwrap, goerr.AsErrors, goerr.Values, goerr.TypedValues, goerr.Tags, goerr.HasTag, goerr.GetTypedValue

Multiple errors: goerr.Join, goerr.Append, (*Errors).ErrorOrNil, (*Errors).IsEmpty, (*Errors).Len

Builder: goerr.NewBuilder, (*Builder).With, (*Builder).New, (*Builder).Wrap

Type-safe keys: goerr.NewTypedKey[T], goerr.TV, goerr.GetTypedValue

Tags: goerr.NewTag, goerr.T, goerr.HasTag, (*Error).HasTag

Stack control: (*Error).Unstack, (*Error).UnstackN

© secmon-lab, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/goerr-error-handling of secmon-lab/warren.

Open the folder on GitHubat commit e9c3607

Compare with similar skills

Goerr Error Handling next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Goerr Error Handling compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Goerr Error Handling this skillsecmon-lab/warren134—~1.2kAutomated safety check: PassApache-2.0
Mole Bug Patternstw93/Mole70k—~2kAutomated safety check: PassGPL-3.0
Native Data FetchingCherryHQ/cherry-studio-app4k6 repos~2.9kAutomated safety check: NotesMIT
Rust Best Practicesfarm-fe/farm5.6k3 repos~1.1kAutomated safety check: PassMIT
R Function Input Validationtidyverse/dplyr5.1k1 repos~2.3kAutomated safety check: PassCustom licence
Next Best Practicesvercel-labs/openreview1.7k18 repos~1kAutomated safety check: PassNone

Similar skills

  • A catalog of recurring bug shapes in the Mole Mac cleaner, used to review safety-sensitive diffs for deletion safety, unbounded commands, shell traps and weak tests.

    70k GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed
  • Native Data Fetching

    CherryHQ/cherry-studio-app

    A skill your agent uses when implementing or debugging ANY network request, API call, or data fetching.

    4k GitHub starsUsed in 6 repos~2.9k tokens
    DevelopmentAuto-check: notes
  • Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.

    5.6k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Validates arguments of exported R functions with the standalone check_* type checkers from rlang, in tidyverse style with clear error messages.

    5.1k GitHub starsUsed in 1 repo~2.3k tokens
    DevelopmentAuto-check passed
  • Next Best Practices

    vercel-labs/openreview

    Official

    Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

    1.7k GitHub starsUsed in 18 repos~1k tokens
    DevelopmentAuto-check passed
  • Error Handling

    microsoft/data-formulator

    Official

    统一错误处理系统。在添加 API 端点、修改错误处理、添加前端 API 调用、编写错误相关测试时使用. An agent skill from microsoft/data-formulator.

    18k GitHub stars~3.8k tokensUpdated today
    DevelopmentAuto-check passed

More from secmon-lab/warren

  • Test With Gt

    secmon-lab/warren

    Write Go test code using the gt library. An agent skill from secmon-lab/warren.

    134 GitHub stars~509 tokensUpdated 2 mo ago
    Auto-check passed

Categories

Questions about Goerr Error Handling

What does Goerr Error Handling do?

Write Go error handling code using the goerr library. An agent skill from secmon-lab/warren. Goerr Error Handling is an agent skill from secmon-lab/warren. Write Go error handling code using the goerr library.

When should I use Goerr Error Handling?

Goerr Error Handling fits situations like: creating errors; wrapping errors; handling errors in Go code that uses goerr.

How do I install Goerr Error Handling in Claude Code?

Run `npx skills add secmon-lab/warren --skill goerr-error-handling -a claude-code`. Or copy the skill folder (.claude/skills/goerr-error-handling in secmon-lab/warren) into .claude/skills/goerr-error-handling in your project. Claude Code loads it when a task matches its description.

How do I install Goerr Error Handling in Codex?

Run `npx skills add secmon-lab/warren --skill goerr-error-handling -a codex`. Or copy the skill folder (.claude/skills/goerr-error-handling in secmon-lab/warren) into .agents/skills/goerr-error-handling in your project. Codex loads it when a task matches its description.

Can I use Goerr Error Handling in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add secmon-lab/warren --skill goerr-error-handling -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/goerr-error-handling, .gemini/skills/goerr-error-handling, .github/skills/goerr-error-handling and .opencode/skills/goerr-error-handling in your project.

What does Goerr Error Handling need to run?

Going by SKILL.md and its folder, Goerr Error Handling needs the command-line tools its instructions call (go). Its frontmatter pre-approves these tools: Read, Bash(go:*).

Does Goerr Error Handling access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Goerr Error Handling safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Goerr Error Handling use?

Goerr Error Handling is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Goerr Error Handling use?

About 1.2k tokens (SKILL.md is roughly 4.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Goerr Error Handling?

Skills that share tags, products or a category with Goerr Error Handling: Mole Bug Patterns (tw93/Mole, 70k stars), Native Data Fetching (CherryHQ/cherry-studio-app, 4k stars), Rust Best Practices (farm-fe/farm, 5.6k stars) and R Function Input Validation (tidyverse/dplyr, 5.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Goerr Error Handling?

secmon-lab (a GitHub organization) maintains it in secmon-lab/warren, which has 134 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on July 20, 2026.

Source: secmon-lab/warren on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.