Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add acaprino/daodan --skill python-tddgit clone --depth 1 https://github.com/acaprino/daodanWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/acaprino/daodan/python-tdd)<a href="https://agentmods.dev/skills/acaprino/daodan/python-tdd"><img src="https://agentmods.dev/badge/skills/acaprino/daodan/python-tdd.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00081 | $0.02530 |
| Opus 5 | $0.00041 | $0.01265 |
| Sonnet 5 | $0.00016 | $0.00506 |
| Haiku 4.5 | $0.00008 | $0.00253 |
Grade A, and why
python-tdd scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
@patch("myapp.services.requests.get") # patch where USED (top-level import) How it starts
The opening of the file, as written. The whole thing — 285 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python Testing Patterns
Generate focused, behavior-driven tests with pytest. Prioritize observable behavior over implementation details. For framework configuration (pyproject.toml, plugins, CI), see references/framework-config.md. For deep conftest patterns and heavy-dep mocking, see references/pytest-infrastructure.md. For full TDD discipline, see references/tdd-best-practices.md.
1. Test Philosophy
What to test
- Observable behavior and return values
- User-facing workflows and API contracts
- Edge cases and error handling at system boundaries
- State transitions and side effects
- Data validation and transformation rules
What NOT to test
- Framework internals (pytest, SQLAlchemy, FastAPI mechanics)
- Implementation details (private methods, internal variable names)
- Third-party library behavior
- Simple utility functions with no branching logic
- That objects are truthy -- this asserts nothing useful
Mocking strategy
DO mock: External API calls / HTTP requests, database queries in unit tests, file system operations, time-dependent behavior (datetime.now, time.time), environment variables.
DON'T mock: Your own models and dataclasses, simple utility functions, the function under test itself, framework features you rely on.
Test count discipline
- Max 10 tests per file for simple modules.
- Max 15 tests per file for complex modules.
- More than that = the module is too complex; suggest splitting it.
2. TDD Workflow
Red-Green-Refactor
- RED -- write a failing test. Must fail for the right reason (NOT import error, NOT syntax error).
- GREEN -- write the minimal code to make it pass. No more.
- REFACTOR -- improve code while all tests stay green. No new behavior.
Coverage targets
| Priority | What | Target |
|---|---|---|
| P0 | Critical paths (auth, payments, data integrity) | 100% line + branch |
| P1 | Core business logic + public API | 90%+ line |
| P2 | Utilities, helpers, config | 80%+ line |
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 285 lines · 81 tokens per session scan A a4273d2d4ac6
python-tdd is a skill published in the GitHub repository acaprino/daodan (8 stars, last pushed yesterday), licensed MIT. It adds 81 tokens to every session and 2,530 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.
Other skills, from other repositories
python
Python development with ruff, mypy, pytest - TDD and type safety.
python-testing
A Python testing guide covering pytest, test coverage, and test-driven development (TDD), a method of writing a failing test before the code that makes it pass.
python-tdd-with-uv
Test-driven development in Python using uv as the package manager. Covers the red-green-refactor cycle, vertical slicing, and uv project setup.
test-generator
A generator that reads Python functions and creates pytest test-file skeletons with parameterized example inputs. Pytest is a Python testing tool, and TDD means writing tests as part of the implementation process.
python-tdd
Python development with TDD using pytest, type checking with mypy, and linting with ruff/black. Use when working on Python projects requiring test-driven development, quality gates, or Python code review. Do NOT use for other programming languages.
Unit Test Scaffold (Python/pytest)
Generate Python/pytest unit test skeletons from specifications.