tdd-guide

tdd-guide is an agent for coding agents from affaan-m/ECC. It costs 42 tokens per session (690 once invoked), scanned A, original, MIT.

A test-first development guide that requires writing a failing test before implementation, then making it pass and refactoring. TDD, or test-driven development, is this red-green-refactor cycle, with unit, integration, and end-to-end tests.

In plain words
What is it for?
Use it when building features, fixing bugs, or refactoring code to plan tests, cover invalid and boundary inputs, and verify coverage.
Why use it?
It helps expose edge cases early and keeps bug fixes and refactors protected by tests. It also sets a stated target of at least 80% coverage across several code measures.

Agent

Part of the ecc plugin — 70 skills, 56 commands, 68 agents, 1 MCP server shipped together

About the project

ECC is a toolkit that organizes and improves how coding agents work through skills, memory, security checks, research practices, and related extensions. It is for developers using agents such as Claude Code, Codex, OpenCode, and Cursor.

affaan-m/ECC · 246,988 stars · on GitHub

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/affaan-m/ecc/tdd-guide
Clone the repo
git clone --depth 1 https://github.com/affaan-m/ECC

Or install ecc, the plugin that ships this one along with the rest of its 70 skills, 56 commands, 68 agents, 1 MCP server.

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/affaan-m/ecc/tdd-guide.svg)](https://agentmods.dev/agents/affaan-m/ecc/tdd-guide)
Your own site
<a href="https://agentmods.dev/agents/affaan-m/ecc/tdd-guide"><img src="https://agentmods.dev/badge/agents/affaan-m/ecc/tdd-guide.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 690 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.00042 $0.00690
Opus 5 $0.00021 $0.00345
Sonnet 5 $0.00008 $0.00138
Haiku 4.5 $0.00004 $0.00069

Measured yesterday against content hash 5bb13b0013c8, 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 yesterday.

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.

Origin

Copies of this mod

8 near-identical copies found in the catalogue:

.kiro/agents/tdd-guide.md · 94 lines

How it starts

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

You are a Test-Driven Development (TDD) specialist who ensures all code is developed test-first with comprehensive coverage.

Your Role

  • Enforce tests-before-code methodology
  • Guide through Red-Green-Refactor cycle
  • Ensure 80%+ test coverage
  • Write comprehensive test suites (unit, integration, E2E)
  • Catch edge cases before implementation

TDD Workflow

1. Write Test First (RED)

Write a failing test that describes the expected behavior.

2. Run Test -- Verify it FAILS

npm test

3. Write Minimal Implementation (GREEN)

Only enough code to make the test pass.

4. Run Test -- Verify it PASSES

5. Refactor (IMPROVE)

Remove duplication, improve names, optimize -- tests must stay green.

6. Verify Coverage

npm run test:coverage
# Required: 80%+ branches, functions, lines, statements

Test Types Required

Type What to Test When
Unit Individual functions in isolation Always
Integration API endpoints, database operations Always
E2E Critical user flows (Playwright) Critical paths

Edge Cases You MUST Test

  1. Null/Undefined input
  2. Empty arrays/strings
  3. Invalid types passed
  4. Boundary values (min/max)
  5. Error paths (network failures, DB errors)
  6. Race conditions (concurrent operations)
  7. Large data (performance with 10k+ items)
  8. Special characters (Unicode, emojis, SQL chars)

Test Anti-Patterns to Avoid

  • Testing implementation details (internal state) instead of behavior
  • Tests depending on each other (shared state)
  • Asserting too little (passing tests that don't verify anything)
  • Not mocking external dependencies (Supabase, Redis, OpenAI, etc.)

Quality Checklist

  • All public functions have unit tests
  • All API endpoints have integration tests
  • Critical user flows have E2E tests
  • Edge cases covered (null, empty, invalid)
  • Error paths tested (not just happy path)
  • Mocks used for external dependencies
  • Tests are independent (no shared state)
  • Assertions are specific and meaningful
  • Coverage is 80%+

Read the full file on GitHub · 94 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. yesterday First seen · 94 lines · 42 tokens per session scan A 5bb13b0013c8

Subscribe to this mod's changes

tdd-guide is an agent published in the GitHub repository affaan-m/ECC (246,988 stars, last pushed yesterday), licensed MIT. It adds 42 tokens to every session and 690 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-09-03.

Related

Other agents, from other repositories

test-automator

Create comprehensive test suites with unit, integration, and e2e tests. Sets up CI pipelines, mocking strategies, and test data. Use PROACTIVELY for test coverage improvement or test automation setup.

echoVic/blade-code · 46 tokens

test-architect

Generates and hardens the test suite — unit AND end-to-end — for a change, runs it, and validates the behavior actually works (not just that assertions pass). Use as the SAFETY GATE before any autonomous fix is approved or merged: no adequate tests, no green light. The thing that makes the autonomous loops safe.

dshakes/compass · 72 tokens

test-engineer

Expert in testing, TDD, and test automation. Use for writing tests, improving coverage, debugging test failures. Triggers on test, spec, coverage, jest, pytest, playwright, e2e, unit test.

ashrafmusa/agenticana · 49 tokens

test-writer

Specialiste en ecriture de tests unitaires et integration. Utiliser pour generer des tests vitest (React/TS), pytest (Python), cargo test (Rust), ou Playwright BDD (E2E).

stoa-platform/stoa · 49 tokens

qa-testing-expert

Use this agent when you need to design, implement, review, or improve test suites and testing strategies. This includes writing unit tests, integration tests, end-to-end tests, setting up test infrastructure, debugging flaky tests, improving test coverage, or evaluating code for testability. Also use when reviewing…

personamanagmentlayer/pcl · 452 tokens

ruthless-tester

Breaks code. Ensures 100% test coverage + E2E validation. No feature passes without full verification.

samibs/guardloop.dev · 0 tokens