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.
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.
- 01
Initiate the loop
Start by sending the kickoff prompt to your coding agent in environments like Cursor, Claude Code, or Codex.
- 02
Review findings
After each check, inspect the deprecation scan results to understand which APIs or patterns need updating.
- 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.
- 04
Validate changes
Ensure that functionality is preserved and tests pass after each round of updates.
Workflow Steps
- 01
Run deprecation scan
Execute static analysis to identify all instances of deprecated APIs in the codebase
- 02
Analyze results
Identify which deprecated APIs are most impactful and require immediate attention
- 03
Apply fixes
Update code to use recommended replacements for deprecated APIs
- 04
Verify changes
Ensure all changes compile and pass existing tests without introducing regressions
- 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
Related loops — Maintenance
Maintenance
Package Audit Fixer
Automatically identifies and fixes package vulnerabilities in your Node.js project by running `npm audit` and applying recommended fixes until the audit is clean.
Maintenance
Upgrade Framework Version
This loop automates the process of upgrading a project's framework to a newer version. It systematically analyzes the current framework, plans the upgrade path, updates dependencies, resolves breaking changes, and ensures all tests pass before completion.
Maintenance
Dependency Update Until Green
Automated loop to safely upgrade project dependencies while ensuring all tests pass after each update. The agent incrementally updates out-of-date packages and runs test checks to prevent breaking changes.