Skip to content
Back to skills

Python3 Tdd

ASecurity

Use when a Python task explicitly requires test-driven development, tests-first implementation, or a red-green-refactor workflow.

  • 67 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 12, 2026
testingpythonbashexpresstesting

Security analysis

A100/100

Scanned September 29, 2026

npx -y skills add Jamie-BitFlight/claude_skills --skill python3-tdd --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python3 Tdd?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python3 Tdd
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jamie-bitflight-python3-tdd/badge)](https://www.skillsdirectory.com/skills/jamie-bitflight-python3-tdd)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: python3-tdd
description: Use when a Python task explicitly requires test-driven development, tests-first implementation, or a red-green-refactor workflow.
argument-hint: '<feature-description>'
user-invocable: true
---

# TDD Workflow

Consult `standards-for-python-development` for the shared rules. Load `python3-testing` for detailed test patterns.

## Input

Task: $ARGUMENTS

## Phases

### 1. Design Interface

- Define only the interface needed to express the behavior under test
- Preserve the project's existing architecture and typing conventions
- Load `python3-typing` when boundary types or models are involved

### 2. Write Failing Tests

- Load `python3-testing` for fixture patterns and test structure
- Tests must fail initially (RED)
- AAA pattern; behavioral naming
- Run the smallest relevant pytest target and confirm RED
- Record the expected failure reason before running it; RED is valid only when the observed failure demonstrates the missing behavior. A syntax/import/fixture failure or a test that already passes does not establish the requirement.

### 3. Implement to Pass

- Minimal code to make tests pass (GREEN)
- Run the smallest relevant pytest target after each change and compare the observed result with the expected GREEN result
- Refactor only while tests stay green

### 4. Verify

```bash
# Linting, formatting, and type checking
uv run prek run --files src/ tests/
# Fallback when no .pre-commit-config.yaml:
# uv run ruff check src/ tests/
# uv run ruff format --check src/ tests/

# Tests with coverage
uv run pytest --cov=src --cov-report=term-missing
```

### 5. Quality Gate

- [ ] All tests pass
- [ ] No lint errors
- [ ] No type errors
- [ ] Changed behavior, boundaries, and regressions have appropriate tests
- [ ] Existing project coverage gate is respected, if configured
- [ ] Shebang validated on scripts

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…