К основному содержанию
скилл CX Codex

migrating-deep-agents-to-pydantic-ai-harness — скилл для Claude Code

Скилл migrating-deep-agents-to-pydantic-ai-harness для Claude Code переносит Python-приложения LangChain Deep Agents на Pydantic AI и Pydantic AI Harness. Работает с контрактами middleware, памяти, субагентов и sandbox.

MIT 234 установок ★ 156 обновлён 2026-10-16

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add pydantic/skills --skill migrating-deep-agents-to-pydantic-ai-harness -a claude-code
Открыть на GitHub

Что делает migrating-deep-agents-to-pydantic-ai-harness

Скилл разбирает приложение на LangChain Deep Agents и переносит его поведение на примитивы Pydantic AI и возможности Pydantic AI Harness. Он предлагает начать с одного вертикального среза, сохранить формы запросов, результатов, ошибок и событий через адаптер, а затем прогнать исходные и проверочные тесты.

Агент проверяет источник импорта deepagents, версии зависимостей, точки входа, тесты и фактический жизненный цикл запроса. Отдельно рассматриваются инструменты, MCP, права, backend, sandbox, skills, memory, делегирование, checkpoints, approvals, streaming и внешние побочные эффекты. Очереди, tenancy, хранение артефактов и удалённый sandbox остаются в сервисах приложения. Если locked source недоступен, затронутое поведение помечается как непроверенное, а паритет не заявляется.

Какие задачи решает

  • перенести приложение с LangChain Deep Agents на Pydantic AI
  • сохранить формы запросов, результатов и ошибок при миграции
  • сопоставить middleware, memory, subagents и sandbox с возможностями Harness
  • проверить паритет поведения через characterization и regression-тесты

Примеры запросов агенту

  • Перенеси это Python-приложение с deepagents на Pydantic AI Harness, сохрани публичную границу.
  • Разбери миграцию по одному вертикальному срезу и проверь формы запросов, результатов, ошибок и событий.
  • Проверь, какие контракты middleware, memory, subagents и sandbox нужно сохранить в целевой архитектуре.

Как установить migrating-deep-agents-to-pydantic-ai-harness

1Через Skills CLI (Vercel)

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

2Вручную: положить файлы

~/.claude/skills/migrating-deep-agents-to-pydantic-ai-harness/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/migrating-deep-agents-to-pydantic-ai-harness/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о migrating-deep-agents-to-pydantic-ai-harness

Как установить migrating-deep-agents-to-pydantic-ai-harness в Claude Code?

Выполни npx skills add pydantic/skills --skill migrating-deep-agents-to-pydantic-ai-harness -a claude-code, затем открой ~/.claude/skills/migrating-deep-agents-to-pydantic-ai-harness/SKILL.md.

Что делает migrating-deep-agents-to-pydantic-ai-harness?

Скилл помогает перенести Python-приложение на LangChain Deep Agents к Pydantic AI и Pydantic AI Harness, сохранив наблюдаемые контракты. Он также задаёт порядок проверки версий, зависимостей, тестов и поведения приложения.

Чем этот скилл отличается от миграции обычного LangChain?

Он предназначен для приложений с upstream-пакетом deepagents или его контрактами middleware, backend, skills, memory, subagents и sandbox. Для обычных LangChain, LangGraph или LCEL-приложений используется migrating-langchain-to-pydantic-ai.

Исходный текст

SKILL.md · MIT
---
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](references/CORE-MIGRATION.md) for construction, models and profiles, prompts, tools and MCP, middleware, state, outputs, caching, or tracing.
   - [Context and Execution](references/CONTEXT-AND-EXECUTION.md) for coding-agent defaults, planning, files, permissions, backends, sandboxes, interpreters, media, skills, memory, retrieval, or context limits.
   - [Orchestration and Recovery](references/ORCHESTRATION-AND-RECOVERY.md) for synchronous, dynamic, or background subagents; grading loops; approvals; checkpoints; fault tolerance; durable execution; or streaming.
   - [Hosts and Protocols](references/HOSTS-AND-PROTOCOLS.md) 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.

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](references/TESTED-COMPOSITION.md) only when a local coding-agent composition is useful.
4. Read [Validation and Cutover](references/VALIDATION.md) 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 · pydantic/skills

