json-to-pydantic
Skill0 starsChanged 10 months agoMITView on GitHub
Convert JSON data snippets into Python Pydantic data models with proper type annotations and validation. Use when converting JSON schemas to Pydantic models, generating data validation models from JSON examples, or creating Python data classes.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- Melmonster13/antigravity-skills-projectedited, first seen Jun 24, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- Melmonster13/antigravity-skills-project★ 093% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository33 other files it gives its agents.
- architectSkill
- brainstormingSkill
- concise-planningSkill
- context-engineerSkill
- data-deprecation-analysisSkill
- data-modelerSkill
- data-pipeline-engineerSkill
- data-quality-frameworksSkill
- dbt-transformation-patternsSkill
- github-workflow-automationSkill
- guardianSkill
- implementerSkill
- llm-app-patternsSkill
- navigatorSkill
- ops-managerSkill
- orchestratorSkill
- principal-data-engineerSkill
- product-manager-toolkitSkill
- proj-memorySkill
- prompt-librarySkill
- qa-testerSkill
- researcherSkill
- senior-data-engineerSkill
- software-architectureSkill
- spark-optimizationSkill
- sql-optimization-patternsSkill
- state-managerSkill
- subagent-driven-developmentSkill
- thinkerSkill
- top-web-vulnerabilitiesSkill
- verification-before-completionSkill
- web-design-guidelinesSkill
- workflow-managerSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Analyze the Input: Look at the JSON object provided by the user.
- Very specific: line 35
Use PascalCase for class names.
- Very specific: line 36
Use type hints (List, Optional) from typing module.
- Very specific: line 37
If a field can be missing or null, default it to None.
- Distinctive: line 50
Must handle nested objects and optional fields correctly.
- Distinctive: line 54
Ignoring Nested Structures: Not extracting nested objects into separate classes creates monolithic models.
- Very specific: line 57
Skipping Validation: Not adding constraints like Field(min_length=1) or regex patterns.
- Very specific: line 58
Mixing Array Element Types: Not using Union types when arrays can contain multiple types.
- Distinctive: line 59
Missing Aliases: Not mapping JSON camelCase to Python snake_case with Field aliases.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
JSON to Pydantic Skill
This skill helps convert raw JSON data or API responses into structured, strongly-typed Python classes using Pydantic.
Instructions
- Analyze the Input: Look at the JSON object provided by the user.
- Infer Types:
string->strnumber->intorfloatboolean->boolarray->List[Type]null->Optional[Type]- Nested Objects -> Create a separate sub-class.
Follow the Example: Review
examples/to see how to structure the output code. notice how nested dictionaries likepreferencesare extracted into their own class.- Input:
examples/input_data.json - Output:
examples/output_model.py
- Input:
Style Guidelines
- Use
PascalCasefor class names. - Use type hints (
List,Optional) fromtypingmodule. - If a field can be missing or null, default it to
None.
Outputs & Deliverables
- Primary Output: Python Pydantic models with complete type annotations
- Secondary Output: Validation rules and field defaults
- Success Criteria: Models match JSON structure and include proper type hints
- Quality Gate: Ready for integration into implementer's codebase
Constraints
- NO business logic. Data models only.
- NO implementation code beyond model definitions.
- Must handle nested objects and optional fields correctly.
Common Pitfalls
- Ignoring Nested Structures: Not extracting nested objects into separate classes creates monolithic models. Always decompose; create sub-classes for nested dicts.
- Wrong Type Inference: Confusing
nullwith missing fields.null=Optional, missing entirely = Field withdefault_factory. Be precise. - Generic Field Names: Using
data,value,resultinstead of domain-specific names. Use the field name from JSON. - Skipping Validation: Not adding constraints like
Field(min_length=1)or regex patterns. Add validation rules to the model. - Mixing Array Element Types: Not using
Uniontypes when arrays can contain multiple types. Use generics correctly. - Missing Aliases: Not mapping JSON camelCase to Python snake_case with Field aliases. Handle naming convention mismatches explicitly.
Integration Points
| Phase | Input From | Output To | Context |
| Input | JSON response or API data | Model generation | Analyze JSON structure and infer types |
| Decomposition | Nested structures | Sub-class extraction | Create separate Pydantic models for objects |
| Integration | Generated models | implementer | Use in service layer for validation |
| Validation | Model with constraints | Runtime protection | Pydantic validates all incoming data |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

