factory-db-migration-engineer

factory-db-migration-engineer is a skill for Claude Code from nonlinear-xyz/factory-kit. It costs 156 tokens per session (2,633 once invoked), scanned A, original, MIT.

A specialist workflow for making risky changes to a live production database, such as changing tables or updating existing data. It focuses on changes that may be difficult to undo.

In plain words
What is it for?
Use it to plan or carry out database migrations with data backfills, imports, one-time database procedures, constraint changes, or manually entered updates and deletions.
Why use it?
It helps reduce the risk of long recovery work, broken data, or customer impact when changing production records or structure.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the factory-kit plugin — 37 skills, 8 commands, 12 agents, 1 MCP server shipped together

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/nonlinear-xyz/factory-kit/factory-db-migration-engineer
Any agent
npx skills add nonlinear-xyz/factory-kit --skill factory-db-migration-engineer
Clone the repo
git clone --depth 1 https://github.com/nonlinear-xyz/factory-kit

Made for: Claude Code.

Or install factory-kit, the plugin that ships this one along with the rest of its 37 skills, 8 commands, 12 agents, 1 MCP server.

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 factory-db-migration-engineer

README.md
[![agentmods](https://agentmods.dev/badge/skills/nonlinear-xyz/factory-kit/factory-db-migration-engineer.svg)](https://agentmods.dev/skills/nonlinear-xyz/factory-kit/factory-db-migration-engineer)
Your own site
<a href="https://agentmods.dev/skills/nonlinear-xyz/factory-kit/factory-db-migration-engineer"><img src="https://agentmods.dev/badge/skills/nonlinear-xyz/factory-kit/factory-db-migration-engineer.svg" alt="Measured on agentmods" height="20"></a>
Per session 156 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,633 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.1 $0.00156 $0.02633
Opus 5 $0.00078 $0.01316
Sonnet 5 $0.00031 $0.00527
Haiku 4.5 $0.00016 $0.00263

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

Security

Grade A, and why

factory-db-migration-engineer 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 6d 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/factory-db-migration-engineer/SKILL.md · 186 lines

How it starts

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

Apply the db-migration-engineer specialist workflow. Design and shepherd destructive database changes with senior operational discipline. Load factory-db-migration first through the host's skill capability, followed by factory-data-layer, factory-deployment, and factory-security for adjacent concerns.

The mandate is specific: the act of mutating prod, not the design of the schema (that's db-schema-architect) or the deployment pipeline (that's factory-deployment.md). You are invoked when the user is about to make a change that, if mishandled, costs hours-to-days of recovery and possibly customer trust.

When to invoke

  • Always for: schema migrations involving backfill, periodic data imports, DROP CONSTRAINT, one-shot RPCs against prod, any DELETE / UPDATE against prod tables that the operator typed by hand.
  • Often for: ADD CONSTRAINT against existing data (needs preflight that no row violates), CREATE INDEX CONCURRENTLY (low risk but coordinate with load), data-type changes on populated columns.
  • Skip for: single-column ADD with no backfill, ADD INDEX (non-concurrent on small table), CREATE OR REPLACE FUNCTION with no behavioral change.

How to think (in order)

  1. Restate the destructive change in one sentence. What table(s)? What rows? Reversible by what? If you cannot articulate this in one sentence, the request is under-scoped — ask the user to clarify before designing.

  2. Classify the blast radius.

    • Low — DROP CONSTRAINT (no data touched), CREATE INDEX CONCURRENTLY, CREATE OR REPLACE FUNCTION with same signature.
    • Medium — ADD CONSTRAINT (needs row-by-row preflight), data backfill via UPDATE, schema change with column rename.
    • High — periodic data import (UPSERT loop), one-shot DELETE, ALTER TYPE on populated enum, DROP COLUMN.
    • Catastrophic — TRUNCATE, ALTER TABLE ... USING that rewrites the table, DROP TABLE.

    The higher the blast radius, the more layers of the framework must be exercised. Catastrophic changes need explicit user authorization at the gate level, not just the LLM-says-OK level.

Read the full file on GitHub · 186 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. 6d ago First seen · 186 lines · 156 tokens per session scan A e49fcd9b10de

Subscribe to this mod's changes

factory-db-migration-engineer is a skill published in the GitHub repository nonlinear-xyz/factory-kit (9 stars, last pushed 1mo ago), licensed MIT. It adds 156 tokens to every session and 2,633 once invoked, about $0.0008 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

databases

· Configure/tune/migrate PostgreSQL, MongoDB, MySQL/MariaDB, MSSQL. Triggers: 'database', 'postgres', 'mysql', 'mongodb', 'database schema', 'database migration', 'pgbouncer', 'EXPLAIN'. Not for HTTP APIs (use backend-api).

iuliandita/skills · 66 tokens

audit-data-integrity

Use when auditing and fixing end-to-end data integrity in a scope — invariant violations, partial or conflicting writes, unsafe migrations/backfills, duplicate or reordered effects, precision or time corruption, stale derived stores, broken retention/deletion, and unrecoverable drift. Triggers on "audit data…

JHostalek/dotclaude · 94 tokens

schema-evolve

This skill should be used when the user asks about 'schema drift', 'schema evolution', 'evolve schema', 'schema sync', 'sync schemas', 'update schema fields', 'schema field frequency', 'missing schema fields', 'unused schema fields', 'schema proposal', 'schema cardinality', 'check schema', 'schema audit', 'schema…

voxpelli/vp-claude · 139 tokens

lark-base

飞书多维表格(Base)操作:建表、字段、记录、视图、统计、公式/lookup、表单、仪表盘、workflow、角色权限;遇到 Base/多维表格/bitable 或 /base/ 链接时使用。文件导入/导出转 lark-drive,认证/授权转 lark-shared。.

DropFan/claude-code-plugins · 84 tokens

ecto-patterns

Ecto patterns — schemas, changesets, queries, migrations, Multi, associations, preloads, upserts. Use when editing Repo calls, Ecto.Query, or schema fields. Skip for Ash.

oliver-kriska/claude-elixir-phoenix · 45 tokens

moai-platform-database-cloud

Cloud database platform specialist covering Neon (serverless PostgreSQL), Supabase (PostgreSQL 16 with real-time), and Firebase Firestore (NoSQL with offline sync). Use when choosing or setting up cloud databases.

modu-ai/moai-adk · 51 tokens