Official agent skill

Deep Agents to Pydantic AI Migration

by pydantic in pydantic/pydantic-ai

Migrates Python LangChain Deep Agents applications to Pydantic AI and Pydantic AI Harness while preserving the application's observed behavior.

OfficialMITAuto-check passedAI & LLM Engineering

Install Deep Agents to Pydantic AI Migration

skills CLI
$ npx skills add pydantic/pydantic-ai --skill migrating-deep-agents-to-pydantic-ai-harness -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pydantic/pydantic-ai migrating-deep-agents-to-pydantic-ai-harness --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pydantic/pydantic-ai.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/pydantic_ai_harness/pydantic_ai_harness/.agents/skills/migrating-deep-agents-to-pydantic-ai-harness .claude/skills/migrating-deep-agents-to-pydantic-ai-harness && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
migrating-deep-agents-to-pydantic-ai-harness
GitHub stars
21k
Token cost
~1.7k tokens
SKILL.md length
787 words
Files
8 (incl. references)
Skills in repo
20
Repo updated
First seen
Licence
MIT

At a glance

Migrates Python LangChain Deep Agents applications to Pydantic AI and Pydantic AI Harness while preserving the application's observed behavior.

  • Works in 4 steps: Resolve the deepagents import origin… → Trace one representative request through… → Run the cheapest deterministic baseline.… → …
  • Porting an app built on the `deepagents` package to Pydantic AI
  • SKILL.md covers Establish the source contract, Build the Pydantic AI target and Migrate and verify
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The skill treats a migration as preserving the application's observed contracts, not the shape of `create_deep_agent`. The agent first works out where the `deepagents` import comes from, reads repository instructions, manifests, lockfiles, tests and entrypoints, records exact versions of Deep Agents, LangChain, LangGraph, Pydantic AI and Harness, and traces one representative request through prompts, tools, middleware, backends, skills, memory, delegation, state, approvals, retries and events.

Evidence is labelled as source-inspected, probe-observed or regression-tested, and behavior that cannot be checked is marked unverified instead of being claimed as equivalent. Four reference files are loaded only when matching features are found: core migration, context and execution, orchestration and recovery, and hosts and protocols. The target starts as one reusable Pydantic AI `Agent` with Harness capabilities composed on top, and infrastructure stays with the application that owns it. Plain LangChain, LangGraph or LCEL migrations and greenfield Harness work belong to other skills.

When your agent uses it

  • Porting an app built on the `deepagents` package to Pydantic AI
  • Moving Deep Agents subagents, memory and sandbox backends to Harness capabilities
  • Checking that a migrated agent keeps the original's behavior

Example prompts

  • “Migrate our research assistant built with create_deep_agent to Pydantic AI Harness.”
  • “Map the subagents and sandbox backend of our Deep Agents app onto Harness capabilities.”
  • “Trace one request through our deepagents app and list which behaviors the migration must preserve.”

Requirements

  • A Python application that uses the `deepagents` package or reproduces its contracts

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Resolve the deepagents import origin before applying these mappings. Route a local module or project-owned create_deep_agent to the…
  2. Trace one representative request through prompt and model profile, tools and integrations, middleware and permissions, backend and…
  3. Run the cheapest deterministic baseline. Record evidence separately from the outcome: source-inspected, probe-observed, or…
  4. Load only the mapping needed for the detected source features

What it can do on your machine

Read from SKILL.md and the folder at commit 69ea1e5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Deep Agents to Pydantic AI Migration loads about 1.7k tokens when it runs, and up to ~8.5k if it reads all its reference files. Until then it costs about 111 tokens; SKILL.md has 787 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~111
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~8.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from pydantic/pydantic-ai at commit 69ea1e5, republished under its MIT licence (© pydantic). 787 words, ~1,661 tokens.

Download SKILL.mdSave it as .claude/skills/migrating-deep-agents-to-pydantic-ai-harness/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
migrating-deep-agents-to-pydantic-ai-harness
description
Migrate Python LangChain Deep Agents applications to Pydantic AI and Pydantic AI Harness. Use when the source uses the upstream `deepagents` package or demonstrably reproduces its middleware, backends, skills, memory, subagents, or sandbox contracts. Use `migrating-langchain-to-pydantic-ai` for plain LangChain, LangGraph, or LCEL migrations and `pydantic-ai-harness` for greenfield Harness usage.

Migrate Deep Agents to Pydantic AI Harness

