tdd

tdd is a skill for Claude Code from Pharaoh-so/pharaoh-mcp. It costs 58 tokens per session (774 once invoked), scanned A, original, MIT.

A test-driven development workflow, or TDD, where a failing test is written and observed before the production code, followed by making it pass and then cleaning up the code.

In plain words
What is it for?
It helps develop features, fix bugs, refactor code, and change behavior through the red-green-refactor cycle.
Why use it?
It prevents code from being written without a test that demonstrates the required behavior.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the pharaoh plugin — 8 skills, 2 commands, 1 hook, 1 MCP server shipped together

Good fit It helps develop features, fix bugs, refactor code, and change behavior through the red-green-refactor cycle.

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

Made for: Claude Code.

Or install pharaoh, the plugin that ships this one along with the rest of its 8 skills, 2 commands, 1 hook, 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

README.md
[![agentmods](https://agentmods.dev/badge/skills/pharaoh-so/pharaoh-mcp/tdd/github.svg)](https://agentmods.dev/skills/pharaoh-so/pharaoh-mcp/tdd)
Your own site
<a href="https://agentmods.dev/skills/pharaoh-so/pharaoh-mcp/tdd"><img src="https://agentmods.dev/badge/skills/pharaoh-so/pharaoh-mcp/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/pharaoh-so/pharaoh-mcp/tdd"><img src="https://agentmods.dev/badge/skills/pharaoh-so/pharaoh-mcp/tdd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 774 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.00058 $0.00774
Opus 5.5 $0.00023 $0.00310
Sonnet 5.5 $0.00012 $0.00155
Haiku 4.5 $0.00006 $0.00077

Measured 9d ago against content hash eb722f5c1a0b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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.

skills/tdd/SKILL.md · 106 lines

How it starts

The opening of the file, as written. The whole thing — 106 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. Refactor.

If you didn't watch the test fail, you don't know if it tests the right thing.

When to Use

Always — for new features, bug fixes, refactoring, and behavior changes. Exceptions require explicit user permission (throwaway prototypes, generated code, config files).

The Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Wrote code before the test? Delete it. Start over. Don't keep it as "reference." Don't adapt it. Delete means delete.

Red-Green-Refactor

RED — Write Failing Test

Write one minimal test showing what should happen.

  • One behavior per test
  • Clear name describing the behavior
  • Real code, not mocks (unless unavoidable)

Run the test. Confirm it fails (not errors) for the expected reason — the feature is missing, not a typo.

GREEN — Minimal Code

Write the simplest code that makes the test pass. Nothing more.

  • Don't add features the test doesn't require
  • Don't refactor other code
  • Don't "improve" beyond the test

Run the test. Confirm it passes. Confirm other tests still pass.

REFACTOR — Clean Up

Only after green:

  • Remove duplication
  • Improve names
  • Extract helpers

Keep tests green throughout. Don't add behavior during refactor.

Repeat

Next failing test for next behavior.

Bug Fix Flow

  1. Write a failing test that reproduces the bug
  2. Watch it fail — confirms the test catches the bug
  3. Fix the bug with minimal code
  4. Watch it pass — confirms the fix works
  5. Refactor if needed

Never fix bugs without a regression test.

Common Rationalizations

Excuse Reality
"Too simple to test" Simple code breaks. Test takes 30 seconds.
"I'll test after" Tests passing immediately prove nothing.
"Need to explore first" Fine. Throw away exploration, then start with TDD.
"Test hard = skip test" Hard to test = hard to use. Simplify the interface.
"TDD will slow me down" TDD is faster than debugging. Always.
"Already manually tested" Ad-hoc is not systematic. No record, can't re-run.

Read the full file on GitHub · 106 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 · 106 lines · 58 tokens per session scan A eb722f5c1a0b

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository Pharaoh-so/pharaoh-mcp (2 stars, last pushed today), licensed MIT. It adds 58 tokens to every session and 774 once invoked, about $0.0002 per session on Opus 5.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-10-21.

Related

Other skills, from other repositories

sparc-methodology

SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) comprehensive development methodology with multi-agent orchestration.

ruvnet/RuView · 29 tokens

testatlas

Use for any question about the tests in a .NET test-automation solution (Reqnroll, SpecFlow, NUnit, xUnit, MSTest, Playwright, RestSharp) - finding, identifying, listing or counting the tests, scenarios or step definitions for a feature or keyword, checking whether coverage exists, and before writing, changing or…

Karzone/TestAtlas · 112 tokens

index

Build or rebuild the TestAtlas map (codemap.db) for the .NET solution in this project. Use when the session-start note says the map is missing or stale, when the testatlas tools report no map, or after editing .cs or .feature files.

Karzone/TestAtlas · 56 tokens

add-tests

Generates tests for existing code. Analyzes the target function, method, or class to identify the happy path, error cases, and edge cases, then writes test cases following the project's testing framework and naming conventions. Invoked when the user asks to add tests, write tests, cover code, or increase coverage.

soulcodex/agentic · 67 tokens

report

Write the TestAtlas HTML report for the .NET solution in this project - a self-contained drill-down of features, scenarios, step bindings, class kinds and endpoints - and optionally the project dependency graph. Use when the person asks for the TestAtlas report, an HTML view or overview of the test suite, a drill-down…

Karzone/TestAtlas · 80 tokens

deep-plan

Creates detailed, sectionized, TDD-oriented implementation plans through research, stakeholder interviews, and multi-LLM review. Use when planning features that need thorough pre-implementation analysis.

piercelamb/deep-plan · 39 tokens