Skills DirectoryCurated open-source Skills from GitHub

tddcommit 3f59913SKILL.md · Testing & Debugging

Test-Driven Development

Builds features and fixes bugs test-first in a red-to-green loop, testing behavior only at public seams agreed with the user.

npx skills add mattpocock/skills --skill tdd
Permissions
  • read-repo
  • write-files
  • shell
  • network
Compatible with
Claude Code, Codex, Copilot, Gemini CLI
GitHub
308.7k
Source
Community · Matt Pocock
Status
Scan passed
License
MIT

Core rule

Red before green: write the failing test first, then only enough code to pass it.

Execution Phases

  1. Phase 01Learn the domain language

    Read GLOSSARY.md if it exists so test names match the project's language, and respect ADRs in the area.

  2. Phase 02Agree on the seams

    Write down the seams under test, each with a one-line note on what it catches and misses, and confirm them with the user.

  3. Phase 03Write one failing test

    Test behavior through the public interface at one seam, with expected values from an independent source of truth.

  4. Phase 04Minimal implementation

    Write only enough code to pass the test, without anticipating future tests or adding speculative features.

  5. Phase 05Repeat in vertical slices

    Repeat one test and one implementation per cycle; refactoring is not part of the loop and belongs to the code review stage.

Permissions (summarised from SKILL.md)

CapabilityNeededDetails
File writesRequiredWrites tests and the implementation code that makes them pass.
Command executionTests onlyRuns tests to see them fail, then pass.
Network outboundNot requiredThe workflow has no network steps.

SKILL.md frontmatter (YAML)

SKILL.md frontmatter (YAML)commit 3f59913
---
name: tdd
description: Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
---

Related skills

A rule scan cannot catch every risk. Read this skill's SKILL.md and check its permissions before installing.