agentleFS
abevzabevz/devops-skills/skills/go-testing-review/SKILL.md

go-testing-review

Skill0 starsChanged 41 days agoMITView on GitHub

Use when reviewing or improving Go tests for coverage, quality, or reliability. Mention "review these go tests", "improve test coverage", "go test review" as triggers.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 11 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read production behavior and test assertions.

    line 18
  2. Distinctive:

    Do not reward coverage numbers when assertions miss the failure mode.

    line 22
  3. Distinctive:

    Follow the Workflow, Safety rules, and Quality checklist below.

    line 26
  4. Distinctive:

    Use when reviewing existing Go tests, or deciding what tests to add, for a package or change.

    line 36
  5. Distinctive:

    Check table-driven tests are used where multiple similar cases exist, instead of repeated near-identical test functions.

    line 45
  6. Distinctive:

    Check edge cases: empty input, nil, zero values, max/min boundaries, duplicate entries — are these covered, or only the happy path?

    line 47
  7. Distinctive:

    Check error paths: does every function that returns an error have a test that triggers that error and asserts on it (not just the success …

    line 49
  8. Very specific:

    Check concurrency cases: if the code under test uses goroutines/channels, are there tests that exercise concurrent access, and is go test …

    line 51
  9. Distinctive:

    Check mocks/fakes: are they narrow interfaces matching real usage, or brittle mocks that assert on implementation details rather than …

    line 53
  10. Distinctive:

    Check determinism: no reliance on real time, real network, unseeded randomness, or test execution order — flag anything that could flake in …

    line 55
  11. Very specific:

    Check test readability: descriptive test/subtest names (t.Run("empty input returns ErrInvalid", ...)), clear arrange/act/assert structure, …

    line 57
  12. Very specific:

    Run the tests (go test ./...

    line 59
  13. Distinctive:

    Do not claim a test "covers" a case unless the assertion would actually fail if that behavior broke — flag tests that run code but assert …

    line 66
  14. Distinctive:

    Do not recommend chasing 100% coverage over testing behavior that actually matters.

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Go Testing Review

TL;DR checklist

  • Check behavior coverage across success, error, boundary, and concurrency cases.
  • Look for deterministic tests and narrow fakes.
  • Identify missing tests that would catch a real regression.

Key read-only checks

  • Read production behavior and test assertions; inspect race-test output when supplied.

Common pitfalls

  • Do not reward coverage numbers when assertions miss the failure mode.

Agent procedure

Follow the Workflow, Safety rules, and Quality checklist below.

Quick references

  • Workflow below.

Last verified: unverified

When to use

Use when reviewing existing Go tests, or deciding what tests to add, for a package or change.

Goal

Find real gaps in test quality and coverage — missing edge cases, non-deterministic tests, weak assertions — not just raw coverage percentage.

Workflow

  1. Check table-driven tests are used where multiple similar cases exist, instead of repeated near-identical test functions.
  2. Check edge cases: empty input, nil, zero values, max/min boundaries, duplicate entries — are these covered, or only the happy path?
  3. Check error paths: does every function that returns an error have a test that triggers that error and asserts on it (not just the success case)?
  4. Check concurrency cases: if the code under test uses goroutines/channels, are there tests that exercise concurrent access, and is go test -race clean?
  5. Check mocks/fakes: are they narrow interfaces matching real usage, or brittle mocks that assert on implementation details rather than behavior?
  6. Check determinism: no reliance on real time, real network, unseeded randomness, or test execution order — flag anything that could flake in CI.
  7. Check test readability: descriptive test/subtest names (t.Run("empty input returns ErrInvalid", ...)), clear arrange/act/assert structure, no unexplained magic values.
  8. Run the tests (go test ./... -race) if possible, and report actual results, not assumed ones.

Safety rules

  • This is a review skill: do not delete or drastically rewrite existing tests without asking, even if they look redundant — confirm intent first.
  • Do not claim a test "covers" a case unless the assertion would actually fail if that behavior broke — flag tests that run code but assert nothing meaningful.
  • Do not recommend chasing 100% coverage over testing behavior that actually matters.

Output format

## Missing coverage (edge cases / error paths not tested)
## Flaky / non-deterministic risks
## Weak assertions (tests that wouldn't catch a real regression)
## Readability issues
## Suggested new tests
<table-driven skeletons where applicable>
## Test run result

Quality checklist

  • Error paths were checked, not just success paths
  • Concurrency-related code was checked with -race if applicable
  • Assertions were checked for whether they'd actually catch a regression
  • No existing test was deleted/rewritten without confirming intent
  • Actual test run output is reported when tests were run

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.