Cursor Rules for Go

Stop Cursor writing Go from 2019: rules that know about wg.Go, errors.AsType, synctest and ServeMux routing.

Cursor Rules for Go product illustration

What it does

7 Cursor project rules (.mdc) for Go, scoped so each loads only when relevant, with an installer that detects your stack, an AGENTS.md exporter (Claude Code, Codex) and a rules linter. Written against the Go 1.24-1.27 release notes (checked Nov 10, 2026), with a sample app that uses every new API the rules mention and passes go vet and go test on Go 1.27.

What you get

The screenshot is real output from the kit’s own commands. Tested from a fresh download of this exact zip: ./run_tests.sh ran 9 tests OK on Python 3.13 and 3.10.

Real terminal output from Cursor Rules for Go: demo and passing tests

Install in 30 seconds

python3 tools/install_rules.py --detect /path/to/app          # what it finds
python3 tools/install_rules.py /path/to/app --auto            # install rules for detected stacks into .cursor/rules/
python3 tools/install_rules.py /path/to/app --all --agents-md # everything, plus AGENTS.md
python3 tools/lint_rules.py /path/to/app/.cursor/rules --project /path/to/app

Existing files are never overwritten unless you pass --force; --dry-run previews. ./tools/demo.sh runs it on examples/sample-app; ./run_tests.sh runs the tests. As a Cursor plugin, the manifest is .cursor-plugin/plugin.json.

The rules

RuleLoadsWhat it covers
go-overview.mdcalwaysread the go.mod version first; which feature arrived in which release (1.22-1.27); layout; gofmt / vet / race / go fix
go-errors.mdc/*.go%w wrapping, errors.Is, errors.AsType (1.26), the 1.27 vet check for wrapped pointers, handle once
go-concurrency.mdc/*.gocontext first, wg.Go (1.25), channel ownership, goroutineleak profile (1.27), -race
go-http.mdchandlers, servers, cmd/ServeMux method patterns and r.PathValue, server timeouts, graceful shutdown, CrossOriginProtection (1.25), body limits, slog
go-testing.mdc/*_test.gotable tests, t.Context(), synctest.Test (1.25), b.Loop(), httptest, t.ArtifactDir() (1.26)
go-modules.mdcgo.modgo get -tool / go tool (1.24), tidy, ignore directive (1.25), no needless dependencies
go-json-data.mdcagent picksomitzero, new(expr) (1.26), encoding/json/v2 defaults (1.27), money as cents, os.OpenRoot

The sample app

examples/sample-app is a small orders API (net/http, slog, uuid, iterators) with table tests, httptest, a synctest test with a fake clock, a CSRF test and a b.Loop benchmark. ./run_tests.sh builds, vets and tests it when Go 1.27+ is installed.

Honest limits

  • Rules guide the model; they don't enforce anything. The overview rule tells the agent to respect your go.mod version, so it won't push 1.27 APIs into a 1.22 module.
  • Detection is file-based (go.mod); in monorepos run it per module or use --stack go.

Format and license

Zip, 22 KB, v1.0, 22 files. You may use and modify this kit for your own work and for clients you serve, including paid client work. Not affiliated with or endorsed by Cursor (Anysphere) or the Go project.

FAQ

Which Go version?
Written against Go 1.27 (Nov 2026); each rule names the release a feature arrived in, and the overview rule tells the agent to respect the go line in go.mod.
Will it overwrite my rules?
No, existing files are skipped unless you pass --force.
Claude Code or Codex?
Run the installer with --agents-md to write the same rules into AGENTS.md.
How do I get the files?
Pay by card right here on youraitools.co: your download links appear on this page the moment the payment goes through (claim window: 72 hours, up to 5 downloads per 7 days). Need the files re-sent later? Email hello@youraitools.co.
Refunds?
Email hello@youraitools.co within 14 days if it doesn’t work and we can’t fix it.
Can I pay with crypto?
Yes. Pay the same price in USDC or USDT on Base, Ethereum, Arbitrum, Optimism, Polygon or Solana from the "Pay with crypto" button, with no account or KYC. We check the payment on-chain and show your download links as soon as it confirms.

Get Cursor Rules for Go

Cursor rules for Go: 7 scoped .mdc rules for errors, concurrency, net/http, testing, modules and JSON, current to Go 1.27, with a tested sample app.

Pairs well with

Download$29

Excel MCP Server

Excel MCP server: read sheets and tables, profile columns, trace broken formulas to their source, and edit safely with backups. Python, 26 tests.

View Excel MCP Server
Download$29

MySQL MCP Server

MySQL MCP server for Claude Code, Claude Desktop and Cursor: read-only transactions, schema, EXPLAIN findings, 11 health checks, slow queries. Python. $29.

View MySQL MCP Server

Related

1 email a week: new x402 + MCP tools and free kits.

Short weekly digest of new x402 + MCP tools and free kits, including the MCP OAuth Checker. No spam, unsubscribe any time.