Agent skill

TDD

by TechDufus in TechDufus/oh-my-claude

Systematic TDD methodology for writing tests first. An agent skill from TechDufus/oh-my-claude.

MITAuto-check passedTesting & QA

Install TDD

skills CLI
$ npx skills add TechDufus/oh-my-claude --skill tdd -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install TechDufus/oh-my-claude tdd --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/TechDufus/oh-my-claude.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/oh-my-claude/skills/tdd .claude/skills/tdd && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tdd
GitHub stars
174
Token cost
~1k tokens
SKILL.md length
601 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

Systematic TDD methodology for writing tests first. An agent skill from TechDufus/oh-my-claude.

  • Works in 4 steps: Write ONE test that describes the… → Run the test suite → Verify it fails for the RIGHT reason… → …
  • Implementing features
  • SKILL.md covers The Iron Law, When to Apply, Red-Green-Refactor Cycle and Anti-Rationalization Table, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

TDD is an agent skill from TechDufus/oh-my-claude. Systematic TDD methodology for writing tests first. Use when implementing features or fixes with OMCTDDMODE enabled, when unsure how to structure tests, or when test-first discipline needs reinforcement. Triggers on: 'tdd', 'test first', 'test driven', 'red green refactor'.

Its SKILL.md is about 1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Test-driven development. The repository describes itself as: Add ultrawork to any prompt for maximum parallel execution. The licence is MIT.

When your agent uses it

  • Implementing features
  • Fixes with OMCTDDMODE enabled
  • Unsure how to structure tests
  • Test-first discipline needs reinforcement

Example prompts

  • “test first”
  • “test driven”
  • “red green refactor”
  • “/tdd”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Write ONE test that describes the desired behavior
  2. Run the test suite
  3. Verify it fails for the RIGHT reason (not a syntax error, not a missing import)
  4. If it passes, your test is wrong or the feature already exists

What it can do on your machine

Read from SKILL.md and the folder at commit ede75db. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

TDD loads about 1k tokens when it runs. Until then it costs about 70 tokens; SKILL.md has 601 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~70
When it runs · the whole SKILL.md, loaded when a task matches
~1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from TechDufus/oh-my-claude at commit ede75db, republished under its MIT licence (© TechDufus). 601 words, ~1,047 tokens.

