← Back to Skills Marketplace
codekungfu

Db Migrate

by ClawKK · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
148
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install db-migrate
Description
Deep database migration workflow—expand/contract, backward-compatible deploys, backfills, locking risks, and verification. Use when changing production schem...
README (SKILL.md)

DB Migrations

Production schema changes fail when old and new code disagree during rollout. Prefer expand/contract: add compatible changes first, remove old shapes later.

When to Offer This Workflow

Trigger conditions:

  • ALTER TABLE in production; large table rewrites
  • Blue/green deploys coupled to schema state
  • Need zero-downtime or low-downtime migrations

Initial offer:

Use six stages: (1) classify change, (2) expand phase, (3) backfill & dual-write, (4) flip reads/writes, (5) contract phase, (6) verify & rollback). Confirm database engine (PostgreSQL, MySQL, etc.).


Stage 1: Classify Change

Goal: Additive vs destructive; lock risk (full table rewrite vs instant metadata change).

Exit condition: Migration labeled as expand or contract with risk notes.


Stage 2: Expand Phase

Goal: Add nullable columns or new tables without breaking currently deployed code.

Practices

  • Avoid DEFAULT clauses that lock large tables badly on some engines (use phased backfill instead)

Stage 3: Backfill & Dual-Write

Goal: Throttled batch backfill; dual-write old and new representations during transition when needed.


Stage 4: Flip Reads/Writes

Goal: Deploy code that reads new columns only after backfill completes; use feature flags for staged rollout.


Stage 5: Contract Phase

Goal: Drop old columns only after no code references them (search repo, logs, feature usage).


Stage 6: Verify & Rollback

Goal: Monitor errors, slow queries, replication lag; rollback = redeploy previous app version + avoid destructive steps until stable.


Final Review Checklist

  • Change classified; expand/contract path clear
  • Additive migrations before dependent code
  • Backfill throttled and verified
  • Read/write cutover sequenced with flags
  • Contract only after references gone
  • Monitoring and rollback tested

Tips for Effective Guidance

  • Long transactions on migrations can cause outages—chunk work.
  • Use online schema tools (pt-online-schema-change, etc.) when appropriate.

Handling Deviations

  • SQLite/embedded engines have different locking—validate per engine.
Usage Guidance
This skill is a guidance document for performing safe DB migrations and appears internally consistent. Before using it, confirm how the agent will be given access to your codebase, logs, and production database: the SKILL.md suggests inspecting repo and logs (reasonable for verification) but the skill itself does not request credentials — you should avoid pasting production DB credentials into chat. If you let the agent run actions, grant only the minimum access needed (read-only access to schema/monitoring where possible), and verify any generated migration steps before applying them. If you prefer, treat this as a checklist for a human operator rather than an autonomous agent task.
Capability Analysis
Type: OpenClaw Skill Name: db-migrate Version: 1.0.0 The skill bundle contains purely instructional documentation for performing safe database migrations using the expand/contract pattern. There is no executable code, no network activity, and no evidence of prompt injection or malicious intent in SKILL.md or _meta.json.
Capability Assessment
Purpose & Capability
Name and description match the content of SKILL.md: it provides a six‑stage, zero/low‑downtime migration workflow and best practices. There are no unexpected environment variables, binary requirements, or install steps that would be inconsistent with a migration advisory.
Instruction Scope
The instructions are procedural guidance (classify, expand, backfill, cutover, contract, verify). A few items suggest actions like 'search repo, logs, feature usage' which could lead an agent to read project files or logs when performing the workflow — that is consistent with migration verification, but it implicitly expects access to repo/logs and monitoring data. The SKILL.md does not itself request specific credentials or paths, and it does not include commands that perform I/O or network calls.
Install Mechanism
No install spec and no code files — instruction-only. Nothing will be written to disk or downloaded by the skill itself, which minimizes install risk.
Credentials
The skill declares no required environment variables or credentials. The guidance refers to database engines and tools (pt-online-schema-change) but does not request keys or passwords. This is proportionate to an advisory workflow. Note: if an agent acting with this skill is later provided DB credentials by the user, the workflow would naturally use them — that is not a property of the skill itself.
Persistence & Privilege
The skill is not marked always:true and is user-invocable only. It does not request persistent privileges or modify other skills or global agent settings.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install db-migrate
  3. After installation, invoke the skill by name or use /db-migrate
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
db-migrate v1.0.0 – Initial Release - Introduces a comprehensive workflow for safe, low-downtime database schema migrations using the expand/contract pattern. - Details six migration stages: classify change, expand, backfill & dual-write, flip reads/writes, contract, and verify & rollback. - Provides practical advice on backfills, locking risk mitigation, and staged rollouts. - Includes a final review checklist and tips specific to production use and different database engines.
Metadata
Slug db-migrate
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Db Migrate?

Deep database migration workflow—expand/contract, backward-compatible deploys, backfills, locking risks, and verification. Use when changing production schem... It is an AI Agent Skill for Claude Code / OpenClaw, with 148 downloads so far.

How do I install Db Migrate?

Run "/install db-migrate" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Db Migrate free?

Yes, Db Migrate is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Db Migrate support?

Db Migrate is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Db Migrate?

It is built and maintained by ClawKK (@codekungfu); the current version is v1.0.0.

💬 Comments