Frame the Task Before the Agent Writes Code
A coding agent can implement a clear task quickly. It can also implement an unclear task quickly. The speed is the same. The cost is not. Turn a request into a bounded task frame before editing. Separate repository facts from assumptions and open questions. Define allowed paths, forbidden paths, and acceptance evidence. Decide when reconnaissance is sufficient to begin work. “Add duplicate email protection” sounds specific. It is not. Does uniqueness belong in the API, domain service, or database? Is comparison case-sensitive? Which error shape is already public? Is a migration allowed? Which test proves the behavior? A capable agent will fill those gaps with plausible choices. That is the dangerous case because the implementation can be clean, tested, and still incompatible with the system. The first unit of coding-agent work is therefore not an edit. It is a task frame backed by repository evidence. A useful frame has six fields: Facts need receipts. “The API uses 409 for duplicates” is not a fact until you can point to the existing test or handler. A file path and line is enough. A command result is better when behavior matters. Do not read the entire repository. Search for the surfaces that constrain the change: The current behavior and its caller. The closest existing test. The public contract or serialized shape. The…
Frame the Task Before the Agent Writes Code: A coding agent can implement a clear task quickly. It can also implement an unclear task quickly. The speed is…
This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.
Browse the complete course catalog or open this lesson on GitHub.