When Pydantic AI shipped capabilities in v1.71+, we migrated all of them. The biggest lesson: we deleted our entire middleware abstraction layer (MiddlewareAgent, MiddlewareChain, ParallelMiddleware, pipeline compiler, config loaders). All replaced by subclassing AbstractCapability and overriding a few methods.
The article walks through what capabilities/hooks/agent specs actually are, with before/after code from each of our repos.
Key architectural insight: capabilities compose automatically. Before-hooks fire in registration order, after-hooks reverse, wrap-hooks nest as middleware. You don't build composition logic anymore -- the framework handles it.
Happy to answer questions about the migration or the specific libraries.
- Shields/guardrails: https://github.com/vstorm-co/pydantic-ai-middleware - Subagents: https://github.com/vstorm-co/pydantic-ai-subagents - Summarization: https://github.com/vstorm-co/pydantic-ai-summarization