Preserve the application's observed contracts, not the shape of create_deep_agent. Compose Pydantic AI primitives and Harness capabilities; keep infrastructure with the application that already owns it.

Establish the source contract

  1. Resolve the deepagents import origin before applying these mappings. Route a local module or project-owned create_deep_agent to the ordinary LangChain migration only when its implementation has ordinary LangChain or LangGraph semantics; vendored implementations that reproduce Deep Agents contracts remain in scope. Read repository instructions, manifests, lockfiles, tests, runtime entrypoints, and the resolved source. Record exact Deep Agents, LangChain, LangGraph, Pydantic AI, and Harness versions. If the locked source is unavailable, reproduce its environment without changing the target lockfile. If that is not possible, mark affected behavior unverified and do not claim parity.
  2. Trace one representative request through prompt and model profile, tools and integrations, middleware and permissions, backend and execution, skills and memory, delegation, state, checkpoints and approvals, retries and limits, events, side effects, and the public boundary. Inspect every caller of that boundary.
  3. Run the cheapest deterministic baseline. Record evidence separately from the outcome: source-inspected, probe-observed, or regression-tested.
  4. Load only the mapping needed for the detected source features:
    • Core Migration for construction, models and profiles, prompts, tools and MCP, middleware, state, outputs, caching, or tracing.
    • Context and Execution for coding-agent defaults, planning, files, permissions, backends, sandboxes, interpreters, media, skills, memory, retrieval, or context limits.
    • Orchestration and Recovery for synchronous, dynamic, or background subagents; grading loops; approvals; checkpoints; fault tolerance; durable execution; or streaming.
    • Hosts and Protocols only when migrating Deep Agents Code, a frontend, ACP, A2A, or a deployment boundary.

Build the Pydantic AI target

  • Start with one reusable Agent. Pydantic AI owns the model/provider boundary, normalized messages, agent loop, typed dependencies and outputs, tools and toolsets, run APIs, usage limits, and generic hooks.
  • Put authenticated identity, service clients, and configuration in deps_type and RunContext; expose only model-chosen inputs through typed tools. Choose instructions versus system_prompt from the required history behavior, and consume result.output rather than leaking framework messages through the application boundary.
  • Add Harness capabilities one at a time for observed optional behavior. A capability composes instructions, toolsets, hooks, and model settings onto the agent; it does not replace application infrastructure or Pydantic AI runtime semantics.
  • Select run_sync, run, run_stream, run_stream_events, iter, deferred results, and message history from the caller's actual lifecycle. Preserve the old wire shape with a boundary adapter while callers migrate.
  • Before coding, inspect the locked pydantic_ai and pydantic_ai_harness public exports, docs, and source signatures for the selected provider, Agent, tools/toolsets, capabilities, run and deferred APIs, and persistence integration. Import capabilities from their owning public submodules, reject deprecation warnings, and run an import-and-construction smoke test in the exact target environment. Record the interpreter and resolved pydantic_ai and pydantic_ai_harness module paths with the result. Add only the required extras; do not pass LangChain objects through or copy remembered examples.
  • Keep queues, tenancy, artifact storage, remote sandbox lifecycle, durable domain state, deployment, and external side-effect recovery in application services.
  • Classify orchestration as model-controlled delegation, a fixed application workflow, or a background worker before selecting SubAgents or DynamicWorkflow; keep fixed sequencing and worker queues in application code.
  • If public Pydantic AI primitives cannot implement required generic runtime semantics correctly, propose the core primitive instead of recreating the runtime in Harness.
Show full SKILL.md (234 more words)Show less

When there is no direct equivalent, do not stop at "unsupported." State the source contract and impact, then recommend either an existing composition, a narrow adapter or application service, a new Harness capability built from public primitives, or a Pydantic AI core change. Recommend one option and name its residual risk; ask before choosing when the options materially change behavior, architecture, public API, or scope.

Migrate and verify

  1. Port one vertical slice behind the existing application boundary: typed dependencies, one tool family, output, and one representative request.
  2. Preserve source request, result, error, event, and continuation shapes with a small adapter while callers migrate.
  3. Run the original suite together with focused characterization, parity, and evaluation checks before expanding to the next capability. Exercise the supported Agent boundary in the same interpreter and installed checkout the target will use; do not accept results from another environment. Read Tested Composition only when a local coding-agent composition is useful.
  4. Read Validation and Cutover before publishing examples or claiming cutover; for a simple slice, use only the applicable checks.
  5. Cut over only when each in-scope contract is regression-tested, intentionally changed with agreement, or explicitly not applicable. Report anything else as unverified.

