Agent skill

TDD Mastery

by xenitV1 in xenitV1/claude-code-maestro

Test-Driven Development Iron Law. An agent skill from xenitV1/claude-code-maestro.

MITAuto-check passedTesting & QA

Install TDD Mastery

skills CLI
$ npx skills add xenitV1/claude-code-maestro --skill tdd-mastery -a claude-code

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

GitHub CLI
$ gh skill install xenitV1/claude-code-maestro tdd-mastery --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/xenitV1/claude-code-maestro.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/tdd-mastery .claude/skills/tdd-mastery && 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-mastery
GitHub stars
229
Token cost
~2.2k tokens
SKILL.md length
800 words
Files
2
Skills in repo
13
Repo updated
First seen
Licence
MIT

At a glance

Test-Driven Development Iron Law. An agent skill from xenitV1/claude-code-maestro.

  • Works in 6 steps: RED - Write Failing Test → VERIFY RED - Watch It Fail → GREEN - Minimal Code → …
  • Tasks that involve Test-driven development
  • SKILL.md covers 🚨 THE IRON LAW, 🔴 RED-GREEN-REFACTOR CYCLE, 📋 GOOD TEST QUALITIES and 🚫 COMMON RATIONALIZATIONS…, plus 7 more sections
  • Calls npm, git and pytest

What it does

TDD Mastery is an agent skill from xenitV1/claude-code-maestro. Test-Driven Development Iron Law. Write the test first. Watch it fail. Write minimal code to pass. No exceptions.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `testing-anti-patterns.md`).

It sits in Testing & QA, covering Test-driven development. The licence is MIT.

When your agent uses it

  • Tasks that involve Test-driven development

Example prompts

  • “/tdd-mastery”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. RED - Write Failing Test
  2. VERIFY RED - Watch It Fail
  3. GREEN - Minimal Code
  4. VERIFY GREEN - Watch It Pass
  5. REFACTOR - Clean Up
  6. COMMIT

What it can do on your machine

Read from SKILL.md and the folder at commit 924315b. 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

    Shell commands in SKILL.md call:

    • npm
    • git
    • pytest

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

  • Network

    No URLs in SKILL.md. Its commands use npm and git, which can reach the network depending on how they are called.

    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 Mastery loads about 2.2k tokens when it runs. Until then it costs about 31 tokens; SKILL.md has 800 words of instructions outside code blocks.

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

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 xenitV1/claude-code-maestro at commit 924315b, republished under its MIT licence (© xenitV1). 800 words, ~2,169 tokens.

Download SKILL.mdSave it as .claude/skills/tdd-mastery/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
tdd-mastery
description
Test-Driven Development Iron Law. Write the test first. Watch it fail. Write minimal code to pass. No exceptions.

<domain_overview>

🧪 TDD MASTERY: THE IRON LAW

Philosophy: If you didn't watch the test fail, you don't know if it tests the right thing. TDD is not optional—it's the foundation of trustworthy code. TEST-FIRST INTEGRITY MANDATE (CRITICAL): Never write production code before a test exists and has been seen failing. AI-generated code often attempts to write implementation and tests simultaneously or implementation first. You MUST strictly adhere to the Red-Green-Refactor cycle. Any code submitted without a preceding failing test or that generates tests after the implementation must be rejected as "Legacy Code on Arrival".


🚨 THE IRON LAW

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Write code before the test? Delete it. Start over.

No exceptions:

  • Don't keep it as "reference"
  • Don't "adapt" it while writing tests
  • Don't look at it
  • Delete means delete

Implement fresh from tests. Period. </domain_overview> <core_workflow>

🔴 RED-GREEN-REFACTOR CYCLE

Phase 1: RED - Write Failing Test

Write one minimal test showing what should happen.

Good Example:

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

  const result = await retryOperation(operation);

  expect(result).toBe('success');
  expect(attempts).toBe(3);
});

Clear name, tests real behavior, one thing

Bad Example:

typescript
test('retry works', async () => {
  const mock = jest.fn()
    .mockRejectedValueOnce(new Error())
    .mockResolvedValueOnce('success');
  await retryOperation(mock);
  expect(mock).toHaveBeenCalledTimes(2);
});

Vague name, tests mock not code

Requirements:

  • One behavior per test
  • Clear, descriptive name
  • Real code (mocks only if unavoidable)
Phase 2: VERIFY RED - Watch It Fail

MANDATORY. Never skip.

bash
npm test path/to/test.test.ts
# or
pytest tests/path/test.py::test_name -v

Confirm:

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

Test passes? You're testing existing behavior. Fix test.

Test errors? Fix error, re-run until it fails correctly.

Phase 3: GREEN - Minimal Code

Write simplest code to pass the test.

