go-code-review
Über
Diese Fähigkeit bietet eine strukturierte Checkliste zur Überprüfung von Go-Code, mit Fokus auf idiomatische Muster, Fehlerbehandlung und Testabdeckung. Sie arbeitet in Modi zur Überprüfung von Diffs (wie PRs) oder vollständigen Dateien/Paketen. Nutzen Sie sie für allgemeine Code-Qualitätsprüfungen, nicht für spezifische Sicherheits- oder Leistungsaudits.
Schnellinstallation
Claude Code
Empfohlennpx skills add eduardo-sl/go-agent-skills -a claude-code/plugin add https://github.com/eduardo-sl/go-agent-skillsgit clone https://github.com/eduardo-sl/go-agent-skills.git ~/.claude/skills/go-code-reviewKopieren Sie diesen Befehl und fügen Sie ihn in Claude Code ein, um diese Fähigkeit zu installieren
Dokumentation
Go Code Review
Structured code review process for Go. Reviews should be constructive, specific, and cite the relevant principle behind each finding.
Operating Modes
Pick the mode that matches the request before starting:
- Diff review (default) — review only the changed lines plus enough surrounding context to judge them. Use for PRs and working-tree changes.
- File/package review — review the named files or packages in full, including their tests.
- Full audit — sweep the entire codebase. Use the strategy in "Auditing Large Codebases" below and aggregate everything into one report.
Review Process
Execute these steps in order. For each finding, classify severity:
- 🔴 BLOCKER — Must fix before merge. Correctness, data loss, security.
- 🟡 WARNING — Should fix. Maintainability, idiomatic Go, clarity.
- 🟢 SUGGESTION — Consider improving. Style, naming, documentation.
0. Run the Toolchain First
Before reading code manually, let the tools catch the mechanical issues (skip any tool that is not installed and note it in the report):
go build ./... # it must compile
go vet ./... # suspicious constructs
golangci-lint run # if the repo has a config
go test -race ./... # tests pass, no data races
Report tool findings alongside manual findings — a failing go vet is
an automatic 🔴 BLOCKER. Never report an issue a tool already proves
absent.
1. Correctness & Safety
Error Handling
- Every error is checked. No blank identifier
_discarding errors silently. - Errors are wrapped with context:
fmt.Errorf("fetch user %d: %w", id, err). - Error values compared with
errors.Is()/errors.As(), never==. - No
panicoutside ofinit()or truly unrecoverable situations. - Errors handled exactly once — no log-and-return patterns.
Nil Safety
- Pointer receivers checked before dereference when nil is a valid state.
- Map reads guarded or use comma-ok idiom.
- Channel operations consider closed/nil channels.
- Slice operations check bounds where relevant.
Concurrency
- Shared mutable state protected by
sync.Mutexor channels. - No goroutine leaks — every goroutine has a clear termination path.
- Context propagation: all blocking calls accept and respect
context.Context. sync.WaitGrouporerrgroup.Groupused for goroutine lifecycle.
2. API Design
- Exported functions have doc comments starting with the function name.
- Accept interfaces, return concrete types.
- Use functional options (
WithTimeout(d)) over config structs for optional params. - Context is always the first parameter:
func Foo(ctx context.Context, ...). - Return
erroras the last return value. - Avoid
boolparameters — prefer named types or options.
3. Idiomatic Go
- Uses
:=for local variables,varfor zero-value intent. - No unnecessary
elseafter return/continue/break. - Guard clauses and early returns reduce nesting.
deferused for cleanup, placed right after resource acquisition.rangeused over manual index iteration where appropriate.- Struct literals use field names.
- Interfaces defined at consumer, not producer.
4. Package Structure
- Package names are short, lowercase, singular nouns.
- No circular dependencies between packages.
internal/used for non-public packages.cmd/contains main packages, one per binary.- Clear separation of concerns — no god packages.
5. Testing
- Test functions follow
TestXxxnaming convention. - Table-driven tests used for multiple input/output combinations.
- Test helpers use
t.Helper()for clean stack traces. - No test logic in
init()— useTestMainwhen needed. - Tests use
testify/assertortestify/requireconsistently, or stdlib only. - Edge cases covered: empty input, nil, zero values, max values.
t.Parallel()used where safe.
6. Documentation
- All exported types, functions, and constants have doc comments.
- Doc comments start with the name of the entity.
- Package-level doc comment in
doc.gofor non-trivial packages. - Complex algorithms or business logic have inline comments explaining why.
7. Dependencies
go.modhas no replace directives in committed code (except monorepos).- No unused dependencies.
- Dependencies are from well-maintained, reputable sources.
- Indirect dependencies are understood and acceptable.
Auditing Large Codebases
When the scope exceeds ~20 files, do not read everything in one linear pass. Split the audit into independent passes:
- Enumerate packages (
go list ./...) and group them by layer (handlers, services, stores, shared libraries). - Run one focused pass per concern from sections 1-7 (correctness, API design, idioms, structure, testing, docs, dependencies).
- If your environment supports delegating work to parallel sub-agents or tasks, assign each pass to one — they are independent by design. Otherwise run them sequentially, one concern at a time.
- Require every finding to cite
file.go:lineand severity so the final aggregation is mechanical: merge, deduplicate, sort by severity.
Review Output Format
## Code Review Summary
**Files reviewed:** <list>
**Overall assessment:** APPROVE | REQUEST CHANGES | COMMENT
### Findings
#### 🔴 BLOCKER: <title>
- **File:** `path/to/file.go:42`
- **Issue:** <what is wrong>
- **Why:** <which principle or guideline>
- **Fix:** <concrete suggestion>
#### 🟡 WARNING: <title>
...
#### 🟢 SUGGESTION: <title>
...
### What's Done Well
<genuine positive observations — always include at least one>
GitHub Repository
Häufig gestellte Fragen
Was ist der Skill go-code-review?
go-code-review ist ein Claude Skill von eduardo-sl. Skills bündeln Anweisungen und Ressourcen, die Claude bei Bedarf lädt, um Aufgaben rund um go-code-review ohne zusätzliche Eingaben auszuführen.
Wie installiere ich go-code-review?
Verwende die Installationsbefehle auf dieser Seite: Füge go-code-review als Plugin zu Claude Code hinzu oder klone das Repository in dein Skills-Verzeichnis. Starte Claude danach neu, damit der Skill geladen wird.
Zu welcher Kategorie gehört go-code-review?
go-code-review gehört zur Kategorie Testen.
Kann ich go-code-review kostenlos nutzen?
Ja. go-code-review ist auf AIMCP gelistet und kann kostenlos installiert werden.
Verwandte Skills
Diese Claude Skill führt den lm-evaluation-harness aus, um LLMs über 60+ standardisierte akademische Aufgaben wie MMLU und GSM8K zu benchmarken. Sie wurde für Entwickler entwickelt, um Modellqualität zu vergleichen, Trainingsfortschritt zu verfolgen oder akademische Ergebnisse zu berichten. Das Tool unterstützt verschiedene Backends, einschließlich HuggingFace- und vLLM-Modelle.
Diese Fähigkeit bietet umfassendes Wissen zur Implementierung von Cloudflare Cron Triggers, um Workers mithilfe von Cron-Ausdrücken zu planen. Sie behandelt das Einrichten periodischer Aufgaben, Wartungsjobs und automatisierter Workflows, während häufige Probleme wie ungültige Cron-Ausdrücke und Zeitzonenprobleme behandelt werden. Entwickler können sie zum Konfigurieren geplanter Handler, zum Testen von Cron-Triggers und zur Integration mit Workflows und Green Compute verwenden.
Diese Claude Skill bietet ein Playwright-basiertes Toolkit zum Testen lokaler Webanwendungen durch Python-Skripte. Es ermöglicht Frontend-Verifizierung, UI-Debugging, Screenshot-Aufnahme und Log-Einblick bei gleichzeitiger Verwaltung von Server-Lebenszyklen. Nutzen Sie es für Browser-Automatisierungsaufgaben, führen Sie Skripte jedoch direkt aus, anstatt deren Quellcode zu lesen, um Kontextverschmutzung zu vermeiden.
Diese Fähigkeit unterstützt Entwickler dabei, abgeschlossene Arbeiten zu finalisieren, indem sie testet, ob Tests bestehen, und dann strukturierte Integrationsoptionen präsentiert. Sie leitet den Workflow für das Zusammenführen von Code, das Erstellen von PRs oder das Bereinigen von Branches nach Abschluss der Implementierung. Nutzen Sie sie, wenn Ihr Code bereit und getestet ist, um den Entwicklungsprozess systematisch abzuschließen.
