tdd

Guides Python/pytest developers through Red-Green-Refactor cycles with FIRST principles and mocking techniques.

Updated Dec 22, 2025
One-click install
npx skills add https://github.com/senior-sigan/llm-skills --skill tdd-senior-sigan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/senior-sigan/llm-skills/tree/main/skills/tdd
Command: npx skills add https://github.com/senior-sigan/llm-skills --skill tdd-senior-sigan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Practicing Test-Driven Development (TDD) helps teams design robust software by writing failing tests first, then implementing minimal code to pass, and continuously refactoring to improve design without changing behavior.

Core Features & Use Cases

  • Guided Red-Green-Refactor cycles to reinforce FIRST principles (Fast, Isolated, Repeatable, Self-validating, Timely).
  • Practical workflows with pytest, fixtures, and mock patterns for real-world projects.
  • Use Case: A developer practicing TDD in a new feature sketch, quickly validating API design and preventing over-engineering.

Quick Start

Run the simplest red test first, then implement minimal code to pass, and refactor for clarity.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I practice test-driven development with pytest in Python?

Test-driven development is a cycle where you write a failing test, implement minimal code to pass it, and refactor for clarity. This Skill guides you through pytest workflows including fixtures and mock patterns to reinforce the Red-Green-Refactor cycle.

What are the FIRST principles in test-driven development?

FIRST principles in test-driven development require tests to be Fast, Isolated, Repeatable, Self-validating, and Timely. This Skill guides you to apply these principles during your Red-Green-Refactor cycles to prevent over-engineering and validate API design.

How do I use fixtures and mocks during a Red-Green-Refactor cycle?

Fixtures and mocks are used during the Red-Green-Refactor cycle to isolate tests and validate API design. This Skill provides practical workflows for applying mock patterns and pytest fixtures to ensure tests remain isolated and repeatable in real-world projects.

Can I use this test-driven development workflow for small to medium Python features?

Yes, this test-driven development workflow is designed for individual developers and teams building small to medium Python features. It supports creating software with pytest, helping you quickly validate API design and write reliable test cycles.

How do I run Pants-based tests for my TDD workflow?

Pants-based test runs are supported within the TDD workflow to maintain fast and reliable test cycles. This Skill provides guidance on executing these runs alongside pytest while practicing the Red-Green-Refactor methodology.

What TDD anti-patterns should I avoid when writing pytest tests?

When writing pytest tests, you should avoid TDD anti-patterns that break isolation or repeatability. This Skill guides you in preventing over-engineering and maintaining clean design by adhering to FIRST principles throughout the refactoring phase.