pydantic-models-py
What it does
This tool helps create organized data structures for use in computer programs, especially for communication between different parts of a system (like an API). It uses a pattern called the 'Multi-Model Pattern' to define how data should be.
When to use it
- ✓When defining how data is sent to create something new.
- ✓When defining how data is sent to update something existing.
- ✓When defining how data is returned as a response.
Skill link
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/pydantic-models-py/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Create a Pydantic model for a user with name, email, and creation date fields, following the multi-model pattern.”
5 new skills a week. 1 minute to read.
How it works
The tool uses the Pydantic library to define 'models' which are like blueprints for organizing data. It suggests using base models for common data and specific models for creation, updates, and responses.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Pydantic Models
Create Pydantic models following the multi-model pattern for clean API contracts.
Quick Start
Use the inline model patterns below and adapt class names and fields to the actual API contract. Inspect the installed Pydantic version before selecting configuration syntax; these fragments require the imports and application types shown by your project. Do not assume a standalone template file is bundled.
Multi-Model Pattern
| Model | Purpose |
|---|---|
Base |
Common fields shared across models |
Create |
Request body for creation (required fields) |
Update |
Request body for updates (all optional) |
Response |
API response with all fields |
InDB |
Database document with doc_type |
camelCase Aliases
class MyModel(BaseModel):
workspace_id: str = Field(..., alias="workspaceId")
created_at: datetime = Field(..., alias="createdAt")
class Config:
populate_by_name = True # Accept both snake_case and camelCase
Optional Update Fields
class MyUpdate(BaseModel):
"""All fields optional for PATCH requests."""
name: Optional[str] = Field(None, min_length=1)
description: Optional[str] = None
Database Document
class MyInDB(MyResponse):
"""Adds doc_type for Cosmos DB queries."""
doc_type: str = "my_resource"
Integration Steps
- Create models in
src/backend/app/models/ - Export from
src/backend/app/models/__init__.py - Add corresponding TypeScript types
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
FAQ
What is Pydantic?
Pydantic is a Python library that helps validate and organize data using type annotations.
What is the 'Multi-Model Pattern'?
It's a way to organize your data models for different purposes, such as creation, updates, or responses, ensuring clarity and consistency.
What are 'camelCase Aliases' for?
They allow your models to accept field names in both 'snake_case' (like `workspace_id`) and 'camelCase' (like `workspaceId`) formats, making integration more flexible.
Details
Original description by the author
Create Pydantic models following the multi-model pattern for clean API contracts.
Popularity
- GitHub stars
- 48k
- Ranking position
- #5542
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
00-andruia-consultant
48kHelps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
007
48kLets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
10-andruia-skill-smith
48kHelps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
20-andruia-niche-intelligence
48kLets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
Similar skills
api-connector-builder
280kHas your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
api-design
280kHelps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.