From golang-skills
Reviews Go code against community style standards for formatting, documentation, error handling, and naming using checklists from Go Wiki and Uber guide. Use before PRs or code reviews.
How this skill is triggered — by the user, by Claude, or both
Slash command
/golang-skills:go-code-reviewThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Use `assets/review-template.md` when formatting the output of a code review to ensure consistent structure with Must Fix / Should Fix / Nits severity grouping.
Use
assets/review-template.mdwhen formatting the output of a code review to ensure consistent structure with Must Fix / Should Fix / Nits severity grouping.
gofmt -d . and go vet ./... to catch mechanical issues firstValidation: After completing the review, re-read the diff once more to verify every flagged issue is real. Remove any finding you cannot justify with a specific line reference.
gofmt or goimports → go-linting_; handle, return, or (exceptionally) panic → go-error-handlingMixedCaps or mixedCaps, never underscores; unexported is maxLength not MAX_LENGTH → go-namingURL/url, ID/id, HTTP/http (e.g., ServeHTTP, xmlHTTPRequest) → go-namingi, r, c); longer names for wider scope → go-namingc for Client); no this, self, me; consistent across methods → go-namingchubby.File not chubby.ChubbyFile); avoid util, common, misc → go-packageserror, string, len, cap, append, copy, new, make → go-declarationsvar t []string (nil) over t := []string{} (non-nil zero-length) → go-data-structures*T methods' receivers by value → go-data-structurescrypto/rand for keys, not math/rand → go-defensivevar/const/type in parenthesized blocks; separate unrelated → go-declarationsvar for intentional zero values; := for explicit assignments → go-declarationsvar for zero structs → go-declarationsany: Prefer any over interface{} in new code → go-declarations/* name */ comments for ambiguous bool/int args, or use custom types → go-functionsf for go vet → go-functionsstring not *string for small fixed-size types → go-performance+ for simple; fmt.Sprintf for formatting; strings.Builder for loops → go-performancelog/slog, not log or fmt.Println for operational logging → go-loggingimport _ "pkg" only in main package or tests → go-packagesExample functions or tests demonstrating usage → go-documentationgot != want → go-testinghttptest.NewServer + real client over mocking HTTP → go-testingRun automated pre-review checks:
bash scripts/pre-review.sh ./... # text output
bash scripts/pre-review.sh --json ./... # structured JSON output
Or manually: gofmt -l <path> && go vet ./... && golangci-lint run ./...
Fix any issues before proceeding to the checklist above. For linter setup and configuration, see go-linting.
Read references/WEB-SERVER.md when building a production HTTP server and want to verify your code applies concurrency, error handling, context, documentation, and naming conventions together.
npx claudepluginhub cxuu/golang-skills --plugin golang-skillsReviews Go code for idiomatic patterns, error handling, concurrency safety, and common mistakes. Useful for .go files, goroutines, interfaces, generics (1.18+), and errors.Join/slog (1.20+/1.21+).
Reviews Go code against style guide, focusing on critical bugs, race conditions, and maintainability issues. Use for PRs, feature branches, or completed work reviews.
Reviews Go code for idiomatic patterns, table-driven test conventions, error handling, and build commands like go test -race. Auto-loads for .go files in pre-commit-review.