migrating-openai-agents-sdk-to-pydantic-ai
Skill by pydantic
Migrates Python OpenAI Agents SDK applications to Pydantic AI and, when warranted, Pydantic AI Harness. It is aimed at developers moving agent code that uses Agents SDK runtime features.
Install migrating-openai-agents-sdk-to-pydantic-ai
Built from the published package, never by AI.
git clone --depth 1 https://github.com/pydantic/pydantic-ai /tmp/pydantic-ai && mkdir -p ~/.claude/skills && cp -r /tmp/pydantic-ai/pydantic_ai_slim/pydantic_ai/.agents/skills/migrating-openai-agents-sdk-to-pydantic-ai ~/.claude/skills/migrating-openai-agents-sdk-to-pydantic-Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install migrating-openai-agents-sdk-to-pydantic-ai in Claude Code
git clone --depth 1 https://github.com/pydantic/pydantic-ai /tmp/pydantic-ai && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/pydantic-ai/pydantic_ai_slim/pydantic_ai/.agents/skills/migrating-openai-agents-sdk-to-pydantic-ai ~/.gemini/antigravity-cli/skills/migrating-openai-agents-sdk-to-pydantic-Antigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install migrating-openai-agents-sdk-to-pydantic-ai in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill guides an AI coding assistant through migrating Python applications that use the OpenAI Agents SDK to Pydantic AI, and to Pydantic AI Harness when warranted. It starts by reading the running application, tracing one representative Runner call, and recording a deterministic baseline. It then classifies the slice as an ordinary agent, a manager with specialists, a handoff workflow, a sandbox or coding agent, a realtime path, or a product runtime, and migrates one vertical slice behind the existing boundary.
The skill sets semantic gates for context, handoffs, conversation state, guardrails, approvals, tool completion, streaming, and tracing. It is for developers with Agents SDK code that uses Agent, Runner, handoffs, or SandboxAgent. It does not apply to applications built directly on the OpenAI Responses API without the Agents SDK runtime.
Written from the project's SKILL.md and checked against it.
What it can do
- Runtime tracingTraces one representative Runner.run, run_sync, or run_streamed call through the application.
- Slice classificationSorts the code into an ordinary agent, handoff workflow, sandbox, realtime, or product runtime slice.
- Semantic gatesChecks context, handoffs, conversation state, guardrails, approvals, streaming, and tracing before changes.
- Approval migrationDescribes how human approval maps to DeferredToolRequests and DeferredToolResults or HandleDeferredToolCalls.
- Characterization testsAdds or preserves tests and runs the original code plus focused parity tests.
- Cutover verificationGives checks to run before cutover and before removing the openai-agents package.
What you need
- Python
- An existing project that uses the openai-agents package
- Pydantic AI
Try asking
- Migrate this Agents SDK Runner.run call to Pydantic AI
- Map my OpenAI handoffs and guardrails to Pydantic AI
- Show how to replace SDK human approval with deferred tools
Good to know
- Does not apply to code built directly on the OpenAI Responses API without the Agents SDK runtime.
- Realtime or voice paths are treated as a separate migration slice.
- Existing telemetry is retained unless the user accepts a wider tracing migration.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: pydantic_ai_slim/pydantic_ai/.agents/skills/migrating-openai-agents-sdk-to-pydantic-ai/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md7 KB -
agents/openai.yaml317 B -
references/CONCEPT-MAPPING.md10 KB -
references/VERIFICATION-AND-CUTOVER.md6 KB
Alternatives to migrating-openai-agents-sdk-to-pydantic-ai
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
migrating-openai-agents-sdk-to-pydantic-ai: common questions
Which code does this skill apply to?
Python applications that use OpenAI Agents SDK features such as agents.Agent, Runner, function tools, handoffs, guardrails, sessions, and SandboxAgent.
Does it migrate code that calls the OpenAI Responses API directly?
No. The source says not to use this skill for applications built directly on the Responses API without the Agents SDK runtime.
When should openai-agents be removed?
The skill says to read its verification and cutover reference before declaring completion or removing openai-agents.
How do I install migrating-openai-agents-sdk-to-pydantic-ai?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is migrating-openai-agents-sdk-to-pydantic-ai free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is migrating-openai-agents-sdk-to-pydantic-ai safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to migrating-openai-agents-sdk-to-pydantic-ai?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
