Post-Edit Test Guard
Hook-based loop that runs related tests after file edits to catch regressions early.
This loop is republished with attribution. Full credit and the original content belong to the source linked above.
AI Skill Market Insights
Real data. Real impact.
Emerging
Developers
Kickoff Prompt
Copy this prompt and run it with your agent to start the loop.
Install and run the "Post-Edit Test Guard" loop.
Goal: after each batch of file edits, related tests must pass before continuing.
Between iterations run: npm test -- --findRelatedTests <edited files>
Exit when: related tests exit 0.
Step 1: After edits, run related tests. If they fail, fix before making more changes.