
migration-patterns-plugin
Migration plugin with dual-write, shadow-mode, and automated Python and JS tooling swaps.
- version
- 1.7.1
- GitHub stars
- 60
What it does
- Adds 7 skills covering data migration patterns, tooling migrations, and a cutover gate for retiring incumbent tools
- Covers dual write, shadow mode, and tool swaps: mypy to ty, black to ruff-format, flake8 and isort to ruff, and ESLint and Prettier to Biome
- Enforces a cutover gate that keeps the old tool in place until the replacement shows a positive operational signal
- Designed for teams running zero-downtime migrations, invoked through
/configure:repowhen a migratable pattern is detected
Safe database and system migration patterns - dual write, shadow mode, strangler fig
Add marketplace
/plugin marketplace add laurigates/claude-pluginsRun it inside Claude Code once, then install the plugin below.
Install
/plugin install migration-patterns-plugin@laurigates-claude-pluginsRun it inside Claude Code after adding the marketplace.
Files
Discovered from source/migration-patterns:black-to-ruff-format
Migrate from black to ruff format — Ruff's drop-in Black-compatible formatter written in Rust (~35x faster). Replaces the psf/black pre-commit hook, migrates [tool.black] configuration, and removes black from dev dependencies.
When to Use This Skill
| Use this skill when... | Keep black when... |
|---|---|
.pre-commit-config.yaml contains psf/black | Team has strong preference for black's exact output |
[tool.black] exists in pyproject.toml | CI uses black --check specifically by name |
| Repo already uses ruff for linting | Project uses black's API in build scripts |
| Wanting to consolidate formatting under ruff |
Context
- Pre-commit config: !
find . -maxdepth 1 -name '.pre-commit-config.yaml' - pyproject.toml: !
find . -maxdepth 1 -name 'pyproject.toml' - ruff already present: !
find . -maxdepth 1 -name 'ruff.toml'
Parameters
| Parameter | Description |
|---|---|
--check-only | Report what would change without modifying files |
--fix | Apply migration automatically |
Execution
Execute this black-to-ruff-format migration:
Step 1: Audit current black configuration
- Read
.pre-commit-config.yamland locatepsf/blackentries. - Read
pyproject.tomland extract the[tool.black]section. - Report findings:
Ifblack → ruff-format migration audit ===================================== pre-commit hook: psf/black found at rev <rev> pyproject.toml: [tool.black] section found (line-length=<N>, target-version=<X>) ruff already: EXISTS / NOT PRESENT--check-only, stop here.
Step 2: Update .pre-commit-config.yaml
Remove the psf/black repo block. If ruff-pre-commit is already present, add the ruff-format hook ID. Otherwise add the full ruff-pre-commit repo block with both ruff and ruff-format hooks:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.1 # use latest stable ruff version
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
If ruff-pre-commit already exists but only has the ruff linter hook, add the ruff-format hook ID under the same repo block.
Step 3: Migrate [tool.black] → [tool.ruff.format] in pyproject.toml
Convert black configuration to ruff format config:
| black key | ruff equivalent | Notes |
|---|---|---|
line-length | [tool.ruff] line-length | Shared with linter |
target-version | [tool.ruff] target-version | Shared with linter |
skip-string-normalization | [tool.ruff.format] quote-style = "preserve" | |
skip-magic-trailing-comma | [tool.ruff.format] skip-magic-trailing-comma = true | |
preview | [tool.ruff.format] preview = true |
Remove the [tool.black] section. Merge settings into [tool.ruff] and [tool.ruff.format] sections (create if absent, merge if existing).
Step 4: Remove black from dependencies
Remove black from dev/lint dependencies:
# With uv
uvx --from uv uv remove --dev black 2>/dev/null || true
If not using uv, note it for manual removal.
Step 5: Verify migration
Run the new hook to confirm it works:
pre-commit run ruff-format --all-files
If it exits 0, the migration is complete. If it produces diffs, this is expected on first run (ruff format may reformat some files differently from black). Commit the reformatted files as part of the migration.
Step 6: Report
Print a summary of changes:
black → ruff-format migration complete
=======================================
.pre-commit-config.yaml UPDATED (removed psf/black, added ruff-format hook)
pyproject.toml UPDATED ([tool.black] → [tool.ruff.format])
Note: ruff-format is Black-compatible (same defaults), but may reformat a small
number of files. Review the diff and include these reformatted files in the
migration commit.
Files to stage:
git add .pre-commit-config.yaml pyproject.toml
git add <any reformatted .py files>
Agentic Optimizations
| Context | Command |
|---|---|
| Audit only | /migration-patterns:black-to-ruff-format --check-only |
| Apply migration | /migration-patterns:black-to-ruff-format --fix |
| Verify after migration | pre-commit run ruff-format --all-files |
| Check format directly | uvx ruff format --check . |
Quick Reference
| Item | Value |
|---|---|
| ruff format docs | https://docs.astral.sh/ruff/formatter/ |
| Black compatibility | ruff format is designed as a Black drop-in with ~99.9% compatible output |
| Config section | [tool.ruff.format] in pyproject.toml |
| Pre-commit hook | ruff-format in astral-sh/ruff-pre-commit |
See Also
/migration-patterns:flake8-to-ruff— Migrate flake8/isort linting to ruff/migration-patterns:mypy-to-ty— Migrate mypy to ty/configure:repo— End-to-end repo config driver
Readme
migration-patterns-plugin
Migration patterns for safe, zero-downtime transitions — both data migrations and tooling migrations.
Skills
Data Migration Patterns
| Skill | Description |
|---|---|
dual-write | Dual write (double write) pattern for keeping two data stores in sync during migration |
shadow-mode | Shadow mode (dark launching) pattern for validating new systems under production traffic |
Migration Discipline
| Skill | Description |
|---|---|
tool-migration-cutover | Gate removal of the incumbent tool on a positive operational signal from the replacement — and spot the mirror failure, a leftover still wired and fighting the new tool |
Automated Tooling Migrations
| Skill | Invocation | Description |
|---|---|---|
mypy-to-ty | /migration-patterns:mypy-to-ty | Migrate from mypy to ty (Astral's type checker) |
black-to-ruff-format | /migration-patterns:black-to-ruff-format | Migrate from black to ruff's formatter |
flake8-to-ruff | /migration-patterns:flake8-to-ruff | Migrate from flake8/isort to ruff linting |
eslint-to-biome | /migration-patterns:eslint-to-biome | Migrate from ESLint/Prettier to Biome |
Data Migration Patterns
Dual Write
During a database migration, the application writes to both the old and new system simultaneously. Reads can be compared between them to validate consistency before cutting over.
Use when: Migrating databases, switching storage backends, zero-downtime schema changes.
Shadow Mode
Production requests are mirrored to a shadow deployment in the background. The shadow's responses are discarded (only the production response reaches the user), but responses are logged and compared to verify the new system behaves correctly under real traffic.
Use when: Validating replacement services, testing under production load, comparing response correctness.
Combined Usage
These patterns are complementary tactics within the Strangler Fig migration strategy:
- Shadow mode validates read behavior
- Dual write keeps both systems in sync
- Together they enable safe, gradual migration with rollback at every phase
Tooling Migration Skills
These skills automate common Python and TypeScript tooling migrations. Each migration:
- Audits the current state
- Updates
.pre-commit-config.yaml - Migrates configuration in
pyproject.toml/biome.json - Removes old dependencies
- Verifies the migration with a dry run
All four skills are invoked by /configure:repo via AskUserQuestion when the corresponding migration pattern is detected — they are not run automatically.
mypy → ty
Replaces the mirrors-mypy pre-commit hook with a repo: local hook running uvx ty check. Converts [tool.mypy] config to [tool.ty].
Note: astral-sh/ty-pre-commit does not yet exist; repo: local with entry: uvx ty check is the correct pattern.
black → ruff-format
Replaces psf/black pre-commit hook with ruff-format. Migrates [tool.black] config to [tool.ruff.format]. Drop-in compatible output.
flake8/isort → ruff
Replaces pycqa/flake8 and PyCQA/isort hooks with a single ruff hook. Migrates rule configuration and import-sort settings.
ESLint → Biome
Replaces .eslintrc* and Prettier configs with biome.json. Updates pre-commit hooks and package.json scripts. Flags plugins without Biome equivalents (e.g., eslint-plugin-jsx-a11y) for manual review.
Migration Discipline
tool-migration-cutover
"Config exists" and "config works" are different claims, and the gap between them is where coverage silently drops to zero. This skill gates removal of the incumbent on a positive operational signal from the replacement (a successful runner execution, a side effect on the target repo, a token actually minted and used), and stages the deprecation as a draft until that signal lands. It also covers the mirror failure — the old tool left wired, reformatting correct code on every commit.
Use when: Removing Dependabot after adopting Renovate, retiring a PAT for a GitHub App, replacing a linter/formatter/CI runner, or when a 3-line edit produces a 400-line diff.
Integration with /configure:repo
The end-to-end driver /configure:repo detects migratable patterns and offers each migration via AskUserQuestion. Users choose which migrations to apply.
Installation
Add to your Claude Code plugin registry or install from the marketplace.
Details
- Marketplace
- laurigates/claude-plugins
- Source
- migration-patterns-plugin
- Author
- Lauri Gates
- Category
- Infrastructure
- License
- MIT
- Keywords
- migration, dual-write, shadow-mode, dark-launching, strangler-fig, database-migration, zero-downtime
- Listed since
- Apr 7, 2026
More from laurigates/claude-plugins
All 52- networking-pluginv1.4.3
- obsidian-pluginv1.3.8
- project-pluginv1.21.17
- prompt-engineering-pluginv1.1.4
- prose-pluginv1.4.5
- python-pluginv1.5.10
- reverse-engineering-pluginv1.1.0
- rust-pluginv1.9.1
- session-pluginv1.18.3
- software-design-pluginv1.2.0
- taskwarrior-pluginv1.16.4
- terraform-pluginv1.7.13
- testing-pluginv3.27.2
- tools-pluginv2.16.2
- typescript-pluginv1.10.4
- video-pluginv2.0.2
- workflow-orchestration-pluginv1.20.0
- youtube-pluginv1.1.0
- accessibility-pluginv2.3.6
- agent-patterns-pluginv2.58.5
- agents-pluginv1.16.3
- api-pluginv2.0.1
- bevy-pluginv1.4.2
- bios-pluginv1.2.0
Similar to migration-patterns-plugin
More Developer Tools
database-migrationsSkillaffaan-m/ecc6.9K installsSchema migration patterns for PostgreSQL, Prisma, Drizzle, Kysely, Django, and golang-migrate with zero-downtime and rollback guidance.
migration-plannerSkillpatricio0312rev/skills279 installsPhased data and system migration planner using dual writes, backfills, feature flags, and per-phase rollbacks.
deployment-strategiesPluginwshobson/agents42.8K starsDeployment patterns, rollback automation, and infrastructure templates
migration-generatorPluginrohitg00/awesome-claude-code-toolkit2.8K starsDatabase migration generation and rollback management
ruflo-migrationsPluginruvnet/ruflo82.2K starsSchema migration management — generate, validate, dry-run, and rollback database migrations
framework-migrationPluginwshobson/agents42.8K starsFramework updates, migration planning, and architectural transformation workflows