review-go-tests

Review Go test files against behavior-driven testing guidelines and identify violations and missing coverage.

5|Updated Sep 9, 2017
One-click install
npx skills add https://github.com/hpcsc/dotfiles --skill review-go-tests-hpcsc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: review-go-tests
Source: https://github.com/hpcsc/dotfiles/tree/main/link/common/claude/.claude/skills/review-go-tests
Command: npx skills add https://github.com/hpcsc/dotfiles --skill review-go-tests-hpcsc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Go test suites often accumulate low-value tests that pin implementation details, assert tautologies, or miss critical error paths, making them brittle and unreliable as regression detectors. This Skill audits Go tests against behavior-driven testing principles to flag broken tests and surface valuable missing coverage. ## Core Features & Use Cases - Disqualifier Gate: Detects fundamentally broken tests including tautologies, vacuous passthroughs, constant pins, call-count-only assertions, and trivial getter tests. - Quality Classification: Categorizes violations by Fidelity (won't catch defects), Resilience (breaks on harmless refactors), and Precision (failure won't pinpoint the problem). - Missing Test Identification: Compares production code against existing tests to suggest high-value tests for uncovered error paths, boundary conditions, and untested business rules. - Use Case: Before merging a pull request with new Go tests, run this review to catch tests that mock internal dependencies or copy expected values from production code, and get concrete rewrite suggestions with file:line references. ## Quick Start Ask the AI to review the Go tests in your package, for example: review the tests in internal/handler for adherence to the Go testing guidelines.

Frequently Asked Questions about review-go-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review Go tests for best practices?▼

Run this review on your *_test.go files to check each test against behavior-driven principles. It flags tautologies, vacuous assertions, implementation-detail tests, and improper mocking, then classifies each violation by severity with concrete fix suggestions.

What are common Go testing anti-patterns to avoid?▼

Common anti-patterns include deriving expected values from the code under test (tautology), asserting only require.NoError, verifying mock call counts instead of outcomes, mocking types you don't own, and testing trivial getters. The review detects these automatically.

How do I find missing test coverage in Go code?▼

The review reads the production code alongside your tests and identifies uncovered error paths, boundary conditions, untested business rules, and missing sad paths. Each suggestion includes a skeleton test and explains what regression it would catch.

Should Go tests mock internal dependencies?▼

No. Mocking internal dependencies is a Resilience violation because the test breaks on harmless refactors. Tests should assert on observable outcomes through the public API and only mock at boundaries the code owns, such as external services.

When should I not add more Go tests?▼

Skip tests for trivial code like simple getters, setters, and constructors returning non-nil, as well as framework or language behavior. Also avoid passing new data through an already-tested function, since that tests the framework rather than new behavior.