Back to loops
Testingmanual

Autoloop TDD

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

0 views0 usesby solo lemon.

// parameters

Triggermanual
Max iterations12
Check commandnpm test
Exit conditionTarget behavior covered by tests and full suite passes

// run_this_loop

Copy the kickoff into your agent first. The blueprint below explains how the loop evaluates progress and when it should stop.

Open in CursorOpen in Claude

Use loop copies the kickoff prompt. Share copies the loop link. Open in Cursor / Claude only pre-fill that prompt — they do not install hook files. Download loop saves the loop as autoloop-tdd.md.

Start the "Autoloop TDD" loop.

Goal: implement the target behavior test-first with a green suite
Max iterations: 12
Between iterations run: npm test
Exit when: target behavior is covered and all tests pass

Step 1: Write a failing test for the next behavior, implement the minimum code to pass, refactor, and repeat.

Self-pace this loop. After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when the exit condition passes or max iterations is reached. Give a short status update each pass.

// blueprint

The loop contract: target outcome, execution sequence, checks, stopping condition, and safety constraints.

Goal

implement the target behavior test-first with a green suite

// loop_sequence

// loop_sequence_diagram.json
closed loop

Trigger

Manual start

Actions block

4 steps
1Write failing test
2Implement minimum code
3Verify green
4Refactor

Feedback gate

Evaluate: npm test

Run the check, read the output, then decide whether the loop is complete.

Check failed

Repeat actions with the latest feedback.

Success

Target behavior covered by tests and full suite passes

Safety capMax 12 iterations

// steps

  1. 1
    Write failing test

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

    npm test -- --testPathPattern=<new-test>
  2. 2
    Implement minimum code

    Write the smallest implementation that makes the new test pass. No extra features.

  3. 3
    Verify green

    Run the new test and full suite to confirm everything passes.

    npm test
  4. 4
    Refactor

    Clean up duplication and naming while keeping tests green. Run tests after each refactor.

    npm test