testing-skill

testing-skill is a skill for Claude Code, Codex from pydantic/pydantic-ai. It costs 44 tokens per session (854 once invoked), scanned A, original, MIT.

A workflow for recording HTTP requests and responses in VCR cassette files so tests can replay them without contacting the service each time. Pytest is a Python testing tool, and a cassette is a YAML file containing a saved request and response.

In plain words
What is it for?
It records or rewrites cassettes, verifies that tests pass using playback, and inspects saved response data and snapshot comparisons.
Why use it?
It makes tests repeatable and helps diagnose whether failures come from the code, the recorded response, or the external service.

Skill for Claude CodeCodex

About the project

Pydantic AI is a typed Python SDK for building AI agents that can use different language models and interfaces, including voice, image generation, and embeddings. Developers use it for applications ranging from structured data extraction to long-running multi-agent work. The catalogue entries provide workflows and configuration for its coding-agent and harness features.

pydantic/pydantic-ai · 19,730 stars · on GitHub

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 skills/pydantic/pydantic-ai/testing-skill
Any agent
npx skills add pydantic/pydantic-ai --skill testing-skill
Clone the repo
git clone --depth 1 https://github.com/pydantic/pydantic-ai

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for testing-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/pydantic/pydantic-ai/testing-skill.svg)](https://agentmods.dev/skills/pydantic/pydantic-ai/testing-skill)
Your own site
<a href="https://agentmods.dev/skills/pydantic/pydantic-ai/testing-skill"><img src="https://agentmods.dev/badge/skills/pydantic/pydantic-ai/testing-skill.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 854 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.00044 $0.00854
Opus 5 $0.00022 $0.00427
Sonnet 5 $0.00009 $0.00171
Haiku 4.5 $0.00004 $0.00085

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

Security

Grade A, and why

testing-skill 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 5d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (parse_cassette.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/skills/testing-skill/SKILL.md · 98 lines

How it starts

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

Pytest VCR Workflow

Use this skill when recording or re-recording VCR cassettes for tests, or when debugging cassette contents.

Prerequisites

  • Verify .env exists: test -f .env && echo 'ok' || echo 'missing'
  • Missing API keys will cause clear test errors at runtime

Important flags

  • --record-mode=rewrite : Record cassettes (works for both new and existing)
  • --lf : Run only the last failed tests
  • -vv : Verbose output
  • --tb=line : Short traceback output
  • -k="" : Run tests matching the given substring expression

Recording Cassettes

Step 1: Record cassettes

source .env && uv run pytest path/to/test.py::test_function_name -v --tb=line --record-mode=rewrite

Multiple tests can be specified:

source .env && uv run pytest path/to/test.py::test_one path/to/test.py::test_two -v --tb=line --record-mode=rewrite

Step 2: Verify recordings

Run the same tests WITHOUT --record-mode to verify cassettes play back correctly:

source .env && uv run pytest path/to/test.py::test_function_name -vv --tb=line

Step 3: Review snapshots

If tests use snapshot() assertions:

  • The test run in Step 2 auto-fills snapshot content
  • Review the generated snapshot files to ensure they match expected output
  • You only review - don't manually write snapshot contents
  • Snapshots capture what the test actually produced, additional to explicit assertions

Parsing Cassettes

Parse VCR cassette YAML files to inspect request/response bodies without dealing with raw YAML.

Usage

uv run python .claude/skills/testing-skill/parse_cassette.py <cassette_path> [--interaction N]

Examples

# Parse all interactions in a cassette
uv run python .claude/skills/testing-skill/parse_cassette.py tests/models/cassettes/test_foo/test_bar.yaml

# Parse only interaction 1 (0-indexed)
uv run python .claude/skills/testing-skill/parse_cassette.py tests/models/cassettes/test_foo/test_bar.yaml --interaction 1

Read the full file on GitHub · 98 lines

Files

What ships with it

1 file 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.

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. 5d ago First seen · 98 lines · 44 tokens per session scan A 4f0663ca5bc5

Subscribe to this mod's changes

testing-skill is a skill published in the GitHub repository pydantic/pydantic-ai (19,730 stars, last pushed today), licensed MIT. It adds 44 tokens to every session and 854 once invoked, about $0.0002 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-30.