Skip to content
bobmatnyc avatar

Test Driven Development

Language-agnostic TDD guide covering red-green-refactor, test structure, mocking, and coverage targets for any stack.

CCM score
47 of 100
skills.sh installs
421
GitHub stars
79
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the red-green-refactor workflow, AAA and Given-When-Then structures, and test naming conventions
  • Includes examples in Python (pytest), JavaScript (Jest), and Go, plus unit, integration, and end-to-end test scopes
  • Explains when to use stubs, mocks, and fakes, with coverage targets of 80% overall and 100% on critical paths
  • Designed for agents writing tests or implementing features and bug fixes test-first

Install

$ npx -y skills add bobmatnyc/claude-mpm-skills --skill test-driven-development -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Test-Driven Development (TDD)

Comprehensive TDD patterns and practices for all programming languages. This skill eliminates ~500-800 lines of redundant testing guidance per agent.

When to Use

Apply TDD for:

  • New feature implementation
  • Bug fixes (test the bug first)
  • Code refactoring (tests ensure behavior preservation)
  • API development (test contracts)
  • Complex business logic

TDD Workflow (Red-Green-Refactor)

1. Red Phase: Write Failing Test

Write a test that:
- Describes the desired behavior
- Fails for the right reason (not due to syntax errors)
- Is focused on a single behavior

2. Green Phase: Make It Pass

Write the minimum code to:
- Pass the test
- Not introduce regressions
- Follow existing patterns

3. Refactor Phase: Improve Code

While keeping tests green:
- Remove duplication
- Improve naming
- Simplify logic
- Extract functions/classes

Test Structure Patterns

Arrange-Act-Assert (AAA)

// Arrange: Set up test data and conditions
const user = createTestUser({ role: 'admin' });

// Act: Perform the action being tested
const result = await authenticateUser(user);

Details

Repository
github.com/bobmatnyc/claude-mpm-skills
Categories
Testing & QA, Agent Workflow & Planning
First seen
Jun 3, 2026

Questions

What is the test-driven-development skill for?

It gives the agent TDD patterns and practices that apply to all programming languages. It covers the red-green-refactor workflow, test structure such as Arrange-Act-Assert, naming conventions, unit, integration and end-to-end test types, and mocking.

How do I install the test-driven-development skill?

Run npx -y skills add bobmatnyc/claude-mpm-skills --skill test-driven-development -y in your project. Once installed, the agent can follow these TDD practices when writing or changing tests.

Which skills lead the Testing & QA category, and where does this one stand?

This skill is in the Testing & QA category alongside tdd, migrate-to-shoehorn, webapp-testing and break-ui. Its focus is on general TDD practice across languages rather than tooling for one framework.

Who is test-driven-development for?

It suits developers who want an agent to write tests before code, for new features, bug fixes, refactoring or API work. Its guidance includes what to test and what to skip, plus anti-patterns such as fragile tests and slow unit tests.

More from bobmatnyc/claude-mpm-skills

All 154

Similar to Test Driven Development

More Testing & QA