AI Coding Agents: Why Predefined Workflows Beat Prompting and Wishing

    This article explains why conversational AI coding agents often feel unreliable and why predefined skills and workflows deliver more consistent results. It covers three root causes: the probabilistic nature of LLM sampling, error accumulation across multi-step tasks, and the hard limits of context windows and memory. It then shows how explicit, parameterized skills constrain the action space, improve reproducibility, and become testable, version-controlled assets. Finally, it outlines a practical build-versus-run separation and actionable tips for using AI coding agents in real engineering work.

    Introduction: From a “Wishing Machine” to an “Executor”

    Many people approach an AI coding agent for the first time with a “make a wish” mindset: drop a requirement into the chat box and expect a ready-to-use project to come back. In practice, the more ambitious the wish, the more likely the agent is to fail when it matters. The conversation may look productive and generate a large amount of code, yet almost none of it is usable when you try to put it into production, and repeated changes can make things worse.

    This is not an accidental flaw in one particular tool; it is a shared characteristic of this class of systems. What actually makes an agent reliable is not talking more or chatting longer. It is moving the task from open-ended conversation onto predefined, debugged skills and workflows. Starting from the underlying technical principles, this article explains why conversational interaction is inherently unreliable and why “build the process, then let the agent execute it” is the more pragmatic approach.

    1. Why Conversational Interaction Is Inherently Unreliable

    1.1 LLM Sampling Is Probabilistic by Nature

    At the core, a large language model generates content by sampling from a probability distribution over the next token at each step, conditioned on the existing context. Even with identical parameter settings, different runs can produce different outputs. This non-determinism is not a big problem for a single question-and-answer exchange, but once it is placed inside an agent task that requires many consecutive, interdependent steps, it gets amplified.

    Put differently, every step an agent takes is essentially a bet with randomness built in. You cannot remove this statistical jitter by wishing harder.

    1.2 Error Accumulation in Multi-Step Tasks

    A moderately complex development task usually breaks down into a chain of steps: understanding requirements, retrieving context, generating a plan, writing code, running verification, and fixing problems. In a long agent loop, the deviation from one step becomes the input to the next. A misunderstood field or a misdirected implementation gets treated as fact in later steps and is extrapolated further, eventually producing a systematic drift.

    This is the error accumulation effect: a small-probability mistake in a single step, once chained across many steps, significantly lowers the overall probability of success. Relying purely on conversation leaves the entire chain exposed to unpredictable sampling variation.

    1.3 The Hard Ceiling of Context Windows and “Memory”

    A common intuition is that if you just talk to the agent more and explain the background in more detail, it will “understand you better.” From an engineering perspective, however, memory is far more fragile than it seems:

    • Limited context window: The available context is a finite resource. The longer the conversation history, the more likely early critical information is to be diluted or truncated.
    • Imprecise memory retrieval: Even with external storage for long-term memory, recall and relevance ranking introduce noise, and the information actually needed at this moment may not be retrieved reliably.
    • State is hard to persist: Intermediate conclusions, constraints, and decisions implied during the conversation are impossible to trace once context is lost, unless they are explicitly written to storage.

    So “talking more means understanding you better” often just builds the result on probability rather than on controllable, reproducible engineering constraints.

    2. Skills and Workflows: Putting Uncertainty in a Cage

    2.1 What Are “Skills” and “Workflows”

    In the AI coding context, a “skill” is typically a reusable, parameterized encapsulation of a capability. It specifies what the agent should do for a certain class of tasks, in what steps, which tools to call, and how to determine completion. A “workflow” arranges these skills in a deterministic order to form a clear execution path. They can generally be written as structured configuration files or scripts, for example:

    1. # An illustrative skill definition (structure example only)
    2. skill:
    3. name: "Generate and validate the data access layer"
    4. inputs:
    5. - schema_file # Input: data structure definition
    6. - target_language # Input: target language
    7. steps:
    8. - action: read_schema
    9. - action: generate_code
    10. constraints: ["must include parameter validation", "hardcoded connection strings are forbidden"]
    11. - action: run_unit_tests
    12. - action: report_diff
    13. done_when: "all unit tests pass"

    The key point is that the task’s boundaries, steps, and acceptance criteria are defined explicitly, rather than left entirely to the agent to improvise in conversation.

    2.2 Why Predefined Processes Improve Reliability

    Predefined skills are more dependable than “wishing” for three core reasons:

    • Constrain the action space: Clear inputs, steps, and constraints greatly narrow the range of actions the model can choose at each step, suppressing the negative impact of sampling variation.
    • Improve reproducibility: The same skill with the same input tends to produce consistent output, making regression testing and problem localization easier.
    • Verifiable and iterable: Because the process is explicit and structured, you can write test cases for it and objectively determine success or failure by whether it meets the acceptance criteria, instead of guessing by eye.

    In short: conversation is good at exploring possibilities, while skills and workflows are good at delivering results reliably.

    2.3 Maintainability and Team Collaboration

    Capturing capabilities as skills has a long-term value as well: it is naturally suited to version control. Skill definitions can be reviewed, reused, and gradually improved like code. When team members share the same set of processes, they get consistent output quality, rather than each person taking their own chances in conversation with the agent. This is the dividing line between mature engineering and casual tinkering.

    3. Build the Process vs. Run the Process: A Framework of Separated Responsibilities

    An insightful observation is that the person who builds this system also first uses a mature, well-developed coding agent to create the skills, and then hands them to the execution side to run. Abstracting this phenomenon yields a general engineering principle: fully separate the “building and debugging of the process” from the “execution of the process.”

    • Build phase: In a development environment with mature capabilities and a complete context and toolchain, turn requirements into debuggable, testable skills and workflows. This phase allows ample trial and error and thorough validation.
    • Execution phase: Hand the already-debugged process to the execution side to run repeatedly, making it a “deterministic mover” rather than an “on-the-spot decision maker.”

    Only when you stop expecting the execution side to create something new on the fly and treat it purely as an executor that “runs a ready process” does it truly become reliable and usable. This also raises a sharp question: if you ultimately have to return to a mature environment to build the process, is the value added by “an extra execution layer” really worth the additional complexity and maintenance cost it introduces? This is a question that must be answered honestly during architecture selection.

    4. Practical Advice: How to Actually Use AI Coding Agents Well

    Based on the principles above, here are some actionable recommendations:

    1. Use conversation for exploration and processes for execution: Requirement clarification and solution brainstorming can iterate quickly through conversation; once a solution stabilizes, solidify it into skills and workflows, and avoid betting deterministic delivery on random sampling.
    2. Turn skills into versionable assets: Describe skills with structured files, put them under version control, and continuously review and improve them, rather than starting from scratch with a chat every time.
    3. Constrain output with test cases: Set clear acceptance criteria for each process (such as passing unit tests and no static-check warnings) so that “success” can be judged objectively.
    4. Manage state and memory explicitly: Write intermediate conclusions and key constraints to storage explicitly, instead of relying on conversation history to carry them implicitly, reducing the risk of context loss.
    5. Leverage general cloud capabilities for running and observability: Executing agents also needs an engineered foundation. You can use object storage to save artifacts, message queues to decouple tasks, container platforms to host the runtime environment, and logging services with monitoring and alerting to ensure observability. Platforms like Baidu AI Cloud typically offer the general product categories above and can help bring agent execution into a well-defined operations system.
    6. Be clear about boundaries: Distinguish “execution-type tasks” from “creation-type tasks.” Leave the former to mature processes for stable running, and return the latter to the build phase for iteration. Never conflate the two.

    5. Conclusion

    The surface impression that an AI coding agent “can’t do anything right” does not stem from too little conversation. It stems from the fact that pure conversational driving cannot counter the three inherent constraints of LLM sampling, error accumulation, and memory management. The path to a reliable agent is to separate exploratory conversation from reusable, debuggable skill workflows: first build and test the process in a mature environment, then let the execution side reuse it stably. Understanding and practicing this “build the process, run the process” separation of responsibilities is what turns an uncertain game of probability into predictable, maintainable engineering delivery.