← GophersCONTENT HISTORY

Update to Gophers

Snapshot Sep 30, 2026 · 23:14 UTC · version 0.1.0

Collection source: not recorded for this historical snapshot.

WHAT CHANGED · RULE-BASED ANALYSIS

First saved snapshot

No earlier snapshot is available to establish a change.

Compare saved observations

Download comparison JSON
Full technical diff · 0 changed fields
Full snapshot data
{
  "description": "Invoke this skill to systematically review a Go change against community style standards before merging. Walks the diff topic by topic — formatting, errors, naming, concurrency, interfaces, data structures, security, declarations, functions, style, logging, imports, generics, testing — flagging issues with line references and severity (must-fix / should-fix / nit). Apply proactively before any Go PR ships.",
  "included_files": [
    {
      "relative_path": "agents/openai.yaml",
      "size_in_bytes": 232
    },
    {
      "relative_path": "references/integrative-example.md",
      "size_in_bytes": 4396
    },
    {
      "relative_path": "references/review-template.md",
      "size_in_bytes": 2236
    },
    {
      "relative_path": "references/severity-rubric.md",
      "size_in_bytes": 3329
    }
  ],
  "name": "go-code-review",
  "skill_md_contents": "---\nname: go-code-review\ndescription: \"Invoke this skill to systematically review a Go change against community style standards before merging. Walks the diff topic by topic — formatting, errors, naming, concurrency, interfaces, data structures, security, declarations, functions, style, logging, imports, generics, testing — flagging issues with line references and severity (must-fix / should-fix / nit). Apply proactively before any Go PR ships.\"\nlicense: MIT\ncompatibility: \"Designed for Claude Code or similar AI coding agents. Examples assume Go 1.21+ for log/slog references.\"\nallowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*)\n---\n\n# Go Code Review\n\nA repeatable, opinionated review pass for Go code. Read the diff file by file, walk each topic in order, flag findings with file:line references, then group by severity.\n\n## Core Rules\n\n1. **Mechanical checks first.** Never start a human review until `gofmt`, `go vet`, and `golangci-lint` are clean. They free your attention for what tools cannot catch.\n2. **One file at a time, topic by topic.** Walk the diff in order and apply each topic checklist below. Switching topics mid-file loses the thread.\n3. **Every finding cites a rule.** `file:line` plus the rule name (`go-naming: initialisms`) — never a bare opinion.\n4. **Severity is non-negotiable.** Must-Fix (correctness/security/data-loss/broken contract) blocks merge; Should-Fix (significant design or style issue); Nit (small preference, flag once).\n5. **Drop what you cannot defend.** After flagging, re-read and remove any finding you would not stand behind in a thread.\n6. **Praise non-trivial improvements.** A review without acknowledgement teaches only avoidance.\n\n## Review Procedure\n\n1. Run mechanical checks: `gofmt -d ./...`, `go vet ./...`, `golangci-lint run ./...`, `go test ./... -race -short`.\n2. Read the diff one file at a time. For each file, walk the topic checklists below in order.\n3. Flag every issue with `file:line` and the rule name that justifies it.\n4. After all files are reviewed, re-read flagged items and drop any you cannot justify.\n5. Group findings by **Must Fix / Should Fix / Nit** using the rubric below.\n\n> Use [references/review-template.md](references/review-template.md) when writing up the review for consistent severity grouping and tone.\n\n## Automated Checks\n\n```bash\ngofmt -l ./... && go vet ./... && golangci-lint run ./... && go test ./... -race -short\n```\n\nFix anything the tools find before continuing. See [go-linting](../go-linting/SKILL.md) for setup.\n\n## Formatting\n\n- [ ] `gofmt`/`goimports` clean; long lines break by semantics, not column count\n\n## Documentation\n\n- [ ] Exported symbols documented (starts with name, ends with `.`); package comment adjacent to `package` clause; non-trivial unexported have intent comments; named returns only when they clarify\n\nSee [go-documentation](../go-documentation/SKILL.md).\n\n## Error Handling\n\n- [ ] No discarded errors (`_ = f()`) without a written justification\n- [ ] Error strings are lowercase with no trailing punctuation\n- [ ] Errors wrap with `%w` when the caller may want to inspect; `%v` only when hiding is deliberate\n- [ ] No in-band magic values (`-1`, `\"\"`, `nil`) for failure — multi-return with an `error` or `ok bool`\n- [ ] Error path comes first; the success path stays unindented\n- [ ] Each error is handled exactly once (log **or** return, not both)\n\nSee [go-error-handling](../go-error-handling/SKILL.md).\n\n## Naming\n\n- [ ] `MixedCaps` / `mixedCaps` only — no underscores or `SCREAMING_SNAKE`\n- [ ] Initialisms are uniformly cased: `URL`, `ID`, `HTTP`, `XMLHTTPRequest`, `serveHTTP`\n- [ ] Short names for short scopes (`i`, `r`, `ctx`); longer names for wider scopes\n- [ ] Receiver names are one or two letters, consistent across methods; no `this`/`self`/`me`\n- [ ] Packages don't stutter (`http.Server`, not `http.HTTPServer`)\n- [ ] Package names avoid `util`, `helpers`, `common`, `misc`\n- [ ] No identifiers shadow builtins (`len`, `error`, `cap`, `new`, `make`, `copy`, `any`)\n\nSee [go-naming](../go-naming/SKILL.md) and [go-packages](../go-packages/SKILL.md).\n\n## Declarations\n\n- [ ] Related `var`/`const`/`type` are in grouped blocks; unrelated kept separate\n- [ ] `var` for intentional zero values; `:=` for computed locals\n- [ ] Variables scoped as narrowly as is readable (if-init where it fits)\n- [ ] Struct literals use field names; zero-value fields are omitted\n- [ ] Enums start at `iota + 1` (or zero is explicitly meaningful)\n- [ ] `any` instead of `interface{}` in new code\n\nSee [go-declarations](../go-declarations/SKILL.md).\n\n## Control Flow\n\n- [ ] No `else` after a returning/breaking/continuing `if`; no `:=` shadowing of outer `ctx`/`err`; map iteration is order-agnostic; labeled `break`/`continue` for switch-in-loop\n\nSee [go-control-flow](../go-control-flow/SKILL.md).\n\n## Functions\n\n- [ ] File order: type → constructor → exported → unexported → utilities; wrapped signatures one-per-line; no pointer-to-interface; bool/int params renamed via type or commented; printf-style helpers end in `f`\n\nSee [go-functions](../go-functions/SKILL.md).\n\n## Interfaces\n\n- [ ] Defined in the consumer package; not \"just for mocking\" on the implementor; consistent receivers per type; compile-time `var _ I = (*T)(nil)` on exported implementations\n\nSee [go-interfaces](../go-interfaces/SKILL.md).\n\n## Concurrency\n\n- [ ] Goroutine lifetimes clear (bounded by `ctx.Done()` or documented); APIs synchronous by default; `context.Context` first param, never struct field; lock order documented; sender closes channels\n\nExample to flag (`pkg/worker/worker.go:42`):\n\n```go\ngo s.process(req)   // ✗ no ctx, no done signal — leak on shutdown\n```\n\nvs. acceptable:\n\n```go\ns.wg.Add(1)\ngo func() { defer s.wg.Done(); s.process(ctx, req) }()\n```\n\nSee [go-concurrency](../go-concurrency/SKILL.md).\n\n## Data Structures\n\n- [ ] `var t []T` for nil slices, `[]T{}` only when empty non-nil is required (JSON output); copies of structs containing `sync.Mutex` flagged; slice/map at API boundaries copied or borrowing documented\n\nSee [go-data-structures](../go-data-structures/SKILL.md).\n\n## Security & Logging\n\n- [ ] `crypto/rand` for secret material (never `math/rand`); no library `panic` for ordinary failures\n- [ ] `log/slog` (not `log`/`fmt.Println`); static message + structured attrs; secrets and PII never logged\n\nSee [go-defensive](../go-defensive/SKILL.md) and [go-logging](../go-logging/SKILL.md).\n\n## Imports\n\n- [ ] Grouped: stdlib → external → local; no rename unless collision; no blank import outside `main`/tests; no dot imports\n\nSee [go-packages](../go-packages/SKILL.md).\n\n## Generics\n\n- [ ] Justified by ≥2 real call sites; constraint is the loosest that compiles; no generics-just-for-an-interface\n\nSee [go-generics](../go-generics/SKILL.md).\n\n## Testing\n\n- [ ] Tests cover the new behavior at the right level; failure messages include what/inputs/got/want\n- [ ] `httptest.NewServer` over hand-rolled mocks; `TestMain` only when truly necessary; `Example*` for non-trivial APIs\n\n> Read [references/integrative-example.md](references/integrative-example.md) to see the rules applied together on a small HTTP server.\n>\n> Read [references/severity-rubric.md](references/severity-rubric.md) when deciding whether to label a finding must-fix, should-fix, or nit.\n\n## Quick Severity Rubric\n\n| Severity | Examples |\n|---|---|\n| Must Fix | Race, security bug, swallowed error, broken API, data loss |\n| Should Fix | Wrong layer for an interface, panic in a library, leaky goroutine |\n| Nit | Name preference, comment phrasing, ordering within a block |\n\n## Anti-Patterns\n\nThese are reviewer anti-patterns — bad habits to avoid when *writing* the review itself:\n\n| Anti-pattern | Do this instead |\n|---|---|\n| \"I would have written this differently\" | drop it, or cite a concrete rule |\n| Listing every `nit` you noticed | flag once, note \"× N similar\" |\n| No severity labels; comment without `file:line` | label Must / Should / Nit; anchor with `path:line` |\n| Reviewing the author, not the code | write about the change, not the person |\n| Re-doing the work in the review | point to the rule and let them write it |\n| Approving without reading tests | tests are part of the diff |\n\n## Verification Checklist\n\n- [ ] Every finding has `file:line` + a rule citation; no bare opinions\n- [ ] No duplicates (note \"× N similar\" if widespread); severity matches the rubric\n- [ ] Tests were read, not just counted\n- [ ] Praise included for non-trivial improvements; tone is about the change, never the author\n\n## References\n\n- [review-template.md](references/review-template.md) — markdown shape for posting a review\n- [severity-rubric.md](references/severity-rubric.md) — extended must/should/nit guidance\n- [integrative-example.md](references/integrative-example.md) — sample HTTP server walked through\n"
}

SHA-256 of public snapshot: a7054985fee5a3f541135e0732ce23b3dc5b21059591a00b52c684643a45f589