Goal: To create a coding system that requires less oversight and fewer opportunities of distraction (while still introducing friction and thorough thought)
Within software engineering, common practice is to have a clear definition of a function’s inputs and expected outputs so clear tests can be developed. Functions start small with a single purpose in order to be clearly defined and easily understandable.
Problem: Coding agents allow vague requests to be turned into functioning code, even though the code works it may actually produce outputs that don’t match what the user intended because the user did not specify their intent. While experienced programmers send PRDs to coding tools, most people don’t and rely on unverified generated code.
The system will be broken into two agentic loops. The first is to iteratively force the user to be more and more specific for example:
User: Write a program that makes a cool shader.
AI: Before continuing, please be more specific in your request
User: The shader should simulate light.
AI: Continue to further refine your request. The more specified, the better the result.
User: Create a shader that has four light sources 150px away from each corner of a 400x400 canvas. Each source should be angled 45º facing the center of the canvas where a 30px square should be placed acting as a reflective material redirecting the light back out towards the edge of the canvas.
The iterative process continues until the reviewed prompt has a clear request that will lead to minimal future interventions. The intent is to have a pre-emptive intervention in order to have a more accurate output from the system. The initial re-prompting would cause many people to become frustrated and abandon the agent for one with less restrictions, but it provides an opportunity to step back and reflect on what the actual outcome should be of the generated code. While the example was related to a visual sketch, it can also be applied to more standard bugs.
As the agent executes, if multiple interpretations can be generated for a given code output, it can also elevate the choice to the user for the intended outcome. For example from the shader example:
[After running for some time]
AI: The main shader file has been setup. Before it runs, what initial color should each light source be?
User: A warm orange.
The worry with much knowledge work is all the output can be generated without the need of a person. While it’s true a version of an agent implementation that keeps a person closer to the cycle of work continues to rely on their expertise and provides opportinuties for people with less experience to gain expertise.
The agent was inspired by my early computer science classes in my undergrad where we learned, what the faculty described, as the “design recipe” from a book called How to Design Programs. A list of steps for developing software and programs that centered around the idea of strong testing and knowing the purpose of a function before writing any code.