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 mfmezger/ai_agent_dotfiles --skill building-pydantic-ai-agentsgit clone --depth 1 https://github.com/mfmezger/ai_agent_dotfilesWrote 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/mfmezger/ai_agent_dotfiles/building-pydantic-ai-agents)<a href="https://agentmods.dev/skills/mfmezger/ai_agent_dotfiles/building-pydantic-ai-agents"><img src="https://agentmods.dev/badge/skills/mfmezger/ai_agent_dotfiles/building-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/mfmezger/ai_agent_dotfiles/building-pydantic-ai-agents"><img src="https://agentmods.dev/badge/skills/mfmezger/ai_agent_dotfiles/building-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.00076 | $0.02701 |
| Opus 5.5 | $0.00030 | $0.01080 |
| Sonnet 5.5 | $0.00015 | $0.00540 |
| Haiku 4.5 | $0.00008 | $0.00270 |
Grade A, and why
building-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 3mo 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 — 275 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Building AI Agents with Pydantic AI
Pydantic AI is a Python agent framework for building production-grade Generative AI applications. This skill provides patterns, architecture guidance, and tested code examples for building applications with Pydantic AI.
When to Use This Skill
Invoke this skill when:
- User asks to build an AI agent, create an LLM-powered app, or mentions Pydantic AI
- User wants to add tools, capabilities (thinking, web search), or structured output to an agent
- User asks to define agents from YAML/JSON specs or use template strings
- User wants to stream agent events, delegate between agents, or test agent behavior
- Code imports
pydantic_aior references Pydantic AI classes (Agent,RunContext,Tool) - User asks about hooks, lifecycle interception, or agent observability with Logfire
Do not use this skill for:
- The Pydantic validation library alone (
pydantic/BaseModelwithout agents) - Other AI frameworks (LangChain, LlamaIndex, CrewAI, AutoGen)
- General Python development unrelated to AI agents
Quick-Start Patterns
Create a Basic Agent
from pydantic_ai import Agent
agent = Agent(
'anthropic:claude-sonnet-4-6',
instructions='Be concise, reply with one sentence.',
)
result = agent.run_sync('Where does "hello world" come from?')
print(result.output)
"""
The first known use of "hello, world" was in a 1974 textbook about the C programming language.
"""
Add Tools to an Agent
import random
from pydantic_ai import Agent, RunContext
agent = Agent(
'google-gla:gemini-3-flash-preview',
deps_type=str,
instructions=(
"You're a dice game, you should roll the die and see if the number "
"you get back matches the user's guess. If so, tell them they're a winner. "
"Use the player's name in the response."
),
)
@agent.tool_plain
def roll_dice() -> str:
"""Roll a six-sided die and return the result."""
return str(random.randint(1, 6))
@agent.tool
def get_player_name(ctx: RunContext[str]) -> str:
"""Get the player's name."""
return ctx.deps
dice_result = agent.run_sync('My guess is 4', deps='Anne')
print(dice_result.output)
#> Congratulations Anne, you guessed correctly! You're a winner!
What ships with it
10 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/AGENTS-CORE.md 4.1 KB
- references/ARCHITECTURE.md 10 KB
- references/BUILTIN-TOOLS.md 1.9 KB
- references/CAPABILITIES-AND-HOOKS.md 2.5 KB
- references/COMMON-TASKS.md 4.5 KB
- references/INPUT-AND-HISTORY.md 1.8 KB
- references/ORCHESTRATION-AND-INTEGRATIONS.md 3.4 KB
- references/TESTING-AND-DEBUGGING.md 2.0 KB
- references/TOOLS-ADVANCED.md 3.9 KB
- references/TOOLS-CORE.md 2.8 KB
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.
- 3mo ago First seen · 275 lines · 76 tokens per session scan A 4fed3c0a468c
building-pydantic-ai-agents is a skill published in the GitHub repository mfmezger/ai_agent_dotfiles (7 stars, last pushed 4mo ago), licensed MIT. It adds 76 tokens to every session and 2,701 once invoked, about $0.0003 per session on Opus 5.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.
building-pydantic-ai-agents compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| building-pydantic-ai-agentsmfmezger/ai_agent_dotfiles | Skill | 7 | 4mo ago | MIT | A | 76 | Claude Code, Codex |
| python-engineering-guidelinesanywhere-labs/Agents-Anywhere | Skill | 3.9k | today | Apache-2.0 | A | 75 | Codex |
| python-patternsDVNghiem/FlowDeck | Skill | 44 | 15d ago | MIT | A | 33 | Claude Code, Codex |
| writing-pythonalexei-led/cc-thingz | Skill | 37 | yesterday | MIT | A | 74 | Claude Code, Codex |
| mainframe-python-backendCATWILLgh/MAINFRAME | Skill | 2 | 13d ago | MIT | A | 40 | Claude Code, Codex |
| test-generatorbestdeejay-design/agent-skills | Skill | 5 | 2mo ago | MIT | A | 0 | Claude Code |
| python-developmentHK-hub/AgentSkills | Skill | 7 | 3mo ago | MIT | A | 63 | Claude Code, Codex |