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

migrating-agno-to-pydantic-ai — скилл для Claude Code и Cursor

Скилл migrating-agno-to-pydantic-ai для Claude Code переносит Python-приложения с Agno на Pydantic AI, трассируя реальный путь запроса и сохраняя HTTP-границы и инфраструктуру.

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

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

Что делает migrating-agno-to-pydantic-ai

Скилл трассирует один реальный вызов — от Agent.run() или Team.run() через инструменты, хуки, загрузку сессий и события — и фиксирует контракт наблюдаемого поведения до начала миграции.

Дальше скилл выбирает наименьшую цель: pydantic_ai.Agent для цикла агента, зависимостей и инструментов; pydantic_graph только когда нужны явные ветки и объединения; pydantic-ai-harness только при наблюдаемой переиспользуемой политике — памяти, планировщике или гардрейлах. Приложение сохраняет свои базы данных, очереди, маршруты и схемы хранения.

Есть зоны повышенного внимания: Agno Skills загружает инструкции из SKILL.md, но Harness Skills не подгружает связанные ресурсы и не выполняет скрипты — поэтому дополнительные инструменты FileSystem или Shell добавляются только для поведения, которое реально наблюдалось в источнике.

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

  • Перенести агентов, команды и рабочие процессы Agno на pydantic_ai.Agent
  • Сохранить историю чата и состояние сессии при смене фреймворка
  • Переложить хуки, гардрейлы и паузы на подтверждение в Pydantic AI
  • Написать базовый тест поведения до начала переноса кода
  • Удалить зависимость agno только после того, как ни один путь её не требует

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

  • Перенеси src/agents/analyst.py с Agno на Pydantic AI, сохрани текущий HTTP-интерфейс
  • Протрассируй вызов Team.run() в pipeline.py и составь план миграции
  • Перенеси хуки и гардрейлы из app/hooks.py на эквиваленты Pydantic AI

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

1Через Skills CLI (Vercel)

npx skills add pydantic/skills --skill migrating-agno-to-pydantic-ai -a claude-code

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

~/.claude/skills/migrating-agno-to-pydantic-ai/SKILL.md

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

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

Вопросы о migrating-agno-to-pydantic-ai

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

Выполните команду npx skills add pydantic/skills --skill migrating-agno-to-pydantic-ai -a claude-code. Скилл появится в ~/.claude/skills/migrating-agno-to-pydantic-ai/SKILL.md.

Что делает скилл migrating-agno-to-pydantic-ai?

Он ведёт перенос Python-кода с Agno на Pydantic AI: трассирует наблюдаемое поведение, выбирает минимальный набор целевых пакетов и контролирует высокорисковые точки — сессии, делегирование команды, паузы и стриминг.

Нужен ли Pydantic AI Harness для каждой миграции?

Нет. Harness добавляется только когда в источнике есть реально наблюдаемая политика: переиспользуемая память, планировщик, субагенты или гардрейлы. Простой агент мигрирует через pydantic_ai.Agent без Harness.

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

SKILL.md · MIT
---
name: migrating-agno-to-pydantic-ai
description: Migrate 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.
---

# Migrate Agno to Pydantic AI

Preserve observable behavior, not Agno's object model. Migrate the smallest complete caller path and keep application infrastructure in place.

## Trace the source before choosing a target

1. Read repository instructions, dependencies, tests, and the runtime entrypoint. Record the installed Agno, Pydantic AI, and Harness versions.
2. Trace one real request from `Agent.run()` / `arun()`, `Team.run()` / `arun()`, a `Workflow`, or an AgentOS endpoint through instructions, model and tool calls, hooks, session loading, memory or knowledge retrieval, events, results, state, and side effects. Establish a focused baseline or characterization test.
3. Separate these source contracts when present:
   - trusted dependencies, model-chosen tool input, session state, and workflow state;
   - conversation history, session summaries, user memories, knowledge retrieval, workflow checkpoints, and model-owned plans;
   - final content, structured output, token deltas, run events, pauses, and terminal status;
   - confirmation, user input, external tool execution, authenticated authorization, and process isolation;
   - team delegation, deterministic workflow control, AgentOS transport, queues, and deployment.
