From a One-Sentence Request to a Working Prototype: Practical Insights into Agentic Programming

    This article examines the practical realities of "wish-driven programming," where developers describe a goal in one or two sentences and let AI agents handle requirement decomposition, design, coding, and debugging. Using a small racing game as a case study, it explores what happens when such a request is executed without detailed specs, why iterative prompt refinement—rather than repetition—produces better outcomes, and how to estimate and optimize token costs. It also offers guidance on reading benchmark scores, building internal evaluation sets, and engineering safeguards for running agents safely in real projects.

    What “Wish-Driven Programming” Really Means

    Wish-driven programming refers to a development style where the developer describes a goal in one or two natural-language sentences, leaving requirement decomposition, solution design, code writing, and debugging to an AI agent. This approach lowers the entry barrier and is well suited for rapidly validating an idea.

    However, the quality of the output depends heavily on how complete the description is. When the goal is clear, agents typically produce a runnable skeleton. When the goal is vague, the result tends to remain in a “it runs, but it’s rough” state. The key question, then, is what constraints need to be provided beyond that one-liner to achieve results close to what you actually want.

    What an Agent Task Looks Like in Practice

    A single agent task typically involves many model calls and tool calls arranged in a loop. The following pseudocode illustrates the process:

    1. function run_agent(goal, tools, model, max_steps = 30):
    2. context = [{role: "user", content: goal}]
    3. for step in 1..max_steps:
    4. reply = model.generate(context) # The model decides the next action
    5. if reply.is_final:
    6. return reply.content # Task complete
    7. result = tools.execute(reply.tool_call) # Execute a tool, e.g., read/write files or run tests
    8. context.append(reply.as_message())
    9. context.append({role: "tool", content: truncate(result)})
    10. raise error("Max steps exceeded; task incomplete")

    Three points stand out in this pseudocode.

    First, at every step, the entire conversation history is sent back to the model. The longer the context, the higher the per-step cost.

    Second, tool outputs that are not truncated will quickly fill up the context window.

    Third, the loop’s termination condition determines when the task ends. Without a clear definition of “done,” the agent may repeatedly attempt the same operation.

    First Experiment: The Outcome of a One-Sentence Request

    The goal of this experiment was to build a small racing game. The original request was just one sentence: the player can drive, there is a track, there is a timer, and the game supports both a driver’s-eye view and a rear-view camera.

    The outcome can be assessed on two levels.

    • Functional level: Basic driving controls, the track, the timer, and camera switching were all implemented. This shows the agent can map functional requirements to code modules.
    • Experience level: The visual style, level of detail, and interaction feedback fell noticeably short of expectations.

    This gap is structural. Agents are good at fulfilling verifiable requirements—for example, “there is a timer” can be confirmed by seeing a number on the screen. But subjective requirements like “the visuals should feel polished” will not be enforced unless they are explicitly written into the prompt.

    Iterative Prompting: Turning Vague Desires into Constraints

    The second iteration focused on adding constraints rather than repeating the same goal. Effective prompts generally include the following elements:

    • Goal and scope: List the features to be implemented and clearly state what is out of scope.
    • Visual and interaction specifications: Color palette, visual hierarchy, UI elements, and feedback for user actions.
    • Numerical values and rules: Parameters such as speed range or steering sensitivity, expressed as intervals.
    • Resources and directory structure: Where assets live and which file is the entry point.
    • Acceptance criteria: How each feature should be verified, such as how to launch and what to expect.

    Below is a prompt template that can be adapted to the specifics of a project:

    1. Goal: Implement a single-player racing game running in the browser.
    2. Must-have features:
    3. 1. Basic vehicle controls (accelerate, brake, steer), with a developer-specified speed cap.
    4. 2. A closed track with at least one lap, including collision feedback at track boundaries.
    5. 3. Lap timing, showing the current lap and the best lap time.
    6. 4. Driver's-eye view and rear-view camera, switchable via key press.
    7. Visual requirements: High-contrast color scheme; the UI displays speed and lap count.
    8. Out of scope: Multiplayer mode, AI opponents.
    9. Acceptance criteria: The game is playable immediately after launch; pressing the specified key switches views; completing a lap displays the elapsed time.

    Every line in the template corresponds to a checkable outcome. The benefit is that after the agent finishes, the developer can verify each item one by one instead of relying on an overall impression.

    The Cost Perspective: Unit Price and Per-Task Consumption

    Model services are typically billed per token for both input and output. Given a fixed unit price, cost is determined by the number of tokens consumed per round and the total number of rounds. The cost of a single task can be estimated with the following formula:

    1. Total cost = Σ (round i input tokens × input price + round i output tokens × output price)
    2. Example:
    3. rounds = list of {input_tokens, output_tokens} recorded per round
    4. in_price, out_price = unit prices from the provider's pricing table (placeholder values here)
    5. total = 0
    6. for r in rounds:
    7. total += r.input_tokens × in_price + r.output_tokens × out_price

    This formula points to three optimization directions.

    1. Reduce the number of rounds. Define completion criteria clearly to prevent the agent from repeatedly attempting the same problem.
    2. Reduce per-round input. Compress conversation history and summarize or truncate tool outputs, keeping only what is needed for subsequent steps. Many services also allow reuse of repeated context prefixes, so stable system instructions should be placed early in the prompt.
    3. Reduce ineffective output. Ask the agent to produce a plan before acting, avoiding large chunks of irrelevant code and repeated explanations.

    The economic concept of a “Pareto improvement” fits here as a way to think about optimization goals: reduce the cost per task without lowering the quality of the result. If costs drop but the pass rate also drops, that is not an improvement—it is trading quality for cost.

    How to Read Benchmark Scores

    Benchmark scores can indicate general capability direction, but they should not be taken as a direct prediction of performance on your actual project. When evaluating them, consider three things:

    • Whether the task type resembles your own scenario. Terminal use, tool invocation, automated workflows, and coding problems each test different capabilities.
    • Whether score changes are accompanied by changes in cost or latency.
    • Whether the conclusions can be reproduced on your own codebase and requirements.

    A more reliable approach is to build an internal evaluation set. Prepare 10 to 20 representative tasks, and after each change to the model or prompts, run the full set and record the pass rate, number of rounds, and token consumption. Pseudocode:

    1. cases = load_evaluation_tasks()
    2. report = []
    3. for case in cases:
    4. result = run_agent(case.goal, tools, model)
    5. report.append({
    6. id: case.id,
    7. passed: case.check(result.output),
    8. rounds: result.rounds,
    9. tokens: result.total_tokens
    10. })
    11. summarize_and_output(report)

    Engineering Considerations for Production Use

    • Sandbox execution: When agents run code or commands, restrict them to an isolated environment with limited file system and network access.
    • Least privilege: Only expose the tools needed to complete the task. Destructive operations such as deletion or overwriting should require human confirmation.
    • Key management: API credentials should be supplied through environment variables or a secrets manager rather than embedded in code or prompts.