Maintenanceprompt onlyIntermediate

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.

← all loops
maintenancedependenciesnpmtestingautomation

Goal

Upgrade dependencies safely with test coverage validation

How to Run

Run this loop in your preferred AI coding agent by providing the kickoff prompt. The agent will automatically iterate through dependency updates until tests pass or max attempts are reached.

  1. 01

    Open Your IDE/Agent Environment

    Launch Cursor, Claude Code, Codex, OpenCode, or Gemini CLI.

  2. 02

    Start New Session or File

    Create a new session or open the relevant project folder.

  3. 03

    Provide Kickoff Prompt

    Paste the kickoff prompt into the agent and initiate the loop.

  4. 04

    Monitor Progress

    Observe the agent's actions in the terminal/output panel as it updates dependencies and runs tests.

Workflow Steps

  1. 01

    Check for outdated dependencies

    Identify which packages require updating

  2. 02

    Update one or two outdated packages

    Perform incremental update to minimize risk

  3. 03

    Run test suite

    Validate that the update didn't break existing functionality

  4. 04

    Evaluate test results

    If tests fail

  5. 05

    Repeat or exit

    If max iterations exceeded without success

Kickoff Prompt

Start the "Dependency Update Until Green" loop.

Goal: Upgrade dependencies safely with test coverage validation
Max iterations: 10
Between iterations run: npm test
Exit when: All tests pass successfully (exit code 0)


Begin the 'Dependency Update Until Green' process. First, check which packages are outdated using 'npm outdated'. Then, update one or two packages at a time, preferring minor/patch updates over major ones. After each update, run 'npm test' to validate functionality. If tests fail, revert the changes and try updating fewer packages. Continue this cycle until all dependencies are updated and tests pass, or until 10 iterations have been completed. Ensure you back up package-lock.json before making changes and prioritize development dependencies first.

Self-pace this loop. After each iteration, run `npm test` and evaluate the output, and only continue if the exit condition is not met (All tests pass successfully (exit code 0)). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.

Guardrails

hardcoded
  • ·Always check for breaking changes before updating major versions
  • ·Backup package-lock.json before any changes
  • ·If more than 30% of tests fail after an update, immediately revert and reduce update scope
  • ·Prioritize updating development dependencies over production ones first
  • ·Use --save-dev flag for devDependencies and --save for regular dependencies
  • ·Do not proceed with updates if current git branch has uncommitted changes

Flow Diagram

rendering…

Related loops — Maintenance