AIniverse Get the App

Pre-Commit Guard

Coding by loops! by elorm

Hook that runs tests before git commit commands to block commits when the suite is red.

Prompt

Step 1 — Detect commit intent
When a git commit command is about to run, pause and run the test suite first.

Step 2 — Run tests
Run the full test suite before allowing the commit to proceed.

Check: `npm test`

Step 3 — Block or allow
If tests fail, fix failures and re-run. Only allow the commit when tests pass.

Step 4 — Repeat until done
Repeat the steps above until: Tests pass before each git commit

Check with: `npm test`
Platforms
CLAUDE

Use this prompt in AIniverse

Tap to copy, run it on ChatGPT / Claude / Gemini, save to your stack, or remix.

Open in App

More Coding prompts

Independent Verifier Pass

When implementation claims done, a separate verifier pass runs build, lint, and tests with no access to the implement...

API Contract Until Match

Loop until API responses match the OpenAPI or JSON Schema contract — catch drift between docs and implementation.

De-Sloppify Pass

After implementation, run a cleanup pass: remove debug code, tighten naming, delete dead branches, and align with pro...

Merge Conflict Resolver

Rebase or merge target branch, resolve conflicts file by file, and loop until the branch is current and tests pass.