Best for
- Reviewing code structure and readability
- Checking Go naming conventions and package organization
- Evaluating use of modern Go features
johnqtcg/awesome-skills/skills/go-quality-review/SKILL.md
Review Go code for code quality, style, and modern Go practices including function length, nesting depth, naming, mutable globals, interface design, receiver consistency, modern Go idioms (slog, generics, typed atomics), and static analysis. Trigger when reviewing Go code structure, readability, or maintainability. Also runs golangci-lint for automated style checks.
Decision brief
Review Go code for code quality, style, and modern Go practices including function length, nesting depth, naming, mutable globals, interface design, receiver consistency, modern Go idioms (slog, generics, typed atomics), and static analysis. Trigger when reviewing Go code structure, readability, or maintainability.
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-quality-review"Inspect the Agent Skill "go-quality-review" from https://github.com/johnqtcg/awesome-skills/blob/d63cf368c1b106871b56454bd73c293701bef500/skills/go-quality-review/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. Define scope — files/diff under review. Apply Generated Code Exclusion Gate. 2. Check Go version from go.mod — gate all modern Go recommendations. 3. Run static analysis — follow execution protocol above. Record output. 4. Gather evidence — read changed files, identify qualit…
Code quality, style, modern practices, and lint only — not security, concurrency, errors, performance, tests, or logic
Audit Go code for structural quality, style conformance, and modern Go practices. This skill is the designated lint-tool runner — other vertical review skills do NOT run golangci-lint/staticcheck/go vet, avoiding duplicate execution.
Reviewing code structure and readability
Security vulnerabilities → go-security-review
Permission review
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 95/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
Audit Go code for structural quality, style conformance, and modern Go practices. This skill is the designated lint-tool runner — other vertical review skills do NOT run golangci-lint/staticcheck/go vet, avoiding duplicate execution.
This skill does NOT cover: security, concurrency, performance, error handling, test quality, or business logic — those belong to sibling vertical skills.
golangci-lint / staticcheck / go vetgo-security-reviewgo-concurrency-reviewgo-error-reviewgo-performance-reviewgo-logic-reviewRead go.mod for go directive. Do NOT recommend features above project version.
| Feature | Minimum Go |
|---|---|
| Generics | 1.18 |
Typed atomics (atomic.Int64, atomic.Bool) | 1.19 |
slog, slices/maps packages, min/max builtins, sync.OnceValue/OnceFunc | 1.21 |
| Range-over-func, enhanced loop variable semantics | 1.22 |
iter.Seq, unique package | 1.23 |
MUST quote specific code evidence. Category match alone insufficient.
Embedded anti-examples:
internal/ package not intended for external consumers.Run lint tools in this priority order:
.golangci.yml / .golangci.yaml — respect project configgolangci-lint run (config-aware)staticcheck ./... (if golangci-lint unavailable)go vet ./... (minimal fallback)
Report tool output in Execution Status. If no tools available, state Not available.
Dedup rule: same location + same issue from multiple tools = report once.Exclude: *.pb.go, *_gen.go, mock_*.go, *_string.go, *_enumer.go. Note excluded files in Execution Status.
go.mod — gate all modern Go recommendations.go-error-and-quality.md (quality sections); load go-modern-practices.md when modern Go features relevant.This skill uses mechanical grep pre-scanning to guarantee zero missed checklist items. 8 of 13 items are grep-gated; 5 are semantic-only.
$TMPDIR/review_snippet.go)Include in Execution Status: Grep pre-scan: X/8 items hit, Z confirmed as findings (5 semantic-only)
All Medium severity unless marked (Low).
| # | Item | Pattern | Grep Pattern |
|---|---|---|---|
| 1 | Function too long | > 50 lines → extract helper (see anti-example for flat switch exception) | Semantic-Only (function length requires counting lines — no grep pattern) |
| 2 | Excessive nesting | > 4 levels → early return pattern ("happy path left-aligned") | Semantic-Only (nesting depth requires counting indent levels) |
| 3 | Naked return | In functions > 5 lines → explicit returns for clarity | return$|return\s*$ (naked return — grep for return with nothing after) |
| 4 | Mutable global variable | Mutable var at package level → const, getter, or functional options | ^var\s+\w (package-level var declarations — grep at file scope) |
| 5 | Interface bloat | Interface > 3 methods or defined at implementation site → small interfaces at consumer site | Semantic-Only (interface bloat requires counting methods) |
| 6 | Type assertion without ok | x.(T) without comma-ok → x, ok := x.(T) — panics on wrong type | \.\(\w (type assertion without comma-ok check) |
| 7 | defer in loop | Defer accumulates until function return → extract to helper function | defer\s+ (compound: inside for loop — semantic confirmation) |
| 8 | init() misuse | init() for non-registration logic → explicit initialization | func init\(\) |
| 9 | Inconsistent receiver type | Mixed pointer/value receivers on same type → consistent choice | Semantic-Only (receiver consistency requires checking all methods on type) |
| 10 | Modern Go alternatives | Outdated patterns when modern alternatives exist (version-gated): log → slog, atomic.AddInt64 → atomic.Int64, sort.Slice → slices.SortFunc | log\.|atomic\.Add|sort\.Slice (outdated patterns when modern alternatives exist) |
| 11 | Generics vs interfaces | Wrong choice — type operations (containers, transforms) → generics; behavior contracts → interfaces | interface\s*\{|interface\{|any\b |
| 12 | Naming / package structure (Low) | Stuttering (user.UserService), package utils/helpers/common, unexported type in exported return | \.User\w*Service|\.User\w*Handler|package\s+utils|package\s+helpers|package\s+common |
| 13 | Missing context.Context on I/O function | Function performing DB / HTTP / cache / Redis I/O but signature lacks ctx context.Context as first parameter — queries cannot be cancelled on client disconnect or upstream timeout. Fix: add ctx context.Context first, then .WithContext(ctx) (GORM), http.NewRequestWithContext(ctx, ...), redis.*Cmd(ctx, ...) etc. | Semantic-Only (absence-of-pattern: requires reading both the signature and the body to identify I/O calls without ctx propagation) |
Medium — Maintainability/readability issue increasing cognitive load or bug risk.
Low — Style preference or minor inconsistency.
path:linefollow-upGo version: X.YGrep pre-scan: X/8 items hit, Z confirmed as findings (5 semantic-only)golangci-lint: PASS | FAIL | Not availablestaticcheck: PASS | FAIL | Covered by golangci-lint | Not availablego vet: PASS | FAIL | Covered by golangci-lint | Not availableExcluded (generated): list or NoneReferences loaded: list1-2 lines. Count by severity + lint status.
### Findings
#### [Medium] Function Exceeds 50 Lines with Deep Nesting
- **ID:** QUAL-001
- **Location:** `internal/service/order.go:45-120`
- **Impact:** 75-line function with 5 nesting levels — high cognitive load, hard to test individual branches
- **Evidence:** `ProcessOrder()` has nested if/for/if/switch/case structure. Unlike a flat switch (anti-example), this has complex branching.
- **Recommendation:** Extract inner switch into `classifyOrderType()` and validation into `validateOrderItems()`
- **Action:** follow-up
#### [Medium] Mutable Package-Level Variable
- **ID:** QUAL-002
- **Location:** `internal/config/defaults.go:8`
- **Impact:** `var DefaultTimeout = 30 * time.Second` — any package can mutate, non-deterministic in tests
- **Evidence:** Written at L8, read from 4 packages. golangci-lint: `gochecknoglobals`
- **Recommendation:** Change to `const` or getter: `func DefaultTimeout() time.Duration { return 30 * time.Second }`
- **Action:** follow-up
### Suppressed Items
#### [Suppressed] Long Function — Table-Driven Switch
- **Reason:** `routeRequest()` at router.go:30 is 60 lines but flat switch on HTTP method, no nesting. Anti-example: "straightforward table-driven switch"
### Execution Status
- Go version: 1.21
- golangci-lint: PASS (2 warnings reported above)
- staticcheck: Covered by golangci-lint config
- go vet: Covered by golangci-lint config
- Excluded (generated): None
- References loaded: go-error-and-quality.md, go-modern-practices.md
### Summary
2 Medium findings (function length, mutable global). Lint clean except reported items.
If no issues found: state No code quality findings identified. Still output Execution Status (lint results always reported).
| Reference | Load When |
|---|---|
references/go-error-and-quality.md | Always (code quality sections) |
references/go-modern-practices.md | Code uses or could benefit from modern Go features |
references/go-review-anti-examples.md | Always |
Frequently asked questions
Review Go code for code quality, style, and modern Go practices including function length, nesting depth, naming, mutable globals, interface design, receiver consistency, modern Go idioms (slog, generics, typed atomics), and static analysis. Trigger when reviewing Go code structure, readability, or maintainability.
The source record exposes this install command: npx skills add https://github.com/johnqtcg/awesome-skills --skill "skills/go-quality-review". Inspect the command and pinned source before running it.
Alternatives
brucesongs/kali-claw
Insecure Design (OWASP A06:2025) focuses on security flaws in system architecture and design phases, rather than code implementation-level bugs.
NintendaDev/unikit-ai
Generate and maintain the project's TECHNICAL documentation from its codebase — scans the project structure, tech stack, and module boundaries, then writes a lean README landing page plus detailed topic pages (architecture, modules, setup, build, APIs), only the docs that are relevant. Use whenever the user wants to create, update, or validate documentation of the CODE or the project itself, e.g. "generate documentation", "create docs", "write the README", "update the project docs", "document th
Jamie-BitFlight/claude_skills
Create high-quality Claude Code agents from scratch or by adapting existing agents as templates. Use when the user wants to create a new agent, modify agent configurations, build specialized subagents, or design agent architectures. Guides through requirements gathering, template selection, and agent file generation following Anthropic best practices (v2.1.63+).
magnus919/agent-skills
Use this skill to reverse-engineer an existing software system, map its architecture, data flow, privacy posture, coupling, quality characteristics, and feature surface, then produce an evidence-grounded clean-room design document, PRD, or migration plan under new constraints. Use for codebase archaeology, implicit contract extraction, architecture health assessment, or decomposition-readiness analysis. Do not use for greenfield architecture design, direct code review, bug hunting, security audi