Match validation to observed contracts. Focused characterization and parity tests are sufficient for a stateless slice; persistence, approvals, concurrency, streaming, and external side effects require the ledger and applicable restart and idempotency checks.

© pydantic, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (references) in src/pydantic_ai_harness/pydantic_ai_harness/.agents/skills/migrating-deep-agents-to-pydantic-ai-harness of pydantic/pydantic-ai.

  • SKILL.md
  • agents/openai.yaml
  • references/CONTEXT-AND-EXECUTION.md
  • references/CORE-MIGRATION.md
  • references/HOSTS-AND-PROTOCOLS.md
  • references/ORCHESTRATION-AND-RECOVERY.md
  • references/TESTED-COMPOSITION.md
  • references/VALIDATION.md

Open the folder on GitHubat commit 69ea1e5

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders. This page covers the copy in pydantic/pydantic-ai, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Deep Agents to Pydantic AI Migration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Deep Agents to Pydantic AI Migration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Deep Agents to Pydantic AI Migration this skillpydantic/pydantic-ai21k—~1.7kAutomated safety check: PassMIT
Failproof AI SDK IntegrationFailproofAI/failproofai5.3k—~6kAutomated safety check: PassCustom licence
Langchain Upgrade Migrationjeremylongshore/tons-of-skills-marketplace2.8k—~3.3kAutomated safety check: PassMIT
Add Example AgentGetBindu/Bindu10k—~1.1kAutomated safety check: NotesCustom licence
Omnigent Framework Detectionomnigent-ai/omnigent11k—~610Automated safety check: PassApache-2.0
LangGraph Decision Modelslangchain-ai/langchain-skills1.3k—~2.3kAutomated safety check: PassMIT

Similar skills

  • Failproof AI SDK Integration

    FailproofAI/failproofai

    Helps instrument a custom Python or TypeScript agent to record events for Failproof AI, verify what gets written, and run an evaluator worker that scores the runs.

    5.3k GitHub stars~6k tokensUpdated 4 days ago
    AI & LLM EngineeringAuto-check passed
  • Langchain Upgrade Migration

    jeremylongshore/tons-of-skills-marketplace

    Migrate a LangChain 0.3.x Python codebase to LangChain 1.0 / LangGraph 1.0 without breaking production — named breaking changes, codemod patterns, and a phased rollout.

    2.8k GitHub stars~3.3k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Add Example Agent

    GetBindu/Bindu

    Add a new self-contained example agent under examples/. An agent skill from GetBindu/Bindu.

    10k GitHub stars~1.1k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check: notes
  • Omnigent Framework Detection

    omnigent-ai/omnigent

    Scans Python agent code for framework imports and recommends the matching Omnigent executor type, or says when the framework is not natively supported yet.

    11k GitHub stars~610 tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • LangGraph Decision Models

    langchain-ai/langchain-skills

    Official

    Routes LangGraph agents with typed decision models that return probabilities, and finds LLM calls that only exist to produce a routing decision.

    1.3k GitHub stars~2.3k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed
  • Tool Design

    agentailor/fullstack-langgraph-nextjs-agent

    Design and verify tools that AI agents can actually use — for any framework or language (MCP servers, LangChain/LangGraph, function-calling, raw JSON schema; TypeScript, Python, or otherwise).

    132 GitHub stars~3.2k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed

More from pydantic/pydantic-ai

All 20 skills in this repo
  • Pydantic AI Harness

    pydantic/pydantic-ai

    Official

    Adds optional capabilities to Pydantic AI agents from pydantic-ai-harness, led by Code Mode, which runs many tool calls as one sandboxed Python script.

    21k GitHub stars~4.9k tokensUpdated today
    Auto-check passed
  • Building Pydantic AI Agents

    pydantic/pydantic-ai

    Official

    Build AI agents with Pydantic AI — tools, capabilities (including on-demand loading), workspaces, structured output, streaming, testing, and multi-agent patterns.

    21k GitHub stars~8.2k tokensUpdated today
    Auto-check passed
  • Complete Partial PR

    pydantic/pydantic-ai

    Official

    Evaluate and complete an issue or PR where the submitted patch fixes only a narrow symptom of the reported pain point.

    21k GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Testing Skill

    pydantic/pydantic-ai

    Official

    Record, rewrite, and debug VCR cassettes for HTTP recordings.

    21k GitHub stars~839 tokensUpdated today
    Auto-check: notes
  • Migrating Agno To Pydantic AI

    pydantic/pydantic-ai

    Official

    Migrate Python Agno applications to Pydantic AI and, only when needed, Pydantic AI Harness.

    21k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Official

    Migrate Python applications from the Claude Agent SDK to Pydantic AI and, only when needed, Pydantic AI Harness.

    21k GitHub stars~1.6k tokensUpdated today
    Auto-check passed

