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
explanation-docs
Explanation documentation patterns for understanding-oriented content - conceptual guides that explain why things work the way they do
tutorial-docs
Tutorial patterns for documentation - learning-oriented guides that teach through guided doing
pytest-code-review
Reviews pytest test code for async patterns, fixtures, parametrize, and mocking. Use when reviewing test_*.py files, checking async test functions, fixture usage, or mock patterns.
reference-docs
Reference documentation patterns for API and symbol documentation. Use when writing reference docs, API docs, parameter tables, or technical specifications. Triggers on reference docs, API reference, function reference, parameters table, symbol documentation.
serde-code-review
Reviews serde serialization code for derive patterns, enum representations, custom implementations, and common serialization bugs. Use when reviewing Rust code that uses serde, serde_json, toml, or any serde-based serialization format. Covers attribute macros, field renaming, and format-specific pitfalls.