Skip to content

ericrisco/rsc-harness / skills/testing-go

testing-go

Verified

Use when writing or running Go tests — table-driven cases, named subtests, parallel isolation, fakes instead of mock frameworks, coverage profiles, benchmarks, fuzzing, golden files, and testing concurrent goroutines deterministically. NOT general Go code or modules (that is `go`), NOT pytest fixtures (that is `testing-py`), NOT browser user flows (that is `e2e-testing`).

FileKindSize
SKILL.mdskill md14.5 KB
evals/README.mdmarkdown800 B
evals/cases.yamlconfig3.4 KB
references/coverage-and-benchmarks.mdmarkdown3.8 KB
references/mocks-and-fakes.mdmarkdown4.4 KB
references/synctest-and-concurrency.mdmarkdown4.0 KB
scripts/verify.shexecutablescript1.9 KB

evals/cases.yaml

View on GitHub
skill: testing-go

should_trigger:
  - prompt: "Turn these three near-identical test functions into a table-driven test with subtests."
    why: Core table-driven refactor — the canonical reason this skill exists.
  - prompt: "Benchmark this hashing function and tell me if my change actually made it faster."
    why: Benchmarks + benchstat comparison; non-obvious that this is testing-go and not the general go skill.
  - prompt: "My parallel subtests are flaky and sometimes pick up the wrong test case data."
    why: Loop-variable / parallel-isolation symptom; the fix (Go 1.22 scope, drop tt := tt) is testing-go knowledge, and the phrasing names a symptom, not the tool.
  - prompt: "Necesito testear código con goroutines y timeouts sin que el test tarde 5 segundos."
    why: Spanish; deterministic concurrency/time testing via testing/synctest and a fake clock.
  - prompt: "How do I get cross-package coverage and an HTML report out of go test?"
    why: Coverage profile workflow (-coverpkg, -coverprofile, go tool cover -html).
  - prompt: "Mock the payment client interface so this Go service test doesn't hit the network."
    why: Test doubles for Go — routes here (fake/httptest), not to go; non-obvious because user said "mock".
  - prompt: "Add a fuzz test for my Go URL parser so it doesn't panic on garbage input."
    why: Fuzzing parsers/untrusted input with FuzzXxx — squarely testing-go.

should_not_trigger:
  - prompt: "How should I structure error handling and generics in this Go package?"
    route_to: go
    why: Language design and idioms, not test code.
  - prompt: "Write pytest fixtures and parametrize for my Python API."
    route_to: testing-py
    why: Wrong ecosystem — Python test tooling.
  - prompt: "Add Playwright tests for the checkout flow across multiple pages."
    route_to: e2e-testing
    why: Browser-driven multi-page user journey, past the process boundary.
  - prompt: "Set up Vitest and Testing Library for my React component."
    route_to: testing-web
    why: Frontend/component unit tests, different runtime.
  - prompt: "Review this Go diff for bugs before I merge it."
    route_to: review
    why: General code review of a diff, not authoring test code.

capability:
  - scenario: "Given a Go RateLimiter that uses a time.Ticker and exposes fetch(ctx context.Context) (Resp, error) calling an HTTP backend, write a test suite for it."
    must_include:
      - Table-driven cases with named subtests run via t.Run(tc.name, ...)
      - Uses testing/synctest (or an injected fake clock) for the ticker/timeout path, with no real time.Sleep to synchronize
      - t.Parallel() where safe, and does NOT add a gratuitous tt := tt copy (notes Go 1.22 per-iteration loop scope)
      - A hand-written interface fake or net/http/httptest server for the HTTP dependency, not a mock framework by default
      - Runs with -race for the concurrent path and shows a go test -coverprofile / cross-package coverage command
      - A benchmark using for b.Loop() with b.ReportAllocs() rather than a b.N loop
      - "Does not present the coverage percentage as proof the suite detects bugs: states Go has no mature mutation tool, gives the manual procedure, and distinguishes mutation (tests that would not notice a bug) from fuzzing (inputs the code mishandles)."
      - "Requires a hand-rolled mutant runner to prove it executed each mutant, and says why — a kill reported without running can only inflate the score, so no failing run would ever reveal it."
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall