pydantic-models-py

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

16 stars

Best use case

pydantic-models-py is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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

Teams using pydantic-models-py should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/pydantic-models-py/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/backend/pydantic-models-py/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/pydantic-models-py/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How pydantic-models-py Compares

Feature / Agentpydantic-models-pyStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 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

| 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

```python
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

```python
class MyUpdate(BaseModel):
    """All fields optional for PATCH requests."""
    name: Optional[str] = Field(None, min_length=1)
    description: Optional[str] = None
```

## Database Document

```python
class MyInDB(MyResponse):
    """Adds doc_type for Cosmos DB queries."""
    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

## When to Use
This skill is applicable to execute the workflow or actions described in the overview.

Related Skills

ios-foundation-models-diag

16
from diegosouzapw/awesome-omni-skill

Use when debugging Foundation Models issues — context exceeded, guardrail violations, slow generation, availability problems, unsupported language, or unexpected output. Systematic diagnostics with production crisis defense.

axiom-foundation-models

16
from diegosouzapw/awesome-omni-skill

Use when implementing on-device AI with Apple's Foundation Models framework — prevents context overflow, blocking UI, wrong model use cases, and manual JSON parsing when @Generable should be used. iOS 26+, macOS 26+, iPadOS 26+, axiom-visionOS 26+

avalonia-viewmodels-zafiro

16
from diegosouzapw/awesome-omni-skill

Optimal ViewModel and Wizard creation patterns for Avalonia using Zafiro and ReactiveUI.

defining-typescript-models

16
from diegosouzapw/awesome-omni-skill

Defines standard TypeScript interfaces for Appwrite Collections. Use when creating new models for Tours, Users, or Bookings to ensure full type safety.

sqlmodel-task-models

16
from diegosouzapw/awesome-omni-skill

This skill should be used when defining a robust, type-safe, and async-compatible database schema for the Todo application using SQLModel, ensuring compatibility with Better Auth and optimized for PostgreSQL.

API Models

16
from diegosouzapw/awesome-omni-skill

Your approach to handling API models. Use this skill when working on files where API models comes into play.

pydantic-ai

16
from diegosouzapw/awesome-omni-skill

Python framework for building production-grade AI agents with LLMs. Use when creating agents that need structured outputs, tools, dependency injection, or type-safe interactions. Specifically use for: (1) Building AI agents with OpenAI, Anthropic, Google, or other LLM providers, (2) Creating agents that require structured output validation via Pydantic models, (3) Implementing tool-calling agents with function tools, (4) Building multi-agent applications or A2A (Agent2Agent) protocol servers, (5) Adding observability with Pydantic Logfire, (6) Streaming responses or events from agents

models-dev

16
from diegosouzapw/awesome-omni-skill

Query AI model specifications, pricing, and capabilities from models.dev database. Use when users ask about AI model parameters (context window, token limits, cost per token), model comparisons, provider information, or need to look up specific model IDs for AI SDK integration. Triggers on queries like "What's the context window for GPT-4o?", "Compare Claude vs GPT", "How much does Gemini Pro cost?", "List OpenAI models", or "What models support tool calling?".

ai-models

16
from diegosouzapw/awesome-omni-skill

Latest AI models reference - Claude, OpenAI, Gemini, Eleven Labs, Replicate

agent-selecting-models

16
from diegosouzapw/awesome-omni-skill

Guidance for selecting appropriate AI model (sonnet vs haiku) based on task complexity, reasoning requirements, and performance needs. Use when implementing agents or justifying model selection.

adding-models

16
from diegosouzapw/awesome-omni-skill

Guide for adding new LLM models to Letta Code. Use when the user wants to add support for a new model, needs to know valid model handles, or wants to update the model configuration. Covers models.json configuration, CI test matrix, and handle validation.

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development