用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/arbazkhan971/godmode --skill migration命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | migration |
| description | System migration and technology transition. |
/godmode:migration, "migrate from X to Y"Source: <language, framework, architecture, data stores>
Target: <target stack and architecture>
Code size: <files, LOC, modules>
Test coverage: <percentage>
Team size: <N developers>
Type: Language | Framework | Architecture | Data | API
IF codebase > 50K LOC: use Strangler Fig (not Big Bang)
IF data-critical: use Parallel Run
IF internal component swap: use Branch by Abstraction
BIG BANG: rewrite all, switch over
WHEN: <10K LOC, acceptable downtime
Risk: HIGH — all-or-nothing
STRANGLER FIG: replace piece by piece via facade
WHEN: large codebase, zero-downtime required
Risk: LOW — each piece reversible
PARALLEL RUN: old+new simultaneously, compare
WHEN: data integrity critical
Risk: MEDIUM — double infra cost
BRANCH BY ABSTRACTION: abstraction layer, swap impl
WHEN: internal component, same API contract
Risk: LOW — abstraction isolates change
IF team < 3: avoid Big Bang (too risky with small team). IF match_rate < 99.0%: do NOT cutover. IF match_rate >= 99.9%: ramp 5% -> 25% -> 50% -> 100%.
JS -> TS: Phase 1: tsconfig with allowJs:true, strict:false Phase 2: Rename .js->.ts one file at a time (leaves first) Phase 3: Enable strict mode incrementally
REST -> GraphQL: Phase 1: GraphQL alongside REST (resolvers call services) Phase 2: Migrate clients one feature at a time Phase 3: Deprecate REST endpoints
Monolith -> Microservices: Phase 0: Identify bounded contexts, add module boundaries Phase 1: Extract easiest module as first service Phase 2: Feature flag, shadow traffic, ramp
Phase 1 — Dual-write: write BOTH stores, old=source
Phase 2 — Backfill: batch historical data, rate-limited
Track: migrated/total, verify integrity per batch
Phase 3 — Cutover: read from new, stop old writes
Phase 4 — Cleanup: remove old after 2-week stability
# Verify data integrity
psql -c "SELECT count(*) FROM old_table"
psql -c "SELECT count(*) FROM new_table"
# Row counts must match within 0.01%
Route traffic to BOTH systems.
Compare outputs automatically.
Target: > 99.9% match rate before cutover.
IF mismatch > 1%: categorize, fix top 3, re-run.
Triggers: error rate > 1.1x baseline for 5 min,
p99 latency > threshold for 5 min,
data inconsistency detected.
Steps: switch traffic back, stop dual-writes,
reconcile data, notify stakeholders, post-mortem.
FOR each component (fewest dependencies first):
1. EXTRACT + BUILD new implementation
2. WRITE/migrate tests
3. DEPLOY behind feature flag, shadow traffic
4. PARALLEL RUN: target > 99.9% match
5. IF match < 99.0%: fix and re-run
6. IF match >= 99.9%: ramp 5%->25%->50%->100%
7. REMOVE old after 2-week stability
# Run and verify migrations
npm run migrate:status
python manage.py showmigrations
npx prisma migrate status
Append .godmode/migration-results.tsv:
timestamp source target strategy status match_rate
KEEP if: match > 99.9%, rollback tested,
flags control cutover.
DISCARD if: match < 99%, no rollback,
deployment-switched. Revert if error > 1.1x.
STOP when FIRST of:
- Match rate > 99.9% + rollback tested
- Data integrity verified + old system kept 2 weeks
- User requests stop
On failure: git reset --hard HEAD~1. Never pause.
| Failure | Action |
|---|---|
| Match < 99% | Categorize mismatches, fix top 3, re-run |
| Feature breaks | Flip flag back, add test before retry |
| Data integrity | Verify checksums, row counts, samples |