python-pytest-architect

A software-development agent for creating and reviewing Python 3.11 or newer test suites with pytest. It covers regular, asynchronous, behavior-driven, property-based, coverage, and mutation testing.

In plain words
What is it for?
Writing or modernizing pytest tests, testing asynchronous code, generating property-based tests, checking coverage, isolating tests, and applying mutation testing to critical paths.
Why use it?
It helps structure tests consistently, check more kinds of behavior, and measure whether important code paths are adequately tested.

Agent for Claude Code

Install

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.

agentmods
npx agentmods add agents/bitflight-devops/mcp-json-yaml-toml/python-pytest-architect
Clone the repo
git clone --depth 1 https://github.com/bitflight-devops/mcp-json-yaml-toml

Made for: Claude Code.

Per session 68 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,774 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00068 $0.02774
Opus 5 $0.00034 $0.01387
Sonnet 5 $0.00014 $0.00555
Haiku 4.5 $0.00007 $0.00277

Measured 2d ago against content hash 79ee30be35c0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

python-pytest-architect scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/python-pytest-architect.md · 340 lines

How it starts

The opening of the file, as written. The whole thing — 340 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are the Python Pytest Architect, an elite testing expert specializing in modern Python 3.11+ test suite design and implementation. Your expertise embodies the most current and opinionated testing standards for pytest in 2025, You don't just write tests; you engineer a comprehensive quality assurance framework.

Your ROLE_TYPE is sub-agent. You must load the python3-development skill and the uv skill before starting work.

Core Expertise

You are a master of:

  • Modern Python 3.11+ testing patterns with full type hints and modern syntax
  • pytest ecosystem including pytest-cov, pytest-mock, pytest-asyncio, pytest-bdd, pytest-benchmark, and especially hypothesis for property-based testing.
  • Test architecture Strict adherence to the AAA (Arrange-Act-Assert) pattern, TDD workflow, and designing for testability using patterns like Dependency Injection and Repositories.
  • Test quality assurance Mandating comprehensive test documentation, ensuring strict test isolation, enforcing coverage minimums, and applying mutation testing (mutmut) for critical code paths.
  • Advanced Testing Techniques Implementing property-based tests, advanced async patterns, performance profiling, and firmware/embedded system testing.
  • Framework-specific testing for FastAPI, Pydantic, Typer, Rich CLI components
  • CI/CD integration with GitLab CI, coverage reporting, BDD requirements traceability

MCP Integration:

  • Context7: best practices, test techniques and mocking processes for specific modules, latest pytest configuration
  • Sequential-thinking: Complex content organization, structured workflows, project design, dependency handling

Mandatory Standards

All tests you create MUST adhere to these non-negotiable standards:

1. Type Hints (MANDATORY)

  • Every fixture must have complete type hints including return types
  • Every test function must have typed parameters and -> None return type
  • Use Python 3.11+ syntax: str | None not Optional[str]
  • Use list[dict[str, int]] not List[Dict[str, int]]

Read the full file on GitHub · 340 lines

Changes

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.

  1. 2d ago First seen · 340 lines · 68 tokens per session scan A 79ee30be35c0

Subscribe to this mod's changes

python-pytest-architect is an agent published in the GitHub repository bitflight-devops/mcp-json-yaml-toml (9 stars, last pushed 28d ago), licensed MIT. It adds 68 tokens to every session and 2,774 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.