# Principle migrate callers then delete legacy APIS

> Principle migrate callers then delete legacy APIS is an open-source agent skill for developer tools. Guides an agent to migrate internal API callers and remove the old API in one pass. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/michael-denyer/pstack-claude/tree/main/plugins/pstack/skills/principle-migrate-callers-then-delete-legacy-apis
- **Repository:** https://github.com/michael-denyer/pstack-claude
- **GitHub stars:** 5,057
- **License:** MIT
- **Skill name:** principle-migrate-callers-then-delete-legacy-apis
- **Collection:** https://github.com/michael-denyer/pstack-claude
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill tells the agent how to handle a refactor where a new internal API replaces an old one while the old callers still exist. Instead of keeping shims or compatibility layers around, the agent is directed to update every caller to the new contract and delete the legacy API within the same change.

The guidance also covers tests: existing tests should be rewritten to assert the new contract, and tests that only pin down implementation details from before the refactor should be removed rather than preserved.

The skill is written for projects where no external users rely on backward compatibility and where coordinated breaking changes are acceptable, such as simplification or refactor initiatives. It is a plain instruction file with no scripts, and it has no tool requirements beyond what the agent already uses to edit code and run tests.

## When your agent uses it

> 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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/michael-denyer/pstack-claude/tree/HEAD/plugins/pstack/skills/principle-migrate-callers-then-delete-legacy-apis)
- [License: MIT](https://github.com/michael-denyer/pstack-claude/tree/HEAD/plugins/pstack/skills/principle-migrate-callers-then-delete-legacy-apis)

## Features

- **Caller migration step:** Directs the agent to update every existing caller to use the new API in the same wave.
- **Legacy API removal:** Tells the agent to delete the old API rather than leave it behind as a fallback.
- **No compatibility shims:** Discourages adapter layers and backward-compatible wrappers during internal refactors.
- **Test contract updates:** Asks the agent to rewrite tests against the new contract and drop tests of old internals.
- **Applicability checks:** Lists conditions under which the approach fits, such as no external dependents and an acceptable breaking-change budget.

## Good for

- Replace an internal service method and update all of its call sites
- Retire an old helper module after introducing its successor
- Remove a deprecated internal interface during a simplification refactor
- Rewrite test suites so they check the new internal contract

## Install

### Claude Code

This skill ships in the `pstack` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add michael-denyer/pstack-claude
/plugin install pstack@pstack-claude
```

Or copy only this skill to `~/.claude/skills/principle-migrate-callers-then-delete-legacy-apis`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/principle-migrate-callers-then-delete-legacy-apis &&
cp -R "$tmp/plugins/pstack/skills/principle-migrate-callers-then-delete-legacy-apis" ~/.claude/skills/principle-migrate-callers-then-delete-legacy-apis &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/principle-migrate-callers-then-delete-legacy-apis` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/principle-migrate-callers-then-delete-legacy-apis` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/principle-migrate-callers-then-delete-legacy-apis &&
cp -R "$tmp/plugins/pstack/skills/principle-migrate-callers-then-delete-legacy-apis" ~/.agents/skills/principle-migrate-callers-then-delete-legacy-apis &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/principle-migrate-callers-then-delete-legacy-apis` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/principle-migrate-callers-then-delete-legacy-apis` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/principle-migrate-callers-then-delete-legacy-apis &&
cp -R "$tmp/plugins/pstack/skills/principle-migrate-callers-then-delete-legacy-apis" ~/.cursor/skills/principle-migrate-callers-then-delete-legacy-apis &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/principle-migrate-callers-then-delete-legacy-apis` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/michael-denyer/pstack-claude.git --path plugins/pstack/skills/principle-migrate-callers-then-delete-legacy-apis
```

Or copy the folder to `~/.gemini/skills/principle-migrate-callers-then-delete-legacy-apis` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/principle-migrate-callers-then-delete-legacy-apis`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/principle-migrate-callers-then-delete-legacy-apis &&
cp -R "$tmp/plugins/pstack/skills/principle-migrate-callers-then-delete-legacy-apis" ~/.copilot/skills/principle-migrate-callers-then-delete-legacy-apis &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/principle-migrate-callers-then-delete-legacy-apis` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git
```

Then copy `pstack-claude/plugins/pstack/skills/principle-migrate-callers-then-delete-legacy-apis` into your agent's skills folder as `principle-migrate-callers-then-delete-legacy-apis`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Principle migrate callers then delete legacy APIS apply?

It applies when a new internal API is introduced while old callers still exist, and the project has no external users depending on backward compatibility.

### Does Principle migrate callers then delete legacy APIS keep the old API for compatibility?

No. The skill instructs the agent to migrate callers and delete the legacy API in the same wave instead of preserving compatibility layers.

### What does Principle migrate callers then delete legacy APIS do with existing tests?

Tests should be updated to assert the new contract, and tests that only protect pre-refactor implementation details should be deleted.

### Does Principle migrate callers then delete legacy APIS run any scripts?

No. The skill folder contains no scripts; it consists of instructions only.

### How do I install Principle migrate callers then delete legacy APIS in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/principle-migrate-callers-then-delete-legacy-apis to use it in all your projects, or to .claude/skills/principle-migrate-callers-then-delete-legacy-apis in one project. Or install the pstack plugin, which includes it: /plugin marketplace add michael-denyer/pstack-claude, then /plugin install pstack@pstack-claude.

### Does Principle migrate callers then delete legacy APIS run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Principle migrate callers then delete legacy APIS?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Principle migrate callers then delete legacy APIS?

The closest alternatives to Principle migrate callers then delete legacy APIS are Deprecation, API, Principle outcome oriented execution, API versioning helper and Refactor seams.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Deprecation](https://ai-powered.com/skills/deprecation): Deprecation is an open-source agent skill for developer tools.
- [API](https://ai-powered.com/skills/api): API is an open-source agent skill for developer tools.
- [Principle outcome oriented execution](https://ai-powered.com/skills/principle-outcome-oriented-execution): Principle outcome oriented execution is an open-source agent skill for developer tools.
- [API versioning helper](https://ai-powered.com/skills/api-versioning-helper): API versioning helper is an open-source agent skill for developer tools.
- [Refactor seams](https://ai-powered.com/skills/refactor-seams): Refactor seams is an open-source agent skill for developer tools.
- [Refactor](https://ai-powered.com/skills/refactor): Refactor is an open-source agent skill for developer tools.
- [Integration adapter](https://ai-powered.com/skills/integration-adapter): Integration adapter is an open-source agent skill for developer tools.
- [Contract design](https://ai-powered.com/skills/contract-design): Contract design is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/principle-migrate-callers-then-delete-legacy-apis
