Agent skill
go-code-review
Reviews Go code for idiomatic patterns, error handling, concurrency safety, and common mistakes. Use when reviewing .go files, checking error handling, goroutine usage, or interface design.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/go-code-review
SKILL.md
Go Code Review
Quick Reference
| Issue Type | Reference |
|---|---|
| Missing error checks, wrapped errors | references/error-handling.md |
| Race conditions, channel misuse | references/concurrency.md |
| Interface pollution, naming | references/interfaces.md |
| Resource leaks, defer misuse | references/common-mistakes.md |
Review Checklist
- All errors are checked (no
_ = err) - Errors wrapped with context (
fmt.Errorf("...: %w", err)) - Resources closed with
deferimmediately after creation - No goroutine leaks (channels closed, contexts canceled)
- Interfaces defined by consumers, not producers
- Interface names end in
-er(Reader, Writer, Handler) - Exported names have doc comments
- No naked returns in functions > 5 lines
- Context passed as first parameter
- Mutexes protect shared state, not methods
When to Load References
- Reviewing error return patterns → error-handling.md
- Reviewing goroutines/channels → concurrency.md
- Reviewing type definitions → interfaces.md
- General Go review → common-mistakes.md
Review Questions
- Are all error returns checked and wrapped?
- Are goroutines properly managed with context cancellation?
- Are resources (files, connections) closed with defer?
- Are interfaces minimal and defined where used?
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?