AI Coding Agents in Practice: Optimizing a Partially Built Admin System
This article shares a hands-on experience of using an AI coding agent together with a general-purpose LLM to optimize a partially completed admin system over a weekend. It explains why half-built projects are difficult to modify, how to turn vague goals into bounded engineering tasks, what kinds of work coding agents handle well, and why independent review and validation are essential. It also covers a recommended task workflow, context and cost management, and the limits of agent execution compared with human engineering judgment.
During the continuous development of an admin system, the most time-consuming work is often not writing a single feature. It is understanding existing code, analyzing relationships between modules, maintaining compatibility with historical implementations, and repeatedly validating details. This is especially true for partially built projects. They often already contain some pages, APIs, and data structures, but the code style is inconsistent, business boundaries are unclear, and exception handling is incomplete. As a result, later changes can easily affect many unrelated areas.
Recently, I tried using an “AI coding agent + general-purpose LLM” approach to carry out concentrated optimization on a partially built admin system. The whole process lasted one weekend, with about 8 to 10 hours of total effort. The results show that this kind of tool is well suited to high-frequency, repetitive development tasks that require continuous operations. However, the developer must establish clear task boundaries, a review mechanism, and a validation process. It can significantly reduce manual effort, but it cannot fully replace engineering judgment.
1. Project Background: Why Partially Built Systems Are Hard to Change
The project already had some basic functionality, including admin pages, permission-related modules, data display, and several business APIs. From an engineering perspective, however, it still had several typical problems.
- Inconsistent module completion
Some pages only implemented static display, some were already connected to APIs, and other features were in a “runs but incomplete” state. Before writing code, a developer first needs to determine what stage the current module is in.
- No unified code structure
Different modules might use different naming conventions, request wrappers, and state management approaches. If an AI coding agent modifies code based only on a local view, it can easily amplify inconsistency across the project.
- Many hidden defects
The most common problems in a partially built system do not always appear on first run. Examples include errors when handling empty data, inconsistent pagination parameters, lists that do not refresh after editing, delete operations without a second confirmation, and action entry points that remain visible when permissions are insufficient. These issues need to be found through code reading, runtime validation, and business reasoning.
- Changes can easily get out of control
A seemingly simple field adjustment may affect database queries, backend response structures, frontend tables, form validation, and detail pages at the same time. Without clear modification boundaries, the agent may expand the scope on its own and increase regression risk.
For these reasons, a partially built project is not an ideal scenario for “letting the model freely explore.” It requires more precise direction from the developer.
2. Core Method: From Wish-Based Prompting to Task-Oriented Collaboration
In practice, I did not make broad requests such as “optimize this admin system.” Instead, I split tasks by file, module, and objective.
An effective task description usually includes the following:
- The responsibility of the current file or module;
- Known issues and reproduction conditions;
- The specific result to achieve;
- Parts that must not be changed;
- The validation method to run;
- The changes to report at the end.
For example, instead of saying “optimize the user management page,” the task can be split as follows:
- Read the user list page and its request logic.
- Identify state issues among pagination, search, and reset conditions.
- Keep the existing APIs unchanged and fix frontend parameter passing.
- Add empty-data, loading, and request-failure states.
- Check list refresh logic after create, edit, and delete operations.
- After modification, list changed files and explain the validation results.
The value of this approach is that it turns a vague goal into a set of checkable engineering tasks. The agent does not need to guess what “optimize” means, and the developer can quickly judge whether the result meets expectations.
3. What AI Coding Agents Are Good At
In this practice, AI coding agents performed well in the following tasks.
1. Rapid project understanding
By reading the directory structure, entry files, route configuration, API wrappers, and component dependencies, an agent can quickly form an initial understanding of a project. When taking over unfamiliar code, this is more efficient than opening files one by one manually.
Project understanding should not rely on a single scan, however. The agent should be asked to output:
- The main project modules;
- The mapping between pages and APIs;
- Shared components and utility functions;
- Potentially duplicated logic;
- Core files with a large impact scope;
- The issues most worth fixing first.
This turns “reading code” into structured information rather than a vague summary.
2. Executing clear local modifications
For local tasks such as field adjustments, form validation, list state handling, error messages, style consistency, and request parameter fixes, agents usually have strong execution ability. As long as the goal is clear, they can continuously perform searches, modifications, formatting, and basic checks.
3. Running repetitive validation
An agent can repeatedly run type checks, build checks, static analysis, test commands, and file searches. It can also compare code before and after changes. These tasks are not complex, but manual execution is easy to overlook. Delegating them to an agent reduces mechanical work.
4. Helping trace related issues
When an issue involves multiple files, an agent can follow function calls, component references, and data flow. For example, after a backend field changes, it can further search for related references in frontend tables, forms, detail display, and export logic.
It is important to emphasize that the agent finds “possibly related code.” The final decision on whether a change should be made still depends on the developer’s understanding of business semantics.
4. Why an Independent Review Step Is Necessary
In this practice, one effective approach was to have one AI agent perform modifications and a separate independent code review step check the work. The two should not share exactly the same reasoning path; otherwise, the same mistake may be confirmed twice.
The review can focus on four categories.
Functional correctness
Check whether the requirement is truly implemented, not just whether the code compiles. For example, can list search be used repeatedly? Does reset restore the default pagination? Does a failed edit incorrectly show success?
Edge cases
Focus on empty arrays, empty strings, missing fields, duplicate submissions, network exceptions, insufficient permissions, and large data volumes. Many issues do not appear in the normal flow but directly affect user experience under edge conditions.
Compatibility
Confirm whether changes break existing APIs, shared components, route navigation, permission control, or other pages. In particular, when parameters of shared methods change, all callers must be checked.
Maintainability
Review whether the changes introduce duplicated code, overly complex conditional logic, unclear variable names, or unnecessary large-scale refactoring. AI agents sometimes add temporary logic to complete a task quickly. Such code may work in the short term but increases maintenance cost over time.
5. Recommended Workflow for a Complete Task
To improve the success rate, each task can follow a fixed workflow.
Step 1: Read before changing
Ask the agent to analyze relevant files and call chains first, output only its problem assessment and modification plan, and not write code immediately. This avoids incorrect changes when context is insufficient.
Step 2: Limit the modification scope
Clearly specify which files may be modified and which modules should not be touched. For cross-module tasks, also explain which changes are necessary and which would be extra refactoring.
Step 3: Execute in stages
Modify core logic first, then add exception handling, and finally handle styles and code cleanup. Changing too much at once makes issue localization difficult.
Step 4: Validate immediately
After each small stage, run the corresponding checks instead of waiting until all tasks are complete. This makes it faster to determine which change introduced an error.
Step 5: Generate a change report
Ask the agent to list modified files, core changes, unresolved issues, and validation results. Any unverified content must be clearly marked. “It should be fine” is not a substitute for facts.
6. Context and Cost Management
This practice involved approximately 820 interactions, a context size of about 660,000 tokens, and cached content of about 659,900 tokens. The cache ratio was nearly 99%, and the total cost was about CNY 10. These figures are only a record of one personal practice. They cannot be directly generalized into a universal cost conclusion, because actual consumption depends on the model, context reuse, task complexity, number of tool calls, output length, and other factors.
From an engineering perspective, however, several general rules can still be summarized.
Maintaining context continuity helps reduce repeated explanations.
The agent can remember previous directory analysis, API relationships, and modification constraints, lowering communication costs for later tasks.A longer context does not necessarily mean more accurate understanding.
Irrelevant logs, repeated discussions, and outdated plans can interfere with judgment. Stage conclusions should therefore be organized regularly, and invalid information should be cleaned up.Tool-call quality matters more than conversation quantity.
Large numbers of read, search, modify, and validation operations are valuable only when they serve a clear objective. Simply increasing the number of interaction rounds does not guarantee better results.Avoid asking the agent to repeatedly explain the same issue.
If the direction is wrong, directly state the cause of the error, the correct boundary, and the acceptance criteria instead of only saying “change it again.”
7. Capability Boundaries: Strong Execution Is Not Engineering Judgment
The outstanding advantage of this kind of AI coding agent is execution. It can continuously read files, search references, modify code, and run checks, making it suitable for a large amount of repetitive work. For clear, fine-grained, verifiable tasks, efficiency is very high.
It also has clear limitations:
- Its understanding of business goals may remain superficial;
- It may make locally optimal changes based on local code;
- It may be insufficiently sensitive to potential security issues and long-term maintenance costs;
- It may overlook exception flows, permission boundaries, and data consistency;
- It lacks stable subjective judgment for complex architecture decisions;
- When an issue is found, it may require multiple rounds of pointing out specific symptoms before a real fix is completed.
A reasonable positioning is therefore not “fully automated development,” but “the developer owns direction and acceptance, while the agent handles execution and assists analysis.”
8. Final Conclusion
After this high-intensity practice, the value of AI coding agents in optimizing partially built admin systems is clear. They can free developers from hands-on work and improve efficiency in code reading, batch modification, and repetitive validation. They are especially suitable for engineering tasks with clear boundaries and explicit steps.
However, when it comes to code reliability, proactive issue discovery, complex business understanding, and defensive programming, human supervision is still required. A more reliable collaboration model is:
The developer defines the problem, and the agent analyzes and executes; an independent step performs review, automated checks perform validation, and the developer makes the final confirmation.
If an AI coding agent is treated as a programmer that can freely grant wishes, results are often unstable. If it is treated as a highly capable engineering assistant and combined with clear tasks, strict boundaries, and multiple rounds of validation, it can deliver significant development efficiency gains at relatively low cost.
