agentleFS
jmxt3jmxt3/gitscape.ai/.agents/skills/deprecation-and-migration/SKILL.md

deprecation-and-migration

Skill32 starsChanged 5 months agoApache-2.0View on GitHub

Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when deciding whether to maintain or sunset existing code.

34 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use constraint-driven-development, doubt-driven-development and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • vinvcnSkill

    constraint-driven-development

    把一个项目的质量线确立为书面契约,并阻止 agent 悄悄降低它。通过访谈确定用户在意哪些维度,当用户心里没有数字时提供合理的默认阈值,把一切记录进 CONSTRAINTS.md,并盯住 diff 中质量线被削弱的迹象——新增的 @ts-ignore 或 eslint-disable 抑制注释、被跳过或删除的测试、被剥掉的断言、未实现的 stub、被调低的阈值。当没有任何质量线被写下来时使用;当用户说 "set up constraints" 或 "define our standards" 时;当用户希望把他们在意的维度——无障碍性、Web 性能、覆盖率——设置成被强制执行的约束时;当 agent 为了变绿不断静默检查或跳过测试时;当你需要一个覆盖率或性能阈值却不知道该选什么数字时;或者当 agent 写下的代码超出任何人会读的体量时。

    Also in 4 projects that use this

  • mycelium-hqSkill

    doubt-driven-development

    Use when correctness matters more than speed: about to commit non-trivial code, make an architectural call under uncertainty, work in unfamiliar code, or assert what the compiler cannot check (''this is safe'', ''thread-safe'', ''this scales'', ''matches the spec''). Strongest on high-stakes surfaces (production deploys, security-sensitive logic, data migrations, irreversible operations) and when the user asks to sanity-check, red-team, double-check, or get a second opinion on a decision.

    Also in 13 projects that use this

  • luischanciSkill

    interview-me

    Interactive interview to formalize a research idea into a structured specification with hypotheses and empirical strategy.

    Also in 12 projects that use this

  • OpenAISkill

    finishing-a-development-branch

    Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

    Also in 3 projects that use this

  • OpenAISkill

    using-git-worktrees

    Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback

    Also in 3 projects that use this

  • VercelSkill

    web-design-guidelines

    Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

    Also in 3 projects that use this

  • +4 more from openai

The file

Show its rules and text

We split this skill into the rules it gives an agent

20 rules. 1 is common, 15 are distinctive, and 4 are very specific to this project.

  • 1

    Common

    Most of the 32 edited versions we read keep these.

  • 15

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Always be explicit about which type you are doing.

    line 28
  2. Distinctive:

    Before removing anything, document:

    line 34
  3. Distinctive:

    When removal will happen (for compulsory deprecation)

    line 38
  4. Distinctive:

    Before removing the deprecated thing:

    line 97
  5. Distinctive:

    Verify no callers remain: the grep should return nothing

    line 100
  6. Distinctive:

    Remove the deprecated code

    line 101
  7. Distinctive:

    When removing deprecated code:

    line 105
  8. Distinctive:

    Delete the entire file or function — don't leave it commented out

    line 106
  9. Distinctive:

    Remove associated tests for the removed code

    line 107
  10. Distinctive:

    Update any documentation that referenced the removed thing

    line 108
  11. Distinctive:

    Update the CHANGELOG or ADR

    line 109
  12. Distinctive:

    When renaming or removing a secret in GCP Secret Manager:

    line 138
  13. Very specific:

    Add the new secret: gcloud secrets create NEW_SECRET_NAME

    line 140
  14. Very specific:

    Update cloudbuild.yaml to inject both old and new: test that it works with new

    line 141
  15. Distinctive:

    Update all code to use the new name

    line 142
  16. Distinctive:

    Verify no code references the old name

    line 143
  17. Very specific:

    Remove old secret from cloudbuild.yaml

    line 144
  18. Very specific:

    Delete the old secret: gcloud secrets delete OLD_SECRET_NAME

    line 145
  19. Distinctive:

    Never delete a secret before confirming no live Cloud Run revision references it.

    line 147
  20. Common:

    After completing a deprecation or migration:

    line 167

“Common” is measured: kept by at least 6 in 10 of the 32 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Deprecation and Migration

Overview

Code is a liability, not an asset. Every line maintained is a line that can break. Deprecation is the practice of systematically retiring code, APIs, or features that are no longer earning their maintenance cost. Do it deliberately, not by abandonment.

When to Use

  • Removing an old API endpoint that has been replaced
  • Migrating from one library or pattern to another
  • Sunsetting a feature that is no longer used or supported
  • Cleaning up dead code identified during a refactor

The Deprecation Mindset

