go-service-idioms

go-service-idioms is a skill for Claude Code from shennawardana23/skillme. It costs 101 tokens per session (1,208 once invoked), scanned A, original, Apache-2.0.

A guide to common patterns for writing and reviewing production Go services, including errors, contexts, concurrency, package layout, and tests. Production-grade means code designed to behave predictably in real deployments and failures.

In plain words
What is it for?
Implementing Go backend functions, wrapping and checking errors, propagating cancellation, structuring packages, writing table-driven tests, and reviewing Go code.
Why use it?
It reduces silently ignored errors, unclear package structure, unsafe failure handling, and inconsistent service code.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Part of the skillme plugin — 137 skills, 2 commands shipped together

Good fit Implementing Go backend functions, wrapping and checking errors, propagating cancellation, structuring packages, writing table-driven tests, and reviewing Go code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shennawardana23/skillme/go-service-idioms
Install

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.

Any agent
npx skills add shennawardana23/skillme --skill go-service-idioms
Clone the repo
git clone --depth 1 https://github.com/shennawardana23/skillme

Made for: Claude Code.

Or install skillme, the plugin that ships this one along with the rest of its 137 skills, 2 commands.

Wrote 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.

agentmods badge for go-service-idioms

README.md
[![agentmods](https://agentmods.dev/badge/skills/shennawardana23/skillme/go-service-idioms/github.svg)](https://agentmods.dev/skills/shennawardana23/skillme/go-service-idioms)
Your own site
<a href="https://agentmods.dev/skills/shennawardana23/skillme/go-service-idioms"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/go-service-idioms/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.

agentmods 80×15 button for go-service-idioms

Your own site · 80×15
<a href="https://agentmods.dev/skills/shennawardana23/skillme/go-service-idioms"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/go-service-idioms.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 101 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,208 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00101 $0.01208
Opus 5 $0.00051 $0.00604
Sonnet 5 $0.00020 $0.00242
Haiku 4.5 $0.00010 $0.00121

Measured 9d ago against content hash 75a314aae2b4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

go-service-idioms 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 9d 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.

skills/go-service-idioms/SKILL.md · 134 lines

How it starts

The opening of the file, as written. The whole thing — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Go Service Idioms

Provide idiomatic, production-grade Go patterns for backend services: error handling, context propagation, concurrency, package layout, and testing. Apply these defaults whenever writing or reviewing Go code in this catalog's domain, unless the surrounding project's existing conventions say otherwise — match existing patterns first, fall back to this skill's defaults for new code.

Error handling

Wrap errors with %w and enough context to debug without a stack trace, never discard an error silently, and never use panic for expected failure paths (bad input, network failure, not-found). Reserve panic for programmer errors (nil deref, invariant violation) that should crash fast in development.

cfg, err := loadConfig(path)
if err != nil {
    return nil, fmt.Errorf("load config from %s: %w", path, err)
}

Define sentinel errors (var ErrNotFound = errors.New("not found")) or typed errors when callers need to branch on failure kind, and check them with errors.Is / errors.As — never string-match an error message.

Do not wrap an error and then also log it at every layer it passes through; wrap once, log once at the boundary that handles it (an HTTP handler, a CLI entrypoint, a queue consumer).

Context propagation

Thread context.Context as the first parameter of any function that does I/O (network call, DB query, file read over a slow mount) so callers can cancel or bound it with a deadline. Never store a context.Context in a struct field — pass it explicitly through the call chain.

func fetchReservation(ctx context.Context, db *sql.DB, id string) (*Reservation, error) {
    row := db.QueryRowContext(ctx, "SELECT ... WHERE id = $1", id)
    ...
}

Check ctx.Err() (or select on ctx.Done()) inside loops that could run long, and return promptly with ctx.Err() wrapped, rather than polling with time.Sleep.

Concurrency

Prefer golang.org/x/sync/errgroup over hand-rolled sync.WaitGroup + manual error channel when fanning out concurrent work that can fail:

Read the full file on GitHub · 134 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 9d ago First seen · 134 lines · 101 tokens per session scan A 75a314aae2b4

Subscribe to this mod's changes

go-service-idioms is a skill published in the GitHub repository shennawardana23/skillme (2 stars, last pushed 15d ago), licensed Apache-2.0. It adds 101 tokens to every session and 1,208 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-09-03.

Related

Other skills, from other repositories

test-driven-development

Use when implementing any feature or bugfix, before writing implementation code.

obra/superpowers · 17 tokens

xdto-validate

A validator for XDTO packages in 1C:Enterprise. It checks the package model, its metadata object, and its connection to the configuration.

Nikolay-Shirokov/cc-1c-skills · 34 tokens

unit-test-caching

Provides patterns for unit testing Spring Cache annotations (@Cacheable, @CachePut, @CacheEvict). Generates test code that mocks cache managers, verifies cache hit/miss behavior, tests cache key generation with SpEL expressions, validates eviction strategies, and checks conditional caching scenarios. Triggers: caching…

giuseppe-trisciuoglio/developer-kit · 88 tokens

spring-boot-test-patterns

Provides comprehensive testing patterns for Spring Boot applications covering unit, integration, slice, and container-based testing with JUnit 5, Mockito, Testcontainers, and performance optimization. Use when writing tests, @Test methods, @MockBean mocks, or implementing test suites for Spring Boot applications.

giuseppe-trisciuoglio/developer-kit · 64 tokens

unit-test-config-properties

Provides patterns for unit testing @ConfigurationProperties classes with @ConfigurationPropertiesTest. Validates property binding, tests validation constraints, verifies default values, checks type conversions, and mocks property sources for Spring Boot configuration properties. Use when testing application…

giuseppe-trisciuoglio/developer-kit · 75 tokens

unit-test-json-serialization

Provides patterns for unit testing JSON serialization/deserialization with Jackson and @JsonTest. Validates JSON mapping, custom serializers, date formats, and polymorphic types. Use when testing JSON serialization, validating custom serializers, or writing JSON unit tests in Spring Boot applications.

giuseppe-trisciuoglio/developer-kit · 59 tokens