pydanticai-docs
Use this skill whenever the user is working with the Pydantic AI framework — including building AI agents, defining structured outputs with Pydantic models, wiring up tools/function calling, configuring model providers (OpenAI, Anthropic, Gemini, etc.), managing dependencies via agent context, handling streaming responses, or debugging agent runs. Trigger this skill even for adjacent tasks like "how do I make my agent return JSON", "set up a multi-step agent", "add a tool to my agent", or "validate LLM output with Pydantic" — any time Pydantic AI is mentioned or implied as the target framework
npx skills add majiayu000/claude-skill-registry --skill pydanticai-docs-dougtrajano-pydantic-ai-skills-2 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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/index.md> --- ## Core Concepts ### 1. Agent Instantiation ```python 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`) ```python 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`. ### 3. Dependency Injection (`RunContext`) `
- What is Pydantic AI?
- Core Concepts
- 1. Agent Instantiation
- 2. Function Tools (@agent.tool)
- 3. Dependency Injection (RunContext)
- 4. Structured Output
- Additional Topics
- Agent Behavior Rules
What does the pydanticai-docs skill do?
Use this skill whenever the user is working with the Pydantic AI framework — including building AI agents, defining structured outputs with Pydantic models, wiring up tools/function calling, configuring model providers (OpenAI, Anthropic, Gemini, etc.), managing dependencies via agent context, handling streaming responses, or debugging agent runs. Trigger this skill even for adjacent tasks like "how do I make my agent return JSON", "set up a multi-step agent", "add a tool to my agent", or "validate LLM output with Pydantic" — any time Pydantic AI is mentioned or implied as the target framework
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill pydanticai-docs-dougtrajano-pydantic-ai-skills-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
