Replicating LLM Chat Applications: A Complete Workflow from Requirements to Delivery
This article presents a practical framework for replicating a full-featured conversational AI web application using AI coding tools. It defines three deliverables—a product functionality document, a high-fidelity interface, and an improved interface—along with clear acceptance criteria for each. The article explains why a two-round prompting strategy works better than a single prompt, outlines the key engineering layers of a reference implementation, and lists common defects with practical mitigation techniques. A reusable evaluation workflow is also provided, covering environment setup, acceptance checklists, scoring dimensions, and baseline archiving. Readers will learn how to turn vague requirements into verifiable engineering output and how to compare coding tools fairly.
1. Background and Problem Definition
The industry is seeing a trend toward exposing the full capabilities of conversational AI products as open APIs: session management, deep reasoning modes, web retrieval, file upload and parsing, speech synthesis, and speech recognition are being broken into callable modules. This raises a practical question: once the underlying capabilities are standardized, what engineering steps are required to replicate a complete conversational web application, and which steps are most error-prone?
This article does not review any specific product. Instead, it frames the problem as a general technical challenge: given a reference site and a capability API document, have an AI coding tool produce three deliverables without human intervention—a functionality document, a high-fidelity interface, and an improved interface. The value of this challenge is that it tests a model’s requirement understanding, information retrieval, frontend reproduction, API integration, and self-verification all at once.
2. Task Breakdown: Acceptance Criteria for the Three Deliverables
To make evaluation results comparable, the first step is not writing prompts but defining the deliverables clearly.
- Product functionality document and structure diagram: List the information architecture, navigation hierarchy, and core interaction paths, and express module ownership with a tree structure or flowchart. Acceptance focuses on whether functionality is exhaustive and whether the hierarchy is self-consistent, not on polished wording.
- High-fidelity reproduction interface: Layout, spacing, control sizes, responsive breakpoints, and interaction feedback must match the reference site. Acceptance focuses on cross-device consistency, especially easily overlooked details such as the position and size of the mobile input area.
- Improved interface: Experience optimizations are allowed on top of understanding the original design, but each change must be justified. Acceptance focuses on whether improvements are evidence-based, avoiding changes made for their own sake.
It helps to write acceptance criteria as a checkable list, for example:
[ ] Session list supports create/rename/delete[ ] Message stream supports incremental output and interruption[ ] Deep reasoning process can be displayed in a collapsible view[ ] Attachment upload shows progress and supports retry on failure[ ] Mobile input box sticks to the bottom and does not overlap the safe area[ ] No style flickering after theme switching
3. Prompt Design: Why Two Rounds Are Necessary
A single-round prompt can hardly distinguish “can write code” from “can deliver.” In practice, a more reliable approach is to split the interaction into two rounds.
The first round provides only requirements and boundaries: Set the role as a senior product manager and frontend engineer, provide the reference site URL and the entry point to the API documentation, specify the three outputs, and require ignoring historical context and existing plugin configurations to avoid toolchain interference. This round observes whether the tool proactively clarifies ambiguities, whether it produces the information architecture before coding, and whether it delivers a runnable project rather than code fragments.
The second round adds only key information: This round is the real dividing line. Different implementation strategies show clear differences:
- One type performs only minimal connectivity verification and stops once requests go through;
- The other runs the full pipeline, covering stream interruption, overly long input, concurrent sessions, and error code handling, thereby proactively exposing defects and fixing them.
This difference is not about model capability but about default toolchain strategies: some lean toward conservative delivery, others toward exploratory verification. In engineering, this strategic difference should be written explicitly into the prompt, for example by requiring “list at least five self-test cases with results.”
4. Key Engineering Points of a Reference Implementation
Regardless of the model or coding tool used, a deliverable reproduction project typically includes the following layers:
- Session and context layer: Session persistence, message ordering, and context trimming strategy (sliding window or summary compression).
- Capability orchestration layer: Abstract reasoning modes, retrieval, file parsing, and speech capabilities into a unified capability interface for easy provider replacement.
- Streaming transport layer: Incremental output based on server-side push, handling heartbeats, reconnection, and cancellation semantics.
- Frontend state layer: Distinguish four states—requesting, streaming, interrupted, and failed—to prevent duplicate submissions.
A schematic capability abstraction:
class Capability(Protocol):name: strasync def invoke(self, payload: dict) -> AsyncIterator[dict]: ...# Reasoning, retrieval, file parsing, and speech all implement the same protocolregistry: dict[str, Capability] = {}
The benefit of this abstraction is that implementations can be swapped without changing upper-layer logic during evaluation or deployment, making horizontal comparison of the same prompt easier.
5. Common Defects and Mitigation Techniques
- Mobile layout drift: The input area lacks bottom sticking and safe-area adaptation. Mitigation: enforce multi-breakpoint screenshot self-checks.
- Missing sharing and authentication: Reproductions often ignore cross-session isolation of share links, allowing others to read them. Mitigation: write authentication and visibility into the acceptance checklist.
- No protection for long input: Missing length validation and truncation hints. Mitigation: validate on both frontend and backend.
- Missing error states: Only the success path is implemented. Mitigation: require coverage of three exception types—timeout, rate limiting, and authentication failure.
- Insufficient verification depth: Only one connectivity call is made. Mitigation: specify a minimum number of self-test cases and a recording format.
6. A Reusable Evaluation Workflow
- Unify the environment and initial conditions, clearing historical context and plugin configurations;
- Send requirements in the first round and record whether structure comes before code;
- Send keys in the second round and record self-test depth and the number of defects found;
- Accept the three deliverables item by item against the checklist, taking one screenshot per device;
- Normalize scoring dimensions: reproduction fidelity, functional completeness, improvement reasonableness, and verification sufficiency;
- Archive prompts and outputs to form a regression baseline.
7. Conclusion
Using “replicate a conversational application” as an evaluation vehicle essentially tests whether an AI coding tool can close the loop from vague requirements to verifiable engineering. What truly separates tools is often not code generation speed but whether they proactively clarify, build structure first, and are willing to self-test deeply. Writing these three points into the workflow and prompts makes evaluation results comparable and engineering output genuinely usable.
