Best for
- PR contains test.go files
- Code uses httptest, testing.B, testing.F
- Code includes testdata/ directory changes
johnqtcg/awesome-skills/skills/go-test-review/SKILL.md
Review Go test code for quality including table-driven tests, t.Helper usage, assertion completeness, boundary cases, benchmarks, fuzz tests, and coverage targets. Trigger when PR contains _test.go files, test helpers, httptest usage, testing.B, testing.F, or testdata directories. Use for test-quality focused review.
Decision brief
Review Go test code for quality including table-driven tests, t. Helper usage, assertion completeness, boundary cases, benchmarks, fuzz tests, and coverage targets.
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-test-review"Inspect the Agent Skill "go-test-review" from https://github.com/johnqtcg/awesome-skills/blob/d933bc88237f7a18a7ecf01e5d97a745b083df0f/skills/go-test-review/SKILL.md at commit d933bc88237f7a18a7ecf01e5d97a745b083df0f. 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 — identify test.go files in diff. 2. Run go test -cover for impacted packages — record coverage percentage. 3. Load references — always load go-test-quality.md. 4. Evaluate ALL 10 checklist items. 5. Apply suppression → format output.
Test quality only — not production code security/performance/logic
Audit Go test code for quality and coverage effectiveness. Reviews HOW tests are written — not the production code being tested.
PR contains test.go files
Reviewing production code security/performance/logic → use corresponding sibling skill
Permission review
The documentation asks the agent to create, modify, or delete local files.
| 9 | **Golden file testing** | `-update` flag support, `testdata/` directory, deterministic output (no timestamps/random) | Semantic-Only (golden file testing pattern requires understanding test intent) |Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 92/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 test code for quality and coverage effectiveness. Reviews HOW tests are written — not the production code being tested.
This skill is conditionally triggered — only when _test.go files are in the diff. If a PR has only implementation code with no tests, this skill may suggest "missing test coverage" but does not deep-dive.
This skill does NOT cover: security, concurrency, performance, quality, error handling, or logic of production code — those belong to sibling vertical skills.
_test.go fileshttptest, testing.B, testing.Ftestdata/ directory changesRead go.mod. Key version gates:
| Feature | Minimum Go | Caveat |
|---|---|---|
t.Setenv | 1.17 | Cannot combine with t.Parallel() — panics on every Go version (process-wide env) |
Fuzz testing (testing.F) | 1.18 | |
| Loop variable fix | 1.22 | Affects t.Parallel() + loop variable capture |
t.Chdir | 1.24 | Added 1.24; like t.Setenv, panics if combined with t.Parallel() |
MUST quote specific evidence. Category match alone insufficient.
Embedded anti-examples:
json.Marshal produces valid JSON, or that strings.Contains works. These test Go's stdlib, not your code.Close(), Flush()).mock_*.go from mockgen: review for usage patterns only, not mock implementation itself.
_test.go files in diff.go test -cover for impacted packages — record coverage percentage.go-test-quality.md.This skill uses mechanical grep pre-scanning to guarantee zero missed checklist items. 8 of 10 items are grep-gated; 2 are semantic-only.
Include in Execution Status: Grep pre-scan: X/8 items hit, Z confirmed as findings (2 semantic-only)
| # | Item | What to Check | Grep Pattern |
|---|---|---|---|
| 1 | Table-driven tests | Table-driven pattern with meaningful subtest names: t.Run(tc.name, ...) | func Test|t\.Run (compound: check if table-driven pattern used) |
| 2 | t.Helper() | Test helper functions call t.Helper() for accurate failure line reporting | func\s+\w+.*\*testing\.T\b (compound: AND NOT t\.Helper\(\) in function body) |
| 3 | Assertion completeness | Not just err == nil — verify return values, error types, side effects, field values | assert\.|require\.|if.*!=|if.*== |
| 4 | Boundary case coverage | nil/zero, empty collection, single element, boundary values, Unicode, concurrent access | Semantic-Only (boundary case coverage requires understanding domain context) |
| 5 | Minimal mocks/stubs | Minimal interface mocks; prefer hand-written doubles; mock at boundary, not internal | mock\.|Mock|Stub|fake|Fake |
| 6 | Benchmark correctness | b.ResetTimer() after setup, b.ReportAllocs(), b.RunParallel() for concurrent benchmarks | testing\.B|b\.Run|b\.ResetTimer|b\.ReportAllocs |
| 7 | Fuzz testing | Seed corpus provided, invariant-based assertions (not exact match), no external deps in target | testing\.F|f\.Fuzz|f\.Add |
| 8 | HTTP handler testing | httptest.NewRecorder (unit) or httptest.NewServer (integration); check status + body + headers | httptest\.|NewRecorder|NewServer |
| 9 | Golden file testing | -update flag support, testdata/ directory, deterministic output (no timestamps/random) | Semantic-Only (golden file testing pattern requires understanding test intent) |
| 10 | Coverage >= 80% | Business logic packages must hit 80%+; not required for generated code, wire/DI glue, or main.go | go test.*-cover|coverage (or check test existence for changed packages) |
High — Missing critical coverage (changed behavior untested), assertion that can never fail (false confidence).
Medium — Test quality issue reducing diagnostic value but not creating false confidence.
path:linemust-fix | follow-upGo version: X.YGrep pre-scan: X/8 items hit, Z confirmed as findings (2 semantic-only)go test -cover: coverage% for impacted packagesReferences loaded: list1-2 lines. Count by severity + coverage status.
### Findings
#### [High] False-Confidence Assertion — Only Checks err == nil
- **ID:** TEST-001
- **Location:** `internal/service/user_test.go:45`
- **Impact:** Test passes even if CreateUser returns wrong user — only error checked, return value ignored
- **Evidence:** `err := svc.CreateUser(ctx, input); assert.NoError(t, err)` — no assertion on returned User (name, email, ID)
- **Recommendation:**
```go
user, err := svc.CreateUser(ctx, input)
assert.NoError(t, err)
assert.Equal(t, input.Name, user.Name)
assert.Equal(t, input.Email, user.Email)
assert.NotEmpty(t, user.ID)
internal/validator/email_test.go:20-55{"unicode: ü@domain.com", true}, {"max-length-254", ...}, {" [email protected]", false}1 High (false-confidence assertion), 1 Medium (missing boundary cases). Coverage: service 72% (below 80% threshold).
## No-Finding Case
If no issues found: state `No test quality findings identified.` Still output coverage numbers in Execution Status.
## Load References Selectively
| Reference | Load When |
|-----------|-----------|
| `references/go-test-quality.md` | Always |
| `references/go-review-anti-examples.md` | Always |
## Review Discipline
- **Test quality only** — not production code security/performance/logic
- Execute ALL 10 checklist items
- Coverage threshold: 80% for business logic packages — flag if below
- Do not review mock implementation code (generated mocks); review mock usage patterns
Frequently asked questions
Review Go test code for quality including table-driven tests, t. Helper usage, assertion completeness, boundary cases, benchmarks, fuzz tests, and coverage targets.
The source record exposes this install command: npx skills add https://github.com/johnqtcg/awesome-skills --skill "skills/go-test-review". Inspect the command and pinned source before running it.
Static rules flagged write-files in the source; the page lists the matching lines and excerpts.
Alternatives
garrytan/gbrain
End-to-end discipline for turning any large data source (audio libraries, email takeouts, document corpora, chat exports, API dumps) into brain pages at scale. The lifecycle spine: SCHEMA → ACCESS → TRIAL → EVALUATE → IMPROVE → CODIFY → TEST → SKILLIFY → BULK → MONITOR. State is tracked in a durable JSON manifest (see MANIFEST-PATTERN.md) so any crash, session boundary, or subagent fan-out resumes from ground truth instead of memory.
alirezarezvani/claude-skills
App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist
dotnet/skills
Migrates .NET test projects from VSTest to Microsoft.Testing.Platform (MTP). Use when user asks to "migrate to MTP", "switch from VSTest", "enable Microsoft.Testing.Platform", "use MTP runner", set OutputType=Exe only for test projects in Directory.Build.props, or mentions EnableMSTestRunner, EnableNUnitRunner, or UseMicrosoftTestingPlatformRunner. USE FOR: MTP behavioral differences vs VSTest (exit code 8, zero tests discovered, --ignore-exit-code, TESTINGPLATFORM_EXITCODE_IGNORE); centralizing
vipshop/cache-dit
High-level guide for integrating a new DiT model into cache-dit: Cache (BlockAdapter/ForwardPattern), Context Parallelism, Tensor Parallelism, Text Encoder Parallelism (TE-P), VAE Parallelism (VAE-P), generate CLI, installation, testing workflow, and detailed references. Use when adding support for a new diffusion transformer model in cache-dit.