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.
npx skills add Fuenfgeld/pydantic-ai-skills --skill pydantic-ai-agentsgit clone --depth 1 https://github.com/Fuenfgeld/pydantic-ai-skillsWrote 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.
[](https://agentmods.dev/skills/fuenfgeld/pydantic-ai-skills/pydantic-ai-agents)<a href="https://agentmods.dev/skills/fuenfgeld/pydantic-ai-skills/pydantic-ai-agents"><img src="https://agentmods.dev/badge/skills/fuenfgeld/pydantic-ai-skills/pydantic-ai-agents/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/fuenfgeld/pydantic-ai-skills/pydantic-ai-agents"><img src="https://agentmods.dev/badge/skills/fuenfgeld/pydantic-ai-skills/pydantic-ai-agents.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00135 | $0.04194 |
| Opus 5 | $0.00068 | $0.02097 |
| Sonnet 5 | $0.00027 | $0.00839 |
| Haiku 4.5 | $0.00014 | $0.00419 |
Grade A, and why
pydantic-ai-agents 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 12d 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.
How it starts
The opening of the file, as written. The whole thing — 387 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Pydantic AI Reference Skill
Targets Pydantic AI v2 (v2.0.0 released 2026-06-23). See the v1 → v2 migration notes at the end for the breaking changes this skill's examples already incorporate.
Pydantic AI Developer Guide
0. Environment Setup
Store API keys in a .env file and add it to .gitignore:
OPENAI_API_KEY=your_key
OPENROUTER_API_KEY=your_key
LOGFIRE_API_KEY=your_key
Load with python-dotenv: load_dotenv(). Never hardcode keys in source code.
1. Core Architecture
Pydantic AI agents have five key components:
Dependencies (deps):
- Reference:
references/01_dependencies.py - Use dataclasses to hold API keys, database connections, and user context
- Never use global variables for state
Instructions (instructions):
- Reference:
references/02_prompts.py - v2 recommended: use
instructions=/@agent.instructions(instructions are NOT carried in message history, so they always reflect the current agent) - Make them dynamic using the
@agent.instructionsdecorator - Inject data from
ctx.depsinto the prompt string - Legacy
system_prompt=/@agent.system_promptstill work; their text IS carried in message history - only use when replaying history across agents
Tools (@agent.tool / @agent.tool_plain):
- Reference:
references/03_tools.py - v2:
@agent.toolREQUIRESctx: RunContextas first parameter; use@agent.tool_plainfor context-free tools (it raises otherwise) - Use
ctx.depsto access injected dependencies
Validators (output_type):
- Reference:
references/04_validators.py - Use Pydantic models to enforce structured output
- Use
@field_validatorfor logic checks
Capabilities (capabilities) - NEW in v2:
- Reference:
references/13_capabilities_native_tools.py - THE core v2 primitive: one composable unit bundling tools, hooks, instructions, and model settings
- Provider-adaptive capabilities:
Thinking,WebSearch,WebFetch,ImageGeneration,MCP - Replaces v1's
builtin_tools=,prepare_tools=,history_processors=,instrument=,event_stream_handler=Agent arguments
What ships with it
15 files 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.
- references/01_dependencies.py 1.4 KB runs code
- references/02_prompts.py 3.0 KB runs code
- references/03_tools.py 4.0 KB runs code
- references/04_validators.py 5.3 KB runs code
- references/05_main.py 8.2 KB runs code
- references/06_openrouter.py 2.8 KB runs code
- references/07_logfire.py 4.2 KB runs code
- references/08_streaming.py 3.8 KB runs code
- references/09_result_validators.py 6.3 KB runs code
- references/10_model_settings.py 5.4 KB runs code
- references/11_multi_agent.py 9.1 KB runs code
- references/12_conversation_history.py 5.9 KB runs code
- references/13_capabilities_native_tools.py 4.9 KB runs code
- references/14_hooks.py 3.5 KB runs code
- references/15_toolsets_mcp.py 3.1 KB runs code
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.
- 12d ago First seen · 387 lines · 135 tokens per session scan A 4c310cc0f005
pydantic-ai-agents is a skill published in the GitHub repository Fuenfgeld/pydantic-ai-skills (10 stars, last pushed 2mo ago), licensed MIT. It adds 135 tokens to every session and 4,194 once invoked, about $0.0007 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.
Other skills, from other repositories
migrating-langchain-to-pydantic-ai
Migrate Python LangChain or LangGraph applications to Pydantic AI. Use for LangChain agents, chains, LCEL, or direct LangGraph graphs, persistence, interrupts, and streaming. Do not use for migrations centered on createdeepagent or Deep Agents harness features.
test-generator
Generate pytest test cases for Python functions and classes.
code-execution
Writes and runs Python code in a sandbox. Describe the task in plain English — the skill will write and execute the program.
django-patterns
Django architecture patterns, REST API design with DRF, ORM best practices, caching, signals, middleware, and production-grade Django apps.
accelerate
Run PyTorch training across GPUs with minimal changes.
python-patterns
Python-specific design patterns and best practices including protocols, dataclasses, context managers, decorators, async/await, type hints, and package organization. Use when working with Python code to apply Pythonic patterns.