Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add gonzaloserrano/gopilot --skill go-error-hygienegit clone --depth 1 https://github.com/gonzaloserrano/gopilotWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/gonzaloserrano/gopilot/go-error-hygiene)<a href="https://agentmods.dev/skills/gonzaloserrano/gopilot/go-error-hygiene"><img src="https://agentmods.dev/badge/skills/gonzaloserrano/gopilot/go-error-hygiene/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/gonzaloserrano/gopilot/go-error-hygiene"><img src="https://agentmods.dev/badge/skills/gonzaloserrano/gopilot/go-error-hygiene.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00092 | $0.02205 |
| Opus 5 | $0.00046 | $0.01103 |
| Sonnet 5 | $0.00018 | $0.00441 |
| Haiku 4.5 | $0.00009 | $0.00220 |
Grade A, and why
go-error-hygiene scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 255 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Go Error Hygiene
Detect and fix the "handle errors more than once" antipattern across a Go codebase.
The Rule
An error should be handled exactly once. Handling means one of:
- Logging it (to stdout, a logger, or a tracing span)
- Returning it to the caller (wrapped with context)
- Degrading gracefully (fallback, retry, default value)
If you do more than one at the same call site, you're double-handling. The most common violation: log AND return.
Why It Matters
- Duplicate log lines obscure root cause during incidents
- Callers that receive the returned error may log it again, tripling noise
- Coupling observability (tracing/logging) with error propagation makes both harder to change
- Interior log noise buries the wrapped error chain that actually tells the story
Detection Procedure
Step 1: Find helper functions that log AND wrap
Search for functions that combine logging/tracing with error wrapping in a single call:
# Find definitions (handles both functions and methods)
rg -n "^func\b.*\b(Log|Trace|Record)\w*(Wrap|Error|Return)" --type go
rg -n "^func\b.*\b(Wrap|Return)\w*(Log|Trace|Record)" --type go
# Find usages of common helpers
rg -n "LogAndWrapError|logAndReturn|wrapAndLog|traceAndWrap" --type go
Read each definition. If the function both logs/traces AND returns a wrapped error, it's a codified antipattern.
Step 2: Find explicit log-then-return blocks
Search for logging calls near error returns:
# Standard library log (exclude Fatal -- it's terminal, not double-handling)
rg -n "log\.(Printf|Println|Print)\b" --type go -A 3
# Zap
rg -n "zap\.L\(\)\.(Error|Warn)|logger\.(Error|Warn|Errorw|Warnw)" --type go -A 3
# Slog
rg -n "slog\.(Error|Warn)" --type go -A 3
# OpenTracing/OpenTelemetry span logging
rg -n "span\.(LogFields|SetTag|RecordError|AddEvent)|tracing\.LogError" --type go -A 3
For each match, check whether a return ...err follows within 1-3 lines. If yes, it's a double-handle candidate.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 255 lines · 92 tokens per session scan A 41071546df27
go-error-hygiene is a skill published in the GitHub repository gonzaloserrano/gopilot (17 stars, last pushed 2mo ago), licensed MIT. It adds 92 tokens to every session and 2,205 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
golang-refactoring
Golang refactoring — safe, at-scale restructuring of existing Go code: a coverage-adaptive safety net, behavior-preserving transforms (gopls Rename/Extract, gofmt -r, gopatch), the Fowler catalog mapped to Go, breaking import cycles, and small stacked PRs. Apply when a function or type has grown too large, a code…
sapcc-review
Gold-standard SAP CC Go code review: 10 parallel domain specialists.
go-concurrency-safety
L1 supplement - audits Go-specific concurrency hazards in node client code: map iteration non-determinism, goroutine leaks, mutex ordering, panic boundaries, context cancellation.
design-review
Deep design review of Go codebase — naming, structure, consistency, interfaces, error handling. Scores each dimension and provides actionable fixes.
agents-md
Generate AGENTS.md files for Go, Rust, TypeScript, and Java projects. Use this skill whenever the user asks to create, scaffold, bootstrap, update, or review an AGENTS.md (or agent-instructions, CLAUDE.md, repo guide for agents) file in a codebase. Also trigger when the user says "add AGENTS.md", "make this repo…
sapcc-audit
Full-repo SAP CC Go compliance audit against review standards.