pydantic-ai
Skill1 starsChanged 10 months agoMITView on GitHub
Expert guidance on building agents and tools with Pydantic AI.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-orchestration-patternsSkill
- architecture-decision-recordSkill
- clean-architectureSkill
- doclingSkill
- docs-standardSkill
- mermaid-diagramsSkill
- mongodbSkill
- python-async-patternsSkill
- skill-creatorSkill
- software-architectureSkill
- supabaseSkill
- workflow-creatorSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
State Management: Use StateDeps[T] to pass dependencies (DB clients, settings) to agents.
- Very specific: line 14
Model Choice: Use OpenAIModel as a base for OpenAI-compatible providers (OpenRouter, Ollama) via OpenAIProvider.
- Very specific: line 24
Rich Integration: Use Rich to display real-time streaming of agent output and tool call details.
- Distinctive: line 26
Transparency: Always show the user which tool is being called and with what parameters.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Pydantic AI Expert Skill
This skill provides patterns for defining agents, dependencies, and tools using Pydantic AI.
🤖 Agent Definition
- State Management: Use
StateDeps[T]to pass dependencies (DB clients, settings) to agents. - System Prompts: Define complex prompts in
src/prompts.py. Use@agent.instructionsfor dynamic context. - Model Choice: Use
OpenAIModelas a base for OpenAI-compatible providers (OpenRouter, Ollama) viaOpenAIProvider.
🛠️ Tool Patterns
- Return Strings: Agents work best with text. Tools should return formatted strings, not Pydantic objects.
- Resource Management: Initialize and cleanup DB connections properly within the tool or via injected deps.
- Error Handling: Tools should catch exceptions and return helpful error messages to the agent rather than crashing.
📺 CLI & Streaming
- Rich Integration: Use
Richto display real-time streaming of agent output and tool call details. - Node Handling: Implement logic for
user_prompt,model_request,call_tools, andendnodes in the CLI. - Transparency: Always show the user which tool is being called and with what parameters.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

