working-with-tdd

working-with-tdd is a skill for Claude Code from slowdini/slow-powers. It costs 20 tokens per session (1,147 once invoked), scanned A, original, MIT.

A test-driven development guide for implementing features, refactoring code, or fixing bugs. Test-driven development, or TDD, means writing a test that fails first, then the smallest code change that makes it pass, followed by cleanup.

In plain words
What is it for?
Use it whenever changing software behaviour, including new features, refactors, and bug fixes.
Why use it?
It makes the intended behaviour explicit before production code is written and provides a check against regressions. It also requires an isolated workspace first and verification after implementation.

Skill for Claude Code

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

Part of the slow-powers plugin — 9 skills, 2 hooks shipped together

Good fit Use it whenever changing software behaviour, including new features, refactors, and bug fixes.

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

Made for: Claude Code.

Or install slow-powers, the plugin that ships this one along with the rest of its 9 skills, 2 hooks.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/slowdini/slow-powers/working-with-tdd.svg)](https://agentmods.dev/skills/slowdini/slow-powers/working-with-tdd)
Your own site
<a href="https://agentmods.dev/skills/slowdini/slow-powers/working-with-tdd"><img src="https://agentmods.dev/badge/skills/slowdini/slow-powers/working-with-tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,147 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.00020 $0.01147
Opus 5 $0.00010 $0.00574
Sonnet 5 $0.00004 $0.00229
Haiku 4.5 $0.00002 $0.00115

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

Security

Grade A, and why

working-with-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 8d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (evals/fixtures/helper-tautology/formatMoney.ts, evals/fixtures/helper-tautology/test-utils.ts, evals/fixtures/paginated-fetch/userList.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/working-with-tdd/SKILL.md · 113 lines

How it starts

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

Test-driven development (TDD)

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

THE IRON LAW: NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST.

Write production code before the test? Delete it. Start over. Do not keep it for "reference" or "adapt" it. Delete means delete.

Violating the letter of the rules is violating the spirit of the rules.

REQUIRED PREREQUISITE: You must have already completed slow-powers:working-in-isolation — establish an isolated workspace before writing any test or production code.

REQUIRED NEXT SKILL: You must complete slow-powers:verifying-development-work next, after the TDD implementation work is done and before claiming the task is complete or handing work back to the user.


Red-green-refactor cycle

  1. RED — Write a failing test:
    • Write one minimal, focused test showing what the behavior should do.
    • Use real code and real inputs; avoid mocks unless absolutely unavoidable. Before committing a test, scan it against the Testing anti-patterns table below; if it matches a row, read the named section of the testing anti-patterns reference first.
  2. Verify RED — Watch it fail:
    • Run the test command: npm test / pytest / go test.
    • MANDATORY: Verify it fails for the expected reason (for example, a function is undefined or a value is incorrect), not because of a typo or build error.
  3. GREEN — Write minimal code:
    • Write the simplest possible implementation to make the test pass.
    • Avoid over-engineering or speculative optimization.
  4. Verify GREEN — Watch it pass:
    • Run the test suite. Verify the test passes, and no regressions are introduced.
  5. REFACTOR — Clean up:
    • Clean up names, remove duplication, and extract helper methods.
    • Keep the test suite green. Do not add new behavior during refactoring.

Example: code vs. mock testing

Good (focuses on real behavior)

test('retries failed operations 3 times', async () => {
  let attempts = 0;
  const operation = async () => {
    attempts++;
    if (attempts < 3) throw new Error('fail');
    return 'success';
  };
  const result = await retryOperation(operation);
  expect(result).toBe('success');
  expect(attempts).toBe(3);
});

Read the full file on GitHub · 113 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. 8d ago First seen · 113 lines · 20 tokens per session scan A c770ff51b108

Subscribe to this mod's changes

working-with-tdd is a skill published in the GitHub repository slowdini/slow-powers (2 stars, last pushed 24d ago), licensed MIT. It adds 20 tokens to every session and 1,147 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-31.

Related

Other skills, from other repositories

init-pipeline

Infrastructure skill for scaffolding pipeline enforcement into a project. Sets up Claude Code hooks (TDD classification gate, git guardrails, optional quality gate), pre-commit hooks (detects existing tools, defaults to Lefthook + Biome + pnpm if none found). Run when setting up a project for pipeline work, and again…

chrislacey89/skills · 105 tokens

triage-issue

Invoked helper skill for deep bug diagnosis, usually delegated from /qa when a reported issue needs root-cause analysis and a TDD fix plan before implementation. Use when the cause is unclear, the bug is a regression, or the user explicitly wants diagnosis. Not for lightweight QA intake (use /qa) or already-clear…

chrislacey89/skills · 77 tokens

tdd

Invoked helper skill for strict red-green-refactor implementation, usually delegated from /execute or bug-fix work shaped by /triage-issue. Use when backend behavior or behavior-heavy frontend logic should be built test-first through public interfaces. Not for shaping, decomposition, vague implementation tasks, or…

chrislacey89/skills · 67 tokens

tdd

Enforces red-green-refactor TDD cycle with atomic commits per phase. Used when implementing features, fixing bugs, or when tests should drive the design.

maystudios/maxsimcli · 34 tokens

specmint-tdd

TDD-first spec management for AI coding workflows. Use this skill when the user explicitly mentions specs, forging, or structured planning: says "forge", "forge a spec", "write a spec for X", "create a spec", "plan X as a spec", "resume", "what was I working on", "spec list/status/pause/switch/activate", "implement…

ngvoicu/specmint-tdd · 146 tokens

setup

Set up or update TDD Guard for the current project. Detects the test framework, installs or updates the matching reporter, and configures or migrates its configuration to match the current specification.

nizos/tdd-guard · 39 tokens