Best for
- Go code review / PR review / diff review
- Code quality or best-practice checks
- Risk or regression analysis
johnqtcg/awesome-skills/skills/go-code-reviewer/SKILL.md
Review Go code with a defect-first approach using repository policy (constitution.md first, then AGENTS.md fallback). Use for code review, PR review, quality checks, risk analysis, and regression detection.
Decision brief
Review Go code with a defect-first approach using repository policy (constitution. md first, then AGENTS.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/johnqtcg/awesome-skills --skill "skills/go-code-reviewer"Inspect the Agent Skill "go-code-reviewer" from https://github.com/johnqtcg/awesome-skills/blob/d63cf368c1b106871b56454bd73c293701bef500/skills/go-code-reviewer/SKILL.md at commit d63cf368c1b106871b56454bd73c293701bef500. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
1. constitution.md (highest repository policy for this skill) 2. AGENTS.md (repo workflow/testing/style constraints) 3. Local package conventions (tests, interfaces, dependency patterns) 4. Go language/runtime best practices If constitution.md is missing, explicitly state that a…
Full workflow in this skill applies as written.
Never claim verification was executed unless it actually ran. - If go test or go test -race is not run, you must output: - Not run in this environment - reason - exact commands to run - Do not imply pass/fail for commands you did not execute.
0. Select review mode (Lite|Standard|Strict) and record mode selection rationale. - Check go.mod for the project Go version. Record as Go version: X.Y. - If go.mod is not accessible, record Go version: unknown.
Lite|Standard|Strict
Permission review
The documentation asks the agent to read local files, directories, or repositories.
| Read repo policy before reviewing | §Review Policy Sources |The documentation asks the agent to run terminal commands or scripts.
bash "<path-to-skill>/scripts/run_regression.sh"Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 94/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 30 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Use this skill to review Go code for real defects and risk, not just style. The review must be evidence-based, policy-aligned, and actionable.
| When you need to… | Jump to |
|---|---|
| Select review depth (Lite / Standard / Strict) | §Execution Modes |
| Read repo policy before reviewing | §Review Policy Sources |
| Execute full review checklist | §Review Checklist |
| Determine finding severity | §Finding Severity |
| Decide what NOT to report | §Review Discipline |
| Format findings and report | §Output Format |
| See a complete formatted output example | Load references/example-output.md |
Trigger this skill when the user asks for:
constitution.md (highest repository policy for this skill)AGENTS.md (repo workflow/testing/style constraints)constitution.md is missing, explicitly state that and continue with AGENTS.md + Go best practices.Choose a mode before starting review and state it in the report.
StandardReview Mode section.
Mode selection rules:Lite only when scope is small (typically <=3 files), low-risk, and no security/auth/concurrency/public API changes are involved.Strict when any high-risk signal exists: security/auth, concurrency/lifecycle, HTTP/API contract changes, persistence/schema changes, exported signature changes, or broad refactors (typically >15 files).Standard for everything else.golangci-lint preferred, else staticcheck/go vet).go test for impacted package(s).go test -race only if concurrency risk is present; if skipped, state reason.golangci-lint run (config-aware fallback strategy),go test -race when concurrency/shared state risk exists.golangci-lint run + direct staticcheck/go vet when not explicitly covered by config.go test ./...go test -race ./...Never claim verification was executed unless it actually ran.
go test or go test -race is not run, you must output:
Not run in this environmentWhen prior review context exists (previous PR review comments, prior findings, or known issue list), classify each finding as:
newregressedunchangedresolved
If no baseline is available, state: Baseline not found.Before reporting a finding, check whether the risk is already blocked by:
Suppressed items section with rationale.For unresolved findings, include:
High: fix or strong mitigation in <= 3 business daysMedium: <= 14 calendar daysLow: next planned iteration
Risk acceptance entry fields:Before recommending version-specific features, check the project's minimum Go version:
go.mod for the go directive (e.g., go 1.21).go.mod is not found or not readable, state Go version: unknown and annotate version-specific recommendations with their minimum required version.
Version-gated features (non-exhaustive):| Feature | Minimum Go |
|---|---|
| Generics | 1.18 |
atomic.Int64, atomic.Bool, typed atomics | 1.19 |
context.WithCancelCause, strings.Clone, errors.Join | 1.20 |
slog, context.WithoutCancel, context.AfterFunc, slices, maps, min/max builtins | 1.21 |
sync.OnceValue, sync.OnceFunc | 1.21 |
Range-over-func, enhanced loop variable semantics, math/rand/v2 | 1.22 |
iter.Seq, unique package | 1.23 |
Exclude auto-generated files from review findings:
*.pb.go, *_gen.go, wire_gen.go, *_string.go, *_enumer.gomock_*.go (from mockgen), *_mock.go// Code generated .* DO NOT EDIT
Rules:Excluded (generated) with the file name.When code under review matches trigger patterns (see Appendix), the corresponding reference file MUST be loaded before evaluating that category.
go-concurrency-patterns.md will miss nuanced patterns and produce lower-quality findings.When reviewing a PR or diff, classify each finding's origin relative to the current change:
introduced: The defective code was added or modified in this PR/diff. The author owns this finding.pre-existing: The defect exists in code that was NOT changed in this PR/diff. This is historical technical debt, not the author's fault.uncertain: Origin cannot be determined (e.g., full-file review without diff context, or ambiguous refactoring).
Classification method:introduced.pre-existing.uncertain.
Actionability by origin:| Origin | Merge-blocking? | Action |
|---|---|---|
introduced | Yes | Must fix or explicitly accept before merge. Counts toward SLA. |
pre-existing | No (unless High severity with immediate security/data-integrity/crash risk) | Report for awareness. Recommend filing as a follow-up issue with tracking link. Do NOT block the PR for historical debt. |
uncertain | Treat as introduced | Author may reclassify with evidence (e.g., git blame showing the line predates the branch). |
This gate exists so that developers are never blocked by legacy issues they did not introduce, while still surfacing important pre-existing risks for visibility. Pre-existing issues that do not make it into Findings (due to severity or volume cap) MUST still appear in Residual Risk / Testing Gaps with a one-line summary — no validated issue should be silently dropped. |
Select review mode (Lite|Standard|Strict) and record mode selection rationale.
go.mod for the project Go version. Record as Go version: X.Y.go.mod is not accessible, record Go version: unknown.Define scope.
Origin: pre-existing and Action: follow-up issue. Medium-severity pre-existing defects in unchanged code MUST be listed in Residual Risk / Testing Gaps with a one-line summary so they are not silently lost. Low-severity pre-existing issues may be omitted..golangci.yml / .golangci.yaml first; respect project settings.golangci-lint run → staticcheck ./... → go vet ./...
golangci-lint is available, inspect .golangci* config for enabled linters.go vet / staticcheck as covered when they are explicitly enabled by config.golangci-lint is not available, try staticcheck, then fall back to go vet.Not available and continue.go test for impacted package(s)go test -race when concurrency/shared state risk existsreferences/go-security-patterns.mddatabase/sql, os/exec, filepathInsecureSkipVerify), weak cryptounsafe package usage without justificationtext/template or fmt.Fprintf used for HTML output, template.HTML() on user inputOrigin, wildcard with credentialsX-Content-Type-Options, X-Frame-Options, Strict-Transport-Security, Content-Security-Policy== comparison on secrets/tokens instead of crypto/subtle.ConstantTimeComparehttp.MaxBytesReader), unchecked integer inputs used for allocation
Error Handling (High) → references/go-error-and-quality.md_ discard on error-returning calls)%w) — inspect every return err pathpanic used for recoverable errorserrors.Is / errors.As
Concurrency & Lifecycle (High) → references/go-concurrency-patterns.mddefer Unlock, lock copying)errgroup for coordinated goroutine error handlingcontext.Context not propagated; context.Value abusesync.Pool / sync.Once misusedefer recover() — unrecovered panic crashes entire processerrgroup.SetLimit / worker pool)
Test Quality (High) → references/go-test-quality.mdt.Helper() on test helpersnil, 0, 1, empty, max)references/go-api-http-checklist.mdr.Body.Close(); focus on bounded reads and error handling.resp.Body.Close() on all paths.Content-Type set explicitlyhttp.Server graceful shutdownc.Request.Context() propagationreferences/go-database-patterns.mdsql.Rows not closed (resource leak)defer tx.Rollback() + commit override)SetMaxOpenConns, SetConnMaxLifetime)db.Query instead of db.QueryContext)sql.ErrNoRows mishandled as server errorsql.Null* types
Code Quality (Medium) → references/go-error-and-quality.mdelse after error return)[]*T elements not nil-guarded before field access or method call
Performance (Medium) → references/go-performance-patterns.mdstrings.Builder)sync.Pool misuse or missed opportunity for hot-path allocationsfieldalignment tool)strings.Clone)bufio) for frequent small writes/readshttp.DefaultClient without timeout or transport tuningregexp.Compile in hot path instead of package-level compile-once
Modern Go & Best Practices (Medium) → references/go-modern-practices.mdany overuse where type constraint is possibleslog for structured logging (Go 1.21+)atomic.Int64 etc., Go 1.19+)context.WithCancelCause / context.WithoutCancel (Go 1.20+/1.21+)context.Background() vs context.TODO() usagego.sum synchronizedreplace directivesApply False-Positive Suppression Gate.
Apply Baseline Comparison Gate.
Apply Change Origin Classification Gate.
introduced; outside → pre-existing.git blame or file history to confirm.Origin and Action to each finding.Origin only if all locations have the same origin; otherwise list origins per location.introduced over pre-existing.Residual Risk / Testing Gaps with a one-line summary each, and note N additional lower-priority issues moved to Residual Risk in Summary.introduced before pre-existing within the same severity level. High → Medium → Low.Origin, and Action.path:line)See references/go-review-anti-examples.md (always loaded — see Appendix).
Before suppressing a finding using an anti-example, you MUST quote specific code evidence satisfying the anti-example's stated precondition. Category match alone is not sufficient — if you cannot cite evidence, the finding must be reported.
Lite|Standard|StrictList findings first, ordered by severity.
REV-001introduced|pre-existing|uncertainnew|regressed|unchanged (or N/A if baseline missing)constitution.md clause (or N/A with reason)path:line (or location list for merged findings)must-fix | follow-up issue (aligned with Origin actionability table)Only include items filtered by the suppression gate.
path:lineGo version: X.Y (from go.mod) or unknownExcluded (generated): list of generated files excluded, or NoneReferences loaded: list of reference files loaded for this reviewgo vet: PASS|FAIL|Not available|Covered by golangci-lint configstaticcheck: PASS|FAIL|Not available|Covered by golangci-lint configgolangci-lint: PASS|FAIL|Not availablego test: PASS|FAIL|Not run in this environmentgo test -race: PASS|FAIL|Not run in this environmentOnly include blockers that materially affect confidence.
This section captures items that are valuable context but do not belong in Findings:
severity | origin | location | short description) so no validated issue is silently dropped.Origin: pre-existing.1-3 lines only, after findings. Include origin breakdown: X introduced / Y pre-existing / Z uncertain.
If findings were capped by volume limit, note: N additional lower-priority issues moved to Residual Risk.
When you need to verify report formatting or check what a complete review looks like:
→ Load references/example-output.md for a full example covering Review Mode, Findings with all required fields (ID, Origin, Baseline, Principle, Location, Impact, Evidence, Recommendation, Action), and Summary.
If no issues are found:
No actionable findings found.Review ModeExecution Statusresolved list if available, otherwise Baseline not found)Run regression checks for this skill with:
bash "<path-to-skill>/scripts/run_regression.sh"
This is a mandatory gate (see §7 Reference Loading Gate). Use the table below as a compact trigger map; detailed patterns live in the reference files themselves.
| Reference | Representative triggers |
|---|---|
references/go-review-anti-examples.md | Any review (always loaded) |
references/pr-review-quick-checklist.md | Any PR or diff review |
references/go-security-patterns.md | auth/token flows, hardcoded string literals, SQL/command/path use, outbound fetches, TLS, HTML/template output, upload/body limits |
references/go-concurrency-patterns.md | go func, channels, mutexes, wait groups, errgroup, lifecycle or cancellation code |
references/go-error-and-quality.md | ignored errors, panic(, errors.Is/As, naked returns, receiver or shadowing issues |
references/go-test-quality.md | _test.go, httptest, testing.B/F, testdata/ |
references/go-api-http-checklist.md | net/http, handlers, servers, gin/echo/chi, gRPC, pb. or proto. |
references/go-database-patterns.md | database/sql, pgx, sqlx, gorm, ent, query/tx/rows code |
references/go-performance-patterns.md | hot loops, builders, preallocation, sync.Pool, atomics, regex, client or JSON hot paths |
references/go-modern-practices.md | generics, any, slog, typed atomics, modern context helpers, slices/maps |
Frequently asked questions
Review Go code with a defect-first approach using repository policy (constitution. md first, then AGENTS.
The source record exposes this install command: npx skills add https://github.com/johnqtcg/awesome-skills --skill "skills/go-code-reviewer". Inspect the command and pinned source before running it.
Static rules flagged read-files, exec-script in the source; the page lists the matching lines and excerpts.
Alternatives
VincentChuWaiChow/vanguard-frontier-agentic
Executes Apex tests against a connected SANDBOX org via sf apex run test, parses results and coverage delta, identifies failures with stack traces, and suggests fixes. T1 read-only runtime (sandbox-only). Production org targets are HARD REFUSED before any API call. TRIGGER when: user wants to run Apex tests, execute a test class, check test coverage, diagnose test failures, or validate coverage before deployment. Trigger phrases: run apex tests, execute test class, test my changes, check test co
ZaxbyHub/opencode-swarm
Apply when committing, pushing, opening or updating a PR, writing a pull request, creating release notes, or closing out remote CI. Enforces the opencode-swarm invariant audit, release-note fragment workflow, full validation suite, issue comment requirement, and post-PR lifecycle rules.
oaslananka/kicad-mcp-pro
Use this skill for GitHub Copilot pull request and code reviews in oaslananka/kicad-mcp-pro. Review Python MCP server changes, KiCad adapter and tool-contract changes, tests, npm/package wrappers, Tauri/Rust desktop code, GitHub Actions, security controls, documentation, generated metadata, and compatibility/release surfaces. Use it whenever reviewing a PR or diff in this repository, especially changes under src/, tests/, packages/, src-tauri/, .github/workflows/, or public MCP metadata/configur
microsoft/Sico
Execute Android UI workflows on a sandbox device, review results, and produce a structured execution report.