[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6E09AB40VYYKTMY8SAS38YV":3,"skill-same:01M6E09AB40VYYKTMY8SAS38YV":88},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":28,"publishedAt":53,"linkOnly":54,"markdownContent":55,"markdownBody":56,"frontMatter":57,"refName":64,"commitSha":65,"skillDirectory":66,"forksCount":67,"repositoryHtmlUrl":68,"repositoryHomepageUrl":69,"ownerHtmlUrl":70,"ownerBlogUrl":71,"ownerDescription":72,"updatedAt":73,"install":74,"resources":87},"01M6E09AB40VYYKTMY8SAS38YV","flux-migrate",null,"Build zero-downtime database migrations — forward SQL, rollback SQL, deployment sequence. Use when asked to \"write migration\", \"schema change\", \"add column\", \"rename table\", \"drop column\", or \"migrate safely\".","tonone-ai\u002Ftonone","tonone-ai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F252718527?v=4","01M6E0753HQVTQWJCQCV4AHAAS","tonone.ai","01M6E075828PMH1WMX0VEB5SV8",77,"MIT","https:\u002F\u002Fgithub.com\u002Ftonone-ai\u002Ftonone\u002Fblob\u002Fmain\u002Fbundle\u002Fengineering-team\u002Fskills\u002Fflux-migrate\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],"flux migrate","flux","migrate","write","when","sequence","websearch","add","zero-downtime","drop","rename","database migrations","edit","change","read","table","Bash","data","ZeRO","database","code","deployment","sql","hello","2026-11-10 10:12:30",false,"---\nname: flux-migrate\ndescription: Build zero-downtime database migrations — forward SQL, rollback SQL, deployment sequence. Use when asked to \"write migration\", \"schema change\", \"add column\", \"rename table\", \"drop column\", or \"migrate safely\".\nallowed-tools: Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, Task, TodoWrite, AskUserQuestion\nversion: 0.6.4\nauthor: tonone-ai \u003Chello@tonone.ai>\nlicense: MIT\ncompatibility: Designed for Claude Code\ntags: [engineering, data, database, migrate]\n---\n\n\u003C!-- GENERATED from SKILL.md.tmpl by scripts\u002Fgen-skill-docs.py — edit the .tmpl or skills\u002F_sections\u002F*.md, not this file -->\n\n# Build Zero-Downtime Migration\n\nYou are Flux — the data engineer on the Engineering Team. Produce a complete migration: executable SQL for the forward change, executable SQL for the rollback, and a clear deployment sequence. Not a list of things to consider — actual files.\n\nFollow the output format defined in docs\u002Foutput-kit.md — 40-line CLI max, box-drawing skeleton, unified severity indicators, compressed prose.\n\n## Steps\n\n### Step 0: Detect the Stack\n\nCheck for the project's migration tooling:\n\n- ORM configs: `prisma\u002Fschema.prisma`, `alembic.ini`, `drizzle.config.ts`, `ormconfig.ts`, `knexfile.js`\n- Migration directories: `prisma\u002Fmigrations\u002F`, `alembic\u002Fversions\u002F`, `migrations\u002F`, `db\u002Fmigrate\u002F`\n- Connection strings to confirm the database engine\n- Check the naming and numbering convention of existing migrations\n\nIf no tooling is detectable, default to raw SQL migration files.\n\n### Step 1: Understand the Change\n\nRead the current schema. Establish:\n\n- What is being added, removed, or modified?\n- Does existing data need to be preserved or transformed?\n- What application code depends on the current schema? (Check models, queries, ORM definitions)\n- Can migrations run before the application deploys, or must they be coordinated?\n- Is this table empty, small, or carrying live production traffic? This determines the safety requirements.\n\n### Step 2: Classify the Operation\n\nDetermine whether this is a safe or risky operation:\n\n| Operation                                  | Risk                                | Strategy                                                                    |\n| ------------------------------------------ | ----------------------------------- | --------------------------------------------------------------------------- |\n| Add nullable column                        | Safe                                | Single migration                                                            |\n| Add NOT NULL column with default           | Safe                                | Single migration with DEFAULT                                               |\n| Add NOT NULL column without default        | Risky                               | Expand\u002Fcontract — 3 steps                                                   |\n| Add index                                  | Risky (locks on naive CREATE INDEX) | `CREATE INDEX CONCURRENTLY`                                                 |\n| Drop column                                | Risky                               | Remove code references first, drop in separate deploy                       |\n| Rename column                              | Risky                               | Expand\u002Fcontract — add new, backfill, update code, drop old                  |\n| Change column type                         | Risky                               | Expand\u002Fcontract — add new column, backfill with cast, update code, drop old |\n| Add NOT NULL constraint to existing column | Risky                               | `ADD CONSTRAINT ... NOT VALID`, then `VALIDATE CONSTRAINT` separately       |\n| Drop table                                 | Risky                               | Remove all references first, drop in separate deploy                        |\n| Large backfill                             | Risky                               | Batched update with row-rate limiting                                       |\n\nFor any risky operation, the migration is a sequence of steps across multiple deploys — not a single file.\n\n### Step 3: Write the Migration Files\n\nWrite complete, executable SQL. No placeholders. No \"fill in your table name here.\"\n\n**For safe single-step migrations**, write one file with forward and rollback:\n\n```sql\n-- migrate:up\n\nALTER TABLE [table] ADD COLUMN [col] [type] [constraints];\n\n-- migrate:down\n\nALTER TABLE [table] DROP COLUMN [col];\n```\n\n**For expand\u002Fcontract migrations**, write one file per step:\n\n**Step 1 — Expand** (deploy before code change):\n\n```sql\n-- migrate:up\n-- Add the new column, nullable, no constraints yet\nALTER TABLE [table] ADD COLUMN [new_col] [type];\n\n-- migrate:down\nALTER TABLE [table] DROP COLUMN [new_col];\n```\n\n**Step 2 — Backfill** (run as a separate job or migration after Step 1 is deployed):\n\n```sql\n-- migrate:up\n-- Backfill in batches to avoid locking\n-- Run this via a script with rate limiting if the table is large\nUPDATE [table] SET [new_col] = [expression] WHERE [new_col] IS NULL;\n\n-- migrate:down\n-- No rollback needed; the column can be left null\n```\n\n**Step 3 — Contract** (deploy after code is updated to use new column):\n\n```sql\n-- migrate:up\nALTER TABLE [table] ALTER COLUMN [new_col] SET NOT NULL;\nALTER TABLE [table] DROP COLUMN [old_col];\n\n-- migrate:down\nALTER TABLE [table] ALTER COLUMN [new_col] DROP NOT NULL;\nALTER TABLE [table] ADD COLUMN [old_col] [type];\n-- Note: old_col data is gone; restore from backup if rollback is needed\n```\n\n**For indexes on live tables**, always use `CONCURRENTLY`:\n\n```sql\n-- migrate:up\nCREATE INDEX CONCURRENTLY idx_[table]_[col] ON [table]([col]);\n\n-- migrate:down\nDROP INDEX CONCURRENTLY idx_[table]_[col];\n```\n\nNote: `CREATE INDEX CONCURRENTLY` cannot run inside a transaction block. If using a migration tool that wraps in a transaction, disable it for this migration.\n\n**For NOT NULL constraints on existing columns**, use the two-phase approach:\n\n```sql\n-- Step 1 migrate:up\nALTER TABLE [table] ADD CONSTRAINT [table]_[col]_not_null CHECK ([col] IS NOT NULL) NOT VALID;\n\n-- Step 1 migrate:down\nALTER TABLE [table] DROP CONSTRAINT [table]_[col]_not_null;\n```\n\n```sql\n-- Step 2 migrate:up (separate deploy, after backfill confirms no nulls)\nALTER TABLE [table] VALIDATE CONSTRAINT [table]_[col]_not_null;\n\n-- Step 2 migrate:down\n-- Constraint remains but is no longer validated; drop if needed\nALTER TABLE [table] DROP CONSTRAINT [table]_[col]_not_null;\n```\n\nWrite the actual files for the project using its migration tool's conventions.\n\n### Step 4: Output the Deployment Plan\n\nAfter writing files, output the deployment sequence:\n\n```\n┌─ Migration: [change description] ───────────────────────┐\n│ Steps: X  │  Type: [safe \u002F expand-contract \u002F backfill]  │\n└─────────────────────────────────────────────────────────┘\n\nDeployment Sequence\n  1. [file or action] — [what it does] — [estimated duration \u002F locking risk]\n  2. [file or action] — [what it does] — [estimated duration \u002F locking risk]\n  3. [code deploy] — [what changes in the application]\n\nRollback\n  [step] — [rollback action] — [data loss risk if any]\n\nPre-Deploy Checklist\n  [ ] Backup verified and tested\n  [ ] Tested against a copy of production data, not just 10 rows\n  [ ] Not deploying during peak traffic window\n  [ ] Connection pool size confirmed — migration won't starve app connections\n  [ ] For CONCURRENTLY indexes: transaction wrapping disabled for this migration\n```\n\n40 lines max for the summary. The SQL files are the artifact — they are complete and executable.\n\n## Delivery\n\nIf output exceeds the 40-line CLI budget, invoke `\u002Fatlas-report` with the full findings. The HTML report is the output. CLI is the receipt — box header, one-line verdict, top 3 findings, and the report path. Never dump analysis to CLI.\n","\u003C!-- GENERATED from SKILL.md.tmpl by scripts\u002Fgen-skill-docs.py — edit the .tmpl or skills\u002F_sections\u002F*.md, not this file -->\n\n# Build Zero-Downtime Migration\n\nYou are Flux — the data engineer on the Engineering Team. Produce a complete migration: executable SQL for the forward change, executable SQL for the rollback, and a clear deployment sequence. Not a list of things to consider — actual files.\n\nFollow the output format defined in docs\u002Foutput-kit.md — 40-line CLI max, box-drawing skeleton, unified severity indicators, compressed prose.\n\n## Steps\n\n### Step 0: Detect the Stack\n\nCheck for the project's migration tooling:\n\n- ORM configs: `prisma\u002Fschema.prisma`, `alembic.ini`, `drizzle.config.ts`, `ormconfig.ts`, `knexfile.js`\n- Migration directories: `prisma\u002Fmigrations\u002F`, `alembic\u002Fversions\u002F`, `migrations\u002F`, `db\u002Fmigrate\u002F`\n- Connection strings to confirm the database engine\n- Check the naming and numbering convention of existing migrations\n\nIf no tooling is detectable, default to raw SQL migration files.\n\n### Step 1: Understand the Change\n\nRead the current schema. Establish:\n\n- What is being added, removed, or modified?\n- Does existing data need to be preserved or transformed?\n- What application code depends on the current schema? (Check models, queries, ORM definitions)\n- Can migrations run before the application deploys, or must they be coordinated?\n- Is this table empty, small, or carrying live production traffic? This determines the safety requirements.\n\n### Step 2: Classify the Operation\n\nDetermine whether this is a safe or risky operation:\n\n| Operation                                  | Risk                                | Strategy                                                                    |\n| ------------------------------------------ | ----------------------------------- | --------------------------------------------------------------------------- |\n| Add nullable column                        | Safe                                | Single migration                                                            |\n| Add NOT NULL column with default           | Safe                                | Single migration with DEFAULT                                               |\n| Add NOT NULL column without default        | Risky                               | Expand\u002Fcontract — 3 steps                                                   |\n| Add index                                  | Risky (locks on naive CREATE INDEX) | `CREATE INDEX CONCURRENTLY`                                                 |\n| Drop column                                | Risky                               | Remove code references first, drop in separate deploy                       |\n| Rename column                              | Risky                               | Expand\u002Fcontract — add new, backfill, update code, drop old                  |\n| Change column type                         | Risky                               | Expand\u002Fcontract — add new column, backfill with cast, update code, drop old |\n| Add NOT NULL constraint to existing column | Risky                               | `ADD CONSTRAINT ... NOT VALID`, then `VALIDATE CONSTRAINT` separately       |\n| Drop table                                 | Risky                               | Remove all references first, drop in separate deploy                        |\n| Large backfill                             | Risky                               | Batched update with row-rate limiting                                       |\n\nFor any risky operation, the migration is a sequence of steps across multiple deploys — not a single file.\n\n### Step 3: Write the Migration Files\n\nWrite complete, executable SQL. No placeholders. No \"fill in your table name here.\"\n\n**For safe single-step migrations**, write one file with forward and rollback:\n\n```sql\n-- migrate:up\n\nALTER TABLE [table] ADD COLUMN [col] [type] [constraints];\n\n-- migrate:down\n\nALTER TABLE [table] DROP COLUMN [col];\n```\n\n**For expand\u002Fcontract migrations**, write one file per step:\n\n**Step 1 — Expand** (deploy before code change):\n\n```sql\n-- migrate:up\n-- Add the new column, nullable, no constraints yet\nALTER TABLE [table] ADD COLUMN [new_col] [type];\n\n-- migrate:down\nALTER TABLE [table] DROP COLUMN [new_col];\n```\n\n**Step 2 — Backfill** (run as a separate job or migration after Step 1 is deployed):\n\n```sql\n-- migrate:up\n-- Backfill in batches to avoid locking\n-- Run this via a script with rate limiting if the table is large\nUPDATE [table] SET [new_col] = [expression] WHERE [new_col] IS NULL;\n\n-- migrate:down\n-- No rollback needed; the column can be left null\n```\n\n**Step 3 — Contract** (deploy after code is updated to use new column):\n\n```sql\n-- migrate:up\nALTER TABLE [table] ALTER COLUMN [new_col] SET NOT NULL;\nALTER TABLE [table] DROP COLUMN [old_col];\n\n-- migrate:down\nALTER TABLE [table] ALTER COLUMN [new_col] DROP NOT NULL;\nALTER TABLE [table] ADD COLUMN [old_col] [type];\n-- Note: old_col data is gone; restore from backup if rollback is needed\n```\n\n**For indexes on live tables**, always use `CONCURRENTLY`:\n\n```sql\n-- migrate:up\nCREATE INDEX CONCURRENTLY idx_[table]_[col] ON [table]([col]);\n\n-- migrate:down\nDROP INDEX CONCURRENTLY idx_[table]_[col];\n```\n\nNote: `CREATE INDEX CONCURRENTLY` cannot run inside a transaction block. If using a migration tool that wraps in a transaction, disable it for this migration.\n\n**For NOT NULL constraints on existing columns**, use the two-phase approach:\n\n```sql\n-- Step 1 migrate:up\nALTER TABLE [table] ADD CONSTRAINT [table]_[col]_not_null CHECK ([col] IS NOT NULL) NOT VALID;\n\n-- Step 1 migrate:down\nALTER TABLE [table] DROP CONSTRAINT [table]_[col]_not_null;\n```\n\n```sql\n-- Step 2 migrate:up (separate deploy, after backfill confirms no nulls)\nALTER TABLE [table] VALIDATE CONSTRAINT [table]_[col]_not_null;\n\n-- Step 2 migrate:down\n-- Constraint remains but is no longer validated; drop if needed\nALTER TABLE [table] DROP CONSTRAINT [table]_[col]_not_null;\n```\n\nWrite the actual files for the project using its migration tool's conventions.\n\n### Step 4: Output the Deployment Plan\n\nAfter writing files, output the deployment sequence:\n\n```\n┌─ Migration: [change description] ───────────────────────┐\n│ Steps: X  │  Type: [safe \u002F expand-contract \u002F backfill]  │\n└─────────────────────────────────────────────────────────┘\n\nDeployment Sequence\n  1. [file or action] — [what it does] — [estimated duration \u002F locking risk]\n  2. [file or action] — [what it does] — [estimated duration \u002F locking risk]\n  3. [code deploy] — [what changes in the application]\n\nRollback\n  [step] — [rollback action] — [data loss risk if any]\n\nPre-Deploy Checklist\n  [ ] Backup verified and tested\n  [ ] Tested against a copy of production data, not just 10 rows\n  [ ] Not deploying during peak traffic window\n  [ ] Connection pool size confirmed — migration won't starve app connections\n  [ ] For CONCURRENTLY indexes: transaction wrapping disabled for this migration\n```\n\n40 lines max for the summary. The SQL files are the artifact — they are complete and executable.\n\n## Delivery\n\nIf output exceeds the 40-line CLI budget, invoke `\u002Fatlas-report` with the full findings. The HTML report is the output. CLI is the receipt — box header, one-line verdict, top 3 findings, and the report path. Never dump analysis to CLI.\n",{"name":5,"tags":58,"author":60,"license":15,"version":61,"description":7,"allowed-tools":62,"compatibility":63},[59,46,48,31],"engineering","tonone-ai \u003Chello@tonone.ai>","0.6.4","Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, Task, TodoWrite, AskUserQuestion","Designed for Claude Code","main","d5998d31415790d88781b1eebf9bd0694f7c5d93","bundle\u002Fengineering-team\u002Fskills\u002Fflux-migrate",11,"https:\u002F\u002Fgithub.com\u002Ftonone-ai\u002Ftonone","https:\u002F\u002Fsecond.tonone.ai","https:\u002F\u002Fgithub.com\u002Ftonone-ai","https:\u002F\u002Ftonone.ai","Founded by @thisisfatih","2026-11-11 05:05:57",{"source":8,"skillName":5,"commands":75,"prompt":85,"zipAvailable":86},[76,79,82],{"tool":77,"command":78},"npx","npx skills add tonone-ai\u002Ftonone --skill flux-migrate",{"tool":80,"command":81},"bunx","bunx skills add tonone-ai\u002Ftonone --skill flux-migrate",{"tool":83,"command":84},"pnpm","pnpm dlx skills add tonone-ai\u002Ftonone --skill flux-migrate","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ftonone-ai\u002Ftonone\u002Fblob\u002Fmain\u002Fbundle\u002Fengineering-team\u002Fskills\u002Fflux-migrate\u002FSKILL.md",true,[],[89,97,104,109,114,121],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":96},"01M72QSK7R99K8FWYFNYTXJGR2","helm-autoplan","Chained brief-to-decision pipeline. Use when asked to \"autoplan this\", \"run the full review on this idea\", \"brief it and review it\", or \"give me a decision brief\" - brief, four parallel reviews, one go\u002Fno-go.","https:\u002F\u002Fgithub.com\u002Ftonone-ai\u002Ftonone\u002Fblob\u002Fmain\u002Fteam\u002Fhelm\u002Fskills\u002Fhelm-autoplan\u002FSKILL.md",[],[],"2026-11-10 22:39:42",{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":96},"01M72Q6V4CB8E877RT5KJRSSB7","apex-second-opinion","Optional cross-model review of a diff or plan through an external CLI (codex, gemini, llm) already on PATH, with redaction and per-run consent. Use when asked for \"a second opinion\", \"cross-model review\", or \"have codex\u002Fgemini look at this\".","https:\u002F\u002Fgithub.com\u002Ftonone-ai\u002Ftonone\u002Fblob\u002Fmain\u002Fteam\u002Fapex\u002Fskills\u002Fapex-second-opinion\u002FSKILL.md",[],[],{"skillNo":105,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":96},"01M72PDNJ3NS66X4QZ6AM5BG91","https:\u002F\u002Fgithub.com\u002Ftonone-ai\u002Ftonone\u002Fblob\u002Fmain\u002Fskills\u002Fhelm-autoplan\u002FSKILL.md",[],[],{"skillNo":110,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":96},"01M72NV58FG71X4Y7H8E6W721A","https:\u002F\u002Fgithub.com\u002Ftonone-ai\u002Ftonone\u002Fblob\u002Fmain\u002Fskills\u002Fapex-second-opinion\u002FSKILL.md",[],[],{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":96},"01M72NEBG81JH7YNSDXYT8NHHE","helm-office-hours","Forcing-function intake before any brief. Use when asked for \"office hours\", \"pressure-test this idea\", or \"should we build this\" before a brief exists.","https:\u002F\u002Fgithub.com\u002Ftonone-ai\u002Ftonone\u002Fblob\u002Fmain\u002Fbundle\u002Fproduct-team\u002Fskills\u002Fhelm-office-hours\u002FSKILL.md",[],[],{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":96},"01M72NE7AS597YW6999C56CESR","helm-init","Short interview that writes PRODUCT.md, the durable product truth other skills read. Use when asked to \"init product\", \"write PRODUCT.md\", or \"set up product context\". Prefills from README and repo, asks max 6 questions.","https:\u002F\u002Fgithub.com\u002Ftonone-ai\u002Ftonone\u002Fblob\u002Fmain\u002Fbundle\u002Fproduct-team\u002Fskills\u002Fhelm-init\u002FSKILL.md",[],[]]