LLM-Assisted Development for Image Apps: From Requirements Breakdown to Production Delivery
Evaluating coding LLMs requires more than code-generation speed; it requires evidence that a model can support an end-to-end engineering loop. Using a mini program with wallpaper browsing, user uploads, and AI image creation as a running example, this article presents a practical framework for LLM-assisted development. It covers requirement decomposition, design contracts, data modeling, masonry layouts, upload validation, asynchronous image tasks, idempotency and retries, vertical-slice collaboration, objective evaluation, and pre-launch security and operations checks. The goal is to show how developers can constrain model output so generated code remains consistent, maintainable, reviewable, and closer to production delivery. The architecture and workflows described here are proposed practices, not benchmark results for any specific model.
1. Evaluating Coding LLMs: Move from “Can It Write Code?” to “Can It Complete an Engineering Loop?”
When discussing LLM-assisted development, the easiest metric to focus on is code-generation speed: how many files a model can output at once, how quickly it can assemble a page, and whether obvious runtime errors appear. These metrics show that a model has some ability to organize code, but they do not prove that an application is ready for delivery.
Real software delivery requires a complete loop from requirement understanding and technical design to module implementation, testing, and deployment. A page that opens does not mean permission control is reliable. An image that can be generated does not mean a failed task can recover. A database query that returns results does not mean it will remain responsive as data grows.
A more useful technical question is therefore whether an LLM can turn vague requirements into a verifiable engineering plan, and how developers can constrain it so that generated results remain consistent, maintainable, and reviewable.
The following sections use a mini program with three capabilities—wallpaper browsing, user uploads, and intelligent image creation—to introduce a general practice framework. The architecture and workflows in this article are recommendations, not measured conclusions about any specific model.
2. Define Business Boundaries Before Discussing Technical Architecture
2.1 Split a One-Sentence Requirement into Three Business Flows
“Build a mini program that supports wallpapers and AI image generation” sounds clear, but it actually contains several businesses with different characteristics.
The first is the content consumption flow:
Users enter the home page, select a category, browse an image list, view a large image, and finally favorite or download it. The focus here is loading speed, content quality, and continuity of interaction.
The second is the content production flow:
Users select an image, complete an upload, add a description, submit it for review, and then check the publication status. The focus here is file validation, content moderation, ownership management, and deletion mechanisms.
The third is the intelligent creation flow:
Users upload a reference image, obtain an image description, edit a prompt, submit a generation task, and then view or save the result. The focus here is multi-step state management, external capability calls, failure recovery, and cost control.
These three flows should not be mixed directly into one page or one backend function. They have different execution times, permission requirements, and exception types. They should be modeled separately and then connected through a unified user identity and resource identifier.
2.2 Define What the First Version Will Not Do
LLMs tend to extend requirements with additional features, such as automatically adding complex recommendations, multi-role management, or a complete operations system. The more features there are, the higher the risk of inconsistency across modules.
The first version can be limited to:
- Category-based wallpaper browsing and detail previews;
- Upload and deletion of a user’s own images after login;
- Reference image analysis, prompt editing, and single-run generation;
- Basic moderation and exception logging;
- No complex recommendations, multi-person collaboration, or fine-grained operations in the first release.
Scope constraints are not a way to lower goals. They create the conditions for validating the architecture and business flows.
3. Have the Model Produce a Design Contract Before Generating Pages
3.1 Establish a Clear Layered Structure
For a small or medium-sized image application, the following general structure can be used:
Mini program client↓Business API layer├─ Identity and permission checks├─ Content query and management├─ Upload authorization and resource registration└─ Image generation task management↓Database, object storage, message queue, background task executor↓Model services such as image understanding, text optimization, and image generation
The client handles interaction, display, and lightweight input checks. The business API layer handles permissions, data rules, and task scheduling. Background tasks handle time-consuming operations.
Credentials for model services should be stored on the server. They must not be written into client code or returned to users through error messages or debug logs.
3.2 Agree on Interfaces Before Implementing Modules
When an LLM generates multiple modules in sequence, the common problem is not syntax errors but contract drift: the same field has different names in different files, the same task state has multiple definitions, and the page and backend understand error formats differently.
Therefore, the following should be fixed first:
- Data entities and field meanings;
- Interface inputs, outputs, and error structures;
- User identity and resource ownership rules;
- Pagination and sorting methods;
- Task states and valid transitions;
- Where file format, size, and dimension limits are configured.
These agreements should be documented in the project and maintained alongside the code. Whenever a new module is added, the model should be required to follow existing contracts rather than design a new set of local rules.
4. Design Data Models Around Business Lifecycles
4.1 Store Image Resources and Generation Tasks Separately
Image resources describe “content that already exists,” while generation tasks describe “a process that is running.” They should not be merged into one entity.
Image resources usually need to record:
- Resource identifier and owning user;
- Storage identifiers for the original image and thumbnail;
- Image width and height, file size, and media type;
- Category, tags, and moderation status;
- Creation time, publication time, and deletion status.
Generation tasks should record:
- Task identifier, owning user, and request identifier;
- Input image and prompt version;
- Current state and failure reason;
- Result resource identifier;
- Creation time, update time, and expiration time.
This separation supports failed-task cleanup, result traceability, permission checks, and resource lifecycle management.
4.2 Match Pagination to Content Changes
For an image list that continuously receives new content, offset-based pagination may produce duplicates or omissions during browsing. Cursor pagination based on a stable sort field combined with a unique identifier is usually better suited to continuously updated feeds.
Pagination design cannot be separated from query conditions. Filters and sort fields such as category, moderation status, and publication time should be considered together with database indexes.
At the same time, the API should limit the number of items returned in a single request so clients do not accidentally request too much data. When returning an image list, the API should prefer thumbnail information rather than making each list item load the original large image directly.
5. Masonry Layout and Upload Management: Details Determine the User Experience
5.1 Masonry Layout Is More Than Splitting Images into Two Columns
A stable masonry experience depends on image dimension metadata. The client can calculate display height in advance from the image aspect ratio, reserve space for the image, and reduce page jumps after loading completes.
Further considerations include:
- Load images only when they are close to the viewport;
- Use thumbnails in lists and load larger images on detail pages;
- Provide placeholders and retry entries for failed images;
- Avoid triggering pagination requests repeatedly;
- Control the number of rendered nodes in long lists.
As the number of images grows, bottlenecks may come from rendering overhead, memory usage, or network transfer. They should not simply be attributed to a slow backend API.
5.2 Client-Side Compression Cannot Replace Server-Side Validation
Client-side compression can reduce upload time, but data submitted by the client cannot be trusted by default. The server should still check file size, actual media type, whether the image can be decoded, and whether pixel dimensions are abnormal.
The upload flow can use the following approach:
- The client requests upload authorization from the business service.
- The server confirms the user identity, quota, and upload scope.
- The client uploads using short-lived, narrowly scoped credentials.
- After upload, the client submits resource registration.
- The server validates the file and moves it into the moderation flow.
- Only after moderation approval does the resource enter the public content list.
Temporary files that are not registered, fail validation, or remain unused for a long time should be reclaimed through a cleanup mechanism to prevent object storage from accumulating indefinitely.
6. Design Image Creation as Asynchronous Tasks
6.1 Image Analysis and Image Generation Are Different Tasks
Image understanding can help extract information about subjects, style, composition, background, and lighting, but the analysis result is not necessarily accurate and cannot be treated directly as reliable fact.
A safer interaction is to present analysis results as editable suggestions, allow users to modify key descriptions, and preserve the user’s original intent. Prompt optimization should not arbitrarily add sensitive attributes, unconfirmed personal identities, or elements unrelated to the input.
Image generation usually has uncertain duration, random results, and possible content restrictions. Therefore, the client should not wait for a long-running synchronous request.
6.2 Use a State Machine to Express the Task Process
A task can use a concise state flow:
Pending → Running → Succeeded↘ Failed
If the business requires it, states such as canceled and expired can be added, but the meaning of each state and the allowed transitions must be explicit.
After submitting a task, the client receives a task identifier and then obtains progress through periodic polling or another mechanism. If the user leaves the page and returns, the task should still be recoverable rather than relying entirely on temporary variables in the current page.
6.3 Design Idempotency, Retries, and Timeouts Together
A network timeout does not necessarily mean the task was not submitted successfully. If the client simply submits again, duplicate generation and duplicate cost may result.
Therefore, a logical request can be assigned an idempotency identifier, and the server can use the user and request identifier to recognize duplicate operations. Background execution should also consider duplicate consumption so that the same task does not register results repeatedly after an executor restart.
Retries cannot be handled with one rule:
- Temporary network errors can be retried within a limited number of attempts;
- Input format errors should prompt the user to make changes;
- Failed content moderation should not be resubmitted automatically in a loop;
- Requests with unknown status should be queried first rather than blindly resent.
In addition, a business timeout and cancellation of an underlying task are not the same thing. Even if the frontend has reported a timeout, the background task may still be running. Later status reconciliation is needed to prevent resource leakage.
7. How to Organize Collaboration with LLMs
7.1 Proceed in Verifiable Vertical Slices
Rather than asking the model to generate a complete project at once, complete a minimal runnable flow first:
“Fetch the wallpaper list—open the detail page—display the image.”
After confirming that the data structure, error handling, and page interaction are consistent, add uploads, and finally integrate intelligent creation. Each stage should have clear inputs, outputs, and acceptance criteria.
This approach exposes architecture problems early and avoids discovering after generating a large amount of code that the core data model needs to be rebuilt.
7.2 Require an Impact Analysis for Every Generation
The model can be given constraints such as the following:
First explain the modules, dependencies, and risks involved in this change.Follow the existing data fields and interface contracts; do not introduce duplicate definitions.Implement the happy path and also handle unauthenticated, unauthorized,network-error, and empty-data scenarios.Finally, list test cases, unverified assumptions, and manual review items.
The key is not how complex the prompt is, but whether the model is required to expose its assumptions explicitly. Any capability, interface, or configuration that has not been confirmed should be marked as unverified and must not be presented as an existing engineering fact.
7.3 Manually Review Generated Code
Developers should at least check:
- Whether keys or sensitive information are written into the client;
- Whether permissions are determined solely by a user identifier passed from the client;
- Whether resource ownership checks are missing;
- Whether exceptions are swallowed and a false success status is returned;
- Whether there are unlimited retries or unbounded queries;
- Whether unnecessary dependencies have been added;
- Whether logs record original image URLs, sensitive prompts, or similar information.
LLMs can reduce implementation cost, but they cannot replace the responsible party’s judgment on security and business rules.
8. How to Turn Subjective Impressions into Objective Evaluation
“It feels like a senior developer” or “the generated code runs directly” can express a subjective impression, but it is not enough to support a technical conclusion. More valuable evaluation should cover the following dimensions.
Requirement understanding: Can the model identify missing conditions and actively distinguish explicit requirements from assumptions that need confirmation?
Architecture consistency: Are the data model, interface contracts, and page logic consistent? Does changing one module break other modules?
Issue repair capability: When given real error logs, can the model locate the root cause instead of repeatedly working around the problem?
Delivery completeness: Are configuration instructions, deployment steps, permission rules, and test cases included?
Maintenance cost: Is the generated code easy to read, modify, and troubleshoot? Will future requirements require large-scale rewrites?
If different models or collaboration methods need to be compared, the task scope, initial code, context, and acceptance criteria should be kept as consistent as possible, and manual modification time, defect types, and final acceptance results should be recorded. Without controlled testing, a single experience should not be generalized into a universal capability advantage.
9. Before Launch, Pass the Security and Operations Gates
Image applications involve user-uploaded content, personal information, and generated content. “The feature works” should not be the only launch criterion.
Before launch, at least check:
- Whether unauthenticated users can call restricted APIs;
- Whether users can modify and delete only their own resources;
- Whether private images can be accessed without permission;
- Whether inputs and generated results have appropriate moderation mechanisms;
- Whether deletion requests cover original images, thumbnails, and related records;
- Whether rate limits are set for uploads, generation, and queries;
- Whether task failure reasons and durations can be traced;
- Whether alerts exist for background backlog, error growth, and storage anomalies;
- Whether high-risk features can be rolled back or temporarily disabled when a version is abnormal.
At the same time, the scope of use, retention period, and deletion method for user-uploaded images should be clearly stated. For photos of people and other content that may involve rights, clear usage notices and necessary restrictions should also be provided.
Conclusion: Let the Model Handle Implementation While Engineering Discipline Safeguards Delivery Quality
The most important change in LLM-assisted development is that it is extending from local code completion to requirement decomposition, solution organization, and multi-module implementation. But this change does not mean developers can skip design, review, and validation.
For wallpaper and intelligent image creation applications, quality is determined by a set of interrelated engineering choices: a reasonable data model, clear permission boundaries, a reliable asynchronous task mechanism, traceable exception handling, and an acceptance process that covers key risks.
A more effective collaboration model is to let the model produce results quickly under clear constraints, and then establish trust through testing and manual review. An assisted development process should also be evaluated by whether it reduces rework, exposes risks, and improves delivery certainty—not just by how impressive the first generation of code looks.
