Wish-Driven Programming in Practice: Rebuilding a Racing Game with an Agent
Wish-driven programming starts from a stated outcome rather than a traditional requirements-to-delivery chain. This article uses a one-sentence racing-game task to show why a dense wish, an executable acceptance rubric, and a suitable agent harness matter, then covers incremental iteration, cost control, and practical evaluation.
1. What Is Wish-Driven Programming
A traditional development flow runs from requirements document to design, coding, integration, and acceptance. Each step requires people to produce explicit intermediate artifacts. Wish-driven programming changes the start of that chain: the developer describes the expected result (the wish), and the agent fills in the design, implementation, and self-testing. People move back to the roles of acceptor and course corrector.
It is not “say something casually and get a finished product.” Three things decide whether it succeeds:
- Information density of the wish: a sentence must contain testable functional boundaries, not adjectives.
- Whether acceptance criteria are executable: without an acceptance checklist, the model can only guess your taste.
- Whether the harness fits the task: context organization, tool use, and loop stop conditions directly decide whether multi-round iteration can converge.
2. Case Background: Generating a Racing Game from One Sentence
The experiment used a coding harness tuned for agent tasks. The model was called through a standard API, with no local fine-tuning.
The first wish was deliberately minimal:
Make a racing game: drivable, with a track and timing,and support switching between a driver view and a chase view.
The result was typical: the features worked, but the look and feel did not meet the bar. The home screen looked acceptable. Once in the game, driving, the track, timing, and both camera views were all implemented, but the car model, road materials, lighting, and sense of speed were clearly short of what people expect from a racing game.
This points to a fact that is easy to overlook: models are strong at completing a feature list and weak at inferring a quality baseline. What you do not say, they fill in at the lowest cost.
3. Round Two: Turn Adjectives into Acceptance Items
The core of the second round was not changing the model. It was turning vague expectations into conditions that can be judged. Write the acceptance table first, then the wish:
| Dimension | Testable acceptance item |
|---|---|
| Sense of speed | Above a speed threshold, add motion blur, camera shake, or FOV change |
| Track | At least one closed track, with straights, corners, and elevation change |
| Lighting | Directional light plus ambient light; the car casts a shadow that follows the ground |
| UI | Speedometer, lap time, best lap, and lap count stay on screen |
| Camera | Two camera rigs; switching has no frame jump and no clipping |
| Performance | No obvious frame drops at the target frame rate; assets can be reused |
Example wish:
Iterate on the existing project; do not rewrite it. Implement each acceptance item:1) Sense of speed: enable motion blur and FOV stretch at high speed;2) Track: a closed track with 3 corner sections and 1 elevation change;3) Lighting: directional light + ambient light; vehicle shadow follows the terrain;4) HUD: speed, current lap time, best lap, and lap count;5) Camera: cockpit and chase rigs, with smooth switching;6) Constraints: reuse existing geometry and materials; no single file over 400 lines.Afterward, self-check item by item and list anything that failed.
Three constraints matter: incremental edits instead of a rewrite (protect what already passed), explicit asset reuse (limit size growth), and a requirement to report failures (make hidden defects explicit).
4. The Harness: An Underestimated Deciding Factor
A clear recent direction in model capability is simultaneous gains on benchmarks for terminal use, tool execution, automated tasks, and programming problem solving. These abilities are not isolated. They all depend on harness quality:
- Context assembly: feed only relevant files and failure logs, so unrelated information does not dilute attention;
- Tool loop: read files, write files, run the build, run tests, and review screenshots. Missing one step turns the process into blind writing;
- Loop and stop: set a maximum number of rounds and a stop rule such as “stop after two consecutive rounds with no improvement”;
- State persistence: write the acceptance table and failure list to disk and carry them across rounds, so the same mistakes are not repeated.
Illustrative loop:
wish, rubric = load_spec()state = load_state()for i in range(MAX_ROUNDS):patch = agent.propose(wish, rubric, state)result = harness.apply_and_run(patch) # build + self-test + screenshotstate = update(state, result)if rubric.all_passed(state) or state.stalled(2):break
5. A Pareto Improvement in Performance and Cost
With unit price unchanged, actual spend falls because token use per task and useless output are compressed. This matters especially for long-running agent tasks: one task is often dozens of model requests and hundreds of tool calls stacked together, so any redundancy is amplified.
Practical optimizations:
- Context trimming: retrieve relevant snippets instead of injecting the whole repository;
- Output constraints: ask for a diff rather than a full-file rewrite, to shorten generation;
- Cache reuse: cache build results and static-analysis conclusions across rounds;
- Fail fast: if the same class of error repeats, roll back to the last stable state;
- Observability: use logging and monitoring alerts to track tokens, rounds, and success rate per task, and form a cost baseline.
6. Practical Advice
- Layer the wish: feature list first, then quality baseline, then performance and code constraints;
- Acceptance first: write the rubric before the model starts;
- Small increments: change one class of problem per round so you can attribute results;
- Keep rollback points: snapshot after each round that passes;
- Evaluate with data: measure improvement by acceptance pass rate and tokens per task, not by look and feel alone.
The value of wish-driven programming is not that it removes design. It is that design is captured as executable acceptance criteria. When the wish is precise enough, the harness is complete enough, and cost is observable enough, a one-sentence requirement can converge into a deliverable engineering artifact.
