AIniverse Get the App

Autoloop TDD

Coding by loops! by elorm

Test-first loop: write a failing test, implement the minimum code to pass, refactor, and repeat.

Prompt

Step 1 — Write failing test
Write a focused test for the next behavior. Run it and confirm it fails for the right reason.

Check: `npm test -- --testPathPattern=<new-test>`

Step 2 — Implement minimum code
Write the smallest implementation that makes the new test pass. No extra features.

Step 3 — Verify green
Run the new test and full suite to confirm everything passes.

Check: `npm test`

Step 4 — Refactor
Clean up duplication and naming while keeping tests green. Run tests after each refactor.

Check: `npm test`

Step 5 — Repeat until done
Repeat the steps above until: Target behavior covered by tests and full suite passes

Check with: `npm test`

Stop after 12 iterations and report what is blocking.
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.