PluginBench
Skill
Pass
Audit score 90

principle-migrate-callers-then-delete-legacy-apis

cursor/plugins

Migrate callers and delete legacy APIs in one refactor wave instead of maintaining compatibility layers.

What is principle-migrate-callers-then-delete-legacy-apis?

This principle guides refactoring internal APIs by migrating all callers and removing the old API simultaneously, rather than preserving backward compatibility. Apply when the project can absorb coordinated breaking changes and no external users depend on the legacy interface.

  • Inventory all callers of the legacy API before refactoring
  • Migrate callers to the new API design in a single coordinated wave
  • Delete the old API immediately after migration completes
  • Update tests to assert the new contract and remove pre-refactor implementation tests
  • Treat temporary adapters as exceptional and time-boxed, not default architecture

How to install principle-migrate-callers-then-delete-legacy-apis

npx skills add https://github.com/cursor/plugins --skill principle-migrate-callers-then-delete-legacy-apis
Claude Code
Cursor
Windsurf
Cline

How to use principle-migrate-callers-then-delete-legacy-apis

  1. 1.Identify the legacy API and all internal callers that depend on it
  2. 2.Plan the migration scope and timeline for updating all callers
  3. 3.Update callers to use the new API design
  4. 4.Update or remove tests that only protect pre-refactor implementation details
  5. 5.Delete the legacy API and verify no references remain
  6. 6.Deploy the changes as a single coordinated refactor wave

Use cases

Good for
  • Simplifying internal API surfaces during major refactors
  • Removing deprecated internal endpoints when all callers can be updated together
  • Cleaning up dual-path complexity that slows development velocity
  • Consolidating multiple versions of the same internal service
  • Eliminating adapter layers that exist only for backward compatibility
Who it's for
  • Backend engineers refactoring internal APIs
  • Platform teams managing shared internal services
  • Architects designing API migration strategies
  • Teams working on codebases without external API consumers

principle-migrate-callers-then-delete-legacy-apis FAQ

When should I keep a compatibility layer instead?

Only in exceptional, time-boxed cases. If external users or long-term integrations depend on the legacy API, maintain compatibility. Otherwise, migrate and delete in the same wave to avoid dual-path complexity.

What if I can't migrate all callers at once?

This principle assumes the project can absorb coordinated breaking changes. If callers are distributed across teams or systems that can't align, reconsider whether a temporary adapter is necessary—but set a hard deadline for removal.

Should I keep tests for the old API?

Delete tests that only protect pre-refactor implementation details. Keep tests that verify business logic, but rewrite them to assert the new contract.

How do I inventory all callers?

Use code search, grep, or static analysis tools to find all references to the legacy API. Document the list and assign migration tasks before starting the refactor.

Full instructions (SKILL.md)

Source of truth, from cursor/plugins.


name: principle-migrate-callers-then-delete-legacy-apis description: "Apply when introducing a new internal API while old callers still exist. Migrate callers and delete the old API in the same wave instead of preserving compatibility layers." disable-model-invocation: true

Migrate Callers Then Delete Legacy APIs

When we decide a new API is the right design, migrate callers and remove the old API in the same refactor wave instead of preserving compatibility layers.

Rule:

  • Do not keep legacy API paths only because internal callers still exist
  • Inventory callers, migrate them, and delete the old API immediately
  • Treat temporary adapters as exceptional and time-boxed, not default architecture
  • Update tests to assert the new contract, and delete tests that only protect pre-refactor implementation details

When this applies:

  • No external users depend on backward compatibility
  • The project can absorb coordinated breaking changes
  • The new API is part of a simplification or refactor initiative

Keeping both old and new APIs creates dual-path complexity, slows cleanup, and makes the codebase feel append-only.