test-driven-development

Enforce test-driven development with failing tests before Python code changes using pytest.

4|3|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/bragabarreto/pjecalc-agente --skill test-driven-development-bragabarreto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/bragabarreto/pjecalc-agente/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/bragabarreto/pjecalc-agente --skill test-driven-development-bragabarreto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide helps teams adopt test-driven development (TDD) practices, ensuring software requirements are validated by tests before implementation, reducing defects and ambiguity.

Core Features & Use Cases

  • Define tests before coding to guide design and keep feature goals visible.
  • Identify and avoid common TDD anti-patterns, promoting incremental refactoring.
  • Integrate with pytest-based workflows and an existing test suite to validate changes quickly.

Quick Start

Write a failing test for the new feature, then implement the minimal code to pass it.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I use test-driven development to fix bugs in a Python project?

Test-driven development for bug fixes requires writing a failing pytest test that reproduces the bug before changing any code. You then implement the minimal code changes to make the failing test pass, validating the fix.

What is the red-green-refactor cycle in pytest?

The red-green-refactor cycle is a test-driven development process where you write a failing pytest test, implement the minimal code to pass it, and then incrementally refactor the code while keeping tests green.

How do I start writing tests before coding for a new feature?

To start writing tests before coding, define a failing test that specifies the new feature requirements, then implement the minimal code changes needed to make that test pass.

Can I integrate test-driven development into an existing pytest test suite?

Yes, test-driven development integrates with existing pytest workflows by adding new failing tests for features or bug fixes alongside your current suite, ensuring quick validation of incremental code changes.

What are common test-driven development anti-patterns to avoid?

Common test-driven development anti-patterns involve skipping the failing test step or writing excessive code before testing, which increases ambiguity and defects. Adopting incremental refactoring helps avoid these issues.

Do I need pytest to apply test-driven development practices?

Yes, this specific test-driven development guide is designed for Python projects using pytest to drive the cycle from failing tests to passing code for features and bug fixes.