Good:

typescript
async function retryOperation<T>(fn: () => Promise<T>): Promise<T> {
  for (let i = 0; i < 3; i++) {
    try {
      return await fn();
    } catch (e) {
      if (i === 2) throw e;
    }
  }
  throw new Error('unreachable');
}

Just enough to pass

Bad:

typescript
async function retryOperation<T>(
  fn: () => Promise<T>,
  options?: {
    maxRetries?: number;
    backoff?: 'linear' | 'exponential';
    onRetry?: (attempt: number) => void;
  }
): Promise<T> {
  // YAGNI - You Aren't Gonna Need It
}

Over-engineered

Don't add features, refactor other code, or "improve" beyond the test.

Phase 4: VERIFY GREEN - Watch It Pass

MANDATORY.

bash
npm test path/to/test.test.ts

Confirm:

  • Test passes
  • Other tests still pass
  • Output pristine (no errors, warnings)

Test fails? Fix code, not test.

Other tests fail? Fix now.

Phase 5: REFACTOR - Clean Up

After green only:

  • Remove duplication
  • Improve names
  • Extract helpers

Keep tests green. Don't add behavior.

Phase 6: COMMIT
bash
git add tests/path/test.ts src/path/file.ts
git commit -m "feat: add specific feature with tests"

Repeat for next behavior.


</core_workflow>

<quality_standards>

📋 GOOD TEST QUALITIES

QualityGoodBad
MinimalOne thing. "and" in name? Split it.test('validates email and domain and whitespace')
ClearName describes behaviortest('test1')
Shows intentDemonstrates desired APIObscures what code should do
Real behaviorTests actual codeTests mock behavior

🚫 COMMON RATIONALIZATIONS (ALL INVALID)

ExcuseReality
"Too simple to test"Simple code breaks. Test takes 30 seconds.
"I'll test after"Tests passing immediately prove nothing.
"Already manually tested"Ad-hoc ≠ systematic. No record, can't re-run.
"Deleting X hours is wasteful"Sunk cost fallacy. Keeping unverified code is debt.
"Keep as reference"You'll adapt it. That's testing after. Delete means delete.
"Need to explore first"Fine. Throw away exploration, start with TDD.
"Test hard = skip test"Hard to test = hard to use. Simplify design.
"TDD will slow me down"TDD faster than debugging. Pragmatic = test-first.
"Existing code has no tests"You're improving it. Add tests for existing code.

Show full SKILL.md (340 more words)Show less

🚨 RED FLAGS - STOP AND START OVER

If you catch yourself:

  • Writing code before test
  • Test passes immediately
  • Can't explain why test failed
  • Tests added "later"
  • "Just this once"
  • "I already manually tested it"
  • "Keep as reference"
  • "TDD is dogmatic, I'm being pragmatic"

ALL of these mean: Delete code. Start over with TDD.


</quality_standards>

<bug_fix_protocol>

🐛 BUG FIX WORKFLOW

Bug found? Write failing test reproducing it. Follow TDD cycle.

Example:

Bug: Empty email accepted

RED:
test('rejects empty email', async () => {
  const result = await submitForm({ email: '' });
  expect(result.error).toBe('Email required');
});

VERIFY RED:
$ npm test
FAIL: expected 'Email required', got undefined

GREEN:
function submitForm(data: FormData) {
  if (!data.email?.trim()) {
    return { error: 'Email required' };
  }
  // ...
}

VERIFY GREEN:
$ npm test
PASS

Never fix bugs without a test.


</bug_fix_protocol>

<integration_and_tooling>

🔗 RALPH WIGGUM INTEGRATION

When Ralph Wiggum is active:

  1. Before ANY implementation: Write failing test first
  2. Proactive Gate: Check edge cases BEFORE coding (use TDD to cover them)
  3. Reflection Loop: After implementation, verify RED-GREEN was followed
  4. Verification Matrix: Track test coverage for each feature

Ralph Wiggum will REJECT:

  • Code without corresponding tests
  • Tests that were written after code
  • Tests that pass without implementation

✅ VERIFICATION CHECKLIST

Before marking work complete:

  • Every new function/method has a test
  • Watched each test fail before implementing
  • Each test failed for expected reason (feature missing, not typo)
  • Wrote minimal code to pass each test
  • All tests pass
  • Output pristine (no errors, warnings)
  • Tests use real code (mocks only if unavoidable)
  • Edge cases and errors covered

Can't check all boxes? You skipped TDD. Start over.


🛠️ TESTING INFRASTRUCTURE

Stack Detection & Tool Setup

Auto-detect project type and setup appropriate tools:

