pydantic-ai-agents SKILL.md skillA

pydantic-ai-agents from fuenfgeld/pydantic-ai-skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add fuenfgeld/pydantic-ai-skills/pydantic-ai-agents@git:20261017.d039a72

Pins git:20261017.d039a72 in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 17 of 17 checks passed
Kind
SKILL.md skill
Repository
fuenfgeld/pydantic-ai-skills
Path
skills/pydantic-ai-agents/SKILL.md
Versions recorded
4
Latest version
git:20261017.d039a72, committed Oct 17, 2026
First version recorded
Jan 20, 2026
Size
17,474 bytes
Repository stars
10
License
MIT

Build and debug Pydantic AI v2 agents using best practices for dependencies, instructions, tools, capabilities, hooks, and structured output validation. Use when the user wants to: (1) Create a new Pydantic AI agent, (2) Debug or fix an existing agent, (3) Add features like tools, validators, capabilities, hooks, or dynamic instructions, (4) Integrate OpenRouter for multi-model access, (5) Add Logfire for debugging/observability, (6) Structure agent architecture with dependency injection, (7)…

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# Pydantic AI Reference Skill

**Targets Pydantic AI v2** (v2.0.0 released 2026-06-23). See the
[v1 → v2 migration notes](#10-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.instructions` decorator
- Inject data from `ctx.deps` into the prompt string
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add fuenfgeld/pydantic-ai-skills/pydantic-ai-agents@sha256:a9473e1b2351b1b5

The line at the top of this page pins the label git:20261017.d039a72, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_2bdvj2oyudf3qsn6.svg)](https://markdownregistry.com/a/art_2bdvj2oyudf3qsn6)

1 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 4 versions of this file, between Jan 20, 2026 and Oct 17, 2026, about one every 90 days.

versioncommittedcommitsizeaudit
git:20261017.d039a72 latest2026-10-17 d039a72 17,474 BA view · diff
git:20261017.53ad3612026-10-17 53ad361 19,086 BA view · diff
git:20260707.0a11b6b2026-07-07 0a11b6b 16,907 BA view · diff
git:20260120.9fcbca92026-01-20 9fcbca9 10,331 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (17474 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

fuenfgeld/pydantic-ai-skills · 10 stars · license MIT · pushed 2026-10-17 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_2bdvj2oyudf3qsn6
GET https://markdownregistry.com/api/v1/resolve?ref=fuenfgeld/pydantic-ai-skills/pydantic-ai-agents
GET https://markdownregistry.com/api/v1/blob/a9473e1b2351b1b57bef672291ba20197ef455193cf7c4d4b00272ef5b1c0a66

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.

More from fuenfgeld/pydantic-ai-skills

CLAUDE.md CLAUDE.md file
fuenfgeld/pydantic-ai-skills · CLAUDE.md
git:20260120.9fcbca9 · audit A · 10 stars
pydantic-evals SKILL.md skill
fuenfgeld/pydantic-ai-skills · skills/pydantic-evals/SKILL.md · Test and evaluate AI agents and LLM outputs using code-first evaluation framework with strong typing. Use when the user…
git:20260707.0a11b6b · audit A · 10 stars

Every file in fuenfgeld/pydantic-ai-skills

Browse by kind, by grade A, or by owner.