Replicating Web Apps with Multiple LLMs: A Technical Practice Guide

    This article presents a transferable methodology for using AI agents and multiple LLM-plus-harness combinations to replicate an existing conversational web application end to end. It covers a unified two-round prompting strategy, three deliverables (a product requirements document with a structure diagram, a high-fidelity replica, and an improved version based on best practices), five evaluation dimensions with an executable acceptance checklist, common failure modes, and guidance for running the workflow in production on Baidu AI Cloud. The key takeaway is that validation depth and iteration quality in the second round matter more than first-pass generation speed.

    1. Background and Problem Definition

    As AI agents and code generation capabilities evolve rapidly, “letting a model replicate an existing web product end to end” has become a representative task for testing综合 engineering ability. Unlike single-point code completion, this task examines requirement understanding, information retrieval, architecture design, frontend fidelity, integration testing, and autonomous optimization all at once. The original practice selected six combinations of “model + execution harness” and, under unified constraints, produced three deliverables: a product feature document with a structure diagram, a high-fidelity replica page, and an improved new version based on lessons learned. This article strips away the specific product and tool attributes and abstracts the work into a transferable technical methodology.

    The core challenges can be summarized in four points:

    • Requirement ambiguity: natural-language requirements must be broken down into an acceptance-ready feature list;
    • Visual consistency: layout, spacing, and responsive breakpoints must align closely with the reference implementation;
    • Behavioral consistency: interactions such as streaming output, session management, error states, and empty states must be fully covered;
    • Verifiability: whether the model proactively performs deep testing after receiving API credentials largely determines final quality.

    2. Unified Experiment Design and Two-Round Prompting Strategy

    To ensure comparability, the experiment used a “same task, same constraints, two-round prompts” design. The first round provided only the requirements and the reference entry point, asking the model to browse, summarize, and produce the document and pages on its own. The second round added API credentials to observe whether the model would perform real integration testing and regression.

    The first-round prompt is structured as follows:

    1. Role: Senior product manager + frontend architect
    2. Goal: Replicate a conversational web application
    3. Inputs: Reference page entry, API documentation entry, a logged-in browsing environment
    4. Deliverables:
    5. 1) Product report (feature list + feature structure diagram)
    6. 2) High-fidelity replica (UI/interactions consistent with the reference)
    7. 3) Improved version (UI/UX and feature enhancements based on general best practices)
    8. Constraints: Do not rely on existing memory, skill plugins, or external extensions; execute directly

    The second round only appended credential information, used to distinguish “surface-level changes” from “deep validation.” The differences in strategy across combinations were clear: some combinations performed only minimal viable validation after receiving credentials, while others proactively constructed scenarios such as multi-turn conversations, refresh recovery, and abnormal inputs, exposing defects and iterating on fixes. This difference shows that evaluation should focus not only on first-round output but also on closed-loop validation capability.

    3. Deliverable 1: Product Feature Document and Structure Diagram

    A high-quality document serves as the “design baseline” for the subsequent replica. A three-layer structure is recommended:

    1. Feature domains: sessions, messages, attachments, settings, sharing, login state, and so on;
    2. Feature points: atomic capabilities under each domain, such as create, rename, delete, and export a session;
    3. States and constraints: empty, loading, error, permission states, and boundary inputs.

    The structure diagram can use a tree hierarchy so it maps easily to a component tree:

    1. Conversational application
    2. ├── Session management
    3. │ ├── Create/switch/rename/delete
    4. │ └── Session list persistence
    5. ├── Message area
    6. │ ├── User input and multimodal attachments
    7. │ ├── Streaming rendering and interruption
    8. │ └── Quote/copy/regenerate
    9. ├── Sharing and collaboration
    10. │ └── Read-only share links with access isolation
    11. └── System layer
    12. ├── Login state and authentication
    13. └── Theme/language/keyboard shortcuts

    The document must define the “acceptance criteria.” For example, the visibility of a share link is affected by browser session isolation, so it should state that “acceptance must be done in a logged-out state or in another browser” to avoid misjudging environment differences as feature defects.

    4. Deliverable 2: Engineering Essentials for a High-Fidelity Replica

    The key to replication is turning “visual similarity” into a “maintainable frontend structure.” The recommended process:

    • Tokenize the design: abstract colors, font sizes, border radii, and spacing into CSS variables for consistency;
    • Grid-based layout: use Flex/Grid to describe the master-detail structure, with a collapsible sidebar and an adaptive main area;
    • Component decomposition: separate the input area, message bubbles, session items, and settings panel into components;
    • Responsive strategy: two columns on desktop, a single column on mobile with adjusted input position and size;
    • Complete state coverage: design distinct presentations for loading, empty data, network failure, and overly long text.

    Example style tokens:

    1. :root {
    2. --color-bg: #ffffff;
    3. --color-panel: #f7f7f8;
    4. --color-text: #1f2328;
    5. --radius-md: 12px;
    6. --space-4: 16px;
    7. --input-max-width: 768px;
    8. }

    High fidelity is not pixel-level stacking; it means keeping structure, spacing, and interactions consistent at key viewports (desktop/tablet/mobile) while reducing future maintenance costs through component reuse.

    5. Deliverable 3: An Improved Version Based on Best Practices

    The improved version should reflect “explainable optimization” rather than arbitrary feature stacking. It can be developed along these dimensions:

    • Accessibility: semantic tags, keyboard reachability, sufficient contrast, visible focus;
    • Information architecture: session grouping, pinning, and archiving to reduce lookup cost;
    • Input experience: multi-line auto-sizing, keyboard-shortcut sending, draft auto-save;
    • Feedback mechanisms: throttled rendering of streaming output, interruptible generation, retry on failure;
    • Privacy and permissions: access control for share links, sensitive-information warnings, log redaction.

    Each improvement should include a “motivation–benefit–risk” triple to facilitate review. For example, “draft auto-save” improves continuity but requires considering local storage capacity and privacy boundaries.

    6. Evaluation Dimensions and Acceptance Checklist

    Score across five dimensions to avoid results that “look right” but are unusable:

    1. Document completeness: feature coverage, structure diagram clarity, explicit acceptance criteria;
    2. Fidelity: layout and interaction consistency at key viewports;
    3. Functional usability: core flows run end to end;
    4. Validation depth: whether abnormal and regression scenarios are proactively constructed;
    5. Engineering quality: componentization, maintainability, accessibility.

    Example executable acceptance checklist:

    1. [ ] After creating a session and refreshing the page, the session is still visible
    2. [ ] The mobile input position and size meet expectations
    3. [ ] Streaming output can be interrupted with correct state
    4. [ ] Share links display according to permissions in another browser
    5. [ ] Empty/error states show clear messages and a retry entry

    7. Common Failure Modes and How to Avoid Them

    • Static restoration only: lacking state management and persistence, so data is lost on refresh;
    • Shallow validation: after receiving credentials, only running a minimal “it returns” test and missing boundaries;
    • Unmaintainable structure: hard-coded styles and blurred component boundaries;
    • Ignoring environment differences: misjudging visibility issues caused by session isolation as defects;
    • Unfounded improvements: feature stacking that increases complexity and degrades performance.

    The way to avoid these is to “front-load the acceptance checklist,” defining testable conditions before generating code and requiring the model to output self-test records.

    8. Engineering Deployment Recommendations on Baidu AI Cloud

    To use this method in production, you can build a closed loop with the foundational capabilities of Baidu AI Cloud: use the container platform to host frontend and backend services, object storage to store static assets and attachments, a message queue to decouple asynchronous tasks, and logging and monitoring/alerting services to track error rates and latency, with unified authentication managing login state and sharing permissions. On the model side, agent collaboration can split the roles of “requirement analysis–document generation–coding–testing” into an auditable pipeline.

    9. Conclusion

    “Replicating a conversational web application” is a high-information-density,综合 evaluation task. What truly creates separation is not first-round generation speed but validation depth and iteration quality after the second round. Through unified prompts, structured documentation, component-based implementation, checklist-based acceptance, and cloud engineering support, teams can turn a one-off demo into a reusable, measurable, and maintainable delivery process.