Agent skill

Pydantic Models Py

by diegosouzapw in diegosouzapw/awesome-omni-skills

Pydantic Models workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

MITAuto-check passedBackend & APIs

Install Pydantic Models Py

skills CLI
$ npx skills add diegosouzapw/awesome-omni-skills --skill pydantic-models-py -a claude-code

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

GitHub CLI
$ gh skill install diegosouzapw/awesome-omni-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/diegosouzapw/awesome-omni-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills_omni/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
159
Token cost
~3.2k tokens
SKILL.md length
1,449 words
Files
17 (incl. scripts, references, assets)
Skills in repo
39
Repo updated
First seen
Licence
MIT

At a glance

Pydantic Models workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

  • Works in 10 steps: Identify contract boundaries before… → Start from the external contract, not… → Choose a model taxonomy. → …
  • Internal model boundaries before merging
  • SKILL.md covers Overview, When to Use This Skill, Operating Table and Workflow, plus 4 more sections
  • Runs Python scripts from its folder

What it does

Pydantic Models Py is an agent skill from diegosouzapw/awesome-omni-skills. Pydantic Models workflow skill. Use this skill when the user needs Create Pydantic models following the multi-model pattern for clean API contracts and the operator should design explicit request, update, response, and internal model boundaries before merging or handing off.

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 21 other files, including scripts, reference files and assets (for example `ATTRIBUTION.md`, `OMNI_ENHANCED.json` and `ORIGIN.md`).

It sits in Backend & APIs, covering API design. It works with Pydantic and Python. The repository describes itself as: Public repository of AI coding skills, curated improved best-practice skills, and runtime surfaces for CLI, API, MCP, and A2A. The licence is MIT.

When your agent uses it

  • Internal model boundaries before merging
  • Tasks that involve API design

Example prompts

  • “/pydantic-models-py”

Requirements

  • Python 3

Workflow steps

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

  1. Identify contract boundaries before writing code.
  2. Start from the external contract, not the database shape.
  3. Choose a model taxonomy.
  4. Set explicit config for request safety.
  5. Define field naming policy and aliases deliberately.
  6. Separate create and update semantics.
  7. Validate and adapt at the correct boundary.
  8. Serialize public responses from public models.
  9. Place business rules carefully.
  10. Check generated payloads explicitly.

What it can do on your machine

Read from SKILL.md and the folder at commit c3af004. 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 1 file in scripts/ (Python, from the files we listed), 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 3.2k tokens when it runs, and up to ~4.9k if it reads all its reference files. Until then it costs about 74 tokens; SKILL.md has 1,449 words of instructions outside code blocks.

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

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); the scripts in this folder are not scanned.

SKILL.md

The full file from diegosouzapw/awesome-omni-skills at commit c3af004, republished under its MIT licence (© diegosouzapw). 1,449 words, ~3,221 tokens.

