go-code-review

Review Go code for idiomatic patterns, error handling, and concurrency safety.

75|9|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/anderskev/beagle --skill go-code-review-anderskev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-code-review
Source: https://github.com/anderskev/beagle/tree/main/skills/go-code-review
Command: npx skills add https://github.com/anderskev/beagle --skill go-code-review-anderskev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Go code review patterns help ensure idiomatic Go, robust error handling, and concurrency safety.

Core Features & Use Cases

  • Check error handling, goroutine usage, interface design
  • Checklist-based review approach for consistent quality

Quick Start

Review a Go file using the checklist to identify common issues and improvements.

Frequently Asked Questions about go-code-review

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review Go code for common mistakes and idiomatic patterns?

Go code review checks error handling, goroutine usage, interface design, and concurrency safety against idiomatic patterns. It enforces wrapped errors with context, defer-based resource cleanup, context propagation, mutex-guarded shared state, consumer-defined interfaces, and exported symbol documentation while flagging naked returns and other Go pitfalls.

What error handling patterns should I follow in Go?

Go error handling requires checking all errors and wrapping them with context for debugging. The review enforces this pattern alongside proper defer usage for resource cleanup and ensures errors propagate through the call stack with meaningful information.

How do I ensure goroutines and concurrency are safe in Go?

Concurrency safety in Go requires mutexes to guard shared state, proper context propagation to manage cancellation and deadlines, and coordinated goroutine lifecycle. The review checklist validates these patterns to prevent race conditions and resource leaks.

When should I define interfaces in Go?

Interfaces in Go should be defined by their consumers, not providers, to enable flexibility and decouple dependencies. The review enforces this pattern to ensure interfaces are small, focused, and promote composability.

Can I use this for automated code review in CI pipelines?

Yes. The checklist-based approach applies to .go files in code reviews, CI checks, or learning sessions, enabling consistent quality enforcement across teams and automated validation of idiomatic Go patterns.

What happens if I don't check errors or close resources in Go?

Unchecked errors hide failures and make debugging difficult; unclosed resources cause leaks and instability. The review identifies these gaps and enforces checked errors with context wrapping and defer-based resource cleanup as preventive patterns.