golang-always

golang-always is a cursor rule for Cursor from samber/cc-skills-golang. It costs 2,471 tokens per session, scanned A, original, MIT.

A set of automatic routing rules for Go code. It selects the relevant Go guidance for tasks such as naming, API design, errors, concurrency, context cancellation, database work, and gRPC services.

In plain words
What is it for?
Use it whenever working on a Go file. It helps choose the primary and supporting skills for designing types and APIs, writing concurrent code, handling databases, and building gRPC services.
Why use it?
It prevents developers from loading only one narrow guideline when a Go task also involves related concerns such as cancellation, testing, security, or error handling.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it whenever working on a Go file. It helps choose the primary and supporting skills for designing types and APIs, writing concurrent code, handling databases, and building gRPC services.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/samber/cc-skills-golang/golang-always
About the project

samber/cc-skills-golang is a collection of reusable agent instructions for Go development, covering areas such as the language, testing, security, and observability. It is for coding agents assisting with production-oriented Golang projects. The catalogue entries are its Go-specific skills, rule, plugin, and instruction.

samber/cc-skills-golang · 3,223 stars · on GitHub · skills.sh

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.

Clone the repo
git clone --depth 1 https://github.com/samber/cc-skills-golang

Made for: Cursor.

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-always

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

Your own site · 80×15
<a href="https://agentmods.dev/rules/samber/cc-skills-golang/golang-always"><img src="https://agentmods.dev/badge/rules/samber/cc-skills-golang/golang-always.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,471 This file is loaded in full into every session.
When invoked 2,471 The same file — it is already loaded in full.
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.02471 $0.02471
Opus 5 $0.01236 $0.01236
Sonnet 5 $0.00494 $0.00494
Haiku 4.5 $0.00247 $0.00247

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

Security

Grade A, and why

golang-always 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 4d 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.

rules/golang-always.mdc · 113 lines

How it starts

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

Golang Skills — Always Load Rules

This rule embeds the skill-routing logic directly. It applies to every Go file in the project, ensuring the right Go skills trigger on every Go task without an extra skill load.

Skill Loading Rules

For each Go task, load the primary skill and all applicable secondary skills at the same time. Do not wait — load them together at the start.

Intent Primary Skill Also Load
Design an API, choose a pattern golang-design-patterns golang-structs-interfaces, golang-naming
Name a type, function, or package golang-naming golang-code-style
Handle errors idiomatically golang-error-handling golang-safety (nil-heavy code)
Write goroutines, channels, sync golang-concurrency golang-context (if cancellation)
Pass deadlines / cancel operations golang-context golang-concurrency (if goroutines)
Design structs, embed, use interfaces golang-structs-interfaces golang-design-patterns
Database queries and transactions golang-database golang-error-handling, golang-security
Build a gRPC service golang-grpc golang-testing, golang-error-handling
Build a GraphQL API golang-graphql golang-testing, golang-error-handling
Build a CLI command tree golang-spf13-cobra golang-cli, golang-spf13-viper (if config)
Layer config from flags/env/file golang-spf13-viper golang-spf13-cobra
Write tests golang-testing golang-stretchr-testify (if using testify)
Apply optimization patterns golang-performance golang-benchmark (measure first)
Measure with pprof / benchstat golang-benchmark golang-performance (fix), golang-troubleshooting (root cause)
Debug a panic or unexpected behavior golang-troubleshooting golang-safety, golang-benchmark (if perf-related)
Monitor in production golang-observability golang-performance (if SLO breach)
Audit security vulnerabilities golang-security golang-safety, golang-lint
Review formatting and style golang-code-style golang-naming, golang-lint
Refactor or restructure existing code golang-refactoring golang-naming, golang-code-style, golang-project-layout
Configure golangci-lint golang-lint golang-code-style
Write godoc / README / CHANGELOG golang-documentation golang-naming
Set up a new project structure golang-project-layout golang-design-patterns, golang-dependency-injection, golang-lint
Set up CI/CD pipeline golang-continuous-integration golang-lint, golang-security
Choose a library golang-popular-libraries relevant library-specific skill
Look up a package's docs, versions, importers, or CVEs golang-pkg-go-dev golang-dependency-management
Navigate, diagnose, or refactor local code golang-gopls
Adopt new Go language features golang-modernize golang-lint
Use samber/lo (slice/map helpers) golang-samber-lo golang-data-structures, golang-performance
Use samber/oops (structured errors) golang-samber-oops golang-error-handling
Use log/slog golang-samber-slog golang-observability, golang-error-handling
Use dependency injection golang-dependency-injection golang-google-wire or golang-uber-dig or golang-uber-fx or golang-samber-do

Read the full file on GitHub · 113 lines

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. 4d ago First seen · 113 lines · 2,471 tokens per session scan A 9b9acb482222

Subscribe to this mod's changes

golang-always is a cursor rule published in the GitHub repository samber/cc-skills-golang (3,223 stars, last pushed 4d ago), licensed MIT. It adds 2,471 tokens to every session, about $0.0124 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-07.