pydantic-schemas

pydantic-schemas is a skill for Claude Code from robhowley/py-pit-skills. It costs 44 tokens per session (2,816 once invoked), scanned A, original, MIT.

A set of rules for structuring Pydantic v2 schemas, which define the data an API accepts and returns. It covers request, response, query, command, batch, and pagination shapes.

In plain words
What is it for?
For new Python API projects using Pydantic v2, especially when designing create, update, read, search, filter, batch, command, pagination, or reporting schemas.
Why use it?
It reduces schema drift, where different parts of an API gradually use inconsistent data formats, and avoids repeating design decisions.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Part of the py-pit plugin — 16 skills, 1 hook shipped together

Good fit For new Python API projects using Pydantic v2, especially when designing create, update, read, search, filter, batch, command, pagination, or reporting schemas.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/robhowley/py-pit-skills/pydantic-schemas
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add robhowley/py-pit-skills --skill pydantic-schemas
Clone the repo
git clone --depth 1 https://github.com/robhowley/py-pit-skills

Made for: Claude Code.

Or install py-pit, the plugin that ships this one along with the rest of its 16 skills, 1 hook.

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 pydantic-schemas

README.md
[![agentmods](https://agentmods.dev/badge/skills/robhowley/py-pit-skills/pydantic-schemas/github.svg)](https://agentmods.dev/skills/robhowley/py-pit-skills/pydantic-schemas)
Your own site
<a href="https://agentmods.dev/skills/robhowley/py-pit-skills/pydantic-schemas"><img src="https://agentmods.dev/badge/skills/robhowley/py-pit-skills/pydantic-schemas/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pydantic-schemas

Your own site · 80×15
<a href="https://agentmods.dev/skills/robhowley/py-pit-skills/pydantic-schemas"><img src="https://agentmods.dev/badge/skills/robhowley/py-pit-skills/pydantic-schemas.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,816 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.00044 $0.02816
Opus 5 $0.00022 $0.01408
Sonnet 5 $0.00009 $0.00563
Haiku 4.5 $0.00004 $0.00282

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

Security

Grade A, and why

pydantic-schemas 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 12d 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.

skills/pydantic-schemas/SKILL.md · 500 lines

How it starts

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

pydantic-schemas

Opinionated guidance for designing API request/response schemas using Pydantic v2 in new Python backend projects.

This skill is optimized for 0→1 API projects where schema conventions have not yet been established.
Its purpose is to prevent schema drift, eliminate repeated architectural decisions, and enforce a consistent API boundary between domain models and external representations.

This skill does not teach Pydantic basics.
It constrains schema architecture so the model consistently generates predictable request, response, query, and command structures.


Apply this Skill When

Apply this skill when the user:

  • asks how to structure API schemas
  • asks for request or response models
  • asks about Pydantic models in a FastAPI or API backend
  • is creating a new resource schema
  • is designing pagination or response envelopes
  • is implementing create/update/read models
  • is designing command endpoints, search/filter endpoints, batch endpoints, or aggregate/reporting responses

Trigger phrases (user language):

"add a schema for orders", "how should I structure my Pydantic models?", "I need a request body for creating a user", "what's the right way to do partial updates?", "how do I return paginated results?", "should I use the same model for create and update?", "how do I model a cancel order action?", "I need a search endpoint with filters"

Do not apply this skill when:

  • working with internal-only DTOs that never cross an API boundary
  • using Pydantic for local parsing scripts
  • the repository already uses a different schema architecture and the user did not request a refactor
  • working on non-API validation tasks

Mission

When this skill is active, the model's job is to produce or extend schema code that follows this taxonomy without deviation, ask no unnecessary questions, and leave the caller with working, importable schema classes.

Read the full file on GitHub · 500 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. 12d ago First seen · 500 lines · 44 tokens per session scan A 2b12d4e0ebc4

Subscribe to this mod's changes

pydantic-schemas is a skill published in the GitHub repository robhowley/py-pit-skills (5 stars, last pushed 5mo ago), licensed MIT. It adds 44 tokens to every session and 2,816 once invoked, about $0.0002 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-31.

Related

Other skills, from other repositories

python-backend

Production Python async patterns including asyncio TaskGroup, FastAPI dependency injection and middleware, SQLAlchemy 2.0 async sessions, and database connection pool tuning. Python 3.11+ runtime concerns such as ExceptionGroup, cancellation semantics, and session rollback. Use when building async services, wiring…

yonatangross/orchestkit · 82 tokens

python

Use when building FastAPI applications, implementing async endpoints, setting up Pydantic schemas, working with SQLAlchemy, or writing pytest tests for Python backend services.

MadAppGang/claude-code · 34 tokens

crudauth

Use when building or modifying authentication in a FastAPI app with crudauth (the crudauth PyPI package) — covers CRUDAuth, the AuthUserMixin / makeauthidentity user model, IdentityConfig, currentuser(...) gates, session + bearer transports, OAuth (Google/GitHub), email verification / password reset / change, custom…

benavlabs/crudauth · 188 tokens

FastAPI Testing Patterns

FastAPI application testing with TestClient, dependency injection overrides, async testing, database testing with SQLAlchemy, and OpenAPI validation.

PramodDutta/qaskills · 31 tokens

fastapi-best-practices

Use this skill when creating or modifying Python backend services with FastAPI. It defines API design, security, and testing standards.

ApexIQ/skillsmith · 32 tokens

python-fastapi-coding-conventions

This skill should be used when creating a service class, adding an API route, defining Pydantic schemas, writing error handling, reviewing code style, checking project directory structure, writing or running database migrations, or deciding what belongs in which layer. Covers style, naming, error handling, logging…

aishajv/claude-everything · 84 tokens