# Two-Agent Build and Test Loop for paid apps: one agent builds, another tests, and nothing passes on its own say-so

> A tested setup for apps that take money: one agent writes the code, a separate tester session writes the stories and tests and gives the verdicts, a small runner records every red, green and revert exit code itself, and the owner says yes to the plan, any payment or pricing work, each merge and each release. Test keys and sandboxes only. A read-only check with fifteen tests audits the finished run.

- URL: https://paperchasewebb.ai/bots/marketplace/items/two-agent-build-and-test-loop-for-paid-apps/
- Type: Bot template
- Category: Vibe coding
- By: PaperChaseWebb
- Works with: Claude Code, Codex, Grok Bot, Hermes (named in the listing); Plain .md and three Python 3 scripts; any harness pair, test mode and sandboxes only
- Price: $29 USD
- Difficulty: Intermediate
- Setup time: 1 hr
- Time to result: Set up and tested in about an hour; the first watched run takes about 90 minutes more
- Format: Markdown (.md) file, two-agent-build-and-test-loop-for-paid-apps.md
- Version: 1.0, updated 2026-10-28
- License: Use on your own projects and on installs you do for clients. Do not resell or republish the pack itself.

## What you end up with

The builder can no longer delete a failing test and call it done, every pass has a recorded red, green and revert behind it, and nothing near a checkout, price or store submission moves without your yes.

## What you get

- 23 sections in one .md file
- The run folder: loop.json, cards.json, approvals.csv, ledger.csv, actions.csv, events.csv and report.md
- The split: what the builder may do, what the tester may do, and what neither ever does
- The story contract: behavior, test file, test command and a payment flag on every card
- Four owner approvals: plan, payment or pricing work, each merge, and each release or store submission
- Eleven paid-app stories worth writing first, with where to test each in Stripe, StoreKit, Google Play and RevenueCat sandboxes
- card_check.py: five preflight checks before the builder starts, including live keys in the project
- run_test.py: runs each story's test itself and records red, green and a revert proof with a hash of the test file
- loop_check.py: fifteen read-only checks on the finished run
- A seeded fixture with 15 planted faults and a tiny app whose tests really run, with the expected output
- Tester and builder rules blocks, twelve prompts and setup notes for Grok Bot, Claude Code, Codex and Hermes
- A one-afternoon install plan, go-live checklist, weekly review and failure table
- A look at seven test-first skills and agent packs, with sources

## Who it is for

Founders and small teams with a paid app who use coding agents every day, have seen "all tests pass" on code that did not work, and want a builder and a separate tester with proof they can check.

## Tools needed

- Grok Bot, Claude Code, Codex or Hermes: runs the builder and tester as two separate sessions; the tester never edits source, the builder never edits tests, and no session merges, releases or touches live keys
- Your payment provider's test mode or sandbox: Stripe test mode and test clocks, StoreKit Testing and the App Store sandbox, Google Play license testers or RevenueCat Test Store
- Python 3: runs the preflight, the test runner and the read-only run check; standard library only
- Your project's own test command: the command on every story card
- You need: Two coding agent sessions (Grok Bot, Claude Code, Codex or Hermes, any pair)
- You need: An app with a subscription, in-app purchase or checkout, and a test mode or sandbox for it
- You need: Python 3.8 or newer
- You need: A test command for your project, or the willingness to write one per story

Cost to run: The pack is the only purchase. Model usage is billed by those vendors. Test mode and sandboxes cost nothing to run.

## How it works

1. **Test the checks.** Save the three scripts from the file, build the fixture and run loop_check.py and card_check.py on both folders. Expected: loop_check.py: 15 findings on seeded, 0 on fixed. card_check.py: 3, then 0.
2. **Write loop.json.** Make a runs/ folder outside your repo, copy loop.json from section 5, and put in your project path, test paths, two session names and your name as owner. Expected: card_check.py runs on the folder and C1 does not appear.
3. **Lock the two sessions.** Map each role's tools to your harnesses and paste the tester and builder rules blocks. Try editing a source file from the tester and a test file from the builder. Expected: Both edits are refused, and no session can push, merge, release or reach a live key.
4. **Put test keys only in the project.** Use test mode keys and sandbox accounts for every payment provider in the app. Keep live keys where neither agent can read them. Expected: card_check.py shows no C5 finding.
5. **Run two paid-app stories, watched.** Pick two stories from section 8, run the twelve prompts in order, run run_test.py by hand for red, green and revert, and give each yes yourself. Expected: loop_check.py prints 0 findings and the report matches the ledger.

## Sample prompt: Write the story cards (Grok Bot, Claude Code, Codex, Hermes)

```
Turn this request and your notes from staging into cards.json for run {run}: one story per behavior a buyer would notice, each with one test file under {test_paths}, a command that runs only that test, and a payment flag.
Start with the paid-app stories in section 8 that apply. Then run card_check.py and fix every finding.
```

Prompt 2 of 12. Runs in the tester session after the tester rules block in section 14.

## Sample prompt: Build against the failing test (Grok Bot, Claude Code, Codex, Hermes)

```
Here is your card and the failing test output. Make the test pass by changing source only. Log your build and claim rows.
Report the files you changed. Do not touch anything under {test_paths} and do not give a verdict.
```

Prompt 8 of 12. Runs in the builder session after the builder rules block.

## Free preview of two-agent-build-and-test-loop-for-paid-apps.md

````markdown
# Two-Agent Build and Test Loop for paid apps: one agent builds, another tests, and nothing passes on its own say-so

Version 1.0, 2026-10-28. By PaperChaseWebb. Works with Grok Bot, Claude Code, Codex and Hermes. Plain Markdown and three Python 3 scripts (standard library only), tested on a seeded fixture with fifteen planted faults.

This pack sets up one way of working on an app that takes money: one agent writes the code, a second agent in a separate session writes the tests and gives the verdicts, a small script runs every test and records the exit code, and the owner says yes at four points: the plan, anything that touches payments or prices, each merge, and each release or store submission. The whole loop runs on test keys and sandboxes. No live key, no real charge.

It gives you the run folder, the two role files, the story cards the tester writes, the four approval steps, a preflight, a test runner that records red, green and a revert proof, a fifteen-check read-only audit of the finished run, a seeded fixture, rules blocks for both agents, twelve prompts, setup for four harnesses, a one-afternoon install and a failure table.

How to split one job between a strong planner and cheap workers is in Planner Over Cheap Models (pp-planner-over-cheap-models). Moving work between harnesses mid-week is in Cross-Harness Relay (pp-cross-harness-relay). This pack is the part those leave open: keeping the builder from grading its own homework when the homework is a checkout.

## 
````

## Worth knowing

- It needs a test command per story. Work you cannot check with a command (copy, visual taste, open research) does not fit this method.
- Test mode and sandboxes only. The pack never asks for live keys or real charges; adding live keys at release is the owner's step, outside the loop.
- The permissions in loop.json are a record. The real lock is your harness settings, so test both refusals before the first run.
- Store review rules and sandbox behavior change. Check Apple, Google, Stripe and RevenueCat docs before each release.
- On 2026-10-28, loop_check.py reported the fifteen expected findings on the seeded fixture, then 0 on the fixed one, with file hashes unchanged and exit 2 on a missing folder; card_check.py gave 3 then 0; run_test.py recorded real red, green and revert exit codes on the fixture app. Run the tests on your own machine first.

## Questions

**Why two agents instead of one agent that writes tests first?** One agent that writes the tests and the code can also change the tests to pass, and it shares its own blind spots. A separate tester that cannot edit source, plus a runner that records the exit codes, makes that move visible in the ledger.

**Does it need two different AI products?** No. Two separate sessions are the minimum. A different harness or model for the tester is better, and the pack has setup notes for Grok Bot, Claude Code, Codex and Hermes in either role.

**Will it ever touch real payments?** No. The loop runs on test keys and sandboxes only. card_check.py and loop_check.py both flag a live key in the project and any payment event outside test mode or a sandbox.

**What is the revert proof?** After green, the same test runs on a copy of the project with the change taken out. It must fail again. If it passes, the test does not cover the change. run_test.py records a hash of the test file so a test softened in between shows up.

## How to buy

$29 one time at https://paperchasewebb.ai/bots/marketplace/items/two-agent-build-and-test-loop-for-paid-apps/. Stripe checkout, then an instant download page; the download link is also in your emailed receipt.

Seller: PaperChaseWebb Inc., mgmt@paperchasewebb.com
