pydantic-ai-common-pitfalls
Avoid common mistakes and debug issues in PydanticAI agents. Use when encountering errors, unexpected behavior, or when reviewing agent implementations.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/anderskev/pydantic-ai-common-pitfallsWhat This Skill Does
The pydantic-ai-common-pitfalls skill acts as a diagnostic and reference engine for developers building AI agents with PydanticAI. It provides expert-level pattern matching to identify frequent architectural mistakes, such as improper tool decorator usage, incorrectly ordered RunContext parameters, and Pydantic dependency injection failures. By using this skill, developers can reduce debugging time for common 'UserError' messages and ensure their agent implementations adhere to the official PydanticAI library specifications.
Installation
To integrate this skill into your environment, run the following command in your terminal:
clawhub install openclaw/skills/skills/anderskev/pydantic-ai-common-pitfalls
Use Cases
This skill is best utilized during the iterative development phase of an AI agent. Use it when:
- You receive a
UserErrorregarding tool signature mismatch orRunContextissues. - You are troubleshooting agent crashes that occur during the
agent.run_syncoragent.runexecution lifecycle due to missing dependencies. - You are refactoring existing code to transition from standard functions to decorated tools.
- You need to verify if your custom tool registration pattern is valid under the current version of PydanticAI.
Example Prompts
- 'I am getting a UserError saying RunContext annotations can only be used with tools that take context. Can you check my tool implementation?'
- 'Why is my agent failing when I try to run it with deps? Here is the code snippet for my Agent instantiation.'
- 'Help me debug this error: First parameter of tools that take context must be annotated with RunContext.'
Tips & Limitations
This skill is designed as an analytical tool. When using it, always provide the specific snippet of code causing the issue, including the Agent definition and the relevant tool function signatures. Note that while this skill covers core PydanticAI pitfalls, it cannot diagnose runtime logic errors or issues external to the PydanticAI framework. Always ensure your environment uses compatible versions of Pydantic and PydanticAI, as breaking changes in the framework may render some diagnostic patterns obsolete. Always favor official documentation if the agent's suggestion conflicts with the latest release notes.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-anderskev-pydantic-ai-common-pitfalls": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: code-execution
Related Skills
tutorial-docs
Tutorial patterns for documentation - learning-oriented guides that teach through guided doing
fetch-pr-feedback
Fetch review comments from a PR and evaluate with receive-feedback skill
swift-testing-code-review
Reviews Swift Testing code for proper use of
rust-testing-code-review
Reviews Rust test code for unit test patterns, integration test structure, async testing, mocking approaches, and property-based testing. Covers Rust 2024 edition changes including async fn in traits for mocks,
explanation-docs
Explanation documentation patterns for understanding-oriented content - conceptual guides that explain why things work the way they do