mcpbeat Sign in

Test Driven Development Skill for Claude

Use when implementing any feature or bugfix, before writing implementation code - write the test first, watch it fail, write minimal code to pass; ensures tests actually verify behavior by requiring failure first

967 tokens
context cost
SKILL.md, read when the skill is used
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
4 940
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/microsoft/FluidFramework --skill test-driven-development

What it tells the agent to use

found in the instruction text
Task spawns other agents

The instruction itself

5 sections, as written by the author

<required>

*CRITICAL* Add the following steps to your Todo list using TodoWrite:

  • Write failing tests (RED phase)
  • Create a subagent using the nori-task-runner to evaluate test quality.
  • Ensure that each test does not just test mocks. If it does, remove the test and try again.
  • Ensure each test does not test implementation detail. If it does, rewrite the test so that it tests boundary behavior.
  • Ensure each test does not test data structure format or types. If it does, remove the test and try again.
  • Ensure each test does not test for removed behavior. For example, if some behavior has been deprecated, do not write a test that simply confirms the behavior no longer works.
  • Evaluate if the test treats the interior of the test boundary as a blackbox. You should not know anything about interior variables, function calls, or control flow.
  • Verify the test fails due to the behavior of the application, and NOT due to the test.

<system-reminder>If you have more than one test that you need to write, you should write all of them before moving to the GREEN phase.</system-reminder>

  • Write the minimal amount of code necessary to make the test pass (GREEN phase)
  • Verify the test now passes due to the behavior of the application.
  • If you go through three loops without making progress, switch to running .claude/skills/creating-debug-tests-and-iterating
  • Refactor the code to clean it up.
  • Verify tests still pass.

</required>

RED - Write Failing Test

Write one minimal test showing what should happen.

<good-example>

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 foobar.retryOperation(operation);

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

Clear name, tests real behavior, one thing. Note that the tested operation is

imported -- this is a STRONG sign that this is testing something real.

</good-example>

<bad-example>

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

Vague name, tests mock not code

</bad-example>

Verify RED - Watch It Fail

npm test path/to/test.test.ts

Confirm:

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

GREEN - Minimal Code

Write simplest code to pass the test.

<good-example>

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

</good-example>

<bad-example>

async function retryOperation<T>(
  fn: () => Promise<T>,
  options?: {
    maxRetries?: number;
    backoff?: 'linear' | 'exponential';
    onRetry?: (attempt: number) => void;
  }
): Promise<T> {
  // YAGNI
}

Over-engineered

</bad-example>

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

Verify GREEN - Watch It Pass

npm test path/to/test.test.ts

Confirm:

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

REFACTOR - Clean Up

After green only:

  • Remove duplication
  • Improve names
  • Extract helpers

Keep tests green. Do not add behavior.

Other skills for the same job

different authors, same section of the catalogue
Test Driven Development
by w95
×9

Use when implementing any feature or bugfix, before writing implementation code

2.5k tokens
Test Driven Development
by ComeOnOliver
×2

Use when implementing any feature or bugfix, before writing implementation code - write the test first, watch it fail, write minimal code to pass; ensures tests actually verify behavior by requiring failure first

2.4k tokens
Writing Skills
by ComeOnOliver
×1

Use when creating new skills, editing existing skills, or verifying skills work before deployment - applies TDD to process documentation by testing with subagents before writing, iterating until bulletproof against rationalization

5.2k tokens
Writing Tests
by remotion-dev
vendor

Rules for writing and reviewing tests in the Remotion repository. Use whenever adding, editing, or reviewing tests, especially for Studio UI, rendering, CLI, server, media, and cross-package changes, to prefer complete integration workflows over narrow helper tests and implementation details.

3.5k tokens
Ad Model Onboard
by NVIDIA
vendor

> Translates a HuggingFace model into a prefill-only AutoDeploy custom model using reference custom ops, validates with hierarchical equivalence tests.

8.2k tokens
Ad Model Onboard
by NVIDIA
vendor

Translates a HuggingFace model into a prefill-only AutoDeploy custom model using reference custom ops, validates with hierarchical equivalence tests.

8.1k tokens
Angular Architect
by Jeffallan

Generates Angular 17+ standalone components, configures advanced routing with lazy loading and guards, implements NgRx state management, applies RxJS patterns, and optimizes bundle performance. Use when building Angular 17+ applications with standalone components or signals, setting up NgRx stores, establishing RxJS reactive patterns, performance tuning, or writing Angular tests for enterprise apps.

1.5k tokens
Rails Dev
by tech-leads-club

Opinionated Rails conventions: rich models, concerns, CRUD-everything, state-as-records, minimal dependencies, Minitest with fixtures. Load this skill BEFORE any code-level thinking, not only before editing a file. It is required the moment a task touches Rails code in ANY way: designing or even just discussing a data model, schema, migration, entity, association, field, validation, class, or method name; writing, planning, reviewing, analyzing, testing, debugging, or refactoring; or proposing any model, table, column, route, or code snippet inline in chat. If you are about to name a model or sketch a column you are already in scope, even in an exploratory back-and-forth where no file is written yet. Do not let a \"we're just discussing\" framing defer it. Do NOT use for non-Rails backends, NestJS, or general architecture (use nestjs-modular-monolith or coding-guidelines).

2.2k tokens

How to use it

Copy the folder

Take microsoft/test-driven-development from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.