go-blackbox

go-blackbox is a skill for Claude Code from sgaunet/claude-plugins. It costs 34 tokens per session (1,299 once invoked), scanned A, original, MIT.

A Go testing check that looks for white-box tests and proposes changing them to black-box tests. White-box tests use the package's internal code directly; black-box tests use only its public interface, and an export_test.go bridge can expose selected internals for testing.

In plain words
What is it for?
Use it when creating or reviewing Go tests to detect same-package tests, suggest package foo_test conversions, and create bridges when internal symbols are needed.
Why use it?
It helps tests behave more like users of the package and reduces dependence on private implementation details.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the go-specialist plugin — 4 skills, 7 commands, 1 agent shipped together

Good fit Use it when creating or reviewing Go tests to detect same-package tests, suggest package foo_test conversions, and create bridges when internal symbols are needed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sgaunet/claude-plugins/go-blackbox
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add sgaunet/claude-plugins --skill go-blackbox
Clone the repo
git clone --depth 1 https://github.com/sgaunet/claude-plugins

Made for: Claude Code.

Or install go-specialist, the plugin that ships this one along with the rest of its 4 skills, 7 commands, 1 agent.

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-blackbox

README.md
[![agentmods](https://agentmods.dev/badge/skills/sgaunet/claude-plugins/go-blackbox.svg)](https://agentmods.dev/skills/sgaunet/claude-plugins/go-blackbox)
Your own site
<a href="https://agentmods.dev/skills/sgaunet/claude-plugins/go-blackbox"><img src="https://agentmods.dev/badge/skills/sgaunet/claude-plugins/go-blackbox.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,299 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.00034 $0.01299
Opus 5 $0.00017 $0.00649
Sonnet 5 $0.00007 $0.00260
Haiku 4.5 $0.00003 $0.00130

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

Security

Grade A, and why

go-blackbox 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 7d 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.

plugins/go-specialist/skills/go-blackbox/SKILL.md · 137 lines

How it starts

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

Go Black Box Test Enforcement

Detect Go test files using white box testing (same package name) and propose conversion to black box testing (package foo_test). Creates export_test.go bridge files when internal symbols need external test access.

When to Use

  • Creating new test files (enforce black box from the start)
  • Reviewing existing test files in a Go project
  • User asks to audit or improve test quality
  • The golang-pro agent encounters *_test.go files during implementation

Prerequisites

  1. go.mod exists: Abort if missing.
  2. Go source files exist: At least one .go file and one *_test.go file to analyze.

Workflow: Detect White Box Tests

Step 1: Classify Test Files with go list

go list already reports the in-package/external split per package, and honours build constraints. Use it rather than globbing:

go list -f '{{.ImportPath}} {{.Name}} white={{.TestGoFiles}} black={{.XTestGoFiles}}' ./...
Field Package clause Classification
TestGoFiles package foo White box — candidate for conversion
XTestGoFiles package foo_test Black box — already correct

Two rules when reading the output:

  • Drop export_test.go from the white box set. It is a bridge file and belongs to the source package by design, so it is never a conversion candidate.
  • A package can legitimately hold both. Seeing entries in TestGoFiles and XTestGoFiles for the same package is normal, not a defect.

Why not Glob **/*_test.go and read package lines: a test file behind a constraint like //go:build linux is matched by Glob on any OS but correctly excluded by go list, so the manual approach both over- and under-reports. go list also names the source package directly, removing the need to read sibling non-test files to infer it.

Step 2: Check for export_test.go

For each directory containing test files, check whether an export_test.go already exists.

Step 3: Report Findings

Read the full file on GitHub · 137 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. 7d ago First seen · 137 lines · 34 tokens per session scan A d47ec8b02ce9

Subscribe to this mod's changes

go-blackbox is a skill published in the GitHub repository sgaunet/claude-plugins (16 stars, last pushed 5d ago), licensed MIT. It adds 34 tokens to every session and 1,299 once invoked, about $0.0002 per session on Opus 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-08-30.