Project TypeRequired Tools
Frontend (Vite/React)vitest + playwright
Fullstack (Next.js)vitest + playwright
Backend (Node)vitest or jest
Pythonpytest + pytest-cov
MicroservicesMSW (Mock Service Worker)
Test Coverage Rules

For every new function/component, generate:

  • 1 Happy Path - Expected successful behavior
  • 2 Edge Cases - Boundary conditions, invalid inputs
  • 1 Error Case - Expected failure handling
Contract-First (MSW)

Rule: Every frontend-backend interaction MUST have an MSW handler.

typescript
// Example MSW handler
import { http, HttpResponse } from 'msw'

export const handlers = [
  http.get('/api/users/:id', ({ params }) => {
    return HttpResponse.json({
      id: params.id,
      name: 'Test User'
    })
  })
]

Benefit: Decouples frontend development from backend availability.

Ghost Inspector Protocol

AI must scan for "Untested Logic Slabs" (>20 lines without coverage) and flag them:

bash
# Check coverage gaps
npm run test -- --coverage
# Look for files with <80% coverage

</integration_and_tooling>

<reference_and_audit>

  • @testing-anti-patterns.md - Common mock/test mistakes to avoid
  • @clean-code - Code quality standards
  • @verification-mastery - Evidence before completion claims
  • @debug-mastery - When tests reveal bugs

🏁 FINAL RULE

Production code → test exists and failed first
Otherwise → not TDD

No exceptions without explicit user permission. </reference_and_audit>

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

Files

SKILL.md and 1 other file in skills/tdd-mastery of xenitV1/claude-code-maestro.

  • SKILL.md
  • testing-anti-patterns.md

Open the folder on GitHubat commit 924315b

Compare with similar skills

TDD Mastery 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 Mastery compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
TDD Mastery this skillxenitV1/claude-code-maestro229—~2.2kAutomated 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 yesterday
    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…

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

More from xenitV1/claude-code-maestro

All 13 skills in this repo
  • Clean Code

    xenitV1/claude-code-maestro

    The Foundation Skill. An agent skill from xenitV1/claude-code-maestro.

    229 GitHub stars~1.5k tokensUpdated 8 mo ago
    Auto-check passed
  • Ralph Wiggum

    xenitV1/claude-code-maestro

    Surgical Debugger & Code Optimizer. An agent skill from xenitV1/claude-code-maestro.

    229 GitHub stars~795 tokensUpdated 8 mo ago
    Auto-check: notes
  • Backend Design

    xenitV1/claude-code-maestro

    Elite Tier Backend standards, including Vertical Slice Architecture, Zero Trust Security, and High-Performance API protocols.

    229 GitHub stars~2.1k tokensUpdated 8 mo ago
    Auto-check: notes
  • Brainstorming

    xenitV1/claude-code-maestro

    Design-first methodology. An agent skill from xenitV1/claude-code-maestro.

    229 GitHub stars~2k tokensUpdated 8 mo ago
    Auto-check passed
  • Browser Extension

    xenitV1/claude-code-maestro

    Master specialized skill for building 2025/2026-grade browser extensions.

    229 GitHub stars~1.2k tokensUpdated 8 mo ago
    Auto-check: notes
  • Debug Mastery

    xenitV1/claude-code-maestro

    Systematic debugging methodology with 4-phase process, root cause tracing, and elite observability standards.

    229 GitHub stars~2.5k tokensUpdated 8 mo ago
    Auto-check: notes

Categories

Questions about TDD Mastery

What does TDD Mastery do?

Test-Driven Development Iron Law. An agent skill from xenitV1/claude-code-maestro. TDD Mastery is an agent skill from xenitV1/claude-code-maestro. Test-Driven Development Iron Law.

When should I use TDD Mastery?

TDD Mastery fits situations like: tasks that involve Test-driven development.

How do I install TDD Mastery in Claude Code?

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

How do I install TDD Mastery in Codex?

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

Can I use TDD Mastery 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 xenitV1/claude-code-maestro --skill tdd-mastery -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-mastery, .gemini/skills/tdd-mastery, .github/skills/tdd-mastery and .opencode/skills/tdd-mastery in your project.

What does TDD Mastery need to run?

Going by SKILL.md and its folder, TDD Mastery needs the command-line tools its instructions call (npm, git and pytest).

Does TDD Mastery access the network?

SKILL.md contains no URLs. Its commands use npm and git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is TDD Mastery 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 Mastery use?

TDD Mastery 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 Mastery use?

About 2.2k tokens (SKILL.md is roughly 8.7k 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 Mastery?

Skills that share tags, products or a category with TDD Mastery: 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 Mastery?

xenitV1 (a GitHub user) maintains it in xenitV1/claude-code-maestro, which has 229 GitHub stars. The repository holds 13 skills in this directory. The repository was last updated on January 24, 2026.

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