Download SKILL.mdSave it as .claude/skills/pydantic-models-py/SKILL.md (or your agent's skills folder). This skill also uses 16 other files; get the full folder from GitHub.
name
pydantic-models-py
description
Pydantic Models workflow skill. Use this skill when the user needs Create Pydantic models following the multi-model pattern for clean API contracts and the operator should design explicit request, update, response, and internal model boundaries before merging or handing off.
version
0.0.1
category
machine-learning
tags
pydantic-models-py, pydantic, api-contracts, request-models, response-models, patch-updates, omni-enhanced
complexity
advanced
risk
safe
tools
codex-cli, claude-code, cursor, gemini-cli, opencode
source
omni-team
author
Omni Skills Team
date_added
2026-03-27
date_updated
2026-04-19

Pydantic Models

Overview

Use this skill to create or refactor Pydantic models for API integration work where request and response contracts must stay explicit, stable, and safe.

The upstream intent is preserved: use a multi-model pattern instead of one overloaded model for every purpose. The enhanced workflow modernizes that pattern for Pydantic v2 and focuses on operational API contract design:

  • separate create, update, public response, and internal shapes when their contracts differ
  • use aliases intentionally when wire format differs from Python naming
  • treat PATCH semantics as distinct from create semantics
  • adapt ORM or document objects with from_attributes=True instead of legacy orm_mode
  • prevent accidental field leakage by serializing public models, not internal ones

This skill is framework-agnostic Python guidance. FastAPI-style patterns are referenced because they are common and well documented, but the workflow applies to general API integration work.

Version guard: this workflow assumes Pydantic v2 semantics such as model_validate, model_dump, ConfigDict, field_validator, and from_attributes.

When to Use This Skill

Use this skill when:

  • you need Pydantic models for an external or internal API contract
  • one model is starting to mix input validation, storage fields, and response serialization concerns
  • the task requires separate handling for create vs update vs response payloads
  • the API uses a different field naming style on the wire, such as camelCase externally and snake_case in Python
  • partial updates must preserve the difference between omitted fields and explicit null
  • ORM, document, or service-layer objects must be adapted into response models safely

Do not use this skill as the primary router when:

  • the user only needs a single ad hoc data container with no contract boundary concerns
  • the task is mainly about database schema design rather than API payload design
  • the task depends on framework-specific response plumbing more than on Pydantic model design

Operating Table

SituationRecommended model familyKey choicesPrimary methodsMain risk
Create or POST requestCreate / input modelrequired writable fields, extra='forbid', clear constraintsmodel_validate(...)accepting undeclared fields or weak validation
Partial update or PATCH requestUpdate modelall fields optional as transport inputs, use exclude_unset=Truemodel_dump(exclude_unset=True)clearing stored values by mistake
Public API responsePublic / Read modelexpose only contract fields, serialize with aliases if wire format needs themmodel_validate(...), model_dump(by_alias=True)leaking internal fields or wrong field names
Internal service responseInternal modelinclude operational metadata only if not publicmodel_validate(...), model_dump(...)reusing internal models as public DTOs
ORM or document adaptationPublic or Internal model with attribute adaptationfrom_attributes=True when validating from objectsmodel_validate(obj)legacy orm_mode assumptions or field shape mismatch
Persistence shapeseparate InDB / persistence model only if contract differs materiallyadd store-only fields only when neededvalidate near persistence boundaryunnecessary model sprawl

For selection guidance and config tradeoffs, see references/integration-patterns.md.

Workflow

  1. Identify contract boundaries before writing code. Decide whether the task truly needs separate models for create, update, public response, internal response, or persistence. Do not create extra model families unless the payloads differ in a way that matters.

  2. Start from the external contract, not the database shape. For API work, define what clients may send and receive first. Persistence-only fields such as internal IDs, doc_type, audit flags, revision tokens, or secret material should not appear in public response models unless explicitly required.

  3. Choose a model taxonomy. A practical default is:

    • ThingBase: shared constraints only when reuse is genuinely helpful
    • ThingCreate: fields accepted on creation
    • ThingUpdate: partial-update transport model
    • ThingPublic: fields returned to API clients
    • ThingInternal or ThingInDB: only when internal or persistence needs differ materially

    If Base inheritance makes public/private boundaries fuzzy, prefer separate models instead of inheritance.

  4. Set explicit config for request safety. For externally sourced request models, start conservative:

    python
    from pydantic import BaseModel, ConfigDict
    
    class WidgetCreate(BaseModel):
        model_config = ConfigDict(extra='forbid')

    Consider stricter settings intentionally. Reject undeclared fields unless you have a compatibility reason not to. Use default_factory for dynamic defaults instead of mutable literals.

  5. Define field naming policy and aliases deliberately. If Python code uses snake_case but the API contract uses camelCase, encode that policy explicitly. Be consistent about whether validation accepts Python names, wire aliases, or both.

    Preferred rule of thumb:

    • keep Python attributes idiomatic in code
    • expose the wire contract through aliases
    • serialize public payloads with by_alias=True when aliases define the contract
    • avoid mixing ad hoc field-level aliasing and broad alias generators without a reason
  6. Separate create and update semantics. Create models usually express required writable fields. Update models usually make all updatable fields optional so the transport layer can represent omission.

    Important distinction:

    • omitted field: leave current stored value unchanged
    • field present with null / None: clear it, if the contract allows
    • field present with value: replace or update

    Use model_dump(exclude_unset=True) when applying PATCH-like updates.

  7. Validate and adapt at the correct boundary. Use model_validate(...) when building models from request payloads, trusted dictionaries, or class instances. When validating from ORM or document objects, configure the target model with from_attributes=True.

  8. Serialize public responses from public models. Prefer:

    • validate an internal object into ThingPublic
    • serialize ThingPublic with model_dump(by_alias=True) if aliases define the contract

    Avoid dumping a richer internal model and trying to hide fields with ad hoc exclude lists.

  9. Place business rules carefully. Use field_validator or model_validator for transport and shape validation that belongs to the data contract. Keep workflow-specific side effects, repository checks, and cross-service orchestration in endpoint or service logic.

  10. Check generated payloads explicitly. Before finalizing, verify:

    • required vs optional fields match the real contract
    • public output excludes internal metadata
    • aliases serialize exactly as clients expect
    • PATCH behavior preserves omitted fields
Show full SKILL.md (545 more words)Show less

Troubleshooting

Incoming camelCase fields do not populate snake_case model fields

Symptoms

  • requests fail validation even though field names look correct to the client
  • response output uses the wrong field style

Likely causes

  • aliases were defined but serialization is not using by_alias=True
  • validation settings do not match the accepted request field style
  • alias strategy is mixed inconsistently across fields

Corrective actions

  • define one alias policy for the model family
  • ensure the public serialization path uses model_dump(by_alias=True) when aliases define the API contract
  • avoid silently accepting multiple naming styles unless compatibility requires it
PATCH or update requests clear values unexpectedly

Symptoms

  • omitted fields overwrite stored data with None
  • updates behave like full replacement instead of partial modification

Likely causes

  • create and update models are being reused as if they were identical
  • update application logic uses the full dumped model instead of exclude_unset=True
  • explicit None is not being distinguished from field omission

Corrective actions

  • create a dedicated Update model
  • apply updates using model_dump(exclude_unset=True)
  • decide explicitly whether None means clear-the-value or invalid input for each field
ORM or document objects fail validation

Symptoms

  • validation errors occur when passing model instances or row objects into response models
  • nested attributes do not serialize as expected

Likely causes

  • target model is missing from_attributes=True
  • attribute names on the object do not match the response model fields or aliases
  • the object contains richer nested state than the response contract allows

Corrective actions

  • enable attribute-based validation on the target response model
  • validate into a public DTO rather than serializing the raw ORM object
  • inspect field names and nested object shapes before assuming the failure is a Pydantic bug
Extra fields are accepted or rejected unexpectedly

Symptoms

  • clients can send undeclared fields without error
  • valid-looking requests fail because of unrecognized keys

Likely causes

  • extra handling was left implicit
  • request compatibility expectations are unclear

Corrective actions

  • set extra='forbid' for external request models unless a looser contract is intentional
  • document any compatibility exceptions clearly
  • do not use permissive extra handling as a shortcut for poor contract definition
Public responses leak internal metadata

Symptoms

  • internal IDs, persistence fields, or operational flags appear in API output

Likely causes

  • internal and public models were merged for convenience
  • responses are serialized from internal models with ad hoc exclusions

Corrective actions

  • create a dedicated public response model
  • validate internal data into the public model before serialization
  • verify the exact wire payload with model_dump(by_alias=True) when aliases are used

Examples

See examples/request-response-example.md for a complete worked example that includes:

  • separate create, update, public, internal, and persistence-adaptation models
  • a camelCase wire contract with snake_case Python attributes
  • extra='forbid' on request models
  • from_attributes=True for adapting an object into a public DTO
  • a PATCH scenario showing omitted vs explicit null

Additional Resources

  • references/integration-patterns.md — model-family selection matrix, alias policy options, config defaults, and contract safety guidance
  • Pydantic v2 documentation for models, config, aliases, serialization, validators, and attribute-based validation
  • FastAPI documentation on extra models and body updates for common API usage patterns
  • JSON Schema and OpenAPI references for contract-oriented field semantics

Use related skills when the task drifts into:

  • framework-specific endpoint wiring rather than model design
  • database migrations or persistence schema design
  • TypeScript client generation or OpenAPI publication workflow

When in doubt, keep this skill focused on Pydantic model boundaries and API contract correctness rather than general backend implementation.

© diegosouzapw, 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 16 other files (scripts, references, assets) in skills_omni/pydantic-models-py of diegosouzapw/awesome-omni-skills.

  • SKILL.md
  • ATTRIBUTION.md
  • OMNI_ENHANCED.json
  • ORIGIN.md
  • agents/omni-import-router.md
  • assets/omni-import-source-manifest.json
  • examples/omni-import-operator-packet.md
  • examples/omni-import-prompt-template.md
  • examples/request-response-example.md
  • metadata.json
  • references/integration-patterns.md
  • references/omni-import-checklist.md
  • references/omni-import-playbook.md
  • references/omni-import-rubric.md
  • references/omni-import-source-summary.md
  • scripts/omni_import_list_support_pack.py
  • … and 1 more

Open the folder on GitHubat commit c3af004

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 skilldiegosouzapw/awesome-omni-skills159—~3.2kAutomated safety check: PassMIT
Fastapiericrisco/rsc-harness167—~5kAutomated safety check: NotesMIT
Agentic Workflows API Documentation Lungoagntcy/coffeeAgntcy112—~2.6kAutomated safety check: PassApache-2.0
Fastcrudbenavlabs/fastcrud1.6k—~5kAutomated safety check: PassMIT
API Surface Reviewpolarsource/polar10k—~1.3kAutomated safety check: PassMIT
Fastapi Appccplugins/awesome-claude-code-plugins968—~1.1kAutomated safety check: NotesApache-2.0

Similar skills

  • Fastapi

    ericrisco/rsc-harness

    A skill your agent uses when building, reviewing, testing, securing or shipping a FastAPI / async Python service — routers, Pydantic v2 schemas, dependency injection, async SQLAlchemy 2.0…

    167 GitHub stars~5k tokensUpdated yesterday
    Backend & APIsAuto-check: notes
  • Authors and maintains the human-facing Agentic Workflows API documentation for the lungo subproject at coffeeAGNTCY/coffeeagents/lungo/docs/workflow-instanceapi.md.

    112 GitHub stars~2.6k tokensUpdated yesterday
    DevelopmentAuto-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 14 days ago
    Backend & APIsAuto-check passed
  • API Surface Review

    polarsource/polar

    Review changes to Polar's API contract — Pydantic schemas, FastAPI endpoints, OpenAPI output and the generated SDKs.

    10k GitHub stars~1.3k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Fastapi App

    ccplugins/awesome-claude-code-plugins

    Bootstrap a new FastAPI backend with async SQLAlchemy 2.0, asyncpg, Alembic, Pydantic v2, and no deprecated APIs.

    968 GitHub stars~1.1k tokensUpdated 1 mo ago
    Backend & APIsAuto-check: notes
  • Operator Migration

    vipshop/cache-dit

    A skill your agent uses when doing operator migration or kernel migration for CUDA, Triton, or custom ops in cache-dit; porting kernels from nunchaku, deepcompressor, or other repos; designing…

    1.3k GitHub stars~3.8k tokensUpdated 9 days ago
    Backend & APIsAuto-check passed

More from diegosouzapw/awesome-omni-skills

All 39 skills in this repo
  • Content Creator

    diegosouzapw/awesome-omni-skills

    Content Creator workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

    159 GitHub stars~4k tokensUpdated 3 mo ago
    Auto-check passed
  • Helm Chart Scaffolding

    diegosouzapw/awesome-omni-skills

    Helm Chart Scaffolding workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

    159 GitHub stars~2.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Prompt Engineering

    diegosouzapw/awesome-omni-skills

    Prompt Engineering Patterns workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

    159 GitHub stars~3.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Prompt Engineering Patterns

    diegosouzapw/awesome-omni-skills

    Prompt Engineering Patterns workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

    159 GitHub stars~4k tokensUpdated 3 mo ago
    Auto-check passed
  • Prompt Library

    diegosouzapw/awesome-omni-skills

    📝 Prompt Library workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

    159 GitHub stars~3.1k tokensUpdated 3 mo ago
    Auto-check passed
  • Protocol Reverse Engineering

    diegosouzapw/awesome-omni-skills

    Protocol Reverse Engineering workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

    159 GitHub stars~3.8k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Categories

Questions about Pydantic Models Py

What does Pydantic Models Py do?

Pydantic Models workflow skill. An agent skill from diegosouzapw/awesome-omni-skills. Pydantic Models Py is an agent skill from diegosouzapw/awesome-omni-skills. Pydantic Models workflow skill.

When should I use Pydantic Models Py?

Pydantic Models Py fits situations like: internal model boundaries before merging; tasks that involve API design.

How do I install Pydantic Models Py in Claude Code?

Run `npx skills add diegosouzapw/awesome-omni-skills --skill pydantic-models-py -a claude-code`. Or copy the skill folder (skills_omni/pydantic-models-py in diegosouzapw/awesome-omni-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 diegosouzapw/awesome-omni-skills --skill pydantic-models-py -a codex`. Or copy the skill folder (skills_omni/pydantic-models-py in diegosouzapw/awesome-omni-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 diegosouzapw/awesome-omni-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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Pydantic Models Py use?

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

How many tokens does Pydantic Models Py use?

About 3.2k tokens (SKILL.md is roughly 13k 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 1.7k 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: Fastapi (ericrisco/rsc-harness, 167 stars), Agentic Workflows API Documentation Lungo (agntcy/coffeeAgntcy, 112 stars), Fastcrud (benavlabs/fastcrud, 1.6k stars) and API Surface Review (polarsource/polar, 10k 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?

diegosouzapw (a GitHub user) maintains it in diegosouzapw/awesome-omni-skills, which has 159 GitHub stars. The repository holds 39 skills in this directory. The repository was last updated on July 8, 2026.

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