4. Record each observed contract, its owner, semantic difference, and executable proof. An unused Agno feature is not migration scope.

Read [Research and concept mapping](references/RESEARCH-AND-MAPPING.md) for the detected features. Read [Verification and cutover](references/VERIFICATION-AND-CUTOVER.md) before implementation.

## Choose the smallest target

- **Core:** use `pydantic_ai.Agent` for the agent loop, typed dependencies, tools, outputs, normalized messages, generic hooks, streaming, MCP clients, approvals, usage limits, instrumentation, realtime, and durable-runtime integrations.
- **Graph:** use `pydantic_graph` only when explicit typed nodes, branches, and joins remain useful; use plain async Python for simple fixed control flow.
- **Harness:** add `pydantic-ai-harness` only for observed reusable policy such as memory notebooks, planning, model-directed subagents, Agent Skills, coding tools, guardrails, model-agnostic compaction, or step persistence. Harness capabilities compose through the core agent loop; Harness is not a second runtime.
- **Evals:** add the separate `pydantic-evals` package for observed datasets and evaluators.
- **Application:** retain authentication, databases, vector search, queues, AgentOS/API routes, storage schemas, deployment, product state, and UI transports unless the requested slice includes them.
- **Gap:** name behavior that no supported public seam preserves, explain its impact, and test a bounded adapter. Do not rebuild Agno's registry, database abstraction, event taxonomy, or AgentOS merely to hide a difference.

The normal migration is one reusable `Agent`, application services supplied through typed dependencies, typed tools and output, and application-owned storage of serialized `result.all_messages()` for later turns. Preserve an existing HTTP, job, or UI boundary with a small adapter and its current field names.

## Apply high-risk gates

- Agno `dependencies`, `user_id`, `session_id`, and authenticated identity are trusted runtime context, not model arguments. Put them in typed dependencies and authorize storage or effects in application code.
- Agno sessions combine distinct owners. Map chat history to serialized Pydantic AI messages; keep mutable product/session state in an application store; treat summaries, user memories, knowledge retrieval, workflow checkpoints, and Harness `Memory` as separate contracts. Choose and test record conversion, a read-through adapter, or starting fresh as an accepted change.
- Inspect a `Team`'s actual delegation mode and caller-visible member events. Use Harness `SubAgents` only for model-directed, isolated task delegation. Keep routing, broadcast, deterministic fan-out, shared-context collaboration, aggregation, and retries in application or graph code unless parity is proved.
- Keep Agno `Workflow` steps, conditions, routers, loops, and parallel joins deterministic. Do not move them into an agent prompt. Graph state alone is not a persisted checkpoint.
- Agno pauses for confirmation, user input, and external execution have different payloads and owners. Core deferred tools can preserve pending model tool calls; the application still owns identity, authorization, UI, audit, persistence, correlation, and idempotency. Prove restart when the source pause survives one.
- Map pre/post hooks, tool hooks, and guardrails by firing point, mutation, short-circuit behavior, ordering, retries, streaming visibility, and persistence. Similar hook names do not prove lifecycle parity.
- Map consumer intent for streaming. Pydantic AI output streaming, run-event streaming, capability events, UI adapters, and graph iteration are different surfaces; none promises Agno's run-event taxonomy or resume cursor.
- Agno Skills can expose instructions, references, and scripts. Harness `Skills` loads `SKILL.md` instructions on demand but does not load bundled resources or execute scripts; add explicit `FileSystem`, `Shell`, or application tools only for observed, trusted behavior.
- AgentOS routes, auth, session APIs, telemetry, control plane, database selection, and deployment are product infrastructure. Keep or replace each deliberately rather than treating an agent port as an AgentOS port.
- Tool allowlists, path checks, and guardrails are policy, not OS isolation. Use a container, VM, or cloud sandbox when untrusted execution is in scope.

