go-tdd

go-tdd is a command for coding agents from sgaunet/claude-plugins. It costs 21 tokens per session (1,858 once invoked), scanned A, original, MIT.

A command for implementing Go features with test-driven development, or TDD. TDD means writing a failing test, making it pass, and then improving the code while keeping the tests passing.

In plain words
What is it for?
Use it to implement a Go feature through the RED, GREEN, and REFACTOR stages, with options for a dry run or skipping selected checks.
Why use it?
It provides a defined implementation sequence with testing, refactoring, linting, documentation checks, and build checks, while handling common failures during the process.

Command

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

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.

agentmods
npx agentmods add commands/sgaunet/claude-plugins/go-tdd
Clone the repo
git clone --depth 1 https://github.com/sgaunet/claude-plugins

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/sgaunet/claude-plugins/go-tdd.svg)](https://agentmods.dev/commands/sgaunet/claude-plugins/go-tdd)
Your own site
<a href="https://agentmods.dev/commands/sgaunet/claude-plugins/go-tdd"><img src="https://agentmods.dev/badge/commands/sgaunet/claude-plugins/go-tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,858 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00021 $0.01858
Opus 5 $0.00010 $0.00929
Sonnet 5 $0.00004 $0.00372
Haiku 4.5 $0.00002 $0.00186

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

Security

Grade A, and why

go-tdd 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.

plugins/go-specialist/commands/go-tdd.md · 207 lines

How it starts

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

Go TDD Implementation

Implement a Go feature using strict RED → GREEN → REFACTOR TDD methodology, with Context7 MCP integration for up-to-date library documentation at each phase.

Arguments

  • $argument: Feature description and optional flags (required)

Flags

Flag Short Effect
--skip-lint -l Skip golangci-lint in Phase 5
--skip-refactor -r Skip Phase 4 refactoring
--dry-run -n Show plan only, no file writes
--force -f Skip all user confirmations

Error Handling

Error Action
No go.mod found Abort with message: "Not a Go project — no go.mod found"
Context7 unavailable Warn and continue without doc validation
Tests won't compile Display errors, attempt fix (max 2 retries), then ask user
Tests fail in GREEN phase Attempt fix (max 2 retries), then ask user
Lint failure Attempt auto-fix, re-run, then ask user
Build failure Display errors, abort

Process

Phase 1: Discovery & Documentation (Automatic)

  1. Parse flags from $argument:

    • Extract feature description (everything before flags)
    • Detect --skip-lint / -l, --skip-refactor / -r, --dry-run / -n, --force / -f
  2. Validate Go project:

    • Check go.mod exists — if not, abort: "Not a Go project — no go.mod found"
    • Read go.mod to identify module name and Go version
  3. Analyze project structure:

    • Scan existing packages, test patterns, coding conventions
    • Identify existing test helpers or shared fixtures
    • Note the project's import style, error handling patterns, naming conventions
    • Check existing *_test.go files for package naming: flag any white box tests (package <pkgname> without _test suffix) for potential conversion
  4. Identify libraries needed for the feature:

    • Determine which standard library packages are involved
    • Determine which third-party libraries are needed
  5. Fetch Context7 documentation for each library:

    • Call mcp__context7__resolve-library-id to get the library ID
    • Call mcp__context7__query-docs with a query specific to the feature being implemented
    • If Context7 is unavailable, warn and continue without doc validation

Read the full file on GitHub · 207 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 · 207 lines · 21 tokens per session scan A d13cc76dddde

Subscribe to this mod's changes

go-tdd is a command published in the GitHub repository sgaunet/claude-plugins (16 stars, last pushed 3d ago), licensed MIT. It adds 21 tokens to every session and 1,858 once invoked, about $0.0001 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.