data-contract-migrations

data-contract-migrations is a skill for Codex from majiayu000/spellbook. It costs 75 tokens per session (476 once invoked), scanned A, original, MIT.

A guide for changing the shape of stored or exchanged data while keeping applications, reports, tenants, and integrations compatible. A data contract is the agreed structure and meaning of fields shared between systems.

In plain words
What is it for?
Planning schema changes, mapping API fields to database fields, designing expand-and-migrate rollouts, dual-writing, backfilling data in batches, switching readers, and planning rollback or field removal.
Why use it?
It helps prevent schema or payload changes from breaking old readers and writers, especially during zero-downtime migrations or when historical data needs updating.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Planning schema changes, mapping API fields to database fields, designing expand-and-migrate rollouts, dual-writing, backfilling data in batches, switching readers, and planning rollback or field removal.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/majiayu000/spellbook/data-contract-migrations
Install

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.

Any agent
npx skills add majiayu000/spellbook --skill data-contract-migrations
Clone the repo
git clone --depth 1 https://github.com/majiayu000/spellbook

Made for: Codex.

Wrote 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.

agentmods badge for data-contract-migrations

README.md
[![agentmods](https://agentmods.dev/badge/skills/majiayu000/spellbook/data-contract-migrations/github.svg)](https://agentmods.dev/skills/majiayu000/spellbook/data-contract-migrations)
Your own site
<a href="https://agentmods.dev/skills/majiayu000/spellbook/data-contract-migrations"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/data-contract-migrations/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.

agentmods 80×15 button for data-contract-migrations

Your own site · 80×15
<a href="https://agentmods.dev/skills/majiayu000/spellbook/data-contract-migrations"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/data-contract-migrations.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 476 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00075 $0.00476
Opus 5 $0.00037 $0.00238
Sonnet 5 $0.00015 $0.00095
Haiku 4.5 $0.00007 $0.00048

Measured 9d ago against content hash bda25c39a77c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

data-contract-migrations 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 9d 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.

skills/data-contract-migrations/SKILL.md · 64 lines

What it actually says

Data Contract Migrations

Purpose

Use this skill when data shape changes can break reads, writes, reports, tenants, or integrations. The goal is an explicit compatibility and migration plan, not just a SQL diff.

Preflight

Gather these facts before proposing changes:

  1. Current schema, models, serializers, API contracts, and persisted samples.
  2. Writers and readers of each field.
  3. Migration tool and rollback support.
  4. Data volume, tenant boundaries, and backfill cost.
  5. Required zero-downtime or maintenance-window constraints.
  6. Existing tests or fixtures that prove compatibility.

If the current data does not contain a field, treat it as absent. Do not invent fallback fields.

Migration Design

Use expand-migrate-contract for production systems:

  1. Expand: add nullable columns, new tables, new enum values, or versioned payloads without breaking old readers.
  2. Dual-write or adapter: write both old and new forms when needed.
  3. Backfill: migrate historical data with batching, checkpoints, and retry behavior.
  4. Read switch: move readers to the new contract after verification.
  5. Contract: remove old fields only after the compatibility window and rollback risk pass.

For small systems, a direct migration is acceptable only when downtime, rollback, and data loss risks are explicitly low.

Required Checks

Every plan must include:

  • Forward migration command.
  • Rollback or roll-forward recovery command.
  • Backfill idempotency and resume behavior.
  • Data validation query before and after.
  • Tenant isolation check when tenants exist.
  • API/serializer compatibility test.
  • Observability for migration progress and failure.

Output Shape

contract_change:
affected_readers_writers:
migration_strategy:
backfill_plan:
rollback_or_recovery:
tenant_and_security_checks:
verification_queries:
test_commands:
release_gate:

Raise errors for missing critical data rather than warning and falling back to incomplete output.

Files

What ships with it

1 file 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.

Changes

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.

  1. 9d ago First seen · 64 lines · 75 tokens per session scan A bda25c39a77c

Subscribe to this mod's changes

data-contract-migrations is a skill published in the GitHub repository majiayu000/spellbook (277 stars, last pushed yesterday), licensed MIT. It adds 75 tokens to every session and 476 once invoked, about $0.0004 per session on Opus 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-30.