This gives Claude direct access to the Pydantic AI framework docs, covering agent setup, structured outputs, function tools, dependency injection, and multi-provider configuration. Reach for it whenever you're building AI agents in Python and need to wire up tools, validate LLM responses with Pydantic models, or configure streaming and context. The skill loads core concepts inline and routes to specific reference files for deeper topics like message history, toolsets, and MCP integration. It's opinionated about not fabricating API details, which keeps answers grounded in the actual framework. If you're prototyping agents or debugging tool calls, this saves you from tab-switching between docs and your editor.

skills.sh installs
115
GitHub stars
382
last updated
Jun 11, 2026

Install

$ npx -y skills add dougtrajano/pydantic-ai-skills --skill pydanticai-docs --agent claude-code

Installs into .claude/skills of the current project.

Files

Pydantic AI Documentation Skill

What is Pydantic AI?

Pydantic AI is a production-grade Python agent framework for building type-safe, dependency-injected Generative AI applications. It supports multiple LLM providers, structured outputs via Pydantic models, and composable multi-agent patterns.

Doc: https://ai.pydantic.dev/


Core Concepts

1. Agent Instantiation

from pydantic_ai import Agent

agent = Agent(
    'openai:gpt-4o',          # model string: provider:model-name
    system_prompt='Be helpful.',
)
result = agent.run_sync('What is the capital of France?')
print(result.output)

For full constructor parameters, run methods, and streaming: load references/AGENT.md.

2. Function Tools (@agent.tool)

from pydantic_ai import Agent, RunContext

agent = Agent('openai:gpt-4o', deps_type=str)

@agent.tool
def get_user_name(ctx: RunContext[str]) -> str:
    """Return the current user's name."""
    return ctx.deps

result = agent.run_sync('What is my name?', deps='Alice')

Use @agent.tool_plain when you don't need RunContext. For tool registration, return types, and retries: load references/FUNCTION_TOOLS.md.

Sponsors

Details

Repository
github.com/dougtrajano/pydantic-ai-skills
Categories
Documentation, AI & Agent Building, Python
License
MIT
First seen
Jun 11, 2026

More from dougtrajano/pydantic-ai-skills

All 3
1agentworkforce avatarwriting-agent-relay-workflowsagentworkforce/relayThis is the opinionated playbook for building multi-agent workflows with @relayflows/core.0skills.sh installs
2agnosticui avatarexplain-codeagnosticui/agnosticuiExplain what code does in plain English0skills.sh installs
3anthropics avatarWriting Hookify Rulesanthropics/claude-codeThis skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on ho0skills.sh installs
4ar9av avatarpaper-writing-benchar9av/paperorchestraReverse-engineer raw materials (Sparse idea, Dense idea, experimental log) from an existing AI research paper to build a benchmark case for evaluating paper-wri0skills.sh installs
5ar9av avatarsection-writing-agentar9av/paperorchestraStep 4 of the PaperOrchestra pipeline (arXiv:2604.05018). ONE single multimodal LLM call that drafts the remaining paper sections (Abstract, Methodology, Experi0skills.sh installs
6cherryhq avatarcherry-assistant-guidecherryhq/cherry-studioCherry Studio 产品知识库、源码路径索引、故障排查和页面导航。当用户询问 Cherry Studio 的功能、配置、报错、使用方法时触发。也适用于用户提到 provider、模型、知识库、Agent、MCP、OpenClaw、PDF、快捷短语等关键词的场景。0skills.sh installs