migrate-to-library

Migrate code between libraries or APIs incrementally behind characterization tests.

1|Updated Jul 13, 2026
One-click install
npx skills add https://github.com/dineshrevunuru/SuperSkills --skill migrate-to-library-dineshrevunuru
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-to-library
Source: https://github.com/dineshrevunuru/SuperSkills/tree/main/migrate-to-library
Command: npx skills add https://github.com/dineshrevunuru/SuperSkills --skill migrate-to-library-dineshrevunuru

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Swapping one library or API for another often passes the typecheck while silently changing runtime behavior — a 500 that no longer throws, a null that no longer short-circuits, a retry that no longer fires. This Skill prevents that drift by requiring a characterization test net that is green against the old library before any call site is touched. ## Core Features & Use Cases - Safety-net-first migration: Write characterization tests against the old library's behavior contract (success, non-2xx, null, empty, timeout) before swapping, so the net goes red the moment behavior drifts. - Mode-switchable paths: A scrappy codemod-plus-typecheck path for pure compiler-checked renames, a rigor path for behavior-drifting swaps, and a strangler-adapter path for large non-atomic migrations. - Incremental execution: Migrate one seam at a time with green checks between each, track remaining call sites with a grep-driven checklist, and remove the old dependency only when zero references remain. - Use Case: Moving a React/TypeScript app from axios to fetch — the net catches that fetch resolves on HTTP 500 instead of rejecting, a drift the compiler cannot see. ## Quick Start Migrate all axios calls in this repo to fetch safely, writing characterization tests against the current behavior first and migrating one call site at a time.

Frequently Asked Questions about migrate-to-library

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate from axios to fetch without breaking error handling?

Write characterization tests against axios's behavior first — especially that it rejects on non-2xx responses — and confirm they pass. Then swap call sites one at a time, adding an explicit res.ok check with fetch, since fetch resolves on HTTP errors instead of throwing.

How to replace a deprecated npm dependency safely?

Pin both old and new versions, grep every call site to map the migration surface, and read the version-specific migration guide for changed defaults and error semantics. Migrate incrementally with tests green between each seam, then remove the old package once zero references remain.

Does a passing TypeScript typecheck prove a library swap is safe?

No. A typecheck only proves the shapes line up; it cannot detect runtime drift like changed error behavior, null handling, retries, or caching. Only characterization tests run against the old library first can catch that drift.

When should I use a strangler pattern for library migration?

Use a strangler approach when the blast radius is large or the swap cannot be done atomically. Wrap both old and new libraries behind one adapter interface, migrate callers through it one at a time, and delete the shim only when no caller uses the old path.

When is a full characterization test net not needed for a migration?

Skip the net only for pure compiler-checked renames — import-path changes, renamed exports, or argument reorders the typecheck fully verifies. Any swap involving data fetching, dates, validation, state, or money should be treated as behavior-drifting and needs the net.