一键导入
database-migration
Generate, review, test, and deploy database schema migrations. Use when adding columns, creating tables, or changing schema.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate, review, test, and deploy database schema migrations. Use when adding columns, creating tables, or changing schema.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate or update OpenAPI specification from TypeScript/Express route definitions. Validate spec-to-code consistency. Use after adding or changing API endpoints.
Stack-agnostic Clean Code audit — module size, function-length/complexity (via your project's existing linter), long parameter lists, TODO/FIXME/HACK markers, commented-out code, debug-print leakage, and optional duplication detection. Produces a structured findings report with optional fix suggestions. Use before merges, at end of a feature, or as a regular hygiene pass.
Run a comprehensive code review across architecture, security, testing, naming, and patterns. Invokes relevant reviewer agents in sequence. Use before merging features or at the end of a phase. With --quorum, dispatches multi-model analysis for higher confidence.
Scan TypeScript/Node.js project dependencies for vulnerabilities, outdated packages, and license issues. Use before PRs, after adding packages, or on a regular schedule.
Guided plan execution — list available plans, estimate cost, choose mode, and execute with live progress. Use when you want to run a hardened plan through the orchestrator.
Systematically reduce TypeScript code complexity while preserving exact behavior — measure, understand, propose, prove, report. Use after a feature is complete and tests pass, when code works but is harder to maintain than it should be.
| name | database-migration |
| description | Generate, review, test, and deploy database schema migrations. Use when adding columns, creating tables, or changing schema. |
| argument-hint | [migration description, e.g. 'add user_profiles table'] |
| tools | ["run_in_terminal","read_file"] |
"Create a database migration for..." / "Add column..." / "Change schema..."
# Using knex
npx knex migrate:make <migration_name>
# Using Prisma
npx prisma migrate dev --name <migration_name>
# Using raw SQL
# Create file: migrations/NNNN_description.sql
down() function# Knex
npx knex migrate:latest --env development
# Prisma
npx prisma migrate dev
# Raw SQL
psql -h localhost -d contoso_dev -f migrations/NNNN_description.sql
npm run test:integration
npx knex migrate:latest --env staging
If migration fails → immediately run the rollback SQL (down migration), report the failure with the error message, and STOP. Do not proceed to deploy.
down() migration for rollbackIF NOT EXISTS / IF EXISTS guards in raw SQL| Shortcut | Why It Breaks |
|---|---|
| "I'll just edit the model directly" | Skipping the migration file means no rollback path and no deployment audit trail. Schema changes must be versioned. |
| "Rollback SQL isn't needed" | Deployments fail. Without rollback, recovery means restoring from backup — minutes of downtime vs seconds. |
| "I'll seed data manually" | Manual data changes drift between environments. Seeding must be scripted and repeatable. |
| "One migration for multiple changes is simpler" | Atomic migrations enable selective rollback. Bundled changes force all-or-nothing reversals. |
After completing this skill, confirm:
npx knex migrate:latest / npx prisma migrate dev succeeds on local databasenpm run test:integration passes against migrated schemanpx knex migrate:rollback runs cleanlysearch_thoughts("database migration", project: "Falsify", created_by: "copilot-vscode", type: "pattern") — load prior migration patterns, naming conventions, and lessons from failed migrationscapture_thought("Migration: <summary of schema change>", project: "Falsify", created_by: "copilot-vscode", source: "skill-database-migration") — persist the migration decision for future reference