AAWEA.ORG
AAWEA.ORG
AAWEA.ORG
Testing Event trigger πŸ‘‘ Official πŸ›‘ Hardened

Post-Merge Regression Guard

Hook that runs smoke tests after git merge or rebase to catch integration regressions immediately.

πŸ‘ 1,644 views πŸ“₯ 1,601 installs πŸ‘€ by loops!
Download loop
Share Now
Manual start
↓
  1. 1
    Detect merge

    Confirm a merge or rebase just completed. Identify affected areas from the diff stat.

  2. 2
    Run smoke suite

    Run the fast smoke test suite. Fix any failures before starting new feature work.

    > npm run test:smoke
↓
βœ“
Exit condition: tests_pass

Smoke tests pass after merge

> npm run test:smoke
πŸ“¦ Install Files
These files are included when you download the loop.
πŸ“„ .cursor/hooks.json
{
  "version": 1,
  "hooks": {
    "stop": [
      {
        "type": "prompt",
        "prompt": "Post-Merge Regression Guard: if the last git operation was a merge or rebase, run npm run test:smoke and fix failures before stopping."
      }
    ]
  }
}
πŸ“„ .claude/settings.json
{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "prompt",
            "prompt": "Post-Merge Regression Guard: if a merge or rebase just happened, run npm run test:smoke and fix failures."
          }
        ]
      }
    ]
  }
}
πŸ“„ .cursor/loops/post-merge-regression-guard/README.md
# Post-Merge Regression Guard

Runs smoke tests after merge/rebase operations via stop hooks.

Pair with the kickoff prompt from loops! for agent behavior.
πŸ“Š Flow Diagram
flowchart TD Start(["Event start"]) Start --> S0 S0("Detect merge") S1("Run smoke suite") S0 --> S1 Exit{"Smoke tests pass after merge"} S1 --> Exit Exit -- "No" --> S0 Exit -- "Yes" --> Done(["Success"]) style Exit fill:#fffbeb,stroke:#f59e0b,stroke-width:2px,color:#92400e style Done fill:#ecfdf5,stroke:#10b981,stroke-width:2px,color:#065f46
Kickoff prompt
Install and run the "Post-Merge Regression Guard" loop.

Goal: smoke tests pass immediately after every merge or rebase.
Between iterations run: npm run test:smoke
Exit when: smoke suite exits 0.

Step 1: After a merge, run smoke tests. Fix regressions before continuing other work.
Anti-gaming rules
Rules the agent must follow so it cannot cheat the exit condition.
  • Do not modify the check command or exit criteria to force success
  • Do not skip, disable, or bypass checks to pass the exit condition
  • If stuck after several iterations, stop and report blockers instead of gaming metrics