From Conversational Coding to Agent Engineering: A Practical Workflow for AI-Assisted Software Development

    AI-assisted programming is not only about generating code faster. This article explains how to turn conversational exploration into a controlled engineering workflow through acceptance-oriented requirements, layered context, specifications, risk-based task decomposition, evidence-based verification, least-privilege tool access, and clear multi-agent responsibilities. It also presents an end-to-end batch file checker example and guidance for team adoption focused on verifiable delivery rather than generation speed.

    1. From Code Generation to Organizing the Development Process

    AI-assisted programming is changing how software development is performed: developers can describe a goal in natural language, and a model can help analyze the code, propose a solution, modify files, and run validation. But greater convenience does not mean that engineering constraints have disappeared. Requirement ambiguity, data consistency, authorization boundaries, dependency compatibility, and production stability still require explicit design and continuous verification.

    Conversational development is well suited to rapid exploration, such as validating an interaction idea, building a prototype, or understanding an unfamiliar module. Its risk is that generated results often have strong surface-level completeness: the code structure looks reasonable, naming is clear, but exception branches may be missing, existing constraints may be broken, or the result may rely on assumptions that have not been verified.

    Agent engineering goes further by focusing on the entire execution loop:

    Requirement input → fact retrieval → solution formation → controlled execution → result verification → human review → knowledge capture

    Here, an “agent” is not a replacement developer with independent decision-making authority. It is a software system that can work toward a goal, use approved tools, and continue executing tasks based on feedback. Its reliability comes from boundary design, feedback quality, and engineering constraints, not from model output capability alone.

    A mature practice should therefore define responsibilities clearly: humans handle business trade-offs, risk acceptance, and final acceptance, while agents perform analysis and execution within authorized boundaries. Decisions involving funds, security, privacy, and production environments should not be left to a model’s self-approval.

    2. Requirement Expression: Turning Ambiguous Intent into an Acceptance Contract

    “Add an export feature” seems clear, but it lacks much of the information needed to determine how the feature should be implemented: which fields to export, who can access it, how much data is allowed, whether sensitive information is included, how failures are handled, and whether asynchronous execution is required.

    High-quality requirements are not about length. They should allow the executor to distinguish goals, facts, constraints, and unknowns. The following structure can be used:

    1. Task objective:
    2. Add export capability to the business record list.
    3. Usage scenario:
    4. Authorized operators export data under the current filter conditions.
    5. Scope:
    6. Include fields visible in the list. Exclude internal notes and sensitive identifiers.
    7. Constraints:
    8. Reuse the existing authorization checks and data query logic.
    9. Do not change the response structure of the existing list API.
    10. An export failure must not affect the existing query flow.
    11. Acceptance criteria:
    12. Unauthorized users cannot trigger export.
    13. Exported results match the filter conditions.
    14. Empty data, expired permissions, and execution failures all produce clear feedback.
    15. Open questions:
    16. Maximum allowed export size.
    17. Whether an asynchronous task is required and how long results remain available.

    Open questions in a requirement should be listed separately instead of allowing the model to fill them in automatically using “common practice.” In particular, data retention periods, operation approval rules, and cost-related behavior usually must be decided by the business owner.

    Before execution, the agent can also be asked to restate the task, list its assumptions, and describe the impact scope. This is not a formality. It exposes misunderstandings early: correcting a plan is usually cheaper than rolling back a group of cross-module changes.

    3. Context Management: Showing the Model the Right Information

    Context windows are limited, while useful project information is often scattered across code, documentation, tests, and historical decisions. Putting every file into the conversation does not guarantee a more accurate understanding. It can instead dilute important constraints.

    A more reliable approach is to organize context in layers.

    3.1 Long-Term Rules: Preserve Stable Engineering Constraints

    A project should maintain a concise engineering guide that records directory responsibilities, build and verification methods, coding conventions, architecture boundaries, prohibited modification areas, and security requirements.

    This guide should be placed under version control and maintained by the team. It is not an authoritative knowledge base generated automatically by a model. When the guide conflicts with the actual code, the cause should be investigated, and either the documentation or the implementation should be corrected.

    The long-term guide is suitable for stable principles such as “the business layer must not access external services directly.” It is not suitable for accumulating temporary debugging logs or outdated task conclusions.

    3.2 Task Context: Load Only What the Current Decision Needs

    For a specific change, prioritize providing the relevant entry points, core modules, interface contracts, necessary tests, and error logs. For cross-module tasks, the agent can first search for dependencies and then add material step by step rather than reading the entire repository at the outset.

    Key judgments should be tied to their evidence whenever possible. For example: “The existing API returns a success result when the collection is empty,” together with the corresponding implementation or test. This helps distinguish project facts from model inferences.

    3.3 Phase Summaries: Preserve Progress, Not the Entire Conversation

    For long-running tasks, maintain summaries at regular intervals:

    • Confirmed requirements and constraints
    • Completed changes
    • Verification performed and its results
    • Unresolved issues
    • Next-step plan

    The summary must distinguish between “planned verification” and “verification already passed.” Otherwise, later execution may treat an unproven conclusion as a fact.

    Context is also a data exposure surface. Credentials, personal information, and production data should not be entered directly just to simplify troubleshooting. When sample data is necessary, it should first be sanitized and handled in accordance with the organization’s data-processing rules.

    4. Specification-Driven Development: Define Correctness Before Discussing Implementation

    The core of specification-driven development is to define observable behavior, inputs and outputs, and exception semantics before coding. It does not require heavy documentation for every small task; the appropriate granularity of the specification should be chosen according to risk.

    Take “bulk update product status” as an example. At minimum, the following questions need to be clarified:

    • When the input is empty, should the request be rejected or return an empty result?
    • When some products do not exist, should the entire operation fail or should each item be reported individually?
    • Are duplicate submissions allowed?
    • How should status conflicts be handled during concurrent modification?
    • Which roles are allowed to perform the operation?
    • Are audit records required?

    These questions directly determine the transaction boundary, API response structure, and test plan. If the implementation is generated first and requirements are added later, structural rework is likely: the code may already assume “all succeed” while the business requires “partial success.”

    Acceptance criteria can be written as testable descriptions:

    1. Given: An operator has management permission only within a specified business scope.
    2. When: The request contains records outside that scope.
    3. Then: The system must not modify records outside the authorized scope and must return an explicit permission error.
    4. Given: The request contains duplicate records.
    5. When: The bulk update is executed.
    6. Then: The result must follow the agreed de-duplication or rejection rule, rather than leaving the behavior to be decided by the implementation.

    The purpose of a specification is to establish shared criteria for judgment, not to guarantee that the model will be correct. If implementation reveals a conflict between the specification and the existing system, the specification should be discussed and updated before implementation continues.

    5. Task Decomposition: Proceed by Risk and Verification Boundaries

    Large tasks should not be split simply by the number of files. A more effective unit of decomposition is a work package with clear inputs, outputs, and acceptance criteria.

    For example, adding asynchronous export capability to a system could be decomposed as follows:

    1. Map query conditions, authorization logic, and data scope.
    2. Define task states, result structure, and failure semantics.
    3. Implement task creation and status queries.
    4. Implement background execution and result storage.
    5. Add page feedback or an interaction entry point.
    6. Verify exception recovery, access control, and resource cleanup.

    Task states and interface contracts should usually be stabilized first, after which subsequent modules can be developed in parallel. The purpose of decomposition is not to add steps; it is to make each step independently judgeable as complete.

    Each work package should also specify what may be modified and what must not be touched. If the agent finds that the scope must be expanded, it should pause and report the reason, avoiding the transformation of a small feature into an unapproved global refactor.

    For high-risk changes, start with a minimum closed loop: complete one normal path and verify the contract, then add edge-case handling. For tasks that affect core behavior, establish a test baseline before making changes.

    6. Testing and Correction: Use Evidence to Judge Delivery Quality

    A model can help write tests, but “the model-generated tests pass” is not sufficient proof that “the model-generated implementation is correct.” If both share the same incorrect assumption, the tests may only confirm the incorrect implementation.

    More reliable verification requires multiple forms of evidence:

    • Design tests based on confirmed specifications.
    • Preserve existing regression tests.
    • Check authorization, exception, and boundary behavior.
    • Review critical data flows and control flows.
    • Arrange independent review for high-risk scenarios.

    For example, amount calculations should focus on precision and rounding rules; date handling should focus on time zones and cross-day boundaries; authorization features should focus on unauthorized paths, not only successful authorized paths.

    A complete execution report should include:

    1. Change scope:
    2. Which modules changed; whether APIs or data structures changed.
    3. Verification record:
    4. Which checks were run and what actual results were observed.
    5. Unverified scope:
    6. Which scenarios remain uncovered and why.
    7. Residual risk:
    8. Remaining uncertainty in compatibility, performance, or runtime environment.

    When a failure occurs, it is better not to immediately ask the agent to “fix all related problems broadly.” First collect reproduction steps, expected results, actual results, and relevant evidence, then request a minimal fix. Try to change only one major variable per round, which helps clarify the causal relationship between the fix and the result.

    Version management is equally important. Before starting a task, confirm the workspace state and preserve existing modifications. Create a commit after a verifiable unit is complete. Unless explicitly authorized, the agent should not overwrite human changes, rewrite shared history, or perform destructive cleanup.

    7. Tool Access and Automation: Constrain Execution Within Boundaries

    Only after an agent is connected to files, tests, logs, or external systems can it form a more complete work loop. But the more tools an agent has, the greater the scope for permission misuse and error propagation.

    Tool design should follow the principle of least privilege:

    • Grant only the capabilities necessary for the current task.
    • Prefer read-only access.
    • Separate read, write, and publish permissions.
    • Require approval for production writes, bulk deletion, and sensitive configuration changes.
    • Record invocation parameters, execution results, and exception information.
    • Limit timeouts, retries, and resource consumption.

    External documentation, web content, logs, and even code comments may contain untrusted instructions. Agents should treat this content as data to be analyzed, not as new commands that can override task rules.

    Automation can be used for repetitive steps with clear rules, such as formatting checks, static checks, test execution, and change summary generation. Engineering tool extension points can trigger these processes, but the behavior after failure should be explicit: block delivery, prompt for human handling, or allow continuation.

    Automated checks can verify only the rules they cover. They cannot replace architecture review, security review, or business acceptance.

    8. Multi-Agent Collaboration: Assign Responsibilities, Not Repeat Discussions

    Multiple agents can take on different responsibilities such as implementation, test design, code review, and documentation verification. But increasing the number of participants does not necessarily make results more reliable. If all participants operate from the same incorrect understanding, collaboration only amplifies the error.

    Effective collaboration requires three foundations.

    First, specifications and interface contracts must be unified. Different executors must work from the same set of confirmed constraints.

    Second, modification scopes must be isolated. Parallel tasks should operate on independent modules or independent workspaces whenever possible, avoiding simultaneous modification of the same file. When conflicts occur, they should be handled by a coordinator or human owner.

    Third, independent verification must be preserved. A reviewer should not only read the implementer’s summary; it should inspect the actual changes and raise verification questions based on the original requirements.

    For small tasks, a single agent with a clear checklist is often more economical. Multi-agent collaboration becomes more valuable only when the task can be decomposed, boundaries are clear, and integration costs remain controllable.

    9. End-to-End Example: Building a Batch File Checker

    A batch file checker can demonstrate the engineering workflow end to end. The tool needs to scan a specified directory, identify files that do not conform to the naming convention, and generate a report.

    Step 1: Define Boundaries

    Clarify whether scanning includes subdirectories, whether symbolic links are followed, how directories without permission are handled, where the report is stored, and whether files may be modified.

    An initial version can explicitly provide read-only inspection without automatic renaming. This both narrows the requirement and reduces the risk of accidental operations.

    Step 2: Define the Specification

    Define the naming rules, report fields, and error classification. For example, a failure to read a single file can be recorded while processing continues; a missing root directory should terminate the task. The two cases should not be treated as the same type of failure.

    Step 3: Decompose the Implementation

    Separate directory traversal, rule evaluation, and report generation. Rule evaluation should remain free of external side effects as much as possible so it can be tested independently. File-system access should be centralized to make error control and resource use easier to manage.

    Step 4: Establish Verification

    Tests should cover scenarios such as empty directories, nested directories, special characters, paths without permission, and large numbers of files. Runtime and memory usage need to be measured; performance should not be declared compliant based on model estimates.

    Step 5: Review and Deliver

    Check for unintended writes, confirm that the report path will not overwrite existing files, and add usage instructions, known limitations, and troubleshooting guidance. The final delivery includes not only code but also verification records and a risk statement.

    The same process can be applied to application pages, service APIs, office automation, and internal agent tasks. What changes is the implementation; what remains stable is the mechanism of requirements, boundaries, evidence, and review.

    10. Team Adoption: Evaluate Verifiable Deliverables, Not Generation Speed

    When introducing AI-assisted programming, teams can start with tasks that are low risk, easy to roll back, and easy to validate, such as adding tests, maintaining documentation, fixing simple defects, and performing local refactors.

    Effectiveness should not be measured only by code-generation speed. Teams should also observe:

    • The total cycle time from requirement confirmation to completed acceptance
    • Human review and rework time
    • Regression defects and production issues
    • Coverage of automated verification
    • Compliance of permissions and data handling
    • Whether the delivery process can be reproduced

    At the same time, record task types and complexity to avoid directly comparing tasks of different difficulty. Saving time on one type of work does not mean that every development scenario should use the same process.

    The long-term value of AI-assisted programming lies in connecting expression, execution, and feedback. Conversation provides a more natural development entry point. Specifications reduce misunderstanding. Context management provides a factual basis. Tool access expands execution scope. Testing and version management form a traceable verification chain. Only by organizing these capabilities into a controlled process can exploratory programming gradually become reliable agent engineering.