agentleFS
FullFranFullFran/Agent-skills-POC/.agents/skills/pydantic-ai/SKILL.md

pydantic-ai

Skill1 starsChanged 10 months agoMITView on GitHub

Expert guidance on building agents and tools with Pydantic AI.

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
  1. Very specific:

    State Management: Use StateDeps[T] to pass dependencies (DB clients, settings) to agents.

    line 12
  2. Very specific:

    Model Choice: Use OpenAIModel as a base for OpenAI-compatible providers (OpenRouter, Ollama) via OpenAIProvider.

    line 14
  3. Very specific:

    Rich Integration: Use Rich to display real-time streaming of agent output and tool call details.

    line 24
  4. Distinctive:

    Transparency: Always show the user which tool is being called and with what parameters.

    line 26

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.instructions for dynamic context.
  • Model Choice: Use OpenAIModel as a base for OpenAI-compatible providers (OpenRouter, Ollama) via OpenAIProvider.

🛠️ 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 Rich to display real-time streaming of agent output and tool call details.
  • Node Handling: Implement logic for user_prompt, model_request, call_tools, and end nodes in the CLI.
  • Transparency: Always show the user which tool is being called and with what parameters.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.