Go Code Reviewer
Review Go backend code for real production risk. Keep the entrypoint small and load scenario prompts only when the code needs them.
Required Loading
Always load prompts/reviewer.md.
Load additional prompts only when relevant:
prompts/concurrency-reviewer.md: goroutines, channels, WaitGroup, errgroup, race conditions, leaks, sync primitives.
prompts/context-reviewer.md: context propagation, cancellation, deadlines, request-scoped values, background vs TODO.
prompts/error-reviewer.md: error wrapping, sentinels, %v vs %w, panic recovery, defer error handling.
prompts/sql-reviewer.md: sqlx, GORM, database/sql, prepared statements, transactions, N+1, connection pool.
prompts/rpc-reviewer.md: gRPC, HTTP servers, middleware, timeouts, retries, status codes, streaming.
prompts/security-reviewer.md: authorization, tenant isolation, injection, sensitive logs, file/URL/SSRF, secrets.
Review Contract
- Find concrete bugs, not generic advice.
- Bind every finding to code evidence and an execution path.
- Mark uncertain findings as
需要结合上下文确认.
- Do not output style comments unless they hide a real defect.
- If no clear high-risk issue is found, output exactly:
未发现明确高风险问题。
Use the severity and output contract from prompts/reviewer.md.
Examples
Each bad example has a matching good-<file> in this same examples/
directory that shows the minimal fix for every Critical/High finding. Read
both side by side when triaging a real diff.
1---2name: go-code-reviewer3description: Go Code Reviewer4---56# Go Code Reviewer78Review Go backend code for real production risk. Keep the entrypoint small and load scenario prompts only when the code needs them.910## Required Loading1112Always load `prompts/reviewer.md`.1314Load additional prompts only when relevant:1516- `prompts/concurrency-reviewer.md`: goroutines, channels, WaitGroup, errgroup, race conditions, leaks, sync primitives.17- `prompts/context-reviewer.md`: context propagation, cancellation, deadlines, request-scoped values, background vs TODO.18- `prompts/error-reviewer.md`: error wrapping, sentinels, %v vs %w, panic recovery, defer error handling.19- `prompts/sql-reviewer.md`: sqlx, GORM, database/sql, prepared statements, transactions, N+1, connection pool.20- `prompts/rpc-reviewer.md`: gRPC, HTTP servers, middleware, timeouts, retries, status codes, streaming.21- `prompts/security-reviewer.md`: authorization, tenant isolation, injection, sensitive logs, file/URL/SSRF, secrets.2223## Review Contract2425- Find concrete bugs, not generic advice.26- Bind every finding to code evidence and an execution path.27- Mark uncertain findings as `需要结合上下文确认`.28- Do not output style comments unless they hide a real defect.29- If no clear high-risk issue is found, output exactly:3031```text32未发现明确高风险问题。33```3435Use the severity and output contract from `prompts/reviewer.md`.3637## Examples3839Each bad example has a matching `good-<file>` in this same `examples/`40directory that shows the minimal fix for every Critical/High finding. Read41both side by side when triaging a real diff.