smithery/greyhaven-ai

tdd-python

Python Test-Driven Development expertise with pytest, strict red-green-refactor methodology, domain-first modeling (DDD), principled DRY discipline, FastAPI testing patterns, and Pydantic model testing. Use when implementing Python features with TDD, writing pytest tests, testing FastAPI endpoints, developing with test-first approach, modeling domain concepts, refactoring duplication, or when user mentions 'Python TDD', 'pytest', 'FastAPI testing', 'red-green-refactor', 'Python unit tests', 'te…

Installation

$ npx skills add smithery/greyhaven-ai --skill grey-haven-tdd-python

Summary

  • Python Test-Driven Development expertise with pytest, strict red-green-refactor methodology, domain-first modeling (DDD), principled DRY discipline, FastAPI testing patterns, and Pydantic model testing.
  • Use when implementing Python features with TDD, writing pytest tests, testing FastAPI endpoints, developing with test-first approach, modeling domain concepts, refactoring duplication, or when user mentions 'Python TDD', 'pytest', 'FastAPI testing', 'red-green-refactor', 'Python unit tests', 'test-driven Python', 'domain modeling', 'value object', 'ubiquitous language', 'DRY', or 'Python test coverage'.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/greyhaven-ai · top by installs.

npx skills add smithery/greyhaven-ai

Browse all from smithery/greyhaven-ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Allowed toolsRead, Write, MultiEdit, Bash, Grep, Glob, TodoWrite

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,846 B
  • docs SUMMARY.md 466 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

TDD Python Skill

Python Test-Driven Development following strict red-green-refactor cycle with pytest — sharpened by DDD at Red (model the domain first) and DRY at Refactor (deduplicate same-concept repetition only).

Description

Systematic Python implementation using TDD methodology. Tests are written first and drive design; domain vocabulary drives the tests; duplication is removed only when the same concept repeats, not when syntax coincidentally looks alike.

Discipline Layering

  • Before Red — Model the Domain: Name the entity, value object, or aggregate in the business's language. Decide entity vs. value object. Reject primitive obsession — wrap str/int in EmailAddress, Money, NewType, or pydantic.BaseModel when they carry rules. Keep domain logic out of FastAPI routes.
  • Red: Write a failing test. Name it in domain terms (testrejectsrefundwhenamountexceedsdailylimit) — never mechanical (testreturns_false).
  • Green: Minimal code to pass. No speculative abstractions.
  • Refactor — DRY with discipline: Deduplicate only when the same domain concept appears ≥3 times with the same meaning. Three similar lines beats a premature abstraction. Promote recurring primitives to value objects. When uncertain, inline.

What's Included

  • Examples: Python TDD cycles, FastAPI TDD, Pydantic model TDD, value-object modeling
  • Reference: pytest patterns, Python testing best practices, branded-type idioms (NewType, frozen=True)
  • Templates: pytest templates, TDD workflows

Use When

  • Implementing Python features with TDD
  • Modeling domain concepts (entities, value objects, aggregates)
  • FastAPI endpoint development (keeping domain rules out of routes)
  • Pydantic model development
  • Refactoring duplication after a green test

Related Agents

  • tdd-python-implementer

Skill Version: 1.1