Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add vikasudasi/skill-vault --skill python-dataclasses-pydanticgit clone --depth 1 https://github.com/vikasudasi/skill-vaultWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/vikasudasi/skill-vault/python-dataclasses-pydantic)<a href="https://agentmods.dev/skills/vikasudasi/skill-vault/python-dataclasses-pydantic"><img src="https://agentmods.dev/badge/skills/vikasudasi/skill-vault/python-dataclasses-pydantic/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/vikasudasi/skill-vault/python-dataclasses-pydantic"><img src="https://agentmods.dev/badge/skills/vikasudasi/skill-vault/python-dataclasses-pydantic.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00033 | $0.01634 |
| Opus 5.5 | $0.00013 | $0.00654 |
| Sonnet 5.5 | $0.00007 | $0.00327 |
| Haiku 4.5 | $0.00003 | $0.00163 |
Grade A, and why
python-dataclasses-pydantic scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 159 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Data Modeling with Dataclasses + Pydantic
Use when a module carries structured records and you want type safety, validation, or clean JSON round-tripping. The two tools overlap but solve different problems: dataclasses are a lightweight typing/memory tool; Pydantic adds runtime validation + serialization at the boundary.
Type-safety with dataclasses
from __future__ import annotations
from dataclasses import dataclass
@dataclass(slots=True)
class Point:
x: float
y: float
@dataclass(slots=True) reduces memory and prevents accidental attribute typos
(an unknown attribute becomes an AttributeError, not a silent new field).
Validation + serialization with Pydantic (v2)
from pydantic import BaseModel, Field
class SkillInput(BaseModel):
name: str = Field(min_length=3, max_length=64)
description: str
tags: list[str] = Field(default_factory=list)
port: int = Field(ge=1, le=65535)
@field_validator("name")
@classmethod
def _no_whitespace(cls, v: str) -> str:
v = v.strip()
if not v:
raise ValueError("name must not be blank")
return v
Pydantic v2 is the current API (pydantic ≥ 2.0). Key calls:
Model.model_validate(data)— validate/coerce a dict or object.Model.model_validate_json(s)— parse + validate a JSON string directly.model.model_dump()/model.model_dump_json()— serialize to dict / JSON.Field(...)— constraints and defaults (min_length,ge,default_factory).@field_validator("x")— per-field post-validation transforms/checks.@computed_field— a read-only property exposed inmodel_dump().ConfigDict/model_config— e.g.model_config = ConfigDict(frozen=True, extra="forbid").
Nesting composes cleanly: a field whose type is another BaseModel is validated
recursively, so you get a typed, validated object graph from JSON in one call.
Decision table: dataclass vs Pydantic
| Concern | @dataclass |
Pydantic BaseModel |
|---|---|---|
| Runtime validation / coercion of inputs | ✗ none | ✓ automatic, per-field |
| JSON round-trip | manual asdict/json.dumps |
model_dump_json() / model_validate_json |
| Performance (creation in hot loops) | fast, near-plain-class | slower — validation overhead per instantiation |
| Mutable default lists/dicts | foot-gun (see Pitfalls) | default_factory handled, but Field(default_factory=...) still required |
| Immutable value objects | frozen=True |
ConfigDict(frozen=True) |
| Serialization shape control | manual | rich (by_alias, exclude_unset, computed_field) |
| Syntax/deps | stdlib, zero deps | third-party dependency |
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 159 lines · 33 tokens per session scan A f43f9aa9b470
python-dataclasses-pydantic is a skill published in the GitHub repository vikasudasi/skill-vault (0 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 33 tokens to every session and 1,634 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
python-dataclasses-pydantic compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| python-dataclasses-pydanticvikasudasi/skill-vault | Skill | 0 | 3mo ago | Apache-2.0 | A | 33 | Claude Code, Codex |
| migrating-langchain-to-pydantic-aipydantic/pydantic-ai | Skill | 22k | today | MIT | A | 100 | Codex |
| migrating-vercel-ai-sdk-and-eve-to-pydantic-aipydantic/pydantic-ai | Skill | 22k | today | MIT | A | 107 | Codex |
| migrating-pi-to-pydantic-aipydantic/pydantic-ai | Skill | 22k | today | MIT | A | 88 | Codex |
| migrating-claude-agent-sdk-to-pydantic-aipydantic/pydantic-ai | Skill | 22k | today | MIT | A | 90 | Codex |
| migrating-google-adk-to-pydantic-aipydantic/pydantic-ai | Skill | 22k | today | MIT | A | 72 | Codex |
| migrating-mastra-to-pydantic-aipydantic/pydantic-ai | Skill | 22k | today | MIT | A | 73 | Codex |