AI Coding Agents in High-Intensity Development: Practices and Reflections

    This article describes how the author used AI coding agents to improve a partially built back-office admin system. It covers writing file-level task briefs, separating execution and review agents, running tool-based edit, analysis, and test loops, and managing context and cost. It ends with a practical checklist for teams working on similar projects.

    1. Background and Goals: From Half-Finished Code to a Maintainable System

    When iterating on a back-office admin system, a common situation is that the project has some foundation but suffers from messy structure, unclear interface boundaries, missing form validation, scattered permission logic, and incomplete logging and exception handling. Such projects do not suit “wishful prompting,” where you type a single line such as “optimize this” and expect the coding tool to finish everything automatically. A more controllable approach is a collaboration model built on file-level task briefs, a closed tool-calling loop, and independent review.

    The goal of this practice was not to generate a complete system from scratch. It was to optimize a half-finished back-office admin system in a focused way. An earlier coding agent had completed part of the work, but it hit its usage quota, so the project was handed over to a different tool. The key lesson is this: when taking over a half-finished project, first establish verifiable task boundaries instead of letting the agent carry out a large-scale refactor. Each task should map to a specific file, function, or page module, with clear inputs, outputs, constraints, and acceptance criteria.

    For example, a reusable task card can be written as the following pseudo-configuration:

    1. task:
    2. target_file: src/module/user/controller.ts
    3. goal: "Add parameter validation and exception responses to the user list API"
    4. constraints:
    5. - "Keep the existing route paths unchanged"
    6. - "Do not modify the database schema"
    7. - "Reuse the project's standard error codes"
    8. acceptance:
    9. - "Empty parameters, invalid pagination, and unauthorized access each return a clear response"
    10. - "Add corresponding unit tests"
    11. - "Static checks pass"
    12. forbidden:
    13. - "Do not introduce new dependencies"
    14. - "Do not perform large-scale refactoring across modules"

    The value of this kind of brief is that the agent knows both what to do and what not to do. The person knows how to accept the work, and the review agent knows which boundaries to check. Compared with open-ended prompts, file-level tasks substantially reduce context drift and the risk of unintended changes.

    2. Collaboration Model: Separating the Execution Agent from the Review Agent

    In high-intensity development, a single agent that both writes code and performs the final review tends to “confirm its own correctness.” A more reliable approach is to separate the roles. The execution agent modifies code according to the task brief, runs tools, and reads logs. The review agent checks the work from a defensive programming perspective, focusing on boundary conditions, exception paths, input validation, permission control, and test coverage.

    The core observation from this practice can be summarized as follows. The execution agent is effective at carrying out well-defined instructions. It is fast and inexpensive, which frees up the person’s time. However, it may be weaker in proactive judgment and defensive programming awareness than an agent that focuses on review and defensive checks. When it misses something, pointing out the problem in another round of conversation usually fixes it. The person, however, remains responsible for setting goals and accepting the results.

    The recommended workflow is therefore:

    1. The person sets the goal and acceptance criteria. Specify the files, the functionality, the expected behavior, and the prohibited actions.
    2. The execution agent completes the changes. It reads code with tools, traces the call chain, modifies files, and runs tests.
    3. The review agent checks the work independently. It focuses on null values, boundaries, exceptions, concurrency, permissions, logging, and rollback.
    4. The person makes the final merge decision. For high-risk changes, require additional tests or split the commit.

    This model does not aim for full automation. It aims for auditable semi-automation. The agents handle frequent, repetitive, and verifiable changes. The person handles architectural direction, risk judgment, and final acceptance.

    3. Quantitative Observations from High-Intensity Development

    This practice took about 8 to 10 hours over a weekend and produced roughly 820 interaction messages. The context reached about 660,000 tokens, of which about 659,900 tokens were cached, a cache hit rate of roughly 99%. The total cost was on the order of 10 yuan (RMB). Assistant messages made up about 50% of the context, tool messages about 42.3%, and other messages about 7.7%. These numbers show that the agent did not only answer questions in text. It worked heavily through tools to read, modify, analyze, and verify code.

    A high cache hit rate means that much of the repeated context was reused effectively. This matters most for long sessions and multi-file tasks. If every task required re-inserting the full project background, both cost and latency would increase. In practice, the following context management strategies help:

    • Summarize before each task: Ask the agent to output a summary of the current module’s call chain before it starts modifying code.
    • Isolate context by file: Focus on one file or one call chain at a time to avoid flooding the context with the whole repository.
    • Reuse stable background: Project conventions, error code definitions, and directory structure notes can be reused as fixed context.
    • Compress history regularly: Record the conclusions of completed changes in a task log to reduce repeated conversation.
    • Keep tool output short: Retain only the key excerpts from logs and test output so that noise does not fill the context.

    Cache optimization matters for more than cost. It keeps the context stable. In long sessions, agents tend to forget early constraints. Task cards and stage summaries help keep key constraints in view.

    4. The Tool-Calling Loop: Read, Modify, Analyze, Verify

    A high share of tool messages shows that the agent worked in an agentic loop rather than generating code in one pass. A healthy loop usually includes these steps:

    1. Read: Locate the file, function, callers, callees, and related test cases.
    2. Modify: Make the smallest necessary change and avoid refactoring along the way.
    3. Analyze: Check for static errors, type errors, dependencies, and potential side effects.
    4. Verify: Run unit tests, integration tests, static checks, or a local build.
    5. Review: Record the changes made, the remaining risks, and the follow-up tasks.

    In a back-office admin system, the following checks deserve particular attention:

    • Do list queries handle empty parameters, invalid pagination, and very large data sets?
    • Do create and edit operations validate required fields, length, format, and uniqueness?
    • Do delete and bulk operations check permissions and ask for secondary confirmation?
    • Do error responses use a unified error code system, and do they avoid exposing internal stack traces?
    • Do audit logs record the operator, the target object, and the result of each key action?
    • Are frontend and backend validation consistent, and are there any entry points that bypass validation?

    The review agent should be asked to produce a list of issues, with evidence and suggested changes, rather than simply stating that the code “looks fine.” For example:

    1. Review findings:
    2. 1. High risk: The delete endpoint does not check whether the current user has permission for the target data.
    3. Evidence: The controller only verifies that the user is logged in and does not query resource ownership.
    4. Suggestion: Add an ownership check in the service layer and write a test for unauthorized access.
    5. 2. Medium risk: The pageSize parameter has no upper limit.
    6. Suggestion: Set a maximum value and return a unified error code for invalid values.

    5. Quality Differences and Risk Control

    In this practice, the execution agent’s strengths were fast responses, strong execution, and low cost. It suited batch progress on clearly defined tasks. Its weaknesses were limited proactive judgment and possibly insufficient defensive programming awareness, which made it easy to miss boundary conditions and exception paths. Compared with an agent focused on defensive review, the execution agent was more likely to make mistakes in input validation, exception branches, permission boundaries, and test coverage.

    The response to this is not to reject the execution agent. It is to add process controls:

    • Point out problems over multiple rounds: When something is missed, give specific files, specific behaviors, and expected results, and ask the agent to correct them.
    • Review independently: Do not let the execution agent declare the work “complete.” Bring in a review agent or a human reviewer.
    • Write tests first: For high-risk interfaces, add tests before asking the agent to modify the code.
    • Commit in small steps: Split changes by file or feature to reduce the cost of rollback.
    • Maintain a list of prohibited actions: State clearly that the agent must not change table schemas, refactor across modules, or introduce new dependencies.

    6. A Reusable Checklist

    Based on this high-intensity development experience, the following checklist can be used:

    1. Before the task: Define the target file, the functional goal, the constraints, the acceptance criteria, and the prohibited actions.
    2. During execution: Require the agent to read the call chain before changing code, and solve only one clearly defined problem per round.
    3. During verification: Run tests or static checks, and keep the key output.
    4. During review: Check null values, boundaries, exceptions, permissions, logging, and rollback.
    5. Cost control: Reuse stable context, compress history, keep tool output short, and isolate tasks by file.
    6. Risk control: Require manual review for high-risk changes, and split commits when needed.

    7. Conclusion

    AI coding agents suit the role of executors for clearly defined tasks in high-intensity development. They can read code, modify files, run tools, and verify results quickly. Combined with a high cache hit rate, they can keep costs low. However, they should not be treated as fully autonomous architects or as the final reviewers. A more sound division of labor is this: the person owns goals, boundaries, and acceptance. The execution agent handles frequent modifications, and the review agent performs defensive checks. File-level task briefs, a tool-calling loop, and independent review together can provide a more controllable balance among efficiency, cost, and quality.