← ClaudeAtlas

go-back-code-stylelisted

Use when writing, reviewing, renaming, or refactoring any Go in module go-back (~/code/golang): cmd, pkg, rest, lib, common. Also use when adding a file to a Go package, naming a function or variable, adding a slog call, writing a doc comment, or splitting a long function. The model to copy is pkg/del-sol/assetTracker/app/accounts. Apply without being asked.
whoiscarlo/agent-skills · ★ 1 · Code & Development · score 64
Install: claude install-skill whoiscarlo/agent-skills
# Go House Style Every Go file in `~/code/golang` is module `go-back`. This is the standard for all of it. **The reference implementation is `pkg/del-sol/assetTracker/app/accounts`.** Three files, short functions, `//` comments, one job each. Read it when a rule here is unclear. Cursor enforces the short form of this same standard in `.cursor/rules/go-variable-naming.mdc` and `.cursor/rules/go-code-style.mdc`. If they disagree with this file, this file wins. Not the model to copy: **dromo**. It logs with bare `slog.Error` 1416 times and has no request id on any line. Do not learn slog from dromo. ## Quick reference | Thing | Rule | |---|---| | Function name | A verb from the list in "Get is the prefix": `getUserFromBadgeId`, `saveBrand`, `sendSnapshot` | | Variable name | A noun: `account`, `query`, `index`, `group` | | Single letter | Banned. Only exception: `c echo.Context` | | Kept idioms | `err`, `ctx`, `t *testing.T` | | Receiver | A word, and not the type's name: `func (feed *feedResult)` | | Bool | Starts `is` or `has`: `isSignedIn`, `HasQuestion`. Never `ok` | | Running count | Starts `total`: `totalLocked`, `TotalLocked` | | Doc comment | One `//` line. Never `/* */` | | Files in a package | `model.go`, `service.go`, `postgres.go`, `errors.go`, `queries.go` when the SQL is long. `utils.go` for small formatting and simple helpers. Otherwise add nouns | | File name casing | camelCase: `heroImage.go`. Never `hero_image.go` | | Logging | `logCtx *slog.Logger` is a