xxxryan

go-code-review

1
0
# Install this skill:
npx skills add xxxryan/agent-skills --skill "go-code-review"

Install specific skill from multi-skill repository

# Description

Perform a senior Go code review on a diff or files, focusing on correctness, idiomatic Go, error handling, maintainability, and performance. Use when the user asks for review, refactor feedback, or PR comments for Go services.

# SKILL.md


name: go-code-review
description: Perform a senior Go code review on a diff or files, focusing on correctness, idiomatic Go, error handling, maintainability, and performance. Use when the user asks for review, refactor feedback, or PR comments for Go services.
compatibility: Works with diffs or local repo access. Best with gofmt/go test available.
metadata:
short-description: Senior Go PR review
allowed-tools: Bash(git:) Bash(go:) Read


Go Code Review

Review principles

  • Correctness > clarity > performance
  • Prefer small, explicit abstractions
  • Avoid hidden coupling across packages
  • Ensure errors are actionable and wrapped

Checklist (prioritized)

Correctness & API behavior

  • Context propagation, cancellation, timeouts
  • Input validation and boundary conditions
  • Error semantics (sentinel vs typed vs wrapped)
  • Idempotency for write endpoints if relevant

Concurrency & resources

  • Goroutine lifecycle: no leaks; bounded fan-out
  • Channels: ownership, close discipline, backpressure
  • Locks: avoid contention; avoid deadlocks
  • Use errgroup where appropriate

Go idioms & style

  • gofmt, naming, package structure
  • Avoid needless pointers; avoid interface{} when generics / concrete types suffice
  • Minimize exported surface

Performance

  • Avoid per-request allocations in hot paths
  • Preallocate slices/maps when size known
  • Avoid converting between []byte/string unnecessarily
  • DB queries: N+1, missing indexes, scanning errors

Observability & ops

  • Structured logs; include request ids
  • Metrics for errors/latency where important
  • Trace propagation (if applicable)

Workflow

  1. Determine input: diff, files, or PR context.
  2. Produce review comments grouped by severity:
  3. Blockers
  4. Important
  5. Nit / style
  6. For each comment:
  7. Quote the relevant code snippet (short)
  8. Explain impact
  9. Provide a concrete fix suggestion

Output format

  • Use bullet points, grouped by severity.
  • Include small patch suggestions when helpful.

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.