pbf: Skill for Claude Code

.claude/skills/go-testing/SKILL.md

go-testing is a skill for Claude Code from maguro/pbf. It costs 51 tokens per session (576 once invoked), scanned A, original, Apache-2.0.

A guide for choosing and structuring tests in Go, including the standard testing package, Ginkgo, Gomega, and Testify. It matches the test tools to simple cases or more involved behaviour and concurrency.

In plain words
What is it for?
Use it when writing, changing, or reviewing a Go test, example, fixture, mock, bug fix, or behaviour change.
Why use it?
It prevents unnecessarily complex tests and avoids mixing incompatible assertion styles or adding dependencies without need.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions AGENTS.md.

This is maguro/pbf's own configuration. It tells Claude Code how to work on pbf itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything pbf configures →

View source ↗ maguro/pbf
Reuse

Borrowing it

Nothing to install: this file belongs to maguro/pbf. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/maguro/pbf/master/.claude/skills/go-testing/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/maguro/pbf

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for go-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/maguro/pbf/go-testing/github.svg)](https://agentmods.dev/skills/maguro/pbf/go-testing)
Your own site
<a href="https://agentmods.dev/skills/maguro/pbf/go-testing"><img src="https://agentmods.dev/badge/skills/maguro/pbf/go-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for go-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/maguro/pbf/go-testing"><img src="https://agentmods.dev/badge/skills/maguro/pbf/go-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 576 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00051 $0.00576
Opus 5.5 $0.00020 $0.00230
Sonnet 5.5 $0.00010 $0.00115
Haiku 4.5 $0.00005 $0.00058

Measured 5d ago against content hash e743cdbd4c83, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

go-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/go-testing/SKILL.md · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Writing Go tests

AGENTS.md adds the test rules that apply only to this repo.

Match the framework to the test

Use Ginkgo (ginkgo/v2) for complicated behavioral tests: branching setup, a fixture shared across many related cases, or timing and concurrency to pin down. Its containers and Gomega's Eventually and Consistently earn their weight there.

Use plain testing.T for simple features: a handful of independent assertions, a table of input-to-output cases, a single fact. Prefer a table-driven test for new behavior of this kind. Reaching for Ginkgo to assert one thing costs more than it returns.

A repo that does not have Ginkgo in go.mod uses plain testing.T. Do not add Ginkgo to it for one test.

Do not convert an existing test to match. Convert only when you are already changing it for another reason.

Assertions follow the framework

Use Gomega (Expect) inside Ginkgo specs. Use testify (assert and require) in plain testing.T tests, where it clarifies intent. Do not mix them in one test. require inside a spec bypasses Ginkgo's failure reporting.

Examples are tests

example_test.go runs under go test, and its // Output: blocks are assertions. Update them with the behavior they check.

Prefer generated mocks to hand-written fakes

This rule applies to a repo that has go.uber.org/mock in go.mod, under either framework. Stand a collaborator up with a //go:generate ... mockgen directive on the file that declares the interface. Put behavior on the mock, not in a bespoke struct. For example, DoAndReturn supplies a slow call. An unexpected call already fails the test, so "must never be called" needs no assertion. When a mock cannot carry something a test needs, such as a fmt.Stringer identity, embed it and add only the missing method.

Keep passing test output quiet

A suite that does not assert on log content silences slog. It does not print to stderr on every green pass. A spec that checks what got logged installs a capturing handler for its duration and restores the previous default after. A suite that reaches logging paths only incidentally swaps in a discard handler for the whole run, for example in a BeforeSuite.

Read the full file on GitHub · 56 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 56 lines · 51 tokens per session scan A e743cdbd4c83

Subscribe to this mod's changes

go-testing is a skill published in the GitHub repository maguro/pbf (57 stars, last pushed 2d ago), licensed Apache-2.0. It adds 51 tokens to every session and 576 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-01.

Related

go-testing compared with skills from other repositories

go-testing next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
go-testingmaguro/pbfSkill572d agoApache-2.0A51Claude Code
golang-testingaffaan-m/ECCSkill298k4d agoMITA37Claude Code, Kiro
setuponsi/ginkgoSkill9.1k4d agoMITA118Claude Code
timeouts-and-asynconsi/ginkgoSkill9.1k4d agoMITA106Claude Code
golang-testingsamber/cc-skills-golangSkill3.8k5d agoMITA115Claude Code
golang-stretchr-testifysamber/cc-skills-golangSkill3.8k5d agoMITA97Claude Code
overviewonsi/ginkgoSkill9.1k4d agoMITA84Claude Code