Download SKILL.mdSave it as .claude/skills/tdd/SKILL.md (or your agent's skills folder).
name
tdd
description
Systematic TDD methodology for writing tests first. Use when implementing features or fixes with OMC_TDD_MODE enabled, when unsure how to structure tests, or when test-first discipline needs reinforcement. Triggers on: 'tdd', 'test first', 'test driven', 'red green refactor'.

TDD Skill

Write the test. Watch it fail. Make it pass. Clean up. Repeat.

The Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

If you're writing production code and no test just failed, you're doing it wrong.

When to Apply

  • OMC_TDD_MODE is enabled (guided or enforced)
  • Implementing a new feature or behavior
  • Fixing a bug (write the test that reproduces it first)
  • Unsure how to structure tests for a piece of logic
  • When the tdd_enforcer hook blocks an edit

Red-Green-Refactor Cycle

RED: Write a Failing Test
  1. Write ONE test that describes the desired behavior
  2. Run the test suite
  3. Verify it fails for the RIGHT reason (not a syntax error, not a missing import)
  4. If it passes, your test is wrong or the feature already exists

Verification gate: Test output shows a meaningful failure related to the behavior you're implementing.

GREEN: Make It Pass
  1. Write the MINIMUM code to make the test pass
  2. No extra methods. No abstractions. No "while I'm here" additions
  3. Run the test suite
  4. ALL tests pass (not just the new one)

Verification gate: Full test suite green. Zero failures.

REFACTOR: Clean Up
  1. Remove duplication introduced in the GREEN step
  2. Improve naming, extract methods if warranted
  3. Run the test suite after EVERY change
  4. No new behavior during refactor - tests stay green throughout

Verification gate: Tests still green. Code is cleaner. No new functionality added.

Anti-Rationalization Table

ExcuseCounter
"I'll write tests after"Tests written after prove nothing - they pass immediately
"Too simple to test"Simple code breaks. Test takes 30 seconds
"I know this works"Confidence is not evidence. The test IS the evidence
"Tests will slow me down"Debugging without tests slows you down more
"Just a refactor"Refactors without tests are rewrites without safety nets
"The types guarantee correctness"Types check structure, not behavior. Test the behavior
"It's just a config change"Config changes cause production outages. Test them
"I'll TDD the next one"You said that last time. Start now
Show full SKILL.md (262 more words)Show less

Red Flags

Thoughts that signal you're about to violate TDD:

  • "Let me just quickly implement this first..."
  • "This is too obvious to need a test"
  • "I'll come back and add tests"
  • "The test would just be testing the framework"
  • "It's only a one-line change"
  • "I need to see the implementation to know what to test"

If you catch yourself thinking any of these: STOP. Write the test first.

Hook Integration

The tdd_enforcer hook gates file edits when OMC_TDD_MODE is enabled. This skill guides the methodology. The hook fires, you see the gate, invoke this skill for how to proceed.

Flow: Hook blocks edit -> Read the message -> Write/update a test -> Run tests (see RED) -> Now implement (GREEN) -> Clean up (REFACTOR).

When Stuck

ProblemSolution
Can't figure out what to testTest the simplest case first. What's the most basic input/output?
Test is too complexBreak the behavior into smaller units. Test each one
Don't know the test frameworkCheck existing tests in the project. Copy the pattern
Test requires too much setupThat's a design smell. Simplify the interface under test
Multiple things need testingOne test at a time. Pick the smallest behavior first
Existing code has no testsStart with the change you're making. Test the new behavior
Test passes immediatelyYour test isn't testing what you think. Check assertions
Can't make the test failYou might be testing something already implemented. Test the GAP

The Bottom Line

A test that exists before the code proves the code works. A test written after proves nothing but that you can reverse-engineer assertions.

© TechDufus, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/oh-my-claude/skills/tdd of TechDufus/oh-my-claude.

Open the folder on GitHubat commit ede75db

Compare with similar skills

TDD next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

TDD compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
TDD this skillTechDufus/oh-my-claude174—~1kAutomated safety check: PassMIT
TDDpietheinstrengholt/rssmonster56430 repos~906Automated safety check: PassMIT
TDD WorkflowhellangleZ/burn-in-cceverywhere-ralph11211 repos~2.4kAutomated safety check: PassNone
TDDsanity-io/sanity6.4k20 repos~1kAutomated safety check: PassMIT
Test Driven Developmentfarm-fe/farm5.6k51 repos~2.5kAutomated safety check: PassMIT
Tapd Story PipelineTencentBlueKing/bk-bcs840—~2.6kAutomated safety check: PassCustom licence

Similar skills

  • TDD

    pietheinstrengholt/rssmonster

    Test-driven development. An agent skill from pietheinstrengholt/rssmonster.

    564 GitHub starsUsed in 30 repos~906 tokens
    Testing & QAAuto-check passed
  • TDD Workflow

    hellangleZ/burn-in-cceverywhere-ralph

    A skill your agent uses when writing new features, fixing bugs, or refactoring code.

    112 GitHub starsUsed in 11 repos~2.4k tokens
    Testing & QAAuto-check passed
  • TDD

    sanity-io/sanity

    Official

    Test-driven development with red-green-refactor loop. An agent skill from sanity-io/sanity.

    6.4k GitHub starsUsed in 20 repos~1k tokens
    Testing & QAAuto-check passed
  • A skill your agent uses when implementing any feature or bugfix, before writing implementation code

    5.6k GitHub starsUsed in 51 repos~2.5k tokens
    Testing & QAAuto-check passed
  • Tapd Story Pipeline

    TencentBlueKing/bk-bcs

    单需求实现流水线——把一个 TAPD 需求从零推进到代码提交。自动串联技术澄清、 开发计划、任务拆分、TDD 实现、架构/安全校验、代码提交六个阶段。

    840 GitHub stars~2.6k tokensUpdated today
    Testing & QAAuto-check passed
  • Absolute Init

    maddhruv/absolute

    One-time setup for absolute: interview how you want it to behave (output style, autonomy, TDD strictness, spec dir, families) + detect the stack once, then write .absolute.config.json (project…

    218 GitHub starsUsed in 1 repo~3k tokens
    Testing & QAAuto-check passed

More from TechDufus/oh-my-claude

All 12 skills in this repo
  • Debugger

    TechDufus/oh-my-claude

    Systematic debugging methodology for diagnosing failures and root cause analysis.

    174 GitHub stars~1k tokensUpdated 2 mo ago
    Auto-check passed
  • Oh My Claude Runtime

    TechDufus/oh-my-claude

    A skill your agent uses when applying oh-my-claude workflow guidance, ultrawork modes, agent orchestration, plan execution, or plugin configuration.

    174 GitHub stars~4.3k tokensUpdated 2 mo ago
    Auto-check passed
  • PR Creation

    TechDufus/oh-my-claude

    MUST be used when creating pull requests. An agent skill from TechDufus/oh-my-claude.

    174 GitHub stars~1.8k tokensUpdated 2 mo ago
    Auto-check passed
  • Ralph Loop Init

    TechDufus/oh-my-claude

    Transform approved plans into ralph loop infrastructure. An agent skill from TechDufus/oh-my-claude.

    174 GitHub stars~4.6k tokensUpdated 2 mo ago
    Auto-check: notes
  • Ralph Plan

    TechDufus/oh-my-claude

    Structured PRD generation with interview, research, and approval workflow.

    174 GitHub stars~2.4k tokensUpdated 2 mo ago
    Auto-check: notes
  • Writing Skills

    TechDufus/oh-my-claude

    Methodology for creating effective skills using TDD principles.

    174 GitHub stars~1.3k tokensUpdated 2 mo ago
    Auto-check passed

Categories

Questions about TDD

What does TDD do?

Systematic TDD methodology for writing tests first. An agent skill from TechDufus/oh-my-claude. TDD is an agent skill from TechDufus/oh-my-claude. Systematic TDD methodology for writing tests first.

When should I use TDD?

TDD fits situations like: implementing features; fixes with OMCTDDMODE enabled; unsure how to structure tests; test-first discipline needs reinforcement.

How do I install TDD in Claude Code?

Run `npx skills add TechDufus/oh-my-claude --skill tdd -a claude-code`. Or copy the skill folder (plugins/oh-my-claude/skills/tdd in TechDufus/oh-my-claude) into .claude/skills/tdd in your project. Claude Code loads it when a task matches its description.

How do I install TDD in Codex?

Run `npx skills add TechDufus/oh-my-claude --skill tdd -a codex`. Or copy the skill folder (plugins/oh-my-claude/skills/tdd in TechDufus/oh-my-claude) into .agents/skills/tdd in your project. Codex loads it when a task matches its description.

Can I use TDD in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add TechDufus/oh-my-claude --skill tdd -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tdd, .gemini/skills/tdd, .github/skills/tdd and .opencode/skills/tdd in your project.

What does TDD need to run?

SKILL.md names no scripts, command-line tools or credentials: TDD is instructions for the agent only.

Does TDD access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is TDD safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does TDD use?

TDD is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does TDD use?

About 1k tokens (SKILL.md is roughly 4.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to TDD?

Skills that share tags, products or a category with TDD: TDD (pietheinstrengholt/rssmonster, 564 stars), TDD Workflow (hellangleZ/burn-in-cceverywhere-ralph, 112 stars), TDD (sanity-io/sanity, 6.4k stars) and Test Driven Development (farm-fe/farm, 5.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains TDD?

TechDufus (a GitHub user) maintains it in TechDufus/oh-my-claude, which has 174 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on July 13, 2026.

Source: TechDufus/oh-my-claude on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.