Похожие скиллы

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →
managed-deep-agents langchain-ai Помогает проектировать, тестировать и развёртывать Managed Deep Agents в LangSmith. Включается при запросах на сборку серверного агента на Python или TypeScript. CX Codex +1 10 300установок deep-agents-memory langchain-ai Скилл deep-agents-memory разбирает бэкенды памяти в Deep Agents: что живёт внутри одного потока, что переживает перезапуск и как включать файловые инструменты вроде ls и grep. CX Codex +1 20 000установок pydantic-ai-dependency-injection existential-birds Скилл pydantic-ai-dependency-injection показывает, как передавать базы данных, API-клиенты и контекст пользователя в PydanticAI через RunContext и deps_type. CX Codex +1 141установок pydantic-ai-agent-creation existential-birds Скилл pydantic-ai-agent-creation помогает создавать типобезопасных агентов на PydanticAI: со структурированным выводом, зависимостями и настройками модели. Нужен при сборке AI-агентов и чат-систем. CX Codex +1 219установок mapbox-mcp-runtime-patterns mapbox Скилл mapbox-mcp-runtime-patterns учит агента подключать Mapbox MCP Server к ИИ-приложениям. Он помогает модели выбирать между расчётами Turf.js и сетевыми API маршрутизации. CX Codex +1 1 400установок migrating-airflow-2-to-3 astronomer Скилл migrating-airflow-2-to-3 для Claude Code: переводит DAG-код с Airflow 2.x на 3.x — импорты, операторы, хуки, работа с метаданными. Закрывает breaking changes там, где ручной поиск долгий. CX Codex +1 1 200установок

Из того же набора24

Весь набор →
migrating-mastra-to-pydantic-ai Скилл migrating-mastra-to-pydantic-ai для Claude Code и Codex переносит TypeScript-приложения на Mastra в Python с Pydantic AI. Срабатывает на коде с импортами @mastra/* или агентами, инструментами и воркфлоу Mastra. CX Codex +1 464установок migrating-agno-to-pydantic-ai Скилл migrating-agno-to-pydantic-ai для Claude Code переносит Python-приложения с Agno на Pydantic AI, трассируя реальный путь запроса и сохраняя HTTP-границы и инфраструктуру. CX Codex +1 463установок logfire-coding-agents Скилл logfire-coding-agents для Claude Code подключает сессии ИИ-агентов к телеметрии Logfire и настраивает маршрутизацию запросов моделей через Pydantic AI Gateway. CX Codex +1 239установок logfire-frontend Скилл logfire-frontend для Claude Code настраивает телеметрию браузера и сессионные записи Pydantic Logfire в веб-приложениях на JavaScript и TypeScript. CX Codex +1 237установок logfire-codex-connection Скилл logfire-codex-connection для Claude Code связывает Codex с Logfire, проверяет статус соединения и останавливает запись сессий. Включается при запросах на подключение к телеметрии и проверку статуса. CX Codex +1 235установок logfire-gateway Скилл logfire-gateway для Claude Code настраивает маршрутизацию запросов приложения к моделям через Pydantic AI Gateway. Активируется по просьбе подключить Gateway, его ключ или пример настройки провайдера. CX Codex +1 232установок pydantic-ai Плагин подсказывает Claude, как писать агентов на Pydantic AI: шаблоны, деревья решений и разбор типичных ошибок. ★ 156звёзд репо logfire Подключает платформу Logfire к проектам на Python и передаёт трейсы сессий в Claude Code. Помогает находить ошибки в логах и настраивать мониторинг сервисов. ★ 156звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой