implementing-with-tdd

Automate TDD bug fixes and features with pytest red-green-refactor workflows.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/BPSAI/paircoder --skill implementing-with-tdd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: implementing-with-tdd
Source: https://github.com/BPSAI/paircoder/tree/main/tools/cli/bpsai_pair/data/cookiecutter-paircoder/{{cookiecutter.project_slug}}/.claude/skills/implementing-with-tdd
Command: npx skills add https://github.com/BPSAI/paircoder --skill implementing-with-tdd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It enforces a test-first workflow to drive design, implementation, and verification before code changes are committed.

Core Features & Use Cases

  • TDD cycle: RED, GREEN, REFACTOR for each feature.
  • Test placement: Write tests first in the project’s tests folder.
  • Incremental implementation: Implement just enough to pass tests, then refactor.

Quick Start

Write a failing test, run it red, then implement code to pass green, and refactor.

Frequently Asked Questions about implementing-with-tdd

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

FAQPage Schema
How do I implement features using test-driven development with pytest?

Test-driven development with pytest follows a red-green-refactor cycle: write failing tests first in tests/test_<module>.py, run pytest to confirm they fail red, implement code in tools/cli/bpsai_pair/ to pass green, then refactor for clarity while keeping tests passing.

What's the best way to structure tests before writing implementation code?

Place tests in tests/test_<module>.py following the project's naming convention, mock external services to isolate units, then run pytest in verbose mode. This enforces test-first design and ensures your implementation satisfies functional and technical requirements from the start.

Can I use TDD to fix bugs and add features in Python projects?

Yes. TDD applies to both bug fixes and new features in Python projects using pytest. Write a failing test that reproduces the bug or specifies the feature, implement the minimal fix, run tests again, and refactor—this drives correctness and prevents regressions.

Why should I write tests before implementation code?

Writing tests first clarifies requirements, drives better design decisions, and catches issues early. The red-green-refactor workflow ensures your code satisfies specifications before refactoring, reducing bugs and technical debt.

How do I know when my TDD implementation is complete?

Implementation is complete when all tests pass green, you've refactored for clarity, and you've satisfied the functional and technical requirements. Use managing-task-lifecycle commands to finalize and commit changes once the full cycle is done.