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. Covers generics (Go 1.18+), errors.Join and slog (Go 1.21+), and Go 1.22 loop variable semantics.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/anderskev/go-code-reviewWhat This Skill Does
The go-code-review skill provides an automated, expert-level static analysis framework for the Go programming language. It is designed to act as an on-demand senior engineer, evaluating Go code against industry best practices. Unlike simple linters, this skill focuses on architectural integrity, concurrency safety, and the nuances of the Go runtime across different version releases. It ensures that error handling, resource lifecycle management, and interface design align with idiomatic Go standards.
Installation
To integrate this skill into your environment, execute the following command in your terminal:
clawhub install openclaw/skills/skills/anderskev/go-code-review
Once installed, the agent will have the ability to inspect files within your project workspace and provide feedback based on the established review workflow.
Use Cases
- Pre-PR Analysis: Run the skill on a feature branch before opening a Pull Request to catch concurrency bugs or missing error checks.
- Legacy Refactoring: Identify opportunities to upgrade code to modern Go standards, such as replacing old loggers with
slogor simplifying logic witherrors.Join. - Dependency Audit: Analyze how your service consumes external interfaces to ensure they are defined by the consumer, keeping your packages loosely coupled.
- Resource Lifecycle Review: Specifically useful for checking that file handles, database connections, and HTTP response bodies are correctly managed with
defer.
Example Prompts
- "Review the
internal/processorpackage for concurrency safety and ensure all goroutines are properly cleaned up." - "Check the current error handling in
main.go. I'm running Go 1.21, so please suggest where I can improve usingerrors.Join." - "Is this interface design idiomatic for Go? I have a large
Managerinterface that I think needs breaking down into smaller, consumer-driven components."
Tips & Limitations
The skill relies heavily on your go.mod file to determine the Go version. Always ensure your workspace is up to date, as the reviewer will skip version-specific optimizations (like loop variable capture fixes) if it detects an older version. The skill is optimized for logic and pattern analysis; while it excels at catching subtle race conditions and resource leaks, it is not a replacement for unit tests or full-scale dynamic race detectors. Always verify critical changes with the suggested verification protocol before applying them to production codebases.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-anderskev-go-code-review": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read
Related Skills
tutorial-docs
Tutorial patterns for documentation - learning-oriented guides that teach through guided doing
fetch-pr-feedback
Fetch review comments from a PR and evaluate with receive-feedback skill
swift-testing-code-review
Reviews Swift Testing code for proper use of
rust-testing-code-review
Reviews Rust test code for unit test patterns, integration test structure, async testing, mocking approaches, and property-based testing. Covers Rust 2024 edition changes including async fn in traits for mocks,
explanation-docs
Explanation documentation patterns for understanding-oriented content - conceptual guides that explain why things work the way they do