tdd-workflow

Enforce a pytest-based Red-Green-Refactor TDD workflow with Ruff and MyPy checks.

3|5|Updated Dec 19, 2025
One-click install
npx skills add https://github.com/drillan/note-mcp --skill tdd-workflow-drillan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/drillan/note-mcp/tree/main/.claude/skills/tdd-workflow
Command: npx skills add https://github.com/drillan/note-mcp --skill tdd-workflow-drillan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces the Test-Driven Development (TDD) workflow, guiding teams through a Red-Green-Refactor cycle to improve code quality and reliability.

Core Features & Use Cases

  • Phase-based TDD cycle: Red (write failing tests) → Green (make tests pass) → Refactor (improve while keeping tests green).
  • Test-first prompts: Encourages creating tests before implementing functionality.
  • Quality gates: Integrates subsequent lint/type checks after green.

Quick Start

Start a new feature with a Red-Green-Refactor cycle: request test cases first, then implement minimally to pass them.

Frequently Asked Questions about tdd-workflow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce test-first development in my project?

Test-first development enforces writing tests before implementation code. This Skill guides you through the Red-Green-Refactor cycle: write failing tests first (Red), implement minimal code to pass them (Green), then refactor while keeping tests passing. It auto-starts the workflow and includes pytest-based checks with Ruff linting and MyPy type validation.

What is the Red-Green-Refactor cycle and when should I use it?

Red-Green-Refactor is a TDD pattern: Red (write a failing test), Green (write minimal code to pass it), Refactor (improve code quality without breaking tests). Use it when starting new features, fixing bugs, or refactoring existing code. This Skill enforces the full cycle to maintain code quality and test coverage throughout development.

Can I use this workflow with pytest and type checking?

Yes. This Skill implements a pytest-based workflow that integrates Ruff for linting and MyPy for type checking. It follows test-file conventions like tests/test_<name>.py and runs quality gates after tests pass, ensuring code meets both functional and static analysis standards.

How do I set up test files for a TDD workflow?

This Skill enforces test-file conventions matching your implementation files—for example, tests/test_<name>.py for src/<name>.py. It guides test creation before implementation and requires explicit approval before advancing phases, ensuring intentional test design and coverage.

What are the limitations of enforcing TDD from the start?

TDD works best for feature development, bug fixes, and refactoring where requirements are clear. It may slow initial exploration or prototyping. This Skill requires an explicit approval gate between phases; teams must commit to the discipline for it to be effective.

Does this Skill work for bug fixes and refactoring, or only new features?

This Skill applies to new features, bug fixes, and refactoring equally. For any task, it guides test creation first, ensures tests pass, then validates code quality. The Red-Green-Refactor cycle maintains existing test coverage while improving or fixing code.