rmx: Skill for Claude Code

.agents/skills/golang-design-patterns/SKILL.md

golang-design-patterns is a skill for Claude Code from braswelljr/rmx. It costs 83 tokens per session (2,641 once invoked), scanned A, a copy of golang-design-patterns, MIT.

A guide to common design patterns and idiomatic practices for Go programs, including construction, errors, resources, shutdown, resilience, and architecture.

In plain words
What is it for?
Use it when designing or reviewing Go APIs, packages, application structure, dependency handling, data flow, streaming, and service shutdown.
Why use it?
It helps developers choose simple structures that solve real problems and spot issues such as unmanaged resources, missing time limits, and hidden global state.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; mentions Claude Code; installed under .agents/ (shared by several agents).

This is braswelljr/rmx's own configuration. It tells Claude Code how to work on rmx itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything rmx configures →

Reuse

Borrowing it

Nothing to install: this file belongs to braswelljr/rmx. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/braswelljr/rmx/main/.agents/skills/golang-design-patterns/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/braswelljr/rmx

Made for: Claude Code.

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 golang-design-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/braswelljr/rmx/golang-design-patterns/github.svg)](https://agentmods.dev/skills/braswelljr/rmx/golang-design-patterns)
Your own site
<a href="https://agentmods.dev/skills/braswelljr/rmx/golang-design-patterns"><img src="https://agentmods.dev/badge/skills/braswelljr/rmx/golang-design-patterns/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 golang-design-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/braswelljr/rmx/golang-design-patterns"><img src="https://agentmods.dev/badge/skills/braswelljr/rmx/golang-design-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,641 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 94% copy Near-identical to another mod 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.00083 $0.02641
Opus 5 $0.00042 $0.01321
Sonnet 5 $0.00017 $0.00528
Haiku 4.5 $0.00008 $0.00264

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

Security

Grade A, and why

golang-design-patterns 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 10d 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.

Origin

This is a copy

94% identical to golang-design-patterns — 9 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.agents/skills/golang-design-patterns/SKILL.md · 277 lines

How it starts

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

Persona: You are a Go architect who values simplicity and explicitness. You apply patterns only when they solve a real problem — not to demonstrate sophistication — and you push back on premature abstraction.

Modes:

  • Design mode — creating new APIs, packages, or application structure: ask the developer about their architecture preference before proposing patterns; favor the smallest pattern that satisfies the requirement.
  • Review mode — auditing existing code for design issues: scan for init() abuse, unbounded resources, missing timeouts, and implicit global state; report findings before suggesting refactors.

Community default. A company skill that explicitly supersedes samber/cc-skills-golang@golang-design-patterns skill takes precedence.

Go Design Patterns & Idioms

Idiomatic Go patterns for production-ready code. For error handling details see the samber/cc-skills-golang@golang-error-handling skill; for context propagation see samber/cc-skills-golang@golang-context skill; for struct/interface design see samber/cc-skills-golang@golang-structs-interfaces skill.

Best Practices Summary

  1. Constructors SHOULD use functional options — they scale better as APIs evolve (one function per option, no breaking changes)
  2. Functional options MUST return an error if validation can fail — catch bad config at construction, not at runtime
  3. Avoid init() — runs implicitly, cannot return errors, makes testing unpredictable. Use explicit constructors
  4. Enums SHOULD start at 1 (or Unknown sentinel at 0) — Go's zero value silently passes as the first enum member
  5. Error cases MUST be handled first with early return — keep happy path flat
  6. Panic is for bugs, not expected errors — callers can handle returned errors; panics crash the process
  7. defer Close() immediately after opening — later code changes can accidentally skip cleanup
  8. runtime.AddCleanup over runtime.SetFinalizer — finalizers are unpredictable and can resurrect objects
  9. Every external call SHOULD have a timeout — a slow upstream hangs your goroutine indefinitely
  10. Limit everything (pool sizes, queue depths, buffers) — unbounded resources grow until they crash
  11. Retry logic MUST check context cancellation between attempts
  12. Use strings.Builder for concatenation in loops → see samber/cc-skills-golang@golang-code-style
  13. string vs []byte: use []byte for mutation and I/O, string for display and keys — conversions allocate
  14. Iterators (Go 1.23+): use for lazy evaluation — avoid loading everything into memory
  15. Stream large transfers — loading millions of rows causes OOM; stream keeps memory constant
  16. //go:embed for static assets — embeds at compile time, eliminates runtime file I/O errors
  17. Use crypto/rand for keys/tokens — math/rand is predictable → see samber/cc-skills-golang@golang-security
  18. Regexp MUST be compiled once at package level — compilation is O(n) and allocates
  19. Compile-time interface checks: var _ Interface = (*Type)(nil)
  20. A little recode > a big dependency — each dep adds attack surface and maintenance burden
  21. Design for testability — accept interfaces, inject dependencies

Read the full file on GitHub · 277 lines

Files

What ships with it

7 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. 10d ago First seen · 277 lines · 83 tokens per session scan A facb970dcff3

Subscribe to this mod's changes

golang-design-patterns is a skill published in the GitHub repository braswelljr/rmx (5 stars, last pushed 21d ago), licensed MIT. It adds 83 tokens to every session and 2,641 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 94% identical to golang-design-patterns, differing in 9 lines, and is treated as a copy.

Related

Other skills, from other repositories

robotgo-flow

Use when building YAML-driven Windows RPA workflows in Go — step-by-step desktop automation with image template matching, interactive recording mode, hotkey triggers. RobotGo-Flow: YAML-based Windows RPA framework built on RobotGo.

znlgis/opengis-skills · 50 tokens

electron-expert

Expert in Electron framework, desktop app development, IPC, and cross-platform packaging. Use when the user mentions desktop, Node.js, cross platform, Windows, macOS, or Linux, or when the task involves Electron Architecture, Process Types, IPC Communication, or App Lifecycle.

personamanagmentlayer/pcl · 59 tokens

add-cobra-version

Add a version subcommand with build metadata to an existing Cobra-based Go CLI. Use when the user says "add a version subcommand", "add the version command", "wire up version, commit, and date", "add build metadata to version", "add a /version command to this CLI", "make the version command print commit and build…

cboone/agent-harness-plugins · 176 tokens

scaffold-go-cli

Scaffold a complete Go CLI project with Cobra, GoReleaser, GitHub Actions CI/CD, Homebrew tap publishing, and Makefile. Use when the user says "scaffold a Go CLI", "new Go CLI project", "create a Go CLI", "start a Go CLI", "bootstrap a Go CLI", or starts a Go command-line tool from scratch. Optionally adds Viper for…

cboone/agent-harness-plugins · 136 tokens

scaffold-go-library

Scaffold a Go library project with GoReleaser changelog-only releases, golangci-lint, GitHub Actions CI/CD (multi-version Go matrix), and Makefile. Use when the user says "scaffold a Go library", "new Go library", "create a Go package", "start a Go library", "bootstrap a Go library", or starts a Go module that exposes…

cboone/agent-harness-plugins · 123 tokens

add-goreleaser-homebrew

Add GoReleaser configuration and a GitHub Actions release workflow to an existing Go CLI project with Homebrew tap publishing. Use when the user says "add goreleaser", "set up goreleaser", "add Homebrew tap publishing", "publish to Homebrew", "set up release workflow", "add release automation for Go", or wants a Go…

cboone/agent-harness-plugins · 149 tokens