Install
$ agentstack add skill-johnqtcg-awesome-skills-go-performance-review ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Go Performance Review
Purpose
Identify performance issues and resource inefficiency in Go code. This skill exists because performance findings are almost all Medium severity and get systematically crowded out when mixed with High-severity Security/Concurrency findings.
Important distinction: lock contention is performance (here); race condition is concurrency (go-concurrency-review).
This skill does NOT cover: security, concurrency correctness, code style, test quality, error handling, or business logic — those belong to sibling vertical skills.
When To Use
- Code contains
make([]T, ...)ormake(map[K]V, ...) - Code builds strings in loops
- Code queries DB/Redis inside loops
- Code configures connection pools or HTTP clients
- Code runs on hot paths (per-request, high-frequency)
When NOT To Use
- Security vulnerabilities →
go-security-review - Race conditions, goroutine leaks →
go-concurrency-review - Code style/lint →
go-quality-review - Error handling →
go-error-review
Mandatory Gates
1) Go Version Gate
Read go.mod. Key: strings.Clone (1.20+), slices.Clone (1.21+).
2) Anti-Example Suppression Gate
MUST quote specific evidence. Category match alone insufficient.
Embedded anti-examples:
- "Should pre-allocate slice" — when slice is small ( 0 (seeded reference tables, system lookups). |
\.Count\(&(compound: confirm.Find\(also present in same function AND noif.*total.*==.*0orif total == 0early-exit guard) |
Severity Rubric
Medium — Performance issue impacting latency, throughput, or resource usage under load.
Low — Minor optimization with limited real-world impact.
Evidence Rules
- Quantify when possible: "N+1 executes N round-trips", "slice grows through log2(N) allocations"
- For pre-allocation: state the known upper bound and current allocation
- Hot-path requirement: cite evidence code runs frequently (per-request, in loop, high-QPS handler)
- Do NOT flag cold-path optimizations
- Merge rule: same issue at ≥3 locations → one finding with location list
Output Format
Findings
[Medium|Low] Short Title
- ID: PERF-NNN
- Location:
path:line - Impact: Quantified performance consequence (allocations, syscalls, round-trips)
- Evidence: Current code vs optimal pattern
- Recommendation: Specific fix with code example
- Action:
follow-up(performance issues are rarelymust-fix)
Suppressed Items
[Suppressed] Short Title
- Reason: Anti-example matched + evidence cited (cold-path, small size, etc.)
Execution Status
Go version: X.YGrep pre-scan: X/11 items hit, Z confirmed as findings (2 semantic-only)Excluded (generated): list or NoneReferences loaded: list
Summary
1-2 lines. Count by severity.
Example Output
### Findings
#### [Medium] Slice Pre-allocation Missing in Hot Path
- **ID:** PERF-001
- **Location:** `internal/service/batch.go:42`
- **Impact:** len(userIDs) allocations per request instead of 1 — slice grows via append in loop processing user batch
- **Evidence:** `results := make([]User, 0)` at L42; `results = append(results, user)` in loop at L48; `len(userIDs)` is known at L40
- **Recommendation:** `results := make([]User, 0, len(userIDs))`
- **Action:** follow-up
#### [Medium] N+1 Query in Order Processing
- **ID:** PERF-002
- **Location:** `internal/service/order.go:55-60`
- **Impact:** N database round-trips per batch — one SELECT per order item
- **Evidence:** `for _, item := range items { product, _ := repo.GetProduct(ctx, item.ProductID) }` — N individual queries
- **Recommendation:** Batch: `products, err := repo.GetProductsByIDs(ctx, productIDs)` with `WHERE id IN (?)`
- **Action:** follow-up
### Suppressed Items
#### [Suppressed] Slice Pre-allocation in Config Loading
- **Reason:** `make([]Plugin, 0)` at config.go:12 — cold path (called once at startup, typically <5 plugins). Anti-example: "small slice in cold path"
### Execution Status
- Go version: 1.21
- Excluded (generated): None
- References loaded: go-performance-patterns.md, go-database-patterns.md
### Summary
2 Medium findings (slice pre-allocation, N+1 query). Cold-path items suppressed.
No-Finding Case
If no issues found: state No performance findings identified. Still output Execution Status.
Load References Selectively
| Reference | Load When | |-----------|-----------| | references/go-performance-patterns.md | Always | | references/go-database-patterns.md | Code involves database queries, connection pools | | references/go-review-anti-examples.md | Always |
Review Discipline
- Performance only — not security, concurrency, quality, tests, errors, or logic
- Execute ALL 13 checklist items — this is the most commonly skipped dimension; isolation solves that
- Distinguish hot-path vs cold-path: only flag frequently executed code
- Quantify impact — "costs N allocations per request" is better than "suboptimal"
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: johnqtcg
- Source: johnqtcg/awesome-skills
- License: MIT
- Homepage: https://johnqtcg.github.io/awesome-skills/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.