go-conventions
Skill4 starsChanged 2 months agoMITView on GitHub
Scan the current Go repo and write .claude/go-conventions.md — a project-specific convention file that rules/go.md reads whenever a .go file is read, instead of re-scanning the codebase from scratch. Use when starting work in a new Go repo, when conventions have drifted, or when --refresh is passed to merge in new patterns.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- andr-ca/agentharnesstheir own version, first seen Oct 15, 2026
- wtsi-hgi/agentskillstheir own version, first seen Oct 4, 2026
- techmefr/mentistheir own version, first seen Sep 11, 2026
- hashicorp/terraform-provider-awstheir own version, first seen May 14, 2026
- hairglasses-studio/mcpkittheir own version, first seen Apr 9, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- hashicorp/terraform-provider-aws★ 11ksame name
- andr-ca/agentharness★ 1same name
- wtsi-hgi/agentskills★ 1same name
- hairglasses-studio/mcpkit★ 0same name
- techmefr/mentis★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adrSkill
- design-conventionsSkill
- dev-flowSkill
- save-planSkill
- setupSkill
- telemetry-exportSkill
- tipsSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 6 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
Verify you're in a Go repo: check for go.mod.
- Distinctive: line 30
Read these artifacts in priority order:
- Distinctive: line 54
Only document what you *actually observed* — don't invent from general knowledge.
- Distinctive: line 55
If a section has no established pattern, omit it (omit it.
- Distinctive: line 71
TEST: test style and CI commands
- Very specific: line 81
Write to .claude/go-conventions.md in the repo root (create .claude/ if needed).
- Very specific: line 83
With
--refresh: read the existing file first, merge new patterns in, keep existing content that is still valid. - Very specific: line 103
Keep each section tight — 5-15 lines max.
- Distinctive: line 116
Do not commit the file unless the user asks.
- Distinctive: line 123
If the project is a perfect match for the baseline (same stack, same patterns), say so and write a minimal file noting the match rather …
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/go-conventions — generate per-project Go conventions
Scans the current Go module and produces .claude/go-conventions.md — a
lightweight, project-specific convention reference. rules/go.md reads this
file whenever a .go file is read, so conventions load cheaply without
re-scanning. It holds only the delta from the global baseline.
When to run
- First time in a Go repo — before any substantial code work.
--refresh— when conventions have evolved or a new area has been added. Merges new patterns into the existing file; preserves hand-edits.- Prompted by a gap — if you hit a pattern the file doesn't cover while coding, append the rule inline (don't re-run the full scan).
Procedure
1. Confirm context
Verify you're in a Go repo: check for go.mod. If absent, stop and say so.
2. Scan the repo
Read these artifacts in priority order:
a. Module identity
go.mod— module path, Go version, key direct dependencies (web framework, DB driver, logging, IDs, config)
b. Existing config (if any)
.golangci.yml/.golangci.toml— enabled linters and their settingsMakefile—build,test,lint,runtargetsCONTRIBUTING.mdor any docs folder — pre-existing convention docs
c. Project layout (just list, don't read all files yet)
- Top-level dirs:
cmd/,internal/,pkg/,api/,app/, etc.
d. Representative code — read 2-3 files from each category:
- Entry point:
cmd/*.goormain.go - Domain package: a
service.go+repository.go+model.gofrom the largest domain - HTTP/transport: a handler or controller file
- Error handling: look for custom error types
- Logging: find where logs are initialized and called
3. Derive conventions
From what you read, identify the established patterns for each section below. Only document what you actually observed — don't invent from general knowledge. If a section has no established pattern, omit it (omit it; the baseline applies).
Sections to cover (one per baseline topic, named by topic id; see
${CLAUDE_PLUGIN_ROOT}/references/go/README.md). For each, write only where the
repo differs from or extends the baseline default:
- LAY project layout and domain package files (LAY-1..3 are often overridden)
- STY naming, import order (STY-4)
- DI constructor pattern (Builder, functional options, plain params)
- ERR error type, sentinels, propagation (ERR-1, ERR-5)
- CTX how user/tenant identity flows through the context
- CON concurrency helpers in use
- LOG logging library and how a logger is acquired (LOG-2)
- HTTP router framework, route prefix, error rendering (HTTP-1, 2, 4, 6)
- DATA DB driver, pagination, soft delete, collection naming (DATA-2)
- EVT event bus, if one exists (EVT-*)
- TEST test style and CI commands
- Key libraries: one-line usage note per direct dependency
Where the repo contradicts a baseline topic rule, record it as
# OVERRIDE: G-<TOPIC>-n <reason>. Never write an override for G-1..G-8 or
G-10: those are not overridable. If the repo contradicts one, report it to the
user instead.
4. Write the file
Write to .claude/go-conventions.md in the repo root (create .claude/ if needed).
With --refresh: read the existing file first, merge new patterns in, keep
existing content that is still valid. Never overwrite hand-edits — look for
# NOTE: or # OVERRIDE: markers and preserve them.
File header:
# Go conventions — {module-name}
Derived from codebase scan on {date}. Maintained by `/go-conventions --refresh`.
Global baseline: `${CLAUDE_PLUGIN_ROOT}/references/go/README.md` (topic files).
> **Stack:** Go {version} · {key libs}Then one section per category found. Each section:
- States the rule plainly (imperative)
- Shows a short code example where the rule isn't obvious
- Cites the example file/pattern it was derived from (e.g.
// see pkg/sales/service.go)
Keep each section tight — 5-15 lines max. This file is read whenever a .go file
is read; brevity matters more than completeness.
5. Report
Tell the user:
- Path of the written file
- Number of sections covered
- Any areas where you couldn't find an established pattern (and what to do)
- How to view/edit it (it's plain markdown — open in any editor)
- Suggest adding
@.claude/go-conventions.mdto the project'sCLAUDE.mdfor automatic inclusion (optional;rules/go.mdreads it on demand without this)
Do not commit the file unless the user asks.
Notes
- This skill writes to the target project repo, not to the addit-harness repo.
- The file it generates is a supplement to the topic files under
${CLAUDE_PLUGIN_ROOT}/references/go/, not a replacement. Put only the delta — what differs from or extends the global baseline. - If the project is a perfect match for the baseline (same stack, same patterns), say so and write a minimal file noting the match rather than duplicating all baseline content.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

