Official agent skill

Pydantic Models Py

by microsoft in microsoft/skills

Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants.

OfficialMITAuto-check passed

Install Pydantic Models Py

skills CLI
$ npx skills add microsoft/skills --skill pydantic-models-py -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/skills pydantic-models-py --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/plugins/azure-sdk-python/skills/pydantic-models-py .claude/skills/pydantic-models-py && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pydantic-models-py
GitHub stars
3.1k
Used in
6 other repos
Token cost
~496 tokens
SKILL.md length
104 words
Files
3 (incl. references, assets)
Skills in repo
150
Repo updated
First seen
Licence
MIT

At a glance

Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants.

  • Works in 3 steps: Create models in src/backend/app/models/ → Export from src/backend/app/models/init.py → Add corresponding TypeScript types
  • Defining API request/response schemas
  • SKILL.md covers Quick Start, Multi-Model Pattern, camelCase Aliases and Optional Update Fields, plus 3 more sections
  • Runs Python scripts from its folder

What it does

Pydantic Models Py is an agent skill from microsoft/skills, published by the product's own GitHub organization. Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants. Use when defining API request/response schemas, database models, or data validation in Python applications using Pydantic v2.

Its SKILL.md is about 500 tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files and assets (for example `assets/template.py` and `references/capabilities.md`).

It works with Pydantic and Python. The repository describes itself as: Skills, MCP servers, Custom Agents, Agents.md for SDKs to ground Coding Agents. The licence is MIT.

When your agent uses it

  • Defining API request/response schemas
  • Database models
  • Data validation in Python applications using Pydantic v2

Example prompts

  • “/pydantic-models-py”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Create models in src/backend/app/models/
  2. Export from src/backend/app/models/init.py
  3. Add corresponding TypeScript types

What it can do on your machine

Read from SKILL.md and the folder at commit 354361d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Pydantic Models Py loads about 496 tokens when it runs, and up to ~779 if it reads all its reference files. Until then it costs about 64 tokens; SKILL.md has 104 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~64
When it runs · the whole SKILL.md, loaded when a task matches
~496
With references · SKILL.md plus every file in references/, read only if the agent opens them
~779

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microsoft/skills at commit 354361d, republished under its MIT licence (© microsoft). 104 words, ~496 tokens.

Download SKILL.mdSave it as .claude/skills/pydantic-models-py/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
pydantic-models-py
description
Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants. Use when defining API request/response schemas, database models, or data validation in Python applications using Pydantic v2.
license
MIT
metadata.author
Microsoft
metadata.version
1.0.0

Pydantic Models

Create Pydantic models following the multi-model pattern for clean API contracts.

Quick Start

Copy the template from assets/template.py and replace placeholders:

  • {{ResourceName}} → PascalCase name (e.g., Project)
  • {{resource_name}} → snake_case name (e.g., project)

Multi-Model Pattern

ModelPurpose
BaseCommon fields shared across models
CreateRequest body for creation (required fields)
UpdateRequest body for updates (all optional)
ResponseAPI response with all fields
InDBDatabase document with doc_type

camelCase Aliases

python
from datetime import datetime

from pydantic import BaseModel, ConfigDict, Field

class MyModel(BaseModel):
    model_config = ConfigDict(populate_by_name=True)

    workspace_id: str = Field(..., alias="workspaceId")
    created_at: datetime = Field(..., alias="createdAt")

Optional Update Fields

python
class MyUpdate(BaseModel):
    model_config = ConfigDict(populate_by_name=True)

    name: Optional[str] = Field(None, min_length=1)
    description: Optional[str] = None

Database Document

python
class MyInDB(MyResponse):
    doc_type: str = "my_resource"

Integration Steps

  1. Create models in src/backend/app/models/
  2. Export from src/backend/app/models/__init__.py
  3. Add corresponding TypeScript types

Reference Files

FileContents
references/capabilities.mdAdditional non-hero capabilities, operation-group coverage, and production checklists.

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references, assets) in .github/plugins/azure-sdk-python/skills/pydantic-models-py of microsoft/skills.

  • SKILL.md
  • assets/template.py
  • references/capabilities.md

Open the folder on GitHubat commit 354361d

Used in 6 other repositories

We found 17 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 6 other GitHub owners. This page covers the copy in microsoft/skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Pydantic Models Py next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Pydantic Models Py compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Pydantic Models Py this skillmicrosoft/skills3.1k6 repos~496Automated safety check: PassMIT
Building Pydantic AI Agentsdocling-project/docling68k—~2.8kAutomated safety check: PassMIT
Fastcrudbenavlabs/fastcrud1.6k—~5kAutomated safety check: PassMIT
Prompt Engineering Patternswshobson/agents40k—~1.3kAutomated safety check: PassMIT
A2ui Generate Pydantic Modelsa2ui-project/a2ui17k—~2.3kAutomated safety check: PassApache-2.0
Migrating Agno To Pydantic AIpydantic/pydantic-ai20k—~1.8kAutomated safety check: PassMIT

