Regression Prevention Loop
This loop ensures that newly discovered bugs or edge cases are covered by automated regression tests to prevent future incidents. It iterates through identifying missing test coverage, implementing appropriate tests, and validating that the regression suite passes without failures.
Goal
Add missing regression tests
How to Run
Run this loop in your terminal or IDE to automatically identify and add missing regression tests for known issues.
- 01
Initiate Loop
Execute the kickoff prompt to start the regression prevention process.
- 02
Run Check Command
The agent will run the regression suite to detect any uncovered bugs or failures.
- 03
Analyze Results
If there are failures, the agent inspects them to determine which test cases are missing.
- 04
Implement Tests
The agent writes or updates regression tests based on the analysis.
- 05
Repeat Until Success
Continue looping until all identified bugs are covered by passing tests or the maximum iterations are reached.
Workflow Steps
- 01
Run Regression Suite
Execute the defined check command to identify any failing tests that indicate uncovered bugs.
- 02
Analyze Failing Tests
Inspect the output of the regression suite to determine which specific scenarios need test coverage.
- 03
Create/Update Regression Tests
Write new test cases or modify existing ones to cover the identified gaps in the regression suite.
- 04
Rerun Check Command
Re-run the regression suite to confirm that the newly added tests pass and cover the bug.
- 05
Exit or Iterate
If the bug is now covered, exit successfully. Otherwise, repeat the workflow up to max iterations.
Kickoff Prompt
Start the "Regression Prevention Loop" loop. Goal: Add missing regression tests Max iterations: 10 Between iterations run: regression suite Exit when: Bug covered by tests Start by running the regression suite to find any uncovered bugs. For each failure, analyze the root cause and implement a regression test that covers the issue. Keep iterating until all failures are addressed or the iteration limit is reached. Self-pace this loop. After each iteration, run `regression suite` and evaluate the output, and only continue if the exit condition is not met (Bug covered by tests). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.
Guardrails
hardcoded- ·{"title":"Target Specific Failures","description":"Only add tests related to the specific bug or failure detected by the regression suite."}
- ·{"title":"Avoid Redundant Tests","description":"Do not create duplicate tests; ensure new tests provide unique coverage."}
- ·{"title":"Validate Test Quality","description":"Each test must be meaningful, isolated, and aligned with existing testing patterns in the project."}
- ·{"title":"Limit Scope Creep","description":"Focus only on fixing the reported regression; do not introduce unrelated changes."}
Flow Diagram
Related loops — Testing
Testing
E2E Until Stable
This loop automatically identifies and fixes end-to-end test failures by iteratively running the test suite, analyzing failures, and applying targeted fixes until all tests pass or the maximum iteration limit is reached.
Testing
Test Coverage Builder
This loop identifies gaps in test coverage and systematically writes targeted unit/integration tests to increase code coverage. It analyzes coverage reports, prioritizes uncovered code paths, and iterates until the coverage target is achieved, ensuring your codebase remains well-tested without compromising production quality.