## Implement and prove one vertical slice

1. Preserve the supported caller boundary and replace only agent-owned internals.
2. Start core-only. Add `pydantic_graph`, Harness, Evals, or a durable runtime only after a source contract requires it.
3. Test inputs, typed outputs, errors, event order, tool arguments/results, hook decisions, state across turns, and side effects at that boundary. Use deterministic models and fake application services offline; add a focused recorded or live test only when provider behavior is the contract.
4. For persistence, pauses, concurrent workflows, or external effects, test interruption and restart, lineage, authorization, failure aggregation, and idempotency at the exact boundary Agno promised.
5. Remove `agno`, AgentOS setup, and Agno storage or event adapters only after no retained path needs them.

Explain any consequential semantic change before implementing it: state the source behavior, target behavior, caller impact, recommended choice, and remaining risk.

## Completion

Apply the completion criterion in [Verification and cutover](references/VERIFICATION-AND-CUTOVER.md). Label evidence from fakes, recordings, live providers, and operational tests accurately.

© pydantic · MIT · pydantic/skills

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

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →
pydantic-ai-agent-creation existential-birds Скилл pydantic-ai-agent-creation помогает создавать типобезопасных агентов на PydanticAI: со структурированным выводом, зависимостями и настройками модели. Нужен при сборке AI-агентов и чат-систем. CX Codex +1 219установок pydantic-ai-common-pitfalls existential-birds Скилл pydantic-ai-common-pitfalls разбирает типичные ошибки в агентах на PydanticAI и подсказывает, что править: декораторы инструментов, зависимости, схемы вывода, стриминг. CX Codex +1 221установок clickhouse-pydantic-config terrylica Скилл clickhouse-pydantic-config для Claude Code собирает файл подключений DBeaver для ClickHouse из Pydantic-модели и переменных окружения. Локальная и облачная базы открываются в клиенте без ручного ввода. CX Codex +1 130установок pydantic jiatastic Скилл объясняет агенту, как описывать данные моделями Pydantic: типизированные поля, валидаторы, сериализация и выгрузка JSON-схемы. CX Codex +1 194установок 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установок migrating-ai-sdk-to-common-ai astronomer Скилл migrating-ai-sdk-to-common-ai для Claude Code переводит Airflow-проекты с airflow-ai-sdk на apache-airflow-providers-common-ai 0.4.0+. Перестраивает импорты, декораторы и конфигурацию моделей под соединения. CX Codex +1 394установок

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

Весь набор →
migrating-vercel-ai-sdk-and-eve-to-pydantic-ai Скилл migrating-vercel-ai-sdk-and-eve-to-pydantic-ai для Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode переводит TypeScript-проекты на Vercel AI SDK или Eve в Python с Pydantic AI. CX Codex +1 469установок migrating-google-adk-to-pydantic-ai Скилл migrating-google-adk-to-pydantic-ai помогает переносить Python-приложения с Google ADK на Pydantic AI, сохраняя поведение вызовов, инструментов, состояния и рабочих процессов. CX Codex +1 468установок migrating-claude-agent-sdk-to-pydantic-ai Скилл migrating-claude-agent-sdk-to-pydantic-ai для Claude Code, Codex, Cursor, GitHub Copilot и Gemini CLI переводит Python-приложения с claude_agent_sdk на Pydantic AI. CX Codex +1 468установок migrating-mastra-to-pydantic-ai Скилл migrating-mastra-to-pydantic-ai для Claude Code и Codex переносит TypeScript-приложения на Mastra в Python с Pydantic AI. Срабатывает на коде с импортами @mastra/* или агентами, инструментами и воркфлоу Mastra. CX Codex +1 464установок 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установок migrating-deep-agents-to-pydantic-ai-harness Скилл migrating-deep-agents-to-pydantic-ai-harness для Claude Code переносит Python-приложения LangChain Deep Agents на Pydantic AI и Pydantic AI Harness. Работает с контрактами middleware, памяти, субагентов и sandbox. CX Codex +1 234установок

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

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