Maintenanceprompt onlyIntermediate

Remove Deprecated Code

This loop systematically identifies and removes deprecated API usage and code patterns to ensure your codebase remains modern, performant, and free of outdated dependencies. It helps maintain long-term code health and reduces technical debt.

← all loops
maintenancerefactoringcode qualitytechnical debtapi migration

Goal

Eliminate all deprecated APIs and code patterns from the codebase

How to Run

Run this loop in your preferred AI coding environment to iteratively detect and remove deprecated code elements until the codebase is clean.

  1. 01

    Initiate the loop

    Start by sending the kickoff prompt to your coding agent in environments like Cursor, Claude Code, or Codex.

  2. 02

    Review findings

    After each check, inspect the deprecation scan results to understand which APIs or patterns need updating.

  3. 03

    Allow iterative fixes

    Let the agent apply changes and re-run checks until no deprecated code is detected or the iteration limit is reached.

  4. 04

    Validate changes

    Ensure that functionality is preserved and tests pass after each round of updates.

Workflow Steps

  1. 01

    Run deprecation scan

    Execute static analysis to identify all instances of deprecated APIs in the codebase

  2. 02

    Analyze results

    Identify which deprecated APIs are most impactful and require immediate attention

  3. 03

    Apply fixes

    Update code to use recommended replacements for deprecated APIs

  4. 04

    Verify changes

    Ensure all changes compile and pass existing tests without introducing regressions

  5. 05

    Repeat process

    Run another deprecation scan to check if any deprecated code remains

Kickoff Prompt

Start the "Remove Deprecated Code" loop.

Goal: Eliminate all deprecated APIs and code patterns from the codebase
Max iterations: 10
Between iterations run: deprecation scan
Exit when: No deprecated APIs remain in the codebase


Scan the codebase for any deprecated APIs or code patterns. List all found instances and prioritize them based on impact and usage frequency. Begin fixing the highest priority deprecated usages one by one, ensuring that functionality is preserved after each change.

Self-pace this loop. After each iteration, run `deprecation scan` and evaluate the output, and only continue if the exit condition is not met (No deprecated APIs remain in the codebase). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.

Guardrails

hardcoded
  • ·Only modify files that contain confirmed deprecated API usage
  • ·Preserve existing functionality and avoid breaking changes
  • ·Do not introduce new external dependencies during this process
  • ·Maintain backward compatibility where necessary unless explicitly instructed otherwise
  • ·Prioritize removing the most critical or widely-used deprecated APIs first

Flow Diagram

rendering…

Related loops — Maintenance