Similar skills

  • Building Pydantic AI Agents

    docling-project/docling

    Patterns and tested examples for building agents with Pydantic AI: tools, capabilities, structured output, dependency injection, hooks, YAML specs, streaming and testing.

    68k GitHub stars~2.8k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Fastcrud

    benavlabs/fastcrud

    A skill your agent uses when building or modifying CRUD endpoints with FastCRUD (the fastcrud PyPI package) in a FastAPI project — covers FastCRUD, crudrouter, EndpointCreator, FilterConfig…

    1.6k GitHub stars~5k tokensUpdated 12 days ago
    Backend & APIsAuto-check passed
  • Reference for designing and tuning production LLM prompts: few-shot examples, chain-of-thought, structured outputs, templates and system prompts.

    40k GitHub stars~1.3k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed
  • Automated generator for strongly typed Pydantic v2 data models and basic catalogs across any A2UI protocol version (v0.8, v0.9, v0.9.1, v1.0, etc.).

    17k GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Migrating Agno To Pydantic AI

    pydantic/pydantic-ai

    Official

    Migrate Python Agno applications to Pydantic AI and, only when needed, Pydantic AI Harness.

    20k GitHub stars~1.8k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • MCP Scaffold

    timothywarner-org/claude-code

    Scaffold production-ready Python MCP servers using FastMCP. An agent skill from timothywarner-org/claude-code.

    224 GitHub stars~940 tokensUpdated 2 mo ago
    Agent WorkflowsAuto-check passed

More from microsoft/skills

All 150 skills in this repo
  • Official

    Reference for building on Microsoft Foundry with the azure-ai-projects Python SDK: project clients, versioned agents, evaluations, connections, datasets and indexes.

    3.1k GitHub starsUsed in 6 repos~2.8k tokens
    Auto-check passed
  • Official

    Python guidance for the Azure AI Search SDK covering vector, hybrid and semantic search, index management and indexers, with Entra ID authentication preferred over keys.

    3.1k GitHub starsUsed in 6 repos~4.4k tokens
    Auto-check passed
  • Official

    Covers producer, consumer, and checkpoint-store setup for Azure Event Hubs streaming in Python, with Entra ID auth and partition targeting.

    3.1k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Official

    Builds podcast-style audio narration from text with Azure OpenAI's GPT Realtime Mini over WebSocket, from a Python FastAPI backend to a React player.

    3.1k GitHub starsUsed in 1 repo~947 tokens
    Auto-check passed
  • Frontend UI Dark TS

    microsoft/skills

    Official

    Build dark-themed React applications using Tailwind CSS with custom theming, glassmorphism effects, and Framer Motion animations.

    3.1k GitHub starsUsed in 5 repos~3.6k tokens
    Auto-check passed
  • Skill Creator

    microsoft/skills

    Official

    Guide for creating effective skills for AI coding agents working with Azure SDKs and Microsoft Foundry services.

    3.1k GitHub starsUsed in 5 repos~17k tokens
    Auto-check passed

Works with

Questions about Pydantic Models Py

What does Pydantic Models Py do?

Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants. Pydantic Models Py is an agent skill from microsoft/skills, published by the product's own GitHub organization. Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants.

When should I use Pydantic Models Py?

Pydantic Models Py fits situations like: defining API request/response schemas; database models; data validation in Python applications using Pydantic v2.

How do I install Pydantic Models Py in Claude Code?

Run `npx skills add microsoft/skills --skill pydantic-models-py -a claude-code`. Or copy the skill folder (.github/plugins/azure-sdk-python/skills/pydantic-models-py in microsoft/skills) into .claude/skills/pydantic-models-py in your project. Claude Code loads it when a task matches its description.

How do I install Pydantic Models Py in Codex?

Run `npx skills add microsoft/skills --skill pydantic-models-py -a codex`. Or copy the skill folder (.github/plugins/azure-sdk-python/skills/pydantic-models-py in microsoft/skills) into .agents/skills/pydantic-models-py in your project. Codex loads it when a task matches its description.

Can I use Pydantic Models Py in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/skills --skill pydantic-models-py -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pydantic-models-py, .gemini/skills/pydantic-models-py, .github/skills/pydantic-models-py and .opencode/skills/pydantic-models-py in your project.

What does Pydantic Models Py need to run?

Going by SKILL.md and its folder, Pydantic Models Py needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Pydantic Models Py access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Pydantic Models Py safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Pydantic Models Py use?

Pydantic Models Py is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Pydantic Models Py use?

About 496 tokens (SKILL.md is roughly 2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 283 tokens, read only when the agent opens those files.

What are the alternatives to Pydantic Models Py?

Skills that share tags, products or a category with Pydantic Models Py: Building Pydantic AI Agents (docling-project/docling, 68k stars), Fastcrud (benavlabs/fastcrud, 1.6k stars), Prompt Engineering Patterns (wshobson/agents, 40k stars) and A2ui Generate Pydantic Models (a2ui-project/a2ui, 17k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Pydantic Models Py?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/skills, which has 3,086 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on October 6, 2026.

Source: microsoft/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.