Create Pydantic models following the multi-model pattern for clean API contracts.
44
46%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./plugins/AI-Agents-Safe-Coding-Skills/skills/pydantic-models-py/SKILL.mdThe canonical home for this skill is pydantic-models-py in administrakt0r/AI-Agents-Safe-Coding-Skills
Create Pydantic models following the multi-model pattern for clean API contracts.
Copy the template from assets/template.py and replace placeholders:
{{ResourceName}} → PascalCase name (e.g., Project){{resource_name}} → snake_case name (e.g., project)| 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 |
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 camelCaseclass MyUpdate(BaseModel):
"""All fields optional for PATCH requests."""
name: Optional[str] = Field(None, min_length=1)
description: Optional[str] = Noneclass MyInDB(MyResponse):
"""Adds doc_type for Cosmos DB queries."""
doc_type: str = "my_resource"src/backend/app/models/src/backend/app/models/__init__.pyThis skill is applicable to execute the workflow or actions described in the overview.
57c135b
Canonical home
since Aug 19, 2026
Also appears in
since Aug 19, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.