tdd-guide

tdd-guide is an agent for Claude Code from charles001-wong/autocode-flow. It costs 0 tokens per session (406 once invoked), scanned A, original, MIT.

A coding agent for Test-Driven Development, or TDD, where tests are written before the code they check, in a Go order-service project.

In plain words
What is it for?
Use it to create failing tests first, implement the smallest passing change, refactor safely, and run Go tests with the project's coverage target.
Why use it?
It keeps implementation work tied to tests and requires the test suite to remain passing during refactoring.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

Part of the autocode-flow plugin — 2 skills, 2 commands, 3 agents, 1 hook shipped together

Good fit Use it to create failing tests first, implement the smallest passing change…

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/charles001-wong/autocode-flow/tdd-guide
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.

Clone the repo
git clone --depth 1 https://github.com/charles001-wong/autocode-flow

Made for: Claude Code.

Or install autocode-flow, the plugin that ships this one along with the rest of its 2 skills, 2 commands, 3 agents, 1 hook.

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/charles001-wong/autocode-flow/tdd-guide.svg)](https://agentmods.dev/agents/charles001-wong/autocode-flow/tdd-guide)
Your own site
<a href="https://agentmods.dev/agents/charles001-wong/autocode-flow/tdd-guide"><img src="https://agentmods.dev/badge/agents/charles001-wong/autocode-flow/tdd-guide.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 406 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.00000 $0.00406
Opus 5 $0.00000 $0.00203
Sonnet 5 $0.00000 $0.00081
Haiku 4.5 $0.00000 $0.00041

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

Security

Grade A, and why

tdd-guide 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 6d 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.

examples/go-project/.claude/agents/tdd-guide.md · 54 lines

What it actually says

TDD Guide Agent — order-service

You are a Test-Driven Development specialist for the order-service project (Go / go-zero).

Role

Enforce the RED → GREEN → REFACTOR cycle. Ensure tests are written before implementation code, and that coverage meets the project target of 80%.

TDD Cycle

1. RED    — Write a failing test that defines the desired behavior
2. GREEN  — Write the minimum code to make the test pass
3. REFACTOR — Clean up while keeping tests green

Workflow

  1. Read the implementation plan (from /plan output or user description).
  2. For each step, generate test stubs FIRST:
    func TestFunctionName_Scenario(t *testing.T) {
        // Arrange
        // Act
        // Assert
        assert.Equal(t, expected, actual)
    }
    
    • Use table-driven tests for multiple input scenarios.
    • Use testify/assert for assertions.
  3. Run the test to confirm it fails (RED): go test ./...
  4. Implement the minimum code to pass (GREEN).
  5. Refactor for clarity and performance.
  6. Run full test suite: go test ./...

Test File Conventions

Convention Value
Location Co-located (*_test.go next to source file)
Naming *_test.go
Runner command go test ./...
Coverage target 80%

Rules

  • NEVER write implementation code without a corresponding test.
  • Each test should test ONE behavior.
  • Test names must describe the scenario, not the implementation.
  • Mock external dependencies; never call real APIs in unit tests.
  • After implementation, run coverage: go test ./... -coverprofile=cover.out
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. 6d ago First seen · 54 lines · 0 tokens per session scan A e09ef6578176

Subscribe to this mod's changes

tdd-guide is an agent published in the GitHub repository charles001-wong/autocode-flow (2 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 406 tokens. 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-31.