
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.
- Installs
- 412
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/spencerpauly/awesome-cursor-skills --skill python-tdd-with-uv- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads python-tdd-with-uv automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Python TDD with uv
Write Python code test-first using uv for fast dependency and environment management.
Setting Up the Project
- Check if
uvis installed:uv --version - If the project doesn't have a
pyproject.toml, initialize:uv init - Add pytest as a dev dependency:
uv add --dev pytest pytest-cov - Confirm the test runner works:
uv run pytest --co
TDD Workflow — Vertical Slicing
Work in small cycles. Never write more than one failing test at a time.
Planning Phase
Before writing code, answer:
- What interface changes are needed? (functions, classes, APIs)
- Which behaviors matter most? (prioritize critical paths)
- Can we design for testability? (inject dependencies, avoid global state)
The Cycle
RED → Write ONE failing test for the next behavior
GREEN → Write the MINIMUM code to make it pass
REFACTOR → Clean up without changing behavior
REPEAT
Rules:
- Never write implementation before a failing test exists
- Never write more than one failing test at a time
- Run
uv run pytestafter every change - Tests must assert observable behavior, not implementation details
- Mocks should only be used at system boundaries (I/O, network, clock)
Test File Structure
# tests/test_<module>.py
class TestFeatureName:
"""Group related behaviors."""
def test_does_expected_thing_when_given_input(self):
result = function_under_test(input_value)
assert result == expected
def test_raises_when_given_invalid_input(self):
with pytest.raises(ValueError):
function_under_test(bad_input)
Running Tests
uv run pytest # all tests
uv run pytest tests/test_foo.py # single file
uv run pytest -k "test_name" # by name pattern
uv run pytest --cov=src # with coverage
uv run pytest -x # stop on first failure
uv Essentials
uv add <package> # add dependency
uv add --dev <package> # add dev dependency
uv remove <package> # remove dependency
uv sync # sync environment from lockfile
uv run <command> # run in managed environment
uv lock # regenerate lockfile
- Always use
uv runto execute commands — never activate venvs manually - Commit both
pyproject.tomlanduv.lock
References
- mattpocock/skills — TDD skill — vertical-slice TDD philosophy
- nizos/tdd-guard — automated TDD enforcement via hooks
- s2005/uv-skill — uv workflow patterns
FAQ
What does the python-tdd-with-uv skill do?
Test-driven development in Python using uv as the package manager. Covers the red-green-refactor cycle, vertical slicing, and uv project setup.
How do I install python-tdd-with-uv?
Run npx skills add https://github.com/spencerpauly/awesome-cursor-skills --skill python-tdd-with-uv in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/python-tdd-with-uv/ (personal) or .claude/skills/python-tdd-with-uv/ (project).
Which AI agents can use python-tdd-with-uv?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is python-tdd-with-uv safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains python-tdd-with-uv?
It is published by spencerpauly in spencerpauly/awesome-cursor-skills. It has 412 recorded installs.
More from spencerpauly/awesome-cursor-skills
visual-qa-testing
spencerpauly/awesome-cursor-skills
Visually QA a web application by launching it in Cursor's built-in browser, taking screenshots, checking console errors, and auditing network requests. Use after making UI changes to verify they look correct.
auditing-security
spencerpauly/awesome-cursor-skills
Perform a systematic security audit of a codebase, checking for OWASP Top 10 vulnerabilities, secrets exposure, and insecure patterns.
responsive-testing
spencerpauly/awesome-cursor-skills
Open the app in Cursor's browser at multiple viewport sizes, screenshot each, and report any layout breakage.
suggesting-cursor-rules
spencerpauly/awesome-cursor-skills
When the user repeats the same correction or convention multiple times, suggest a Cursor rule to encode it permanently.
systematic-debugging
spencerpauly/awesome-cursor-skills
Structured debugging methodology — reproduce, isolate, hypothesize, verify. Covers git bisect, binary search, logging, and minimal reproduction.
grinding-until-pass
spencerpauly/awesome-cursor-skills
Keep iterating on code changes until the tests pass, the build succeeds, or linting is clean. Runs in a tight loop of fix → run → check → repeat. Use when you want the agent to autonomously grind through test failures or build errors.
Popular testing & qa skills
tdd
mattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
grilling
mattpocock/skills
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
migrate-to-shoehorn
mattpocock/skills
Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.
run-train
lllllllama/rigorpilot-skills
Rigor Train skill for deep learning research repositories. Use when a documented or selected training command should be run conservatively for startup verification, short-run verification, full kickoff, or resume, with command, config, seed, log, checkpoint, status, and metric evidence written to standardized trainoutputs/. Do not use for environment setup, exploratory sweeps, speculative idea implementation, or end-to-end orchestration.
test-driven-development
obra/superpowers
Use when implementing any feature or bugfix, before writing implementation code
finishing-a-development-branch
obra/superpowers
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work