aiprompter.site
Software

Development Squad: code, test, review

Try the three-role prompts.chat development loop on a refund calculation, with an actual failing test, correction and passing result.

Source and original example ↗ · CC0 1.0 · prompts.chat / @f · AIPrompter adaptation

Published on AIPrompter: 2026-11-09 · prompts.chat: 3 source-page count; not verified installs · Checked: 2026-11-09

Engagement source ↗ · Execution record and code ↗

WORKED EXAMPLE

Sample output

Sample input

Sale: 12,000 cents; sale: 8,000 cents; refund: 3,000 cents.
Expected net: 17,000 cents.
The initial implementation incorrectly sums every amount.
Test interface: net_sales(rows).

Sample output

Coder: initial version returned 23,000 cents.
Tester: expected 17,000; RED, test failed.
Reviewer: refunds must subtract from the total.
Fixed version: 17,000 cents; GREEN, test passed.

Final code:
def net_sales(rows):
    return sum(r['amount'] if r['type'] == 'sale'
               else -r['amount'] for r in rows)

On November 9, one AI editor applied the roles sequentially; Python actually executed the broken and corrected code. No three independent bots, draft PR or remote test-data transmission. The source's featured team displayed a count of 3; it is not presented as a verified installation total. This example accepts only sale/refund rows and is not a production accounting validation. CC0 source access is separate from model and hosting costs.

Raw prompt

Use three roles in sequence: coder, tester and reviewer. Build net_sales(rows), adding sales and subtracting refunds. Amounts are integer cents. Write the code, then execute a test against the supplied expected result. If it fails, have the reviewer explain why; fix the code and rerun the test. One AI can apply these roles sequentially. Do not claim multi-agent execution unless separate agents actually ran.

How to use this prompt

1. State the task and expected result. 2. Ask the coder for an implementation. 3. Let the tester execute it. 4. Have the reviewer explain the failure. 5. Rerun after correction. Automated upstream handoffs require a supported agent environment; this is a supervised sequential example.