Questions about Deep Agents to Pydantic AI Migration

What does Deep Agents to Pydantic AI Migration do?

Migrates Python LangChain Deep Agents applications to Pydantic AI and Pydantic AI Harness while preserving the application's observed behavior. The skill treats a migration as preserving the application's observed contracts, not the shape of `create_deep_agent`. The agent first works out where the `deepagents` import comes from, reads repository instructions, manifests, lockfiles, tests and entrypoints, records exact versions of Deep Agents, LangChain, LangGraph, Pydantic AI and Harness, and traces one representative request through prompts, tools, middleware, backends, skills, memory, delegation, state, approvals, retries and events.

When should I use Deep Agents to Pydantic AI Migration?

Deep Agents to Pydantic AI Migration fits situations like: porting an app built on the `deepagents` package to Pydantic AI; moving Deep Agents subagents, memory and sandbox backends to Harness capabilities; checking that a migrated agent keeps the original's behavior.

How do I install Deep Agents to Pydantic AI Migration in Claude Code?

Run `npx skills add pydantic/pydantic-ai --skill migrating-deep-agents-to-pydantic-ai-harness -a claude-code`. Or copy the skill folder (src/pydantic_ai_harness/pydantic_ai_harness/.agents/skills/migrating-deep-agents-to-pydantic-ai-harness in pydantic/pydantic-ai) into .claude/skills/migrating-deep-agents-to-pydantic-ai-harness in your project. Claude Code loads it when a task matches its description.

How do I install Deep Agents to Pydantic AI Migration in Codex?

Run `npx skills add pydantic/pydantic-ai --skill migrating-deep-agents-to-pydantic-ai-harness -a codex`. Or copy the skill folder (src/pydantic_ai_harness/pydantic_ai_harness/.agents/skills/migrating-deep-agents-to-pydantic-ai-harness in pydantic/pydantic-ai) into .agents/skills/migrating-deep-agents-to-pydantic-ai-harness in your project. Codex loads it when a task matches its description.

Can I use Deep Agents to Pydantic AI Migration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pydantic/pydantic-ai --skill migrating-deep-agents-to-pydantic-ai-harness -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/migrating-deep-agents-to-pydantic-ai-harness, .gemini/skills/migrating-deep-agents-to-pydantic-ai-harness, .github/skills/migrating-deep-agents-to-pydantic-ai-harness and .opencode/skills/migrating-deep-agents-to-pydantic-ai-harness in your project.

What does Deep Agents to Pydantic AI Migration need to run?

SKILL.md names no scripts, command-line tools or credentials: Deep Agents to Pydantic AI Migration is instructions for the agent only. Our summary lists: A Python application that uses the `deepagents` package or reproduces its contracts.

Does Deep Agents to Pydantic AI Migration access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Deep Agents to Pydantic AI Migration safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Deep Agents to Pydantic AI Migration use?

Deep Agents to Pydantic AI Migration is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Deep Agents to Pydantic AI Migration use?

About 1.7k tokens (SKILL.md is roughly 6.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6.9k tokens, read only when the agent opens those files.

What are the alternatives to Deep Agents to Pydantic AI Migration?

Skills that share tags, products or a category with Deep Agents to Pydantic AI Migration: Failproof AI SDK Integration (FailproofAI/failproofai, 5.3k stars), Langchain Upgrade Migration (jeremylongshore/tons-of-skills-marketplace, 2.8k stars), Add Example Agent (GetBindu/Bindu, 10k stars) and Omnigent Framework Detection (omnigent-ai/omnigent, 11k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Deep Agents to Pydantic AI Migration?

pydantic (a GitHub organization, an official publisher) maintains it in pydantic/pydantic-ai, which has 20,537 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on October 11, 2026.

Source: pydantic/pydantic-ai on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.