tdd

tdd is a skill for Claude Code from MereWhiplash/engram-cogitator. It costs 36 tokens per session (746 once invoked), scanned A, original, MIT.

A test-first coding method called test-driven development, or TDD: write a failing test, add the smallest code that passes it, then improve the code.

In plain words
What is it for?
Implementing features, fixing bugs, and making other code changes through a repeated test-and-fix cycle.
Why use it?
It checks the intended behavior before implementation and helps prevent changes that work only in untested cases.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cogitation plugin — 20 skills, 1 command, 1 hook shipped together

Good fit Implementing features, fixing bugs, and making other code changes through a repeated test-and-fix cycle.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/merewhiplash/engram-cogitator/tdd
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 MereWhiplash/engram-cogitator --skill tdd
Clone the repo
git clone --depth 1 https://github.com/MereWhiplash/engram-cogitator

Made for: Claude Code.

Or install cogitation, the plugin that ships this one along with the rest of its 20 skills, 1 command, 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

README.md
[![agentmods](https://agentmods.dev/badge/skills/merewhiplash/engram-cogitator/tdd/github.svg)](https://agentmods.dev/skills/merewhiplash/engram-cogitator/tdd)
Your own site
<a href="https://agentmods.dev/skills/merewhiplash/engram-cogitator/tdd"><img src="https://agentmods.dev/badge/skills/merewhiplash/engram-cogitator/tdd/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tdd

Your own site · 80×15
<a href="https://agentmods.dev/skills/merewhiplash/engram-cogitator/tdd"><img src="https://agentmods.dev/badge/skills/merewhiplash/engram-cogitator/tdd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 746 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.00036 $0.00746
Opus 5 $0.00018 $0.00373
Sonnet 5 $0.00007 $0.00149
Haiku 4.5 $0.00004 $0.00075

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

Security

Grade A, and why

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 9d 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.

cogitation/skills/tdd/SKILL.md · 165 lines

How it starts

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

Test-Driven Development

Write the test first. Watch it fail. Write minimal code to pass.

Announce: "I'm using the tdd skill for this implementation."

Step 0: Load Context

Get project config and relevant patterns:

ec_search:
  query: project config
  type: config

ec_search:
  query: test pattern
  type: pattern

Use the configured test_command for running tests.

The Cycle

RED → GREEN → REFACTOR → REPEAT

RED: Write Failing Test

Search for similar test patterns first:

ec_search:
  query: [feature area] test
  type: pattern

Write one minimal test for the behavior you want:

test('rejects empty email', () => {
  const result = validateEmail('');
  expect(result.valid).toBe(false);
  expect(result.error).toBe('Email required');
});

Verify RED: Watch It Fail @verifying

Run tests with configured command:

{test_command} path/to/test

Confirm:

  • Test fails (not errors)
  • Fails because feature is missing
  • Failure message is expected

If test passes: You're testing existing behavior. Fix the test.

GREEN: Minimal Code

Write the simplest code to make the test pass:

function validateEmail(email: string) {
  if (!email?.trim()) {
    return { valid: false, error: 'Email required' };
  }
  return { valid: true };
}

Don't add features beyond what the test requires.

Verify GREEN: Watch It Pass @verifying

{test_command} path/to/test

Confirm:

  • Test passes
  • Other tests still pass

REFACTOR: Clean Up

After green only:

  • Remove duplication
  • Improve names
  • Extract helpers

Keep tests green. Don't add behavior.

REPEAT

Next failing test for next behavior.

Store Patterns

When you establish a useful test pattern:

ec_add:
  type: pattern
  area: [component]
  content: [Description of test pattern and when to use it]
  rationale: Established during TDD implementation

Good patterns to store:

  • How to test async operations in this codebase
  • Mocking conventions used
  • Test data factories or fixtures
  • Integration test setup patterns

Read the full file on GitHub · 165 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. 9d ago First seen · 165 lines · 36 tokens per session scan A b673594e814f

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository MereWhiplash/engram-cogitator (4 stars, last pushed 2mo ago), licensed MIT. It adds 36 tokens to every session and 746 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-31.