Compulsory vs. Advisory Deprecation:

TypeMeaningExample
CompulsoryWill be removed on a specific date — users must migrateOld /v1/skills endpoint being replaced by /v2/skills
AdvisoryDiscouraged but not being removed yetA config option that has a better alternative

Always be explicit about which type you are doing.

The Deprecation Process

Step 1: Document Before Removing

Before removing anything, document:

  • What is being deprecated
  • Why (the reason, not just "it's old")
  • What the replacement is
  • When removal will happen (for compulsory deprecation)
# api/app/routes/skills_v1.py

import warnings

@router.get("/v1/skills/{repo}")
async def get_skill_v1(repo: str):
    """
    DEPRECATED: Use /v2/skills/{repo} instead.
    This endpoint will be removed on 2026-09-01.
    Migration guide: docs/migration/v1-to-v2.md
    """
    warnings.warn(
        "GET /v1/skills is deprecated. Use /v2/skills. Removal: 2026-09-01.",
        DeprecationWarning,
        stacklevel=2,
    )
    # Delegate to v2 during transition period
    return await get_skill_v2(repo)

Step 2: Add Deprecation Signals

Make deprecation visible to consumers:

For HTTP APIs:

# Add Deprecation and Sunset headers per RFC 8594
response.headers["Deprecation"] = "true"
response.headers["Sunset"] = "Tue, 01 Sep 2026 00:00:00 GMT"
response.headers["Link"] = '</v2/skills>; rel="successor-version"'

For Python functions:

import warnings

def generate_skill_v1(repo: str) -> str:
    warnings.warn(
        "generate_skill_v1() is deprecated. Use generate_skill() instead.",
        DeprecationWarning,
        stacklevel=2,
    )
    return generate_skill(repo)

For TypeScript/React:

/** @deprecated Use SkillExportV2 instead. Will be removed in v2.0. */
export function SkillExport({ repo }: Props) {
  console.warn("SkillExport is deprecated. Use SkillExportV2.");
  return <SkillExportV2 repo={repo} />;
}

Step 3: Migrate Callers First

Before removing the deprecated thing:

  • Find all callers: grep -r "generate_skill_v1" api/ web/
  • Migrate each one to the replacement
  • Verify no callers remain: the grep should return nothing
  • Remove the deprecated code

Step 4: Remove Clean

When removing deprecated code:

  • Delete the entire file or function — don't leave it commented out
  • Remove associated tests for the removed code
  • Update any documentation that referenced the removed thing
  • Update the CHANGELOG or ADR

Step 5: Remove Dead Code

Dead code is worse than no code — it confuses future engineers and agents:

# BAD: Commented-out code left "just in case"
# def old_generate_skill(repo):
#     # This was the old way, keeping for reference
#     ...

# GOOD: Delete it. Git history is the reference.

Finding dead code:

# Python: find unreferenced functions
grep -r "def generate_skill_v1" api/ | wc -l  # should be 1 (the definition)
grep -r "generate_skill_v1" api/ | grep -v "def "  # should be 0 callers

# TypeScript: find unused exports
npx ts-prune --project web/tsconfig.json

GitScape-Specific Migration Patterns

Migrating a Cloud Run Environment Variable

When renaming or removing a secret in GCP Secret Manager:

  1. Add the new secret: gcloud secrets create NEW_SECRET_NAME
  2. Update cloudbuild.yaml to inject both old and new: test that it works with new
  3. Update all code to use the new name
  4. Verify no code references the old name
  5. Remove old secret from cloudbuild.yaml
  6. Delete the old secret: gcloud secrets delete OLD_SECRET_NAME

Never delete a secret before confirming no live Cloud Run revision references it.

Common Rationalizations

RationalizationReality
"We might need it later"Git history exists. Dead code is not a backup strategy.
"Let's just leave the old endpoint — it's not hurting anyone"It is. It's surface area to maintain, test, and secure.
"We'll migrate it when we have more time"Migrations get harder over time, not easier. Callers accumulate.
"The deprecated code still works"Working is not the bar. Maintained, understood, and secure is the bar.

Red Flags

  • Commented-out code with "keeping for reference"
  • Functions with _old, _v1, or _deprecated in the name that are still called
  • Deprecated APIs with no removal date
  • Code that can't be removed because "we don't know who uses it"

Verification

After completing a deprecation or migration:

  • Zero callers of the removed API/function (verified via grep)
  • No commented-out old code left behind
  • Deprecation notices were in place for the required notice period (if applicable)
  • Documentation updated to reference the new approach
  • Associated tests for removed code are deleted
  • CHANGELOG or ADR records the removal

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.