go-reviewer

Reviews Go code changes for concurrency safety and style.

412|115|Updated May 24, 2023
One-click install
npx skills add https://github.com/anyproto/anytype-heart --skill go-reviewer-anyproto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-reviewer
Source: https://github.com/anyproto/anytype-heart/tree/main/.claude/skills/go-reviewer
Command: npx skills add https://github.com/anyproto/anytype-heart --skill go-reviewer-anyproto

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps maintain high code quality in the Anytype Heart Go codebase by identifying potential issues related to concurrency, memory usage, code patterns, and testing.

Core Features & Use Cases

  • Concurrency Safety Checks: Detects potential goroutine leaks, improper context propagation, and incorrect mutex usage.
  • Idiomatic Go Patterns: Verifies adherence to established patterns for service registration, object access, and error handling.
  • Memory & Performance: Identifies opportunities for optimization using sync.Pool, arena allocation, and efficient string building.
  • Testing Best Practices: Reviews table-driven tests, fixture patterns, and mock usage.
  • Use Case: After implementing a new feature involving background processing, use this Skill to ensure all goroutines are properly managed and contexts are correctly propagated to prevent leaks and race conditions.

Quick Start

Use the go-reviewer skill to review the Go code changes in the current directory for any issues.

Frequently Asked Questions about go-reviewer

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

FAQPage Schema
How do I review Go code for concurrency safety and goroutine leaks?

Idiomatic Go patterns include established conventions for service registration, object access, and error handling. Adhering to these patterns ensures your codebase remains consistent and maintainable.

How do I optimize memory usage and performance in Go?

Optimize Go memory usage by identifying opportunities to implement sync.Pool, arena allocation, and efficient string building. These techniques reduce garbage collection overhead and improve performance.

What are the best practices for writing Go tests?

Go testing best practices involve using table-driven tests, fixture patterns, and proper mock usage. Following these practices ensures comprehensive test coverage and reliable code validation.

Can I check for issues in my Go code changes automatically?

Yes, you can automatically check for issues in Go code changes by triggering a review after implementing features. This verifies adherence to codebase conventions and identifies concurrency, memory, or pattern issues.

Does this Go code reviewer work with the Anytype Heart repository?

Yes, this code reviewer is designed for the Anytype Heart Go codebase. It applies specific codebase conventions to review changes for idiomatic patterns, concurrency safety, memory optimization, and test quality.