Review Go code for language and runtime conventions: concurrency, context usage, error handling, resource management, API stability, type semantics, and testability. Language-only atomic skill; output is a findings list.
Review code in Go for language and runtime conventions only. Do not define scope (diff vs codebase) or perform security/architecture analysis; those are handled by scope and cognitive skills. Emit a findings list in the standard format for aggregation. Focus on concurrency and goroutine lifecycle, context usage, error handling, resource management, API stability, type and zero-value semantics, and testability.
Core Objective
Primary goal: Produce a Go language/runtime findings list covering concurrency, context usage, error handling, resource management, API stability, type semantics, and testability for the given code scope.
Success Criteria (ALL must be met):
✅ Go-only scope: Only Go language and runtime conventions are reviewed; no scope selection, security, or architecture analysis performed
✅ All seven Go dimensions covered: Concurrency/goroutine lifecycle, context usage, error handling, resource management, API stability, type/zero-value semantics, and testability are assessed where relevant
✅ Findings format compliant: Each finding includes Location, Category (language-go), Severity, Title, Description, and optional Suggestion
✅ File:line references: All findings reference specific file locations with line numbers
✅ Non-Go code excluded: Non-Go files are not analyzed for Go-specific rules unless explicitly in scope
Acceptance Test: Does the output contain a Go-focused findings list with file:line references covering all relevant language/runtime dimensions without performing security, architecture, or scope analysis?
Scope Boundaries
This skill handles:
Goroutine lifecycle and leak prevention (channel closing, cancellation, WaitGroup)
Context propagation through request paths
Error handling (wrapping with %w, errors.Is/As, avoiding panic for expected errors)
API stability and Go modules (exported types, backward compatibility, go.mod)
Type and zero-value semantics (nil interface vs typed nil, pointer/value receiver, slice/map initialization)
Testability (small interfaces, injection over globals, deterministic test seams)
This skill does NOT handle:
Scope selection — scope is provided by the caller
Security analysis — use review-security
Architecture analysis — use review-architecture
SQL-specific analysis — use review-sql
Full orchestrated review — use orchestrate-code-review
Handoff point: When all Go findings are emitted, hand off to orchestrate-code-review for aggregation. For SQL or security issues, note them and suggest the appropriate cognitive skill.
Use Cases
Orchestrated review: Used as the language step when orchestrate-code-review runs scope -> language -> framework -> library -> cognitive for Go projects.
Go-only review: When the user wants only language/runtime conventions checked (e.g. after adding a new Go file).
Pre-PR Go checklist: Ensure concurrency, context, and error handling patterns are correct.
When to use: When the code under review is Go and the task includes language/runtime quality. Scope (diff vs paths) is determined by the caller or user.
Behavior
Scope of this skill
Analyze: Go language and runtime conventions in the given code scope (files or diff provided by the caller). Do not decide scope; accept the code range as input.
Do not: Perform scope selection (diff vs codebase), security review, or architecture review; do not review non-Go files for Go-specific rules unless explicitly in scope.
Review checklist (Go dimension only)
Concurrency and goroutine lifecycle: Proper use of goroutines, channels, sync primitives, WaitGroup usage, channel closing, select patterns, and avoidance of goroutine leaks or data races.
Context usage: Context passed through request paths, cancellation and deadlines respected, avoid context.Background() in request handlers, and no storing context in long-lived structs.
Error handling: Errors checked and returned; wrapping with %w; use of errors.Is/As; avoid panic for expected errors; avoid error shadowing.
Resource management: defer Close() for io.Closer, resp.Body.Close() on HTTP responses, Stop() for Timer/Ticker, and cancel() for contexts.
API stability and modules: Stability of exported APIs, changes to exported types and interfaces, backward compatibility, and Go version/module expectations (go.mod, build tags).
Type and zero-value semantics: Nil interface vs typed nil pitfalls, pointer vs value receivers, map/slice initialization, copying and aliasing of slices, and zero-value correctness.
Testability and interfaces: Prefer small interfaces, injection over globals, and seams for deterministic tests.
Tone and references
Professional and technical: Reference specific locations (file:line). Emit findings with Location, Category, Severity, Title, Description, Suggestion.
Input & Output
Input
Code scope: Files or directories (or diff) already selected by the user or by the scope skill. This skill does not decide scope; it reviews the provided Go code for language conventions only.
Output
Emit zero or more findings in the format defined in specs/findings-list.md, with Categorylanguage-go.
Category for this skill is language-go.
Restrictions
Hard Boundaries
Do not perform security, architecture, or scope selection. Stay within Go language and runtime conventions.
Do not give conclusions without specific locations or actionable suggestions.
Do not review non-Go code for Go-specific rules unless the user explicitly includes it (e.g. embedded code snippets).
Skill Boundaries
Do NOT do these (other skills handle them):
Do NOT select or define the code scope — scope is determined by the caller or orchestrate-code-review
Do NOT perform security analysis — use review-security
Do NOT perform architecture analysis — use review-architecture
Do NOT perform comprehensive SQL analysis — use review-sql
When to stop and hand off:
When all Go findings are emitted, hand off to orchestrate-code-review for aggregation
When the user needs a full review (scope + language + cognitive), redirect to orchestrate-code-review
When SQL or security issues are found, note them and suggest appropriate cognitive skills
Self-Check
Core Success Criteria
Go-only scope: Only Go language and runtime conventions are reviewed; no scope selection, security, or architecture analysis performed
All seven Go dimensions covered: Concurrency/goroutine lifecycle, context usage, error handling, resource management, API stability, type/zero-value semantics, and testability are assessed where relevant
Findings format compliant: Each finding includes Location, Category (language-go), Severity, Title, Description, and optional Suggestion
File:line references: All findings reference specific file locations with line numbers
Non-Go code excluded: Non-Go files are not analyzed for Go-specific rules unless explicitly in scope
Process Quality Checks
Was only the Go language/runtime dimension reviewed (no scope/security/architecture)?
Are concurrency, context usage, error handling, resource management, API stability, type semantics, and testability covered where relevant?
Is each finding emitted with Location, Category=language-go, Severity, Title, Description, and optional Suggestion?
Are issues referenced with file:line?
Acceptance Test
Does the output contain a Go-focused findings list with file:line references covering all relevant language/runtime dimensions without performing security, architecture, or scope analysis?
Examples
Example 1: Goroutine leak
Input: Goroutine started in a request handler that waits on a channel that is never closed or canceled.
Expected: Emit a finding for goroutine leak and missing cancellation; reference the handler and channel usage. Category = language-go.
Example 2: Error handling
Input: Function returns fmt.Errorf("failed: %v", err) and the caller compares errors with ==.
Expected: Emit a finding to wrap with %w and use errors.Is/As; reference the error construction and comparison. Category = language-go.
Example 3: Nil interface pitfall
Input: Function returns (*MyStruct)(nil) as an error interface; caller checks if err != nil.
Expected: Emit a finding that a typed nil assigned to an interface is not nil; suggest returning an explicit nil instead. Category = language-go.
Edge case: Mixed Go and SQL
Input: Go file with embedded SQL strings for database queries.
Expected: Review only Go conventions (context usage, error handling, resource cleanup). Do not emit SQL-injection findings; that is for review-security or review-sql.
1---2name: review-go3description: Review Go code for language and runtime conventions: concurrency, context usage, error handling, resource management, API stability, type semantics, and testability. Language-only atomic skill; output is a findings list.4license: MIT5---67# Skill: Review Go89## Purpose1011Review code in **Go** for **language and runtime conventions** only. Do not define scope (diff vs codebase) or perform security/architecture analysis; those are handled by scope and cognitive skills. Emit a **findings list** in the standard format for aggregation. Focus on concurrency and goroutine lifecycle, context usage, error handling, resource management, API stability, type and zero-value semantics, and testability.1213---1415## Core Objective1617**Primary goal**: Produce a Go language/runtime findings list covering concurrency, context usage, error handling, resource management, API stability, type semantics, and testability for the given code scope.1819**Success Criteria** (ALL must be met):20211. ✅ **Go-only scope**: Only Go language and runtime conventions are reviewed; no scope selection, security, or architecture analysis performed222. ✅ **All seven Go dimensions covered**: Concurrency/goroutine lifecycle, context usage, error handling, resource management, API stability, type/zero-value semantics, and testability are assessed where relevant233. ✅ **Findings format compliant**: Each finding includes Location, Category (`language-go`), Severity, Title, Description, and optional Suggestion244. ✅ **File:line references**: All findings reference specific file locations with line numbers255. ✅ **Non-Go code excluded**: Non-Go files are not analyzed for Go-specific rules unless explicitly in scope2627**Acceptance Test**: Does the output contain a Go-focused findings list with file:line references covering all relevant language/runtime dimensions without performing security, architecture, or scope analysis?2829---3031## Scope Boundaries3233**This skill handles**:3435- Goroutine lifecycle and leak prevention (channel closing, cancellation, WaitGroup)36- Context propagation through request paths37- Error handling (wrapping with `%w`, `errors.Is/As`, avoiding panic for expected errors)38- Resource management (defer Close(), resp.Body.Close(), context cancel())39- API stability and Go modules (exported types, backward compatibility, go.mod)40- Type and zero-value semantics (nil interface vs typed nil, pointer/value receiver, slice/map initialization)41- Testability (small interfaces, injection over globals, deterministic test seams)4243**This skill does NOT handle**:4445- Scope selection — scope is provided by the caller46- Security analysis — use `review-security`47- Architecture analysis — use `review-architecture`48- SQL-specific analysis — use `review-sql`49- Full orchestrated review — use `orchestrate-code-review`5051**Handoff point**: When all Go findings are emitted, hand off to `orchestrate-code-review` for aggregation. For SQL or security issues, note them and suggest the appropriate cognitive skill.5253---5455## Use Cases5657- **Orchestrated review**: Used as the language step when [orchestrate-code-review](../orchestrate-code-review/SKILL.md) runs scope -> language -> framework -> library -> cognitive for Go projects.58- **Go-only review**: When the user wants only language/runtime conventions checked (e.g. after adding a new Go file).59- **Pre-PR Go checklist**: Ensure concurrency, context, and error handling patterns are correct.6061**When to use**: When the code under review is Go and the task includes language/runtime quality. Scope (diff vs paths) is determined by the caller or user.6263---6465## Behavior6667### Scope of this skill6869- **Analyze**: Go language and runtime conventions in the **given code scope** (files or diff provided by the caller). Do not decide scope; accept the code range as input.70- **Do not**: Perform scope selection (diff vs codebase), security review, or architecture review; do not review non-Go files for Go-specific rules unless explicitly in scope.7172### Review checklist (Go dimension only)73741. **Concurrency and goroutine lifecycle**: Proper use of goroutines, channels, sync primitives, WaitGroup usage, channel closing, select patterns, and avoidance of goroutine leaks or data races.752. **Context usage**: Context passed through request paths, cancellation and deadlines respected, avoid context.Background() in request handlers, and no storing context in long-lived structs.763. **Error handling**: Errors checked and returned; wrapping with `%w`; use of `errors.Is/As`; avoid panic for expected errors; avoid error shadowing.774. **Resource management**: `defer Close()` for io.Closer, `resp.Body.Close()` on HTTP responses, `Stop()` for Timer/Ticker, and `cancel()` for contexts.785. **API stability and modules**: Stability of exported APIs, changes to exported types and interfaces, backward compatibility, and Go version/module expectations (go.mod, build tags).796. **Type and zero-value semantics**: Nil interface vs typed nil pitfalls, pointer vs value receivers, map/slice initialization, copying and aliasing of slices, and zero-value correctness.807. **Testability and interfaces**: Prefer small interfaces, injection over globals, and seams for deterministic tests.8182### Tone and references8384- **Professional and technical**: Reference specific locations (file:line). Emit findings with Location, Category, Severity, Title, Description, Suggestion.8586---8788## Input & Output8990### Input9192- **Code scope**: Files or directories (or diff) already selected by the user or by the scope skill. This skill does not decide scope; it reviews the provided Go code for language conventions only.9394### Output9596- Emit zero or more **findings** in the format defined in [specs/findings-list.md](../../specs/findings-list.md), with **Category** `language-go`.97- Category for this skill is **language-go**.9899---100101## Restrictions102103### Hard Boundaries104105- **Do not** perform security, architecture, or scope selection. Stay within Go language and runtime conventions.106- **Do not** give conclusions without specific locations or actionable suggestions.107- **Do not** review non-Go code for Go-specific rules unless the user explicitly includes it (e.g. embedded code snippets).108109### Skill Boundaries110111**Do NOT do these** (other skills handle them):112113- Do NOT select or define the code scope — scope is determined by the caller or `orchestrate-code-review`114- Do NOT perform security analysis — use `review-security`115- Do NOT perform architecture analysis — use `review-architecture`116- Do NOT perform comprehensive SQL analysis — use `review-sql`117118**When to stop and hand off**:119120- When all Go findings are emitted, hand off to `orchestrate-code-review` for aggregation121- When the user needs a full review (scope + language + cognitive), redirect to `orchestrate-code-review`122- When SQL or security issues are found, note them and suggest appropriate cognitive skills123124---125126## Self-Check127128### Core Success Criteria129130- [ ] **Go-only scope**: Only Go language and runtime conventions are reviewed; no scope selection, security, or architecture analysis performed131- [ ] **All seven Go dimensions covered**: Concurrency/goroutine lifecycle, context usage, error handling, resource management, API stability, type/zero-value semantics, and testability are assessed where relevant132- [ ] **Findings format compliant**: Each finding includes Location, Category (`language-go`), Severity, Title, Description, and optional Suggestion133- [ ] **File:line references**: All findings reference specific file locations with line numbers134- [ ] **Non-Go code excluded**: Non-Go files are not analyzed for Go-specific rules unless explicitly in scope135136### Process Quality Checks137138- [ ] Was only the Go language/runtime dimension reviewed (no scope/security/architecture)?139- [ ] Are concurrency, context usage, error handling, resource management, API stability, type semantics, and testability covered where relevant?140- [ ] Is each finding emitted with Location, Category=language-go, Severity, Title, Description, and optional Suggestion?141- [ ] Are issues referenced with file:line?142143### Acceptance Test144145Does the output contain a Go-focused findings list with file:line references covering all relevant language/runtime dimensions without performing security, architecture, or scope analysis?146147---148149## Examples150151### Example 1: Goroutine leak152153- **Input**: Goroutine started in a request handler that waits on a channel that is never closed or canceled.154- **Expected**: Emit a finding for goroutine leak and missing cancellation; reference the handler and channel usage. Category = language-go.155156### Example 2: Error handling157158- **Input**: Function returns `fmt.Errorf("failed: %v", err)` and the caller compares errors with `==`.159- **Expected**: Emit a finding to wrap with `%w` and use `errors.Is/As`; reference the error construction and comparison. Category = language-go.160161### Example 3: Nil interface pitfall162163- **Input**: Function returns `(*MyStruct)(nil)` as an `error` interface; caller checks `if err != nil`.164- **Expected**: Emit a finding that a typed nil assigned to an interface is not nil; suggest returning an explicit `nil` instead. Category = language-go.165166### Edge case: Mixed Go and SQL167168- **Input**: Go file with embedded SQL strings for database queries.169- **Expected**: Review only Go conventions (context usage, error handling, resource cleanup). Do not emit SQL-injection findings; that is for review-security or review-sql.
Run npx skillmds@latest add nesnilnehc/review-go in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Review Go code for language and runtime conventions: concurrency, context usage, error handling, resource management, API stability, type semantics, and testability. Language-only atomic skill; output is a findings list. It is listed under Integrations & APIs on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under MIT.
nesnilnehc (@nesnilnehc) published this skill. Their other Agent Skills are listed on their SkillMD profile.