go-idiomatic-code

go-idiomatic-code is a cursor rule for Cursor from dstotijn/mcp-cbs-cijfers-open-data. It costs 0 tokens per session (871 once invoked), scanned A, a copy of go-idiomatic-code, Apache-2.0.

A set of rules for writing Go code in the style commonly expected by the Go community. It covers naming, code organization, and error handling.

In plain words
What is it for?
Use it when creating or reviewing Go code to apply naming conventions, organize declarations and imports, keep functions focused, and handle errors.
Why use it?
It keeps generated or edited Go code consistent and easier for other Go developers to read and maintain.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions Cursor.

Good fit Use it when creating or reviewing Go code to apply naming conventions, organize declarations and imports, keep functions focused, and handle errors.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/dstotijn/mcp-cbs-cijfers-open-data/go-idiomatic-code
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/dstotijn/mcp-cbs-cijfers-open-data

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 go-idiomatic-code

README.md
[![agentmods](https://agentmods.dev/badge/rules/dstotijn/mcp-cbs-cijfers-open-data/go-idiomatic-code.svg)](https://agentmods.dev/rules/dstotijn/mcp-cbs-cijfers-open-data/go-idiomatic-code)
Your own site
<a href="https://agentmods.dev/rules/dstotijn/mcp-cbs-cijfers-open-data/go-idiomatic-code"><img src="https://agentmods.dev/badge/rules/dstotijn/mcp-cbs-cijfers-open-data/go-idiomatic-code.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 871 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 91% 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.00000 $0.00871
Opus 5 $0.00000 $0.00436
Sonnet 5 $0.00000 $0.00174
Haiku 4.5 $0.00000 $0.00087

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

Security

Grade A, and why

go-idiomatic-code 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 7d 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

91% identical to go-idiomatic-code — 6 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.

.cursor/rules/go-idiomatic-code.mdc · 107 lines

How it starts

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

Description

This rule ensures that all Go code follows idiomatic Go practices, adhering to the official Go style guide and common best practices in the Go community.

Rule

When writing Go code:

Naming Conventions

  1. Use camelCase for variable and function names (not snake_case)
  2. Use PascalCase for exported names (public functions, types, variables, constants)
  3. Use camelCase for unexported names (private functions, types, variables, constants)
  4. Use acronyms in all caps (e.g., HTTP, URL, ID) when they appear at the beginning of a name, otherwise all lowercase
  5. Keep names short and descriptive; the larger the scope, the more descriptive the name should be

Code Organization

  1. Group related declarations (imports, constants, types, variables, functions)
  2. Order imports in groups: standard library, third-party packages, local packages
  3. Use blank lines to separate logical sections of code
  4. Keep functions small and focused on a single responsibility
  5. Place methods on receiver types in a logical order, with the most important methods first

Error Handling

  1. Always check errors and handle them appropriately
  2. Use the errors package for simple errors and fmt.Errorf with %w for wrapping errors
  3. Return errors rather than using panic (except for truly unrecoverable situations)
  4. Use meaningful error messages that help diagnose the problem

Comments and Documentation

  1. Write comments as complete sentences with proper punctuation
  2. Use godoc-style comments for exported functions, types, and variables
  3. Focus on explaining "why" rather than "what" in comments
  4. Document non-obvious behavior and edge cases

Code Style

  1. Use gofmt/goimports to format code
  2. Avoid unnecessary else blocks after return statements
  3. Prefer early returns to reduce nesting
  4. Use named return values only when they improve readability
  5. Limit line length to 100-120 characters
  6. Use blank interfaces (interface{} or any) sparingly

Read the full file on GitHub · 107 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. 7d ago First seen · 107 lines · 871 tokens per session scan A d2de643924ff

Subscribe to this mod's changes

go-idiomatic-code is a cursor rule published in the GitHub repository dstotijn/mcp-cbs-cijfers-open-data (7 stars, last pushed 1y ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 871 tokens. A static security scan graded it A with 0 findings. It is 91% identical to go-idiomatic-code, differing in 6 lines, and is treated as a copy.