Plans safe deprecation, migration, sunset, replacement, and removal of old systems, APIs, features, schemas, flags, cron jobs, integrations, configs, libraries, UI flows, and operational processes. Use when retiring legacy code, replacing an implementation, removing a public/internal interface, migrating consumers, consolidating duplicate systems, deciding maintain-vs-sunset, writing deprecation notices, proving zero usage before deletion, or when Hyrum's Law, compatibility, rollback, data safety, production risk, or consumer communication matters.
Deprecation is not deletion. It is the managed transfer of consumers from old behavior to a safer replacement, followed by evidence-backed removal.
Use this skill to avoid two common failures: keeping legacy systems forever because nobody owns the migration, or deleting "unused" behavior that still has hidden consumers.
Relationship To Other Skills
Use context-engineering first when the source of truth, owner, live state, or relevant docs are unclear.
Use source-driven-development when migration depends on current vendor docs, SDK changes, platform deprecations, version support, or external API behavior.
Use api-and-interface-design when the deprecated surface is an API, schema, event, CLI, config format, or module boundary.
Use spec-driven-development when the desired replacement behavior or success criteria are unclear.
Use planning-and-task-breakdown to turn the migration into waves, issues, owners, gates, and Definition of Done.
Use incremental-implementation to migrate one consumer or slice at a time.
Use test-driven-development for compatibility tests, migration fixtures, adapter checks, and regression guards.
Use doubt-driven-review before irreversible removal, public deprecation deadlines, production cleanup, data migrations, auth changes, or claims that rollback is safe.
Use code-review-and-quality before accepting removal diffs.
Do Not Use
Do not use to justify cleanup without consumer evidence.
Do not remove production, data, secrets, auth, DNS, billing, cron, routing, webhooks, integrations, or public interfaces without explicit approval.
Do not assume code is unused because local search found no references.
Do not create a migration plan if there is no replacement, owner, or rollback path. Return a no-go instead.
Do not turn every tiny private refactor into a formal migration plan.
Core Loop
Work in this order:
INVENTORY
DECISION
REPLACEMENT
MIGRATION PLAN
ROLLOUT
REMOVAL READINESS
HANDOFF
1. Inventory
Identify what is being deprecated and who depends on it.
check imports and dependency graphs where possible;
check logs/metrics over a relevant time window;
confirm no external consumer still has access or contractual expectation;
confirm backups, rollback, or restore path;
define exact files/services/data/config to remove;
define exact checks after removal.
If evidence is incomplete, downgrade to advisory deprecation, add instrumentation, or create a follow-up task.
7. Handoff
Store the plan in the smallest durable layer that matches risk:
Chat-only: tiny internal cleanup with no consumers and no live risk.
Linear issue/document or Work Packet: project execution, waves, approvals, and owners.
Repo docs, ADR, migration guide, or runbook: code-owned technical migration.
Notion: human/client-facing explanation, operating procedure, or reusable knowledge.
local notes: internal sandbox evidence and repeatable checklist.
For user-facing durable prose, write explanations in the user's language. Keep commands, paths, field names, API identifiers, dates, versions, and product names exact.
Keep the old interface while routing it to the new implementation. Use when consumers are hard to change quickly.
Feature Flag
Move consumers by cohort or tenant. Use when rollback needs to be fast and behavior can coexist.
Strangler
Route traffic from old to new gradually. Use for services, routes, and workflows where parallel operation is possible.
Dual-Write Or Shadow Read
Compare old and new outputs before switching authority. Use carefully for data systems; define reconciliation and rollback first.
Alias Or Redirect
Preserve old names while pointing to new names. Use for CLI commands, config keys, URLs, or package exports when compatibility matters.
Zombie Code
Zombie code has active consumers but no owner. Do not delete it casually.
Classify it as one of:
assign owner and maintain;
instrument and measure;
wrap with compatibility boundary;
migrate consumers;
remove after proven zero usage.
If nobody can own the migration, surface that as the blocker.
Common Rationalizations
Rationalization
Response
"Search found no references."
Local search is one evidence source, not proof of zero usage. Check runtime/config/docs where relevant.
"It still works."
Working unowned code can still create security, upgrade, and onboarding risk. Compare maintenance cost to migration cost.
"Users will migrate themselves."
Consumers need tooling, docs, incentives, deadlines, or owned migration work.
"We can keep both forever."
Two systems double testing, docs, incident surface, and cognitive load.
"The replacement is better."
Better is not enough. It must cover critical use cases or have explicit behavior changes.
"We can rollback if needed."
Name the exact rollback step and prove it before removal.
Red Flags
Deprecation without owner.
Replacement not production-proven for critical use cases.
Deadline without migration tooling or support path.
Removing public behavior without consumer audit.
Active warnings for months with no migration progress.
No metric or log that can prove migration completion.
Cleanup bundled with unrelated refactor or deploy.
Data deletion hidden inside migration.
Deprecated system still receiving new features.
Done Check
Deprecated surface, owner, and consumers are named.
Evidence sources and gaps are explicit.
Decision posture is stated: maintain, freeze, advisory, compulsory, emergency, or remove now.
Replacement readiness is proven or the plan is marked no-go.
Migration waves, stop-lines, and rollback are defined.
Removal readiness uses positive evidence over a relevant window.
Approval gates are explicit for production, data, auth, public API, or external systems.
Final state is recorded in the correct durable layer.
1---2name: deprecation-and-migration3description: Plans safe deprecation, migration, sunset, replacement, and removal of old systems, APIs, features, schemas, flags, cron jobs, integrations, configs, libraries, UI flows, and operational processes. Use when retiring legacy code, replacing an implementation, removing a public/internal interface, migrating consumers, consolidating duplicate systems, deciding maintain-vs-sunset, writing deprecation notices, proving zero usage before deletion, or when Hyrum's Law, compatibility, rollback, data safety, production risk, or consumer communication matters.4---56# Deprecation and Migration78## Overview910Deprecation is not deletion. It is the managed transfer of consumers from old behavior to a safer replacement, followed by evidence-backed removal.1112Use this skill to avoid two common failures: keeping legacy systems forever because nobody owns the migration, or deleting "unused" behavior that still has hidden consumers.1314## Relationship To Other Skills1516- Use `context-engineering` first when the source of truth, owner, live state, or relevant docs are unclear.17- Use `source-driven-development` when migration depends on current vendor docs, SDK changes, platform deprecations, version support, or external API behavior.18- Use `api-and-interface-design` when the deprecated surface is an API, schema, event, CLI, config format, or module boundary.19- Use `spec-driven-development` when the desired replacement behavior or success criteria are unclear.20- Use `planning-and-task-breakdown` to turn the migration into waves, issues, owners, gates, and Definition of Done.21- Use `incremental-implementation` to migrate one consumer or slice at a time.22- Use `test-driven-development` for compatibility tests, migration fixtures, adapter checks, and regression guards.23- Use `doubt-driven-review` before irreversible removal, public deprecation deadlines, production cleanup, data migrations, auth changes, or claims that rollback is safe.24- Use `code-review-and-quality` before accepting removal diffs.2526## Do Not Use2728- Do not use to justify cleanup without consumer evidence.29- Do not remove production, data, secrets, auth, DNS, billing, cron, routing, webhooks, integrations, or public interfaces without explicit approval.30- Do not assume code is unused because local search found no references.31- Do not create a migration plan if there is no replacement, owner, or rollback path. Return a no-go instead.32- Do not turn every tiny private refactor into a formal migration plan.3334## Core Loop3536Work in this order:37381. INVENTORY392. DECISION403. REPLACEMENT414. MIGRATION PLAN425. ROLLOUT436. REMOVAL READINESS447. HANDOFF4546## 1. Inventory4748Identify what is being deprecated and who depends on it.4950Capture:5152- Artifact: code path, route, API, schema, feature flag, workflow, cron, integration, library, config, UI, document, or operational process.53- Owner: team, person, repo, service, project, or "unknown".54- Current state: active, deprecated, zombie, duplicate, broken, experimental, replaced, or unknown.55- Consumers: direct callers, imports, database references, events, dashboards, docs, automations, tests, operators, external customers, partners, agents.56- Evidence sources: `rg`, dependency graph, logs, metrics, tracing, analytics, GitHub search, Linear/Notion docs, production config, support history, runbooks, live smoke.57- Risk surfaces: data loss, auth/permission changes, billing, public API, partner integration, SEO, notifications, scheduled jobs, backups, audit trail.5859If the owner or consumers are unknown, start read-only discovery and do not propose removal yet.6061## 2. Decision6263Choose the correct posture.6465Use these outcomes:6667- Maintain: the old system still has unique value or migration cost exceeds maintenance risk.68- Freeze: stop adding new features while measuring usage and preparing replacement.69- Advisory deprecation: migration is recommended, no hard removal date yet.70- Compulsory deprecation: removal has a deadline because risk or cost is high enough.71- Emergency disablement: immediate safety issue; use incident handling and explicit approval.72- Remove now: only when zero usage and rollback/evidence are clear.7374For each decision, state:7576- why now;77- who owns the migration;78- what happens if nothing changes;79- what evidence would change the decision;80- what must not be touched.8182## 3. Replacement8384Never deprecate critical behavior without a usable target.8586Check replacement readiness:8788- covers critical old use cases;89- preserves required compatibility or explicitly changes behavior;90- has docs or examples for consumers;91- has tests or smoke checks;92- has operational ownership;93- has observability for migration progress;94- has rollback or compatibility shim;95- has known gaps documented.9697If the replacement is not ready, output "No-go: replacement not ready" and list the smallest safe next step.9899## 4. Migration Plan100101Plan migration around consumers, not around files.102103Define:104105- consumer list and priority;106- migration waves: canary, low-risk, main, stragglers, final removal;107- compatibility strategy: adapter, dual-write, read-through, feature flag, redirect, alias, shim, versioned API, or manual process;108- communication: who needs notice, where it lives, what date or condition matters;109- verification: tests, logs, metrics, search, dashboards, smoke, old-client fixtures;110- rollback: how to restore old behavior or pause the wave;111- stop-lines: metrics, errors, consumer objections, missing owner, data mismatch.112113Prefer moving one consumer at a time. If the old and new systems run in parallel, define how divergence is detected.114115## 5. Rollout116117Migrate incrementally and keep evidence.118119During rollout:120121- migrate a small safe consumer first;122- verify old and new behavior against the contract;123- watch errors, latency, volume, data parity, and support signals;124- update docs and notices as reality changes;125- keep old path available until removal readiness is proven;126- record what changed and what stayed untouched.127128For production-adjacent systems, separate read-only discovery from mutation. A deprecation plan is not approval to execute the removal.129130## 6. Removal Readiness131132Removal requires positive evidence, not just lack of local references.133134Before deleting:135136- verify zero active usage through appropriate live evidence;137- search code, configs, docs, tests, dashboards, runbooks, jobs, queues, and deployment settings;138- check imports and dependency graphs where possible;139- check logs/metrics over a relevant time window;140- confirm no external consumer still has access or contractual expectation;141- confirm backups, rollback, or restore path;142- define exact files/services/data/config to remove;143- define exact checks after removal.144145If evidence is incomplete, downgrade to advisory deprecation, add instrumentation, or create a follow-up task.146147## 7. Handoff148149Store the plan in the smallest durable layer that matches risk:150151- Chat-only: tiny internal cleanup with no consumers and no live risk.152- Linear issue/document or Work Packet: project execution, waves, approvals, and owners.153- Repo docs, ADR, migration guide, or runbook: code-owned technical migration.154- Notion: human/client-facing explanation, operating procedure, or reusable knowledge.155- local notes: internal sandbox evidence and repeatable checklist.156157For user-facing durable prose, write explanations in the user's language. Keep commands, paths, field names, API identifiers, dates, versions, and product names exact.158159## Deprecation Notice Shape160161Use this compact shape when drafting a notice:162163```text164Deprecation notice:165- Deprecated surface:166- Replacement:167- Status:168- Reason:169- Affected consumers:170- Migration steps:171- Verification:172- Deadline or removal condition:173- Support/owner:174- Rollback/exception path:175```176177## Migration Plan Shape178179Use this shape when returning a plan:180181```text182Migration plan:183- Goal:184- Current surface:185- Replacement:186- Consumers:187- Evidence:188- Decision:189- Waves:190- Compatibility strategy:191- Stop-lines:192- Verification:193- Approval gates:194- Removal readiness:195- Next safe step:196```197198## Patterns199200### Adapter201202Keep the old interface while routing it to the new implementation. Use when consumers are hard to change quickly.203204### Feature Flag205206Move consumers by cohort or tenant. Use when rollback needs to be fast and behavior can coexist.207208### Strangler209210Route traffic from old to new gradually. Use for services, routes, and workflows where parallel operation is possible.211212### Dual-Write Or Shadow Read213214Compare old and new outputs before switching authority. Use carefully for data systems; define reconciliation and rollback first.215216### Alias Or Redirect217218Preserve old names while pointing to new names. Use for CLI commands, config keys, URLs, or package exports when compatibility matters.219220## Zombie Code221222Zombie code has active consumers but no owner. Do not delete it casually.223224Classify it as one of:225226- assign owner and maintain;227- instrument and measure;228- wrap with compatibility boundary;229- migrate consumers;230- remove after proven zero usage.231232If nobody can own the migration, surface that as the blocker.233234## Common Rationalizations235236| Rationalization | Response |237|---|---|238| "Search found no references." | Local search is one evidence source, not proof of zero usage. Check runtime/config/docs where relevant. |239| "It still works." | Working unowned code can still create security, upgrade, and onboarding risk. Compare maintenance cost to migration cost. |240| "Users will migrate themselves." | Consumers need tooling, docs, incentives, deadlines, or owned migration work. |241| "We can keep both forever." | Two systems double testing, docs, incident surface, and cognitive load. |242| "The replacement is better." | Better is not enough. It must cover critical use cases or have explicit behavior changes. |243| "We can rollback if needed." | Name the exact rollback step and prove it before removal. |244245## Red Flags246247- Deprecation without owner.248- Replacement not production-proven for critical use cases.249- Deadline without migration tooling or support path.250- Removing public behavior without consumer audit.251- Active warnings for months with no migration progress.252- No metric or log that can prove migration completion.253- Cleanup bundled with unrelated refactor or deploy.254- Data deletion hidden inside migration.255- Deprecated system still receiving new features.256257## Done Check258259- [ ] Deprecated surface, owner, and consumers are named.260- [ ] Evidence sources and gaps are explicit.261- [ ] Decision posture is stated: maintain, freeze, advisory, compulsory, emergency, or remove now.262- [ ] Replacement readiness is proven or the plan is marked no-go.263- [ ] Migration waves, stop-lines, and rollback are defined.264- [ ] Removal readiness uses positive evidence over a relevant window.265- [ ] Approval gates are explicit for production, data, auth, public API, or external systems.266- [ ] Final state is recorded in the correct durable layer.
Run npx skillmds@latest add pimenov/deprecation-and-migration in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Plans safe deprecation, migration, sunset, replacement, and removal of old systems, APIs, features, schemas, flags, cron jobs, integrations, configs, libraries, UI flows, and operational processes. Use when retiring legacy code, replacing an implementation, removing a public/internal interface, migrating consumers, consolidating duplicate systems, deciding maintain-vs-sunset, writing deprecation notices, proving zero usage before deletion, or when Hyrum's Law, compatibility, rollback, data safety, production risk, or consumer communication matters. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
pimenov (@pimenov) published this skill. Their other Agent Skills are listed on their SkillMD profile.