npx skills add ...
npx skills add cxuu/golang-skills --skill go-code-review
Use when reviewing Go code or checking code against community style standards. Also use proactively before submitting a Go PR or when reviewing any Go code changes, even if the user doesn't explicitly request a style review. Does not cover language-specific syntax — delegates to specialized skills.
npx skills add cxuu/golang-skills --skill go-code-review
Compatibility:
references/WEB-SERVER.mduseslog/slogexamples that require Go 1.21+.
assets/review-template.md - Use when formatting review output with Must Fix, Should Fix, and Nits sections.scripts/pre-review.sh - Run before manual review to collect gofmt, go vet, and golangci-lint results.references/WEB-SERVER.md - Read when reviewing an HTTP server that combines concurrency, context, logging, error handling, and shutdown behavior.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:
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.