data-migration

A set of rules for changing a Postgres database schema and its stored data safely. Postgres is a relational database; the process uses separate expansion, data backfill, and cleanup stages that can be rolled back.

In plain words
What is it for?
Use it when adding or changing database tables or columns, filling new fields in batches, changing the data model, checking rollback plans, or applying production migrations.
Why use it?
It reduces downtime and data loss during changes to tables, columns, or records. It also protects tenant separation, audit history, privacy, and accurate event counts.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/webhook-co/webhook/data-migration
Any agent
npx skills add webhook-co/webhook --skill data-migration
Clone the repo
git clone --depth 1 https://github.com/webhook-co/webhook

Made for: Claude Code, Codex.

Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 794 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00043 $0.00794
Opus 5 $0.00022 $0.00397
Sonnet 5 $0.00009 $0.00159
Haiku 4.5 $0.00004 $0.00079

Measured yesterday against content hash 76047ca84934, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

data-migration 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 yesterday.

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.

.claude/skills/data-migration/SKILL.md · 61 lines

How it starts

The opening of the file, as written. The whole thing — 61 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Data migration

Change the Neon Postgres schema (metadata, config, dedup/idempotency keys) without downtime or data loss. Raw payloads live in R2, not Postgres — migrations touch metadata, not bodies.

Expand → backfill → contract

Never do a breaking change in one step. Split across releases:

  1. Expand — add new columns/tables (nullable/defaulted), additive only. Deploy. Nothing reads the new shape yet.
  2. Backfill — populate new fields in idempotent, re-runnable batches, off the hot path. Never hold a long lock on a hot table.
  3. Contract — switch reads/writes to the new shape, verify, then (in a later release) drop the old shape once rollback is no longer needed.

Safety checklist

  • Migration is idempotent and safe to re-run.
  • Tenant isolation preserved: RLS policies updated for new/changed tables.
  • No PII/PHI moved into logs; no raw payloads pulled into Postgres.
  • Tested rollback path exists before production.
  • Audit log untouched — never rewrite or delete hash-chained audit history.
  • Metering data integrity preserved (event counts stay accurate, single-dimension, dedup-safe).

Applying to prod (schema-before-deploy)

Migrations are applied manually, decoupled from CD, and before the code that depends on them deploys. Apply with scripts/apply-prod-migrations.sh (with DATABASE_URL set to the prod webhook_owner connection) — not a bare dbmate up. The script runs the migration and advances the global prod-schema git tag to the applied commit.

That tag is the deploy migration-guard's source of truth: the three deploy workflows (deploy.yml / deploy-web.yml / deploy-auth.yml) block an auto deploy whenever HEAD is ahead of prod-schema by a migration — so new code can never auto-deploy against an un-applied schema. If you apply with a bare dbmate up, the tag doesn't move and the next migration-bearing push will be blocked with a message telling you to run the script. Recovery from a block: run the script (applies + advances the tag), then push — or workflow_dispatch to override (which does not move the tag, so it can't blind the guard).

Read the full file on GitHub · 61 lines

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. yesterday First seen · 61 lines · 43 tokens per session scan A 76047ca84934

Subscribe to this mod's changes

data-migration is a skill published in the GitHub repository webhook-co/webhook (0 stars, last pushed 6d ago), licensed Apache-2.0. It adds 43 tokens to every session and 794 once invoked, about $0.0002 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-31.

Related

Other skills, from other repositories

update-saasmail

Sync the local saasmail repo with the latest upstream changes from https://github.com/choyiny/saasmail. Use this skill whenever the user wants to update saasmail, pull upstream changes, sync with upstream, rebase on upstream, get the latest saasmail, or says "/update-saasmail". Handles adding the upstream remote if…

choyiny/saasmail · 105 tokens

story-html-publisher

Final step of the AI Storybook pipeline. Consolidates the scenes, images, and per-scene audio into ONE self-contained HTML storybook — a swipe/tap player with every image and audio clip embedded as base64 so the single file works offline and can be shared as-is. Reads {slug}scenes.json, {slug}images.json, and…

hassancs91/claude-image-generation · 207 tokens

github-code-review

Comprehensive GitHub code review with AI-powered swarm coordination.

aegntic/cldcde · 15 tokens

Pair Programming

AI-assisted pair programming with multiple modes (driver/navigator/switch), real-time verification, quality monitoring, and comprehensive testing. Supports TDD, debugging, refactoring, and learning sessions. Features automatic role switching, continuous code review, security scanning, and performance optimization with…

aegntic/cldcde · 61 tokens

sparc-methodology

SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) comprehensive development methodology with multi-agent orchestration.

aegntic/cldcde · 29 tokens

Skill Builder

Create new Claude Code Skills with proper YAML frontmatter, progressive disclosure structure, and complete directory organization. Use when you need to build custom skills for specific workflows, generate skill templates, or understand the Claude Skills specification.

aegntic/cldcde · 46 tokens