pydantic-ai: Skill for Claude Code

.agents/skills/adding-a-provider-api-feature/SKILL.md

adding-a-provider-api-feature is a skill for Claude Code from pydantic/pydantic-ai. It costs 97 tokens per session (3,218 once invoked), scanned A, original, MIT.

A workflow for adding a language-model provider feature, such as prompt caching, structured tool calls, reasoning effort, or safety settings, to Pydantic AI.

In plain words
What is it for?
It finds the existing cross-provider abstraction, uses its shape for the new API, and adds capability checks where needed.
Why use it?
It prevents provider-specific designs from conflicting with the library's shared interface and makes support and defaults deliberate.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; installed under .agents/ (shared by several agents); mentions AGENTS.md.

This is pydantic/pydantic-ai's own configuration. It tells Claude Code how to work on pydantic-ai itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything pydantic-ai configures →

About the project

Pydantic AI is a typed Python SDK for building AI agents that can use different language models and interfaces, including voice, image generation, and embeddings. Developers use it for applications ranging from structured data extraction to long-running multi-agent work. The catalogue entries provide workflows and configuration for its coding-agent and harness features.

pydantic/pydantic-ai · 19,741 stars · on GitHub · pydantic.dev

Reuse

Borrowing it

Nothing to install: this file belongs to pydantic/pydantic-ai. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/pydantic/pydantic-ai/main/.agents/skills/adding-a-provider-api-feature/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/pydantic/pydantic-ai

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for adding-a-provider-api-feature

README.md
[![agentmods](https://agentmods.dev/badge/skills/pydantic/pydantic-ai/adding-a-provider-api-feature.svg)](https://agentmods.dev/skills/pydantic/pydantic-ai/adding-a-provider-api-feature)
Your own site
<a href="https://agentmods.dev/skills/pydantic/pydantic-ai/adding-a-provider-api-feature"><img src="https://agentmods.dev/badge/skills/pydantic/pydantic-ai/adding-a-provider-api-feature.svg" alt="Measured on agentmods" height="20"></a>
Per session 97 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,218 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00097 $0.03218
Opus 5 $0.00048 $0.01609
Sonnet 5 $0.00019 $0.00644
Haiku 4.5 $0.00010 $0.00322

Measured 7d ago against content hash be35009be877, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

adding-a-provider-api-feature scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/adding-a-provider-api-feature/SKILL.md · 100 lines

How it starts

The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Adding a provider API feature

Use this when exposing a new provider API capability through Pydantic AI — prompt caching, strict/structured tool calling, thinking/reasoning effort, service tier, safety settings, logprobs, cache breakpoints, and the like. The output is a change that is consistent with how sibling providers already expose the same concept, defaults deliberately, and gates support with a capability flag.

Not for: adding a new model id (that's add-new-model), a bug fix, or a refactor.

The one rule that prevents the most rework

Before designing anything, find the existing cross-provider abstraction that governs this capability and let its shape decide the API. Most "how should I expose this?" questions are already answered by an abstraction the codebase has — reaching for a new provider-specific knob when one exists is the single most common thing maintainers reject. When a feature routes through an existing abstraction, the abstraction's shape pre-decides the API surface, the opt-out, and often the default.

The tell that you skipped this: you find yourself listing 2-3 "options" for how a user controls the feature. If one of those options duplicates an existing cross-provider control, it isn't a real option — the existing abstraction wins.

Step 0 — Enumerate sibling precedent

For the capability you're adding, list how every provider that already has an analog exposes it, and name the governing existing abstraction. It is one of:

  • a per-tool flagToolDefinition.strict: bool | None (tools.py), resolved in models/__init__.py::_customize_tool_def;
  • a shared ModelSettings fieldthinking, service_tier (settings.py), each with per-model resolvers mapping to native concepts;
  • a provider-prefixed {Provider}ModelSettings fieldanthropic_cache, openai_prompt_cache_key, groq_reasoning_effort;
  • a message-stream markerCachePoint in UserPromptPart.content (messages.py);
  • a ModelProfile capability flagopenai_supports_strict_tool_definition, bedrock_supports_prompt_caching.

Read the full file on GitHub · 100 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 100 lines · 97 tokens per session scan A be35009be877

Subscribe to this mod's changes

adding-a-provider-api-feature is a skill published in the GitHub repository pydantic/pydantic-ai (19,741 stars, last pushed yesterday), licensed MIT. It adds 97 tokens to every session and 3,218 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

open-source

Documentation reference for writing Python code using the browser-use open-source library. Use this skill whenever the user needs help with Agent, Browser, or Tools configuration, is writing code that imports from browseruse, asks about @sandbox deployment, supported LLM models, Actor API, custom tools, lifecycle…

browser-use/browser-use · 137 tokens

vllm

Deploy and serve LLMs with vLLM behind an OpenAI-compatible endpoint, with tool calling enabled for agent workloads.

Prism-Shadow/penguin-harness · 29 tokens

deepseek-harness

Use when building AI agent applications with a plugin-based architecture — Web UI, CLI, Python SDK, Cordis plugin system, multi-model orchestration. DeepSeek Harness (dsh): open-source agent harness by DeepSeek AI where everything is a plugin, powered by Cordis for spatiotemporal composability.

znlgis/opengis-skills · 68 tokens

fsl-business

Write and verify FSL business-layer specs for consultants, business owners, and PMs explicitly working on business-flow policy. Use for As-Is/To-Be process flows, actors, case stages, business policies, controls, KPIs, goals, and reform/control-preservation checks. Do not use for system requirements, UI/API/data-model…

ymm-oss/fsl · 98 tokens

django-patterns

Django architecture patterns, REST API design with DRF, ORM best practices, caching, signals, middleware, and production-grade Django apps.

affaan-m/ECC · 32 tokens

x402

Set up Browser Use Cloud payments with x402 — pay per request from a crypto wallet (USDC on Base mainnet), no signup or API key. Two setups it works out up front — "just use it" (set up a wallet so you or Claude Code can run cloud browser tasks paid from the wallet — Claude writes and runs throwaway scripts, nothing…

browser-use/browser-use · 175 tokens