Post-Merge Regression Guard
FeaturedEvent-drivenAbout Post-Merge Regression Guard
This event-triggered loop runs npm run test:smoke whenever a merge or rebase finishes. If the smoke tests fail, the coding agent finds the cause, fixes it and runs the suite again until it passes.
Key features
- 01Triggered by merge or rebase events
- 02Judges success by the exit code of npm run test:smoke
- 03Supports Cursor
Use cases
- 01After merging the main branch into a feature branch
- 02After a rebase, to confirm core flows still work
- 03After merging several PRs, to check the state of the trunk quickly
- Goal
- The smoke tests pass immediately after every merge or rebase.
- Exit when
- Stop when the smoke suite exits with code 0.
- Between iterations run
- npm run test:smoke
Launch prompt
Paste into Cursor. The agent repeats the steps below until the exit condition is met.
prompt.md
Start the "Post-Merge Regression Guard" loop. Goal: The smoke tests pass immediately after every merge or rebase. Step 1: Run the smoke suite — Execute npm run test:smoke. An exit code of 0 means success and the loop ends; otherwise note the failing cases and error output for the next fix. `npm run test:smoke` Step 2: Locate and fix failures — Compare the failures with the changes brought in by the merge or rebase, apply a minimal fix, then start the next round and rerun the suite. Between iterations run: `npm run test:smoke` Exit when: Stop when the smoke suite exits with code 0.
Steps
Each round runs in order; if the exit condition isn’t met, another round starts, up to 1.
01
Run the smoke suite
Execute npm run test:smoke. An exit code of 0 means success and the loop ends; otherwise note the failing cases and error output for the next fix.
$
npm run test:smoke02
Locate and fix failures
Compare the failures with the changes brought in by the merge or rebase, apply a minimal fix, then start the next round and rerun the suite.
Not met → next roundExits when met
Supported agents
Coding agents that can run this loop directly.
Cursor
Claude Code
Comments
Markdown supported