From go-agent-skills
Reviews Go code for quality, idiomatic patterns, error handling, naming, package structure, and test coverage. Triggered by code review requests or PRs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/go-agent-skills:go-code-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Structured code review process for Go. Reviews should be constructive, specific,
Structured code review process for Go. Reviews should be constructive, specific, and cite the relevant principle behind each finding.
Pick the mode that matches the request before starting:
Execute these steps in order. For each finding, classify severity:
Before reading code manually, let the tools catch the mechanical issues (skip any tool that is not installed and note it in the report):
go build ./... # it must compile
go vet ./... # suspicious constructs
golangci-lint run # if the repo has a config
go test -race ./... # tests pass, no data races
Report tool findings alongside manual findings — a failing go vet is
an automatic 🔴 BLOCKER. Never report an issue a tool already proves
absent.
_ discarding errors silently.fmt.Errorf("fetch user %d: %w", id, err).errors.Is() / errors.As(), never ==.panic outside of init() or truly unrecoverable situations.sync.Mutex or channels.context.Context.sync.WaitGroup or errgroup.Group used for goroutine lifecycle.WithTimeout(d)) over config structs for optional params.func Foo(ctx context.Context, ...).error as the last return value.bool parameters — prefer named types or options.:= for local variables, var for zero-value intent.else after return/continue/break.defer used for cleanup, placed right after resource acquisition.range used over manual index iteration where appropriate.internal/ used for non-public packages.cmd/ contains main packages, one per binary.TestXxx naming convention.t.Helper() for clean stack traces.init() — use TestMain when needed.testify/assert or testify/require consistently, or stdlib only.t.Parallel() used where safe.doc.go for non-trivial packages.go.mod has no replace directives in committed code (except monorepos).When the scope exceeds ~20 files, do not read everything in one linear pass. Split the audit into independent passes:
go list ./...) and group them by layer
(handlers, services, stores, shared libraries).file.go:line and severity so the
final aggregation is mechanical: merge, deduplicate, sort by severity.## Code Review Summary
**Files reviewed:** <list>
**Overall assessment:** APPROVE | REQUEST CHANGES | COMMENT
### Findings
#### 🔴 BLOCKER: <title>
- **File:** `path/to/file.go:42`
- **Issue:** <what is wrong>
- **Why:** <which principle or guideline>
- **Fix:** <concrete suggestion>
#### 🟡 WARNING: <title>
...
#### 🟢 SUGGESTION: <title>
...
### What's Done Well
<genuine positive observations — always include at least one>
npx claudepluginhub eduardo-sl/go-agent-skills --plugin go-agent-skillsReviews Go code against community style standards, covering formatting, documentation, and error handling. Use before submitting a Go PR or during review.
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, error handling, concurrency safety, and common mistakes. Useful for .go files, goroutines, interfaces, generics (1.18+), and errors.Join/slog (1.20+/1.21+).