MR
Mayur Rathi
@mayurrathi
⭐ 40.7k GitHub stars

Pydantic Models Py

Pydantic Models Py is an code AI skill with a core value of Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants. It helps developers solve real-world problems in the code domain, boosting efficiency, automating repetitive tasks, and optimizing workflows.

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

Last verified on: 2026-07-07

Quick Facts

Category code
Works With Claude
Source sickn33/antigravity-awesome-skills
Stars ⭐ 40.7k
Last Verified 2026-07-07
Risk Level Low
mkdir -p ./skills/pydantic-models-py && curl -sfL https://raw.githubusercontent.com/sickn33/antigravity-awesome-skills/main/skills/pydantic-models-py/SKILL.md -o ./skills/pydantic-models-py/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

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

🎯 Best For

  • Claude users
  • Software engineers
  • Development teams
  • Tech leads

💡 Use Cases

  • Code quality improvement
  • Best practice enforcement

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Pydantic Models Py to Your Work

    Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.

  4. 4

    Review and Refine

    Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.

❓ Frequently Asked Questions

Is Pydantic Models Py compatible with Cursor and VS Code?

Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.

Do I need specific dependencies for Pydantic Models Py?

Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.

How do I install Pydantic Models Py?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/pydantic-models-py/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Skipping validation

Always test AI-generated code changes, even for simple refactors.

Missing dependency updates

Check if the skill requires updated dependencies or new packages.

🔗 Related Skills