migrating-mastra-to-pydantic-ai

Installation
SKILL.md

Migrate Mastra to Pydantic AI

Preserve observable behavior, not TypeScript or Mastra'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 Mastra, Pydantic AI, and Harness versions.
  2. Trace one real request from its public entrypoint, whether an Agent.generate() / Agent.stream() call or a workflow run, through the tools, processors, memory, events, results, state, and side effects that callers use. Establish a focused baseline or characterization test.
  3. Separate these source contracts when present:
    • request context, model-chosen tool input, workflow input/output, and shared workflow state;
    • conversation messages, semantic recall, working or observational memory, workflow snapshots, and model-owned plans;
    • final text or objects, token deltas, lifecycle events, tripwires, and terminal workflow status;
    • tool approval, authenticated authorization, and process or sandbox isolation;
    • deterministic workflows, agent-selected delegation, queues, schedules, and durable execution.
  4. Record each observed contract, its owner, semantic difference, and executable proof. An unused Mastra feature is not migration scope.

Read Research and concept mapping for the detected source features. Read Verification and cutover before implementation.

Choose the smallest target

Installs
220
Repository
pydantic/skills
GitHub Stars
140
First Seen
Sep 19, 2026