go-code-review
Skill72 starsChanged 3 months agoMITView on GitHub
Comprehensive code review checklist for Go projects. Evaluates code quality, idiomatic patterns, error handling, naming, package structure, and test coverage. Use when reviewing Go code, PRs, or before merging changes. Trigger examples: "review this code", "check this PR", "code review", "review Go file". Not for: security audits (go-security-audit), performance analysis (go-performance-review).
5 other projects use a version of this.
Adopted by
Most recently taken up by
- muratmirgun/gopherstheir own version, first seen Aug 11, 2026
- cxuu/golang-skillstheir own version, first seen Jun 20, 2026
- saisudhir14/claude-skillstheir own version, first seen Mar 25, 2026
- poteto0/my-skillstheir own version, first seen Feb 19, 2026
- xxxryan/agent-skillstheir own version, first seen Jan 30, 2026
Used with
Projects with it also use go-linting, go-performance and 2 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
saisudhir14Skillgo-linting
Use when setting up linting, configuring golangci-lint, or fixing linter warnings in Go projects. Provides recommended linter sets, golangci-lint configuration, CI integration, and Makefile targets.
Also in 3 projects that use this
saisudhir14Skillgo-performance
Use when writing, reviewing, or optimizing Go code for performance. Covers string operations, memory allocation, preallocating slices and maps, strings.Builder, strconv, container-aware GOMAXPROCS, and runtime considerations for Go 1.25.
Also in 3 projects that use this
wpankSkillgo-concurrency
Production Go concurrency patterns — goroutines, channels, sync primitives, context, worker pools, pipelines, and graceful shutdown. Use when building concurrent Go applications or debugging race conditions.
Also in 3 projects that use this
- +1 more from saisudhir14
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- cxuu/golang-skills★ 165same name
- muratmirgun/gophers★ 9same name
- saisudhir14/claude-skills★ 9same name
- xxxryan/agent-skills★ 1same name
- poteto0/my-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository36 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/go-skills.mdcCursor rule
- go-api-designSkill
- go-architecture-reviewSkill
- go-cliSkill
- go-dependency-injectionSkill
- go-design-patternsSkill
- go-graphqlSkill
- go-grpcSkill
- go-interface-designSkill
- go-openapiSkill
- go-project-layoutSkill
- go-coding-standardsSkill
- go-contextSkill
- go-data-structuresSkill
- go-documentationSkill
- go-error-handlingSkill
- go-modernizeSkill
- go-databaseSkill
- go-concurrency-reviewSkill
- go-defensive-codingSkill
- go-observabilitySkill
- go-performance-reviewSkill
- go-security-auditSkill
- go-troubleshootingSkill
- go-test-qualitySkill
- go-test-table-drivenSkill
- git-commitSkill
- go-binary-sizeSkill
- go-ciSkill
- go-dependency-auditSkill
- go-refactoringSkill
- go-semantic-toolsSkill
- go-skills-routerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 7 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 45
Before reading code manually, let the tools catch the mechanical issues (skip any tool that is not installed and note it in the report):
- Very specific: line 62
Every error is checked. No blank identifier _ discarding errors silently.
- Distinctive: line 76
No goroutine leaks — every goroutine has a clear termination path.
- Very specific: line 84
Use functional options (WithTimeout(d)) over config structs for optional params.
- Very specific: line 87
Avoid bool parameters — prefer named types or options.
- Very specific: line 92
No unnecessary else after return/continue/break.
- Distinctive: line 102
No circular dependencies between packages.
- Very specific: line 109
Test functions follow TestXxx naming convention.
- Very specific: line 111
Test helpers use t.Helper() for clean stack traces.
- Very specific: line 112
No test logic in init() — use TestMain when needed.
- Distinctive: line 119
All exported types, functions, and constants have doc comments.
- Distinctive: line 133
When the scope exceeds ~20 files, do not read everything in one linear pass.
- Distinctive: line 138
Run one focused pass per concern from sections 1-7 (correctness, API design, idioms, structure, testing, docs, dependencies).
- Distinctive: line 140
If your environment supports delegating work to parallel sub-agents or tasks, assign each pass to one — they are independent by design.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Go Code Review
Structured code review process for Go. Reviews should be constructive, specific, and cite the relevant principle behind each finding.
Operating Modes
Pick the mode that matches the request before starting:
- Diff review (default) — review only the changed lines plus enough surrounding context to judge them. Use for PRs and working-tree changes.
- File/package review — review the named files or packages in full, including their tests.
- Full audit — sweep the entire codebase. Use the strategy in "Auditing Large Codebases" below and aggregate everything into one report.
Review Process
Execute these steps in order. For each finding, classify severity:
- 🔴 BLOCKER — Must fix before merge. Correctness, data loss, security.
- 🟡 WARNING — Should fix. Maintainability, idiomatic Go, clarity.
- 🟢 SUGGESTION — Consider improving. Style, naming, documentation.
0. Run the Toolchain First
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 racesReport tool findings alongside manual findings — a failing go vet is
an automatic 🔴 BLOCKER. Never report an issue a tool already proves
absent.
1. Correctness & Safety
Error Handling
- Every error is checked. No blank identifier
_discarding errors silently. - Errors are wrapped with context:
fmt.Errorf("fetch user %d: %w", id, err). - Error values compared with
errors.Is()/errors.As(), never==. - No
panicoutside ofinit()or truly unrecoverable situations. - Errors handled exactly once — no log-and-return patterns.
Nil Safety
- Pointer receivers checked before dereference when nil is a valid state.
- Map reads guarded or use comma-ok idiom.
- Channel operations consider closed/nil channels.
- Slice operations check bounds where relevant.
Concurrency
- Shared mutable state protected by
sync.Mutexor channels. - No goroutine leaks — every goroutine has a clear termination path.
- Context propagation: all blocking calls accept and respect
context.Context. sync.WaitGrouporerrgroup.Groupused for goroutine lifecycle.
2. API Design
- Exported functions have doc comments starting with the function name.
- Accept interfaces, return concrete types.
- Use functional options (
WithTimeout(d)) over config structs for optional params. - Context is always the first parameter:
func Foo(ctx context.Context, ...). - Return
erroras the last return value. - Avoid
boolparameters — prefer named types or options.
3. Idiomatic Go
- Uses
:=for local variables,varfor zero-value intent. - No unnecessary
elseafter return/continue/break. - Guard clauses and early returns reduce nesting.
deferused for cleanup, placed right after resource acquisition.rangeused over manual index iteration where appropriate.- Struct literals use field names.
- Interfaces defined at consumer, not producer.
4. Package Structure
- Package names are short, lowercase, singular nouns.
- No circular dependencies between packages.
internal/used for non-public packages.cmd/contains main packages, one per binary.- Clear separation of concerns — no god packages.
5. Testing
- Test functions follow
TestXxxnaming convention. - Table-driven tests used for multiple input/output combinations.
- Test helpers use
t.Helper()for clean stack traces. - No test logic in
init()— useTestMainwhen needed. - Tests use
testify/assertortestify/requireconsistently, or stdlib only. - Edge cases covered: empty input, nil, zero values, max values.
t.Parallel()used where safe.
6. Documentation
- All exported types, functions, and constants have doc comments.
- Doc comments start with the name of the entity.
- Package-level doc comment in
doc.gofor non-trivial packages. - Complex algorithms or business logic have inline comments explaining why.
7. Dependencies
go.modhas no replace directives in committed code (except monorepos).- No unused dependencies.
- Dependencies are from well-maintained, reputable sources.
- Indirect dependencies are understood and acceptable.
Auditing Large Codebases
When the scope exceeds ~20 files, do not read everything in one linear pass. Split the audit into independent passes:
- Enumerate packages (
go list ./...) and group them by layer (handlers, services, stores, shared libraries). - Run one focused pass per concern from sections 1-7 (correctness, API design, idioms, structure, testing, docs, dependencies).
- If your environment supports delegating work to parallel sub-agents or tasks, assign each pass to one — they are independent by design. Otherwise run them sequentially, one concern at a time.
- Require every finding to cite
file.go:lineand severity so the final aggregation is mechanical: merge, deduplicate, sort by severity.
Review Output Format
## 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>Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

