APIprompt onlyintermediate

API Version Migration

This loop automates the migration of API endpoints from legacy versions (e.g., v1) to the latest supported version (e.g., v2) within a codebase. It systematically identifies outdated endpoints, updates them, and validates changes through automated testing.

← all loops
APImigrationautomationrefactoringendpoint-update

Goal

Upgrade all endpoints to the latest version

How to Run

Run this loop in a prompt-only environment to automatically upgrade API endpoints from v1 to v2. The agent will iterate until all v1 references are removed.

  1. 01

    Initiate Loop Execution

    Start the loop by running the kickoff prompt in your chosen coding agent environment.

  2. 02

    Automated Endpoint Updates

    The agent will scan for v1 endpoints, replace them with v2 equivalents, and run tests to validate changes.

  3. 03

    Verify Completion

    Once the check command returns no results, the loop exits successfully. Review changes if needed.

Workflow Steps

  1. 01

    Scan Codebase

    Execute grep command to identify all files containing 'v1/' API endpoints

  2. 02

    Prioritize Changes

    Create a list of files to update, prioritizing those with highest usage or complexity

  3. 03

    Upgrade Endpoints

    Systematically replace v1 endpoint references with v2 equivalents in each file

  4. 04

    Validate Changes

    Run automated tests to ensure updated endpoints function correctly

  5. 05

    Log Modifications

    Document all changes made including file paths, old/new endpoints, and test results

  6. 06

    Repeat Until Clean

    Continue scanning and updating until the exit condition is met (no v1 references found)

Kickoff Prompt

Start the "API Version Migration" loop.

Goal: Upgrade all endpoints to the latest version
Max iterations: 10
Between iterations run: grep -r 'v1/' src/
Exit when: No deprecated versions remain (grep command returns empty result)


Please begin migrating all API endpoints from v1 to v2. First, scan the codebase for any occurrences of 'v1/' in the src/ directory. For each file found, update the endpoints to use the corresponding v2 paths while preserving functionality. After making changes, run the test suite to verify everything still works. Log your changes and continue this process until the grep check returns no results.

Self-pace this loop. After each iteration, run `grep -r 'v1/' src/` and evaluate the output, and only continue if the exit condition is not met (No deprecated versions remain (grep command returns empty result)). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.

Guardrails

hardcoded
  • ·Only modify files containing 'v1' in their API paths - do not touch other versions
  • ·Preserve backward compatibility by maintaining existing functionality during migration
  • ·Run full test suite after each change to ensure no regressions
  • ·Log all changes made for audit trail purposes
  • ·Do not commit changes automatically - require manual review before finalizing

Flow Diagram

rendering…

Related loops — API