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 agentmods add skills/klr-pattern/pydantic-resolve/skillnpx skills add KLR-Pattern/pydantic-resolve --skill skillgit clone --depth 1 https://github.com/KLR-Pattern/pydantic-resolveWhat 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 | $0.00056 | $0.07002 |
| Opus 5 | $0.00028 | $0.03501 |
| Sonnet 5 | $0.00011 | $0.01400 |
| Haiku 4.5 | $0.00006 | $0.00700 |
Grade A, and why
pydantic-resolve-3step scanned grade A with 1 finding 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 3d 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
| 1 | REST 端点返回的响应字段符合 DTO 定义(FK 隐藏、关系字段包含) | curl GET endpoint | How it starts
The opening of the file, as written. The whole thing — 593 lines — stays where its author put it; the contents beside it link to each section on GitHub.
pydantic-resolve 三阶段开发模式
基于 pydantic-resolve 的渐进式开发方法论。项目在一个 src/ 目录下逐步演进,每个阶段在上一阶段基础上新增代码。
| Phase | 职责 | 产出 |
|---|---|---|
| Phase 0 | 需求确认 | 实体 + 关系 + 聚合根 + 用例方法(与用户反复确认) |
| Phase 1 | Schema + ER Diagram + mock seed | ORM models + Entity DTOs + build_relationship + Voyager |
| Phase 2 | 方法实现 + GraphQL | service//methods.py + QueryConfig/MutationConfig + GraphQL |
| Phase 3 | UseCase 响应组装 + MCP + REST | DefineSubset + AutoLoad + UseCaseService + REST + MCP |
核心原则
- 需求确认是 Phase 0,必须反复与用户确认后才能进入 Phase 1(详见下方「Phase 0: 需求确认」)
- 非功能模块与业务模块解耦,业务概念不侵入基础设施层
- 每个 Phase 采用 V 型验收:先定义验收标准(V 降),再实现,最后回查验收(V 升)
- 每个 Phase 实现完成后必须暂停,展示验收结果,等用户确认后再进入下一阶段
- Phase 间递进:同一项目目录下逐步丰富,只新增不修改已有代码
V 型验收模型(贯穿所有 Phase)
每个 Phase 的结构统一为三段:
┌──────────────────────────────────────────────┐
│ V 降:定义验收标准 │
│ "在当前 Phase 开始之前,先定义什么算做完。" │
│ 写入 spec/<phase>.md 的"验收标准"部分 │
└──────────────────────────────────────────────┘
↓
┌───────────────┐
│ 实现 Phase │
└───────────────┘
↓
┌──────────────────────────────────────────────┐
│ V 升:逐条回查验收 │
│ "一条一条对照验收标准,通过才可继续。" │
│ 用户逐条确认 → 写入 spec/<phase>.md │
└──────────────────────────────────────────────┘
验收标准必须是可观察、可操作的——不写"代码健壮",写"GraphiQL 中执行 X query 返回 Y"。
Phase 0: 需求确认(必做)
在写任何代码之前,必须与用户逐项确认以下内容。每一项都需要用户明确认可后才算完成。
Step 0-1: 术语与实体定义
逐一列出所有业务实体,每个实体说明:
- 业务含义(一句话,团队无歧义)
- 核心字段(名称 + 类型 + 语义说明,不需要穷举,但关键属性不能遗漏)
- 字段约束(唯一、非空、枚举值、联合唯一等)
用表格形式呈现,方便用户逐行确认。
Step 0-2: 实体关系
用文本 ER 图展示实体间关系,每条关系标明:
- 方向(1:N / N:1 / M:N)
- 业务含义(如「Sprint 包含多条 Task」)
- 是否需要中间实体
User ──1:N──→ Task
Sprint ──1:N──→ Task
Task ──N:1──→ User (owner)
必须与用户确认关系方向和基数是否正确。
Step 0-3: 聚合根
明确哪个(或哪些)实体是聚合根。聚合根决定:
- 主要的业务入口(从哪个实体开始查询)
- @query / @mutation 挂在哪些实体上
- Phase 3 的 service 划分依据
What ships with it
23 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.
- template/pyproject.toml 560 B
- template/src/__init__.py 0 B runs code
- template/src/database.py 1.4 KB runs code
- template/src/db.py 478 B runs code
- template/src/entities.py 3.1 KB runs code
- template/src/main.py 3.2 KB runs code
- template/src/models.py 1.7 KB runs code
- template/src/router/__init__.py 0 B runs code
- template/src/router/api.py 1.5 KB runs code
- template/src/service/__init__.py 0 B runs code
- template/src/service/sprint/__init__.py 0 B runs code
- template/src/service/sprint/dtos.py 673 B runs code
- template/src/service/sprint/methods.py 879 B runs code
- template/src/service/sprint/service.py 1.2 KB runs code
- template/src/service/sprint/spec.md 940 B
- template/src/service/task/__init__.py 0 B runs code
- template/src/service/task/dtos.py 512 B runs code
- template/src/service/task/methods.py 1.3 KB runs code
- template/src/service/task/service.py 1.6 KB runs code
- template/src/service/task/spec.md 763 B
- template/src/service/user/__init__.py 0 B runs code
- template/src/service/user/methods.py 658 B runs code
- template/tests/__init__.py 0 B runs code
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.
- 3d ago First seen · 593 lines · 56 tokens per session scan A 3be76d898294
pydantic-resolve-3step is a skill published in the GitHub repository KLR-Pattern/pydantic-resolve (326 stars, last pushed 26d ago), licensed MIT. It adds 56 tokens to every session and 7,002 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
fastcrud
Use when building or modifying CRUD endpoints with FastCRUD (the fastcrud PyPI package) in a FastAPI project — covers FastCRUD, crudrouter, EndpointCreator, FilterConfig, JoinConfig, auto-relationship detection, the filter operator syntax (gte, in, ilike, etc.), cursor pagination, soft delete, and how to avoid N+1…
payload
Use when working with Payload projects (payload.config.ts, collections, fields, hooks, access control, Payload API). Use when debugging validation errors, security issues, relationship queries, transactions, or hook behavior.
datamodel-code-generator
Use this skill when the user wants Python data models, Pydantic models, dataclasses, TypedDicts, msgspec structs, or type-safe Python classes generated from OpenAPI, AsyncAPI, JSON Schema, GraphQL, JSON/YAML/CSV sample data, MCP tool schemas, Protocol Buffers, XML Schema, Apache Avro, or existing Python model objects.…
mysql reporter
生成 MySQL 查询报表并生成可视化图表。当用户需要查询 MySQL 数据库并以报表形式展示结果时使用此技能,包括:统计销售数据、分析用户行为、生成业务报表、查询业务指标等。.
alembic-migration
Create, review, and apply database schema changes with Alembic. Use whenever a SQLAlchemy model is added or changed, a column/index/constraint needs to change, or a data backfill is required — anything that alters the PostgreSQL schema.
add-graphjin-database
Use when adding a new GraphJin database, warehouse, or CQL/NoSQL backend; building a simulator because no live service is available; wiring a dialect, discovery, tests, scripts, README/CONFIG/FEATURES, or website database support surfaces.