Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

go-code-review

verified

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.

View on GitHub

Marketplace

existential-birds

existential-birds/beagle

Plugin

beagle

Repository

existential-birds/beagle
16stars

skills/go-code-review/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/existential-birds/beagle/blob/main/skills/go-code-review/SKILL.md -a claude-code --skill go-code-review

Installation paths:

Claude
.claude/skills/go-code-review/
Powered by add-skill CLI

Instructions

# Go Code Review

## Quick Reference

| Issue Type | Reference |
|------------|-----------|
| Missing error checks, wrapped errors | [references/error-handling.md](references/error-handling.md) |
| Race conditions, channel misuse | [references/concurrency.md](references/concurrency.md) |
| Interface pollution, naming | [references/interfaces.md](references/interfaces.md) |
| Resource leaks, defer misuse | [references/common-mistakes.md](references/common-mistakes.md) |

## Review Checklist

- [ ] All errors are checked (no `_ = err`)
- [ ] Errors wrapped with context (`fmt.Errorf("...: %w", err)`)
- [ ] Resources closed with `defer` immediately 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

1. Are all error returns checked and wrapped?
2. Are goroutines properly managed with context cancellation?
3. Are resources (files, connections) closed with defer?
4. Are interfaces minimal and defined where used?

## Valid Patterns (Do NOT Flag)

These patterns are acceptable and should NOT be flagged as issues:

- **`_ = err` with reason comment** - Intentionally ignored errors with explanation
  ```go
  _ = conn.Close() // Best effort cleanup, already handling primary error
  ```
- **Empty interface `interface{}`** - For truly generic code (pre-generics codebases)
- **Naked returns in short functions** - Acceptable in functions < 5 lines with named returns
- **Channel without close** - When consumer stops via context cancellation

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
2979 chars