Skip to content
Back to skills

Api Deprecation Handling

ASecurity

Deprecates a public function or endpoint the careful way: replacement first, runtime warnings, docs, a migration note and a dated removal plan.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 15, 2026
ai-agentsapi

Works with

  • api

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add workspace-templates/ai-agent-templates --skill api-deprecation-handling --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Api Deprecation Handling?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Api Deprecation Handling
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/workspace-templates-api-deprecation-handling/badge)](https://www.skillsdirectory.com/skills/workspace-templates-api-deprecation-handling)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: api-deprecation-handling
description: "Deprecates a public function or endpoint the careful way: replacement first, runtime warnings, docs, a migration note and a dated removal plan."
---

# API deprecation handling

Never remove in the same release that introduces the replacement.

## Steps

1. Define the change: what is old, what replaces it, and who calls it. Search the repo (`grep` or symbol search) for internal callers and list them. For public APIs, check logs or metrics for external use if available.
2. Confirm the replacement exists, has tests and covers every use case of the old API. If it does not, stop and report the gap.
3. Mark the old API in the language's own way: `@deprecated` JSDoc, `warnings.warn(..., DeprecationWarning)`, `#[deprecated]`, `[Obsolete]`. For HTTP, add `Deprecation` and `Sunset` headers and a `Link` header pointing at the migration doc.
4. Keep behavior identical. The old path may delegate to the new one, which also removes duplicate logic.
5. Emit the warning once per process or per caller, with the replacement name and the removal version or date in the message. Do not flood the logs.
6. Migrate all internal callers to the replacement in the same change. Check that no internal code triggers the warning.
7. Write a migration note: before and after code, differences in behavior, and the removal date. Add it to the changelog and the docs page for the old API.
8. Add a test that the warning fires, and a calendar note or issue for the removal, listing the files to delete.

## Rules

- Choose the removal date at least one release cycle out, longer for public APIs.
- Do not rename or change arguments of the old API during the deprecation period.

## Report

Files changed, internal callers migrated, the exact warning text, removal date and the issue link or text for the removal task.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.