Go Code Review Skill
Auto-triggers when reviewing Go code to catch common mistakes from https://100go.co/
Review Process
- Read Go file(s) mentioned
- Check against patterns in [[knowledge-base.md]]
- Report issues with:
- Severity (Critical/Major/Minor)
- Location (file:line)
- Mistake # from knowledge base
- Suggested fix
- Code example if applicable
Priority Checks
Critical (must fix):
- Error handling (#48-54): ignored errors, incorrect wrapping/comparison
- Concurrency (#58, 69, 70, 74): data races, mutex misuse, sync type copying
- Resource leaks (#26, 28, 76, 79): unclosed resources, memory leaks
Major (should fix):
- Interface design (#5-7): pollution, wrong side, returning interfaces
- Goroutine lifecycle (#62, 63): no stop mechanism, loop var capture
- Testing (#83, 86): no race flag, sleep in tests
Minor (consider):
- Code organization (#1, 2, 15): shadowing, nesting, missing docs
- Performance (#21, 27, 39): unoptimized init, string concat
Reference Knowledge Base
See [[knowledge-base.md]] for full 100 Go mistakes reference.
Example Output
**Issue**: Error not wrapped with context
**Severity**: Major
**Location**: handler.go:42
**Mistake**: #49 - Ignoring When to Wrap an Error
**Fix**: Use `fmt.Errorf("fetch user: %w", err)` instead of returning raw error
**Pattern**: Always wrap errors for context/traceability
1---2name: go-code-review3description: Auto-review Go code for 100+ common mistakes when analyzing .go files, discussing Go patterns, or reviewing PRs with Go code. Checks error handling, concurrency, interfaces, performance, testing, and stdlib usage.4---5
6# Go Code Review Skill
7
8Auto-triggers when reviewing Go code to catch common mistakes from <https://100go.co/>
9
10## Review Process
11
121. Read Go file(s) mentioned
132. Check against patterns in [[knowledge-base.md]]
143. Report issues with:
15 - Severity (Critical/Major/Minor)
16 - Location (file:line)
17 - Mistake # from knowledge base
18 - Suggested fix
19 - Code example if applicable
20
21## Priority Checks
22
23**Critical (must fix):**
24
25- Error handling (#48-54): ignored errors, incorrect wrapping/comparison
26- Concurrency (#58, 69, 70, 74): data races, mutex misuse, sync type copying
27- Resource leaks (#26, 28, 76, 79): unclosed resources, memory leaks
28
29**Major (should fix):**
30
31- Interface design (#5-7): pollution, wrong side, returning interfaces
32- Goroutine lifecycle (#62, 63): no stop mechanism, loop var capture
33- Testing (#83, 86): no race flag, sleep in tests
34
35**Minor (consider):**
36
37- Code organization (#1, 2, 15): shadowing, nesting, missing docs
38- Performance (#21, 27, 39): unoptimized init, string concat
39
40## Reference Knowledge Base
41
42See [[knowledge-base.md]] for full 100 Go mistakes reference.
43
44## Example Output
45
46```text
47**Issue**: Error not wrapped with context
48**Severity**: Major
49**Location**: handler.go:42
50**Mistake**: #49 - Ignoring When to Wrap an Error
51**Fix**: Use `fmt.Errorf("fetch user: %w", err)` instead of returning raw error
52**Pattern**: Always wrap errors for context/traceability
53```