/ai:migrating-openai-agents-sdk-to-pydantic-aifrom ai
Migrates Python OpenAI Agents SDK applications to Pydantic AI while preserving caller-visible behavior. Covers agents, Runner, tools, handoffs, guardrails, sessions, approval, streaming, and sandbox agents.
Ships in ai. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Preserve caller-visible behavior, not OpenAI Agents SDK object shapes. Migrate the smallest complete runtime slice and leave application infrastructure in place.
openai-agents, Pydantic AI, and Harness versions.Runner.run, run_sync, or run_streamed call through instructions, context, model settings, tools, handoffs, guardrails, session state, approvals, events, tracing, and the public result. Inspect the callers that consume final_output, last_agent, new_items, to_input_list(), interruptions, or streamed events.Agent with typed dependencies, tools, and outputs.SubAgents according to who must own the final response.Coder and its component capabilities. Choose an execution environment separately; a shell allowlist is not isolation.Read Concept Mapping for the source features you found. Read Verification and Cutover before changing persistence, handoffs, approval, streaming, security, or production traffic, and before declaring completion or removing openai-agents.
RunContextWrapper.context is trusted application state and normally becomes typed deps. Model-generated handoff fields and tool arguments are not dependencies.last_agent for continuation. Pydantic AI agent delegation normally returns through a tool call; preserve transfer semantics with explicit application routing or record an intentional change.to_input_list() history, SDK Session storage, OpenAI conversation_id, OpenAI previous_response_id, and a serialized interrupted RunState. Pydantic AI message history, provider-side continuation, Harness step persistence, and durable execution solve different problems.RunState. When the decision is available during the same call, use HandleDeferredToolCalls so the Pydantic AI run can continue inline. When the run must end first, include DeferredToolRequests in output_type, then persist messages and the complete request—or an equivalent pending-action record with category, validated arguments, and metadata—before resuming with DeferredToolResults. Re-authorize inside protected tools; approval is not authorization.tool_use_behavior can make an ordinary tool result terminal. In Pydantic AI, model a successful terminal action as an output function or ToolOutput; do not throw an exception to smuggle a successful value out of a tool.run(event_stream_handler=...), run_stream_events(), or iter() when the full agent loop must complete. Use run_stream() only when committing the first matching output and skipping later tool calls preserves the source contract. Adapt the chosen surface to the public schema.max_turns, including its SDK default when omitted. Preserve that bound with UsageLimits.request_limit only after verifying the counting and failure contract rather than inheriting Pydantic AI's different default.Install and import the migrated project from a clean environment so its dependency files match the runtime. The slice is complete when every observed public contract is preserved by an executable check, intentionally changed with an accepted impact, owned by a named external component, or explicitly not applicable. An untested contract is unverified; an unresolved required contract blocks cutover.
What SKILL.md sets; muted values are Claude Code's defaults
9 skills in this plugin
/building-pydantic-ai-agentsBuild AI agents with Pydantic AI — tools, capabilities (including on-demand loading), workspaces, structured output, streaming, testing, and multi-agent patterns. Use when the user mentions Pydantic AI, imports pydantic_ai, or asks to build an AI agent, add tools/capabilities, attach a workspace, defer capability loading, stream output, define agents from YAML, or test agent behavior./migrating-agno-to-pydantic-aiMigrate Python Agno applications to Pydantic AI and, only when needed, Pydantic AI Harness. Use when source code imports `agno` or relies on Agno agents, teams, workflows, sessions, memory, knowledge, tools, hooks, guardrails, approvals, skills, streaming, or AgentOS./migrating-claude-agent-sdk-to-pydantic-aiMigrate Python applications from the Claude Agent SDK to Pydantic AI and, only when needed, Pydantic AI Harness. Use when source code imports `claude_agent_sdk` or relies on Claude Code's agent loop, sessions, built-in tools, hooks, permissions, skills, or subagents. Do not use for the Anthropic Messages SDK or Claude Managed Agents./migrating-google-adk-to-pydantic-aiMigrate Python Google Agent Development Kit (ADK) applications to Pydantic AI. Use for `LlmAgent`, `Runner`, sessions, state, memory, tools, callbacks, plugins, graph or dynamic workflows, resumability, events, artifacts, MCP, and ADK deployment boundaries./migrating-langchain-to-pydantic-aiMigrate Python LangChain, LangGraph, or Deep Agents applications to Pydantic AI and, when the source uses harness features, Pydantic AI Harness. Use for LangChain agents, chains, LCEL, direct LangGraph graphs, persistence, interrupts, streaming, and `create_deep_agent` projects with planning, filesystem or sandbox backends, skills, memory, subagents, permissions, approvals, or Deep Agents Code hosts./migrating-mastra-to-pydantic-aiMigrate TypeScript Mastra applications to Python with Pydantic AI and, only when needed, Pydantic AI Harness. Use when source code imports `@mastra/*` or relies on Mastra agents, tools, workflows, memory, processors, streaming, approvals, skills, or subagents.npx claudepluginhub pydantic/skills --plugin aiOther plugins' skills for the same job