review-golang
Run a comprehensive Go code review on git-changed files using the golang-pro agent with Context7 library docs
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run a comprehensive Go code review on git-changed files using the golang-pro agent with Context7 library docs
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Explain the current git branch's changes in plain product language for a non-technical audience — no file paths, no code references, no jargon. Reads the branch diff, commits, and available docs, then produces a short human briefing about what changed and why it matters. Use when the user invokes /explain-branch-changes, asks what a branch does in simple terms, needs a product summary of changes for a PM / designer / stakeholder / support, or says things like 'объясни ветку простыми словами', 'что поменялось для пользователей', 'explain this branch to a non-developer'. Works with any codebase, language, and project structure. NOT for code review or technical diff analysis — use load-branch-changes for that.
Sync README with current agents/skills, validate plugin conventions, sync the Codex plugin directory (plugins/ai-kit), bump version, and commit. Use when the user says "/review-and-release" or wants to prepare a release after adding, removing, or changing agents or skills.
Perform 12-Factor App compliance analysis on any codebase. Use when evaluating application architecture, auditing SaaS applications, or reviewing cloud-native applications against the original 12-Factor methodology.
Automated technical website audit via the squirrelscan CLI: crawls a live or local site and checks 230+ rules across SEO, performance, security, technical, content, and 16 other categories, returning an LLM-optimized report with a health score, broken links, meta-tag analysis, and actionable fixes (with an optional confirm-first fix loop). Use for a fast, tool-driven scan of a website or webapp. For manual SEO strategy and content review without a crawler, use the seo-audit skill instead.
Check browser support for web platform features (CSS, JS APIs, HTML) against the project's actual browser targets. Resolves the project's browserslist config, queries caniuse/MDN compatibility data, reports Baseline status, and recommends fallbacks or progressive enhancement. Use when asking "can I use X", choosing between modern and legacy approaches, reviewing code for unsupported features, or auditing browser compatibility.
Analyzes code diffs and files to identify bugs, security vulnerabilities (SQL injection, XSS, insecure deserialization), code smells, N+1 queries, naming issues, and architectural concerns, then produces a structured review report with prioritized, actionable feedback. Use when reviewing pull requests, conducting code quality audits, identifying refactoring opportunities, or checking for security issues.
| name | review-golang |
| description | Run a comprehensive Go code review on git-changed files using the golang-pro agent with Context7 library docs |
| model | sonnet |
You are performing a comprehensive Go code review. Follow these steps exactly.
Run these commands to find changed .go files:
git diff --name-only HEAD -- '*.go'
git diff --cached --name-only -- '*.go'
Combine and deduplicate the results. Exclude _test.go files from the primary review list but keep them for the test quality review area.
If NO changed .go files are found, use AskUserQuestion to ask the user which Go files or directories to review. Do not proceed without files.
This step is critical — the golang-pro agent does NOT have Context7 MCP tools, so you must fetch docs now and pass them along.
go.mod to identify third-party dependencies (non-stdlib, non-internal modules).import statements. Identify which third-party libraries are actually used.mcp__context7__resolve-library-id with the library's module path (e.g., github.com/spf13/cobra)
b. If resolved, call mcp__context7__get-library-docs with the resolved ID and a topic query relevant to how the library is used in the changed codeLimit to the 3-5 most important libraries to avoid overwhelming the review context.
Use the Task tool with subagent_type: "golang-pro" to run the review. Pass a prompt that includes:
.go file paths (both source and test files)Construct the prompt as follows:
You are reviewing Go code changes. Read each file listed below and produce a structured review.
## Files to Review
{list of file paths}
## Library Documentation Context
{pre-fetched Context7 docs for third-party libraries used in these files}
## Review Areas
Analyze each file across these 8 areas:
1. **Go Idioms & Code Quality** — Non-idiomatic patterns, naming violations, struct design issues
2. **Error Handling** — Swallowed errors, missing error checks, incorrect error wrapping, sentinel vs type errors
3. **Memory & Allocations** — Unnecessary allocations, missing pre-allocation for known-size slices, string concatenation in loops. Only flag practical issues, no micro-optimizations.
4. **Performance Patterns** — Unoptimal algorithms, unnecessary work in hot paths, missing caching where obvious
5. **Dead Code** — Unused functions, unreachable branches, commented-out code left behind
6. **Code Duplication** — Repeated logic that would clearly benefit from extraction (3+ occurrences or complex blocks). Do NOT suggest extraction for simple 2-3 line patterns.
7. **Test Quality** — Missing edge cases, brittle assertions, test isolation issues, missing error case tests
8. **Library Usage** — Incorrect or suboptimal use of stdlib and third-party libraries. Use the library documentation provided above to verify correct API usage.
## Review Rules
- Be minimal and optimal — don't overcomplicate suggestions
- Be context-specific — no generic advice, only what matters for THIS code
- Simple > complex — never suggest an overengineered solution
- Every finding MUST include a file:line reference
- If a review area has no findings, omit it entirely
- Do NOT suggest adding comments, docstrings, or type annotations unless there is a clear correctness issue
- Do NOT suggest error handling for impossible scenarios
- Do NOT suggest abstractions for one-time code
## Output Format
Group findings by review area. For each finding:
**[Area Name]**
- `file.go:42` — Description of the issue and suggested fix
If everything looks good, say so briefly. Do not pad the review with praise or filler.
The golang-pro agent will return the structured review. Present it directly to the user. Do not add extra commentary or re-analyze — the review stands as-is.