golang
Installation
SKILL.md
Go conventions
Standard idiomatic Go applies. These are the rules that differ or that agents keep breaking.
Code
- Never use
else, in tests too. Return early,continue,break, or use aswitch. - Comments explain a why the code cannot express: a hidden constraint, a workaround, a surprising invariant. No doc comments that restate a name or signature, exported symbols included.
- Use named fields in every struct literal, never positional ones: fixing fieldalignment findings reorders struct fields.
- Keep lines under 180 characters (
lll). - When a standard library package collides with an existing import, alias it
lib<name>, for examplelibtime. - Start error strings lowercase, without trailing punctuation.
- Ask before adding a dependency.