Guides the Red-Green-Refactor testing cycle to ensure high-quality, fully covered Python code.
Install
mkdir -p .claude/skills/tdd-dirkste && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15938" && unzip -o skill.zip -d .claude/skills/tdd-dirkste && rm skill.zipInstalls to .claude/skills/tdd-dirkste
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
tdd — an agent skill by dirkste.Key capabilities
- →Analyze user requests to write failing tests
- →Implement minimal code to make tests pass
- →Optimize code for readability and PEP 8 compliance
- →Ensure 100% code coverage with `pytest --cov`
- →Follow naming conventions for tests
- →Include docstrings for new functions
How it works
The skill automates the Red-Green-Refactor cycle by first writing a failing test, then implementing minimal code to pass the test, and finally refactoring while maintaining test success and 100% coverage.
Inputs & outputs
When to use tdd
- →Implementing new features via TDD
- →Ensuring test coverage
- →Refactoring code safely
About this skill
Python TDD Practitioner
Description: Automates the Red-Green-Refactor cycle with strict coverage enforcement.
Metadata
- ID: python-tdd
- Version: 1.0.0
- Context: Python, pytest, pytest-cov
Instructions
- Red Phase:
- Analyze the user's request.
- Write a failing test in the ests/ directory.
- Run pytest to confirm failure (exit code != 0).
- Green Phase:
- Implement the minimal code in the source file.
- Run pytest to confirm success (exit code 0).
- Refactor Phase:
- Optimize for readability and PEP 8.
- Ensure tests stay green.
Definition of Done (DoD)
- All tests pass.
- Code Coverage is 100% (use pytest --cov).
- Naming follows est_should_[action]when[condition].
- Docstrings included for new functions.
When not to use it
- →When not using Python for development
- →When not adhering to the Test-Driven Development (TDD) cycle
- →When not using `pytest` or `pytest-cov`
Prerequisites
Limitations
- →Specific to Python projects
- →Requires `pytest` and `pytest-cov` for execution and coverage checks
- →Enforces strict naming conventions for tests
How it compares
This workflow strictly enforces the TDD cycle with coverage requirements, providing a disciplined and automated approach to development that ensures code quality and testability from the outset, unlike traditional development.
Compared to similar skills
tdd side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| tdd (this skill) | 0 | 5mo | No flags | Intermediate |
| migrate | 1 | 5mo | Review | Intermediate |
| agent-implementer-sparc-coder | 1 | 6mo | Review | Intermediate |
| tdd-migrate | 1 | 7mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
migrate
alirezarezvani
Migrate from Cypress or Selenium to Playwright. Use when user mentions "cypress", "selenium", "migrate tests", "convert tests", "switch to playwright", "move from cypress", or "replace selenium".
agent-implementer-sparc-coder
ruvnet
Agent skill for implementer-sparc-coder - invoke with $agent-implementer-sparc-coder
tdd-migrate
parcadei
TDD workflow for migrations - orchestrate agents, zero main context growth
py-refactor
vndee
Use when refactoring Python code, cleaning up legacy codebases, optimizing performance, enforcing type safety, or improving clean architecture in a FastAPI backend
kaizen
Peadarpol
Guide for continuous improvement, error proofing (Poka-Yoke), and standardization. Use this skill when the user wants to improve code quality, refactor, or discuss process improvements.
python-code-implementation-workflow
NatLabRockies
Implement and refactor Python code with TDD, API signature discipline, and maintainable design. Use for feature development, bug fixes, test-first workflows, and quality-focused refactoring.