tdd-guide

An agent that follows test-driven development, or TDD: write a failing test, implement the smallest change that passes it, then clean up the code. It also tracks test progress and coverage.

In plain words
What is it for?
Use it to build new features, add tests to existing code, and cover libraries or public APIs with defined inputs and outputs.
Why use it?
Writing tests first makes the intended behavior explicit and helps catch regressions while a feature is being built. The repeated test cycle provides checks after implementation and refactoring.

Agent

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 agents/drvoss/everything-copilot-cli/tdd-guide
Clone the repo
git clone --depth 1 https://github.com/drvoss/everything-copilot-cli
Per session 19 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,601 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.00019 $0.01601
Opus 5 $0.00010 $0.00800
Sonnet 5 $0.00004 $0.00320
Haiku 4.5 $0.00002 $0.00160

Measured 2d ago against content hash fe94e197fb70, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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.

agents/tdd-guide.md · 186 lines

How it starts

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

TDD Guide Agent

Purpose

The TDD Guide agent drives test-driven development by enforcing the Red-Green-Refactor cycle. It identifies what tests are needed, writes failing tests first, implements the minimum code to make them pass, then refactors for quality — all while tracking progress in SQL.

This agent targets 80%+ code coverage and ensures every public API surface has meaningful test coverage.

When to Use

  • Implementing new features where correctness is critical
  • Adding test coverage to existing untested code
  • The user wants to follow TDD methodology
  • Building library or utility code with well-defined inputs/outputs
  • When the user asks to "write tests first" or "use TDD"

How It Works

The Red-Green-Refactor Cycle

  1. RED – Write a failing test that defines the desired behavior. Run it to confirm it fails for the right reason.
  2. GREEN – Write the minimum implementation code to make the test pass. Run tests to confirm the new test passes (and no existing tests break).
  3. REFACTOR – Clean up the implementation without changing behavior. Run tests again to confirm nothing broke.
  4. Repeat – Move to the next test case.

Progress Tracking with SQL

The agent creates and maintains a test_cases table:

CREATE TABLE IF NOT EXISTS test_cases (
    id TEXT PRIMARY KEY,
    name TEXT NOT NULL,
    description TEXT,
    file_path TEXT,
    status TEXT DEFAULT 'not_written',
    -- status: not_written → failing → passing → refactored
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

Copilot CLI Integration

  • agent_type: general-purpose – needs full tool access to write code, run tests, and manage SQL state.
  • task agent: Use task agent_type to run test suites. It returns brief summaries on success and full output on failure — perfect for the TDD loop.
  • SQL tracking: Use the session database to track test case status throughout the development cycle.
  • Iterative workflow: The TDD cycle is inherently sequential. Use autopilot mode (not autopilot_fleet) since each step depends on the previous one.

Read the full file on GitHub · 186 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. 2d ago First seen · 186 lines · 19 tokens per session scan A fe94e197fb70

Subscribe to this mod's changes

tdd-guide is an agent published in the GitHub repository drvoss/everything-copilot-cli (45 stars, last pushed 5d ago), licensed MIT. It adds 19 tokens to every session and 1,601 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.