Two standard Agent Skills and a lints config that teach coding agents to write, review, and enforce simple, idiomatic Go:
go-best-practicesloads whenever an agent writes or changes Go, and steers it toward clear, simple, maintainable code that reads like the standard library.go-reviewreviews existing Go code, a file, a package, or a diff, and writes a prioritized report where every finding cites the rule it breaks and shows the fix.lints/is a drop-in golangci-lint configuration that enforces the machine-checkable rules in CI.
They work with Claude Code, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, and any other agent that reads the Agent Skills format. Every Go example in the skills is checked to parse and be gofmt-clean, and every check in the lint config is proven to fire.
The guidance is distilled from the official Go guidance and the two most widely used company style guides, with a condensed digest of each bundled in the skill so the agent can consult the original reasoning when it needs to:
- Effective Go (the Go team)
- Go Code Review Comments and Go Test Comments (the Go wiki)
- Google Go Style Guide: Guide, Decisions, and Best Practices
- Uber Go Style Guide
- Go Doc Comments
- Organizing a Go module, Keeping Your Modules Compatible, Working with Errors in Go 1.13, and the release notes through Go 1.27
Where the sources disagree, the skill picks a side and says why. For example, Uber
prefers functional options and prefixes unexported globals with _; the skill follows
Google and the standard library instead.
skills/go-best-practices/SKILL.md is about 470 lines, organized so an agent can scan it
while coding:
- Mindset: clarity, simplicity, concision; least mechanism; useful zero values
- Before handing back code: gofmt,
go vet,go test -race, golangci-lint,go fix - Naming: packages, initialisms, receivers, getters, stutter
- Packages and program structure: layout, globals,
init, a thinmain, imports - Types and API design: consumer-side interfaces, receivers, options, enums, slices and maps, generics
- Errors: wrapping with
%w,errors.Is/As, sentinels vs types, handle once, panics - Everyday idioms, including the modern standard library gated on your
godirective - Concurrency: goroutine lifetimes,
context, channels, mutexes, the race detector - Documentation and doc comments
- Tests: table-driven, got before want,
cmp.Diff, no assertion libraries, fakes, fuzzing - Modules and compatibility
- Performance, in order
- Changing someone else's code
- Final checklist
skills/go-best-practices/references/ holds one digest per source, plus a table of which
Go version added which feature, so the agent never writes code newer than your go.mod
allows.
Each skill is a folder under skills/: go-best-practices/ and go-review/. Every
option below puts those folders where your agent looks for skills. Install both; the
review skill leans on the best-practices skill for its rules.
The skills installer supports most agents
(Node 22.20 or later):
npx skills add brrock/BeautifulGoAdd -g to install for your user instead of the current project, or -a <agent> to pick
an agent, such as -a codex or -a cursor.
Install it as a plugin so updates arrive with one command:
claude plugin install beautiful-go --marketplace brrock/BeautifulGoInside a session, the same thing is:
/plugin marketplace add brrock/BeautifulGo
/plugin install beautiful-go@beautiful-go
The skills appear as /beautiful-go:go-best-practices and /beautiful-go:go-review,
though you rarely need to call them, since they trigger on their own. To try it for one
session without installing, clone the repo and run claude --plugin-dir ./BeautifulGo.
codex plugin marketplace add brrock/BeautifulGo
codex plugin add beautiful-go@beautiful-goWith GitHub CLI 2.90 or later:
gh skill install brrock/BeautifulGo go-best-practices
gh skill install brrock/BeautifulGo go-reviewAdd --scope user to install for your user, or --agent <name> for a different agent.
gemini skills install https://github.com/brrock/BeautifulGo --path skills/go-best-practices
gemini skills install https://github.com/brrock/BeautifulGo --path skills/go-reviewgit clone https://github.com/brrock/BeautifulGo
mkdir -p ~/.agents/skills
cp -R BeautifulGo/skills/go-* ~/.agents/skills/| Agent | User directory | Project directory |
|---|---|---|
| Claude Code | ~/.claude/skills/ |
.claude/skills/ |
| OpenAI Codex | ~/.agents/skills/ |
.agents/skills/ |
| GitHub Copilot | ~/.copilot/skills/ or ~/.agents/skills/ |
.github/skills/ or .agents/skills/ |
| Cursor | ~/.cursor/skills/ or ~/.agents/skills/ |
.cursor/skills/ or .agents/skills/ |
| Gemini CLI | ~/.gemini/skills/ or ~/.agents/skills/ |
.gemini/skills/ or .agents/skills/ |
Claude Code does not read .agents/skills/, so use its own directory or the plugin.
Restart the agent if the skill doesn't show up right away.
claude.ai takes one zip per skill, with the skill folder as the zip root:
cd skills
zip -r ../go-best-practices.zip go-best-practices -x '*.DS_Store' -x '*/evals/*'
zip -r ../go-review.zip go-review -x '*.DS_Store' -x '*/evals/*'Upload each under Customize > Skills. Code execution must be enabled first.
Ask your agent to review a file, package, or diff, for example "review store/store.go" or
"what would you change in this PR". The go-review skill runs gofmt, go vet,
go test -race, and golangci-lint when a toolchain is available, then writes a report
with three tiers: must fix, should fix, and consider. Every finding gives a file:line
location, the rule it breaks with its source (a Code Review Comments section, a Google
Decisions or Best Practices entry, an Uber guideline, or a vet check), and the smallest
code change that fixes it. Each report ends with what the code already does well.
The skills teach the rules; the lints keep them from slipping back in. Copy
lints/.golangci.yml to your module root and run:
golangci-lint run
golangci-lint fmtOn top of the standard set (errcheck, govet, ineffassign, staticcheck, unused), it flags
== on wrapped errors, sentinels not named Err..., unchecked type assertions, contexts
stored in structs, HTTP calls without a context or a closed body, constructors returning
interfaces, mixed receiver types, embedded mutexes, untagged marshaled structs, mutable
globals, init functions, shadowed builtins, needless loop-variable copies, code the
go fix modernizers would rewrite, test helpers without t.Helper(), and 25 revive rules
from Code Review Comments, including os.Exit outside main, bool control-flag
parameters, Id instead of ID, and this receivers. A bare //nolint without a linter
name and a reason is itself an error. Linters marked [lib] fit packages that other
modules import; applications can drop them.
Every check is proven. lints/check/ holds one deliberate violation per
linter and revive rule, lints/clean/ holds idiomatic code that must
produce no findings, and this script runs both from the repo root:
python3 scripts/check-lints.pyIt fails if a check stops firing, or if the config starts flagging the idioms the skill recommends.
BeautifulGo/
├── .claude-plugin/
│ ├── plugin.json Claude Code plugin manifest
│ └── marketplace.json lets this repo act as its own marketplace
├── .agents/plugins/
│ └── marketplace.json the same, for Codex
├── plugin.json Codex plugin manifest
├── assets/icon.png plugin icon
├── skills/
│ ├── go-best-practices/ writing skill
│ │ ├── SKILL.md
│ │ ├── references/ one digest per source
│ │ └── evals/
│ └── go-review/ review skill
│ ├── SKILL.md
│ └── evals/
├── lints/
│ ├── .golangci.yml drop-in golangci-lint v2 config
│ ├── check/ one deliberate violation per check
│ └── clean/ idiomatic code that must stay clean
├── scripts/
│ ├── check-skill.py validates skills, references, links, evals, and manifests
│ ├── check-lints.py proves every lint fires and the clean code stays clean
│ └── check-examples.py checks every Go example parses and is gofmt-clean
├── CHANGELOG.md
├── CONTRIBUTING.md
└── README.md
skills/go-best-practices/evals/ holds three test cases in the layout
claude plugin eval reads: a library API task (a semver package), an application CLI
task (a log summarizer), and a refactor-this-package task with a deliberately messy
input file. skills/go-review/evals/ reviews the same messy package. Each case has the
prompt, a description of a good result, and one assertion per file under graders/.
Run them with and without the skill from each skill's directory:
claude plugin eval . --allow-tools Write,Edit,Bash --scaffoldThese are real model runs and are billed.
Edit the skill, bump version in both .claude-plugin/plugin.json and plugin.json
(the checker fails if they differ), add a CHANGELOG.md entry, commit,
and push. Claude Code plugin users pick up the new version with
claude plugin update beautiful-go; Codex users with
codex plugin marketplace upgrade beautiful-go.
Beautiful Go is a rewrite of BeautifulRust by Morgan Linton, whose structure, review format, and eval approach it keeps. MIT licensed; see LICENSE.