Wish-Driven Programming: A Practical Guide to Building With AI Agents
This article explores wish-driven programming, an approach where developers describe desired outcomes and let AI agents handle planning, coding, and debugging. Using a browser-based racing game as a case study, it shows how structured prompts, runtime feedback, and targeted fixes turn vague requests into working software, and offers a reusable methodology for keeping agent-driven development controllable and cost-efficient.
1. From Benchmark Scores to Real Task Cost
A recent model version update from a cloud provider shifted the discussion away from traditional leaderboard scores and back toward engineering practice. Several signals stood out: clear improvements in terminal-operation evaluations, automated-task evaluations, and coding problem-solving evaluations. For developers, changes in these metrics are more useful than general question-answering scores, because they map directly to how an AI agent behaves in real work: whether it can execute commands correctly, call tools reliably, and converge on a goal across multiple loop iterations.
More notable is a new concept introduced by the provider: a Pareto improvement in performance and cost. The idea is that, with the per-token price unchanged, the actual cost of “completing the same task” drops by reducing ineffective output and compressing the number of interaction rounds required. This matters especially for long-horizon tasks. People often think of agents in terms of “one request, one response,” but real agent tasks are usually the result of dozens or even hundreds of model calls, tool calls, and loop iterations stacked together. Any single ineffective inference, redundant output, or erroneous retry along the way gets amplified into a double waste of time and money. Shifting the optimization target from “a smarter single answer” to “a shorter end-to-end task chain” is therefore the more pragmatic engineering route today.
2. What Is Wish-Driven Programming
Wish-driven programming can be summarized as: developers describe only the expected result and hand the decision-making over implementation paths to the model and the agent framework. It is not “just saying something casually,” but a collaboration method with clear boundaries:
- Input side: primarily natural-language wishes, allowing the absence of detailed requirement documents and pre-designed technical plans;
- Execution side: the agent autonomously handles planning, coding, running, debugging, and self-correction;
- Acceptance side: developers use a “runnable, experienceable” finished product as the basis for feedback, converging quality through iterative prompting.
Its value lies in pushing early-stage communication costs extremely low, making it suitable for scenarios such as prototype validation, gameplay exploration, and interface sketches. Its risk is equally clear: the more vague the requirement, the greater the variance in the result. Engineering therefore needs a methodology of “layered prompting + runtime feedback + targeted fixes” as a safety net.
3. Practice: Recreating a Racing Game From a One-Sentence Wish
The environment is a coding toolchain optimized specifically for agent tasks, calling a model with strong tool-execution capabilities through a standard interface. The goal is to recreate a racing game that includes driving, a track, timing, and multiple viewpoint switching.
Attempt 1: Pure Wishing
The prompt was a single sentence:
Make a racing game: drivable, with a track and timing, supporting a driver view and a rear view.
Result analysis: the landing page looked acceptable, and the core gameplay loop held together: the car was controllable, the track existed, timing worked, and the view could be switched. However, the visual style and level of detail were clearly lacking, with no sense of speed, lighting, or scene depth. Overall it felt more like a “playable technical demo” than an “immersive racing title.”
Conclusion: the capability floor is already sufficient; the problem is that the wish description was too general, so the model could only produce a “minimum viable implementation.”
Attempt 2: A Structured Prompt
Splitting the single sentence into four layers significantly reduced ambiguity:
[Goal] A single-file racing game that runs directly in the browser.[Gameplay] Auto-forward + left/right lane changes, accelerating over time, slowing on collision, ending after three laps.[Visuals] Low-poly style, with curbs, guardrails, distant ridges, and a dynamic sky gradient.[View] Press C to switch between driver view and rear view; HUD shows speed, lap count, and timing.[Constraints] No external asset files, 60fps, code structure split into update/render/input.
The key change this round was not “saying more” but “stating the constraints clearly.” The more specific the constraints, the smaller the model’s search space and the lower the output variance.
Attempt 3: Targeted Fixes Based on Runtime Feedback
Turning experience problems into verifiable change items, rather than vaguely saying “make it look better”:
1) Insufficient sense of speed: add near-field dashed lines and slight camera shake that scale linearly with speed;2) Thin scene: add segmented color schemes and distant layers to avoid a single-color flat surface;3) Blurry controls: add steering damping and recentering to avoid jitter caused by keyboard input;4) Performance: replace per-frame object creation with object pool reuse.
A schematic core loop structure:
function loop(dt) {input.read(); // Input sampling and damping handlingworld.update(dt); // Physics, collision, timingcamera.follow(dt); // View interpolationrender.draw(); // Layered drawing + HUDrequestAnimationFrame(loop);}
4. A Reusable Methodology: Keeping Wishes Controllable
- Layer the wish: goal layer (what experience you want), gameplay layer (what counts as winning), presentation layer (what it looks like), constraint layer (performance and dependencies). Missing a layer means more rework.
- Make feedback specific: translate “doesn’t look good” into measurable change items, such as speed feedback, number of layers, and input smoothness.
- Context governance: in long tasks, keep only decision-relevant fragments and promptly clear failed attempts, avoiding ineffective context that drives up rounds and cost. This is also where the Pareto improvement lands on the engineering side.
- Evaluation loop: build a simple dashboard for “runnability rate, task completion rounds, token consumption per task, frame-rate stability,” and use data to judge whether prompts are actually converging.
- Progressive automation: start with manual acceptance, then solidify stable acceptance criteria into automated checks, gradually moving toward higher autonomy.
5. Conclusion
The essence of wish-driven programming is shifting developers’ energy from “writing implementation” to “defining expectations and acceptance criteria.” As models continue to improve on terminal operation, tool execution, and coding problems, and as task-chain costs are systematically compressed, the cost-effectiveness of this paradigm will keep rising. For teams, what truly needs to be accumulated is not a single “magic prompt,” but a reproducible, measurable engineering capability made up of prompt layering, context governance, and an evaluation loop.
