Cloning a Chat Web Client with Multi-Model Collaboration: A Practical Approach
This article describes a practical experiment in which six combinations of AI models and execution frameworks each rebuilt a chat web client. Each combination produced a product feature document with a structure diagram, a replica of the target chat page, and an improved version of that page. The article compares how the combinations handled requirements, integration testing, and defect discovery, and it summarizes reusable engineering practices for moving from requirements to a working web client.
Replicating a Chat Web Client with Multi-Model Collaboration: A Practical Approach
When replicating a chat web client, the hard part is rarely generating a page. The real challenge is connecting product structure, interaction flows, API authentication, error handling, test validation, and long-term maintenance into one complete pipeline. This article describes a practical experiment that combined multiple AI models with execution frameworks. Six combinations were each asked to produce a product feature document with a structure diagram, a replica of the target chat web client, and a version of that replica improved with general product and engineering experience. The work used two rounds of prompts. The first round described the requirements. The second round added only the authentication key. By keeping the operating variables constant, the experiment observed how each combination differed in requirement analysis, integration testing, and defect discovery, and it distilled engineering methods that others can reuse.
1. Task Design and Variable Control
The core goal of this experiment was to test end-to-end capability, from requirements to a working web client. To make the results comparable, the task was split into three clearly defined deliverables:
- Product feature document and structure diagram: Describes page modules, session flows, message states, error states, and key interactions.
- Replica of the target chat web client: Based on the publicly available API documentation, implements the page structure, session management, message sending and display, and authentication configuration.
- Improved web client based on engineering experience: Builds on the replica and adds loading states, error messages, empty states, retry mechanisms, observability, or maintainability improvements based on general product and engineering practices.
The six combinations represent different model capabilities and execution framework strategies. This article does not evaluate the merits of any specific product. It treats each combination as a sample of a different generation and execution strategy. The two-round prompt design also has an engineering purpose. The first round gave only requirements, which showed how each combination broke down the problem and planned its work independently. The second round provided the authentication key, which showed how deeply each combination tested in a real integration setting, how it located problems, and how willing it was to optimize.
The prompt structure, deliverable requirements, and acceptance criteria stayed the same across all combinations. Even so, the combinations differed clearly. Some stopped after the simplest connectivity test once they had the key, confirming only that the page could send one message. Others went further. They checked invalid input, empty sessions, repeated submissions, authentication failure messages, long message display, and state consistency, and they fixed defects they found. This difference shows that an execution framework’s testing strategy directly affects delivery quality.
2. From Requirements to Structure Diagram: Why Documentation Comes First
A chat web client looks simple, but it includes many states: logged out, logged in, empty session, message sending, streaming response, request failure, retrying, and switching sessions. If the product document only describes an input box, a send button, and a message list, the implementation will likely miss edge-case states. The feature document should therefore cover at least the following:
- Information architecture: The top area, session list, message area, input area, and settings or help entry points.
- Core flows: Creating a session, sending a message, receiving a reply, switching sessions, and clearing or deleting sessions.
- State transitions: Blocking repeated submissions while sending, allowing retries after failure, preventing empty messages from being sent, and showing loading states and skeleton screens.
- Exception flows: Authentication failure, network timeout, service rate limiting, malformed responses, and long text overflow.
- Acceptance criteria: Each feature needs observable, testable pass conditions.
The structure diagram does not need to be complicated, but it should show how page modules relate to the data flow. For example, the input area triggers the session service. The session service builds the request, attaches authentication information, handles the response, and writes the message state back to the message list. Documentation first turns page replication into a product and engineering contract. Generation, integration, and testing can then all rely on the same reference.
3. Key Engineering Layers in Chat Web Client Replication
When replicating a chat web client, the implementation can be split into the following layers:
- Presentation layer: Handles layout, responsive adaptation, message bubbles, the input box, button states, and empty-state display.
- Session layer: Maintains the current session identifier, message list, sending state, and error state.
- Service layer: Encapsulates request construction, authentication header injection, timeout control, response parsing, and error mapping.
- Configuration layer: Provides the API base URL and authentication key through environment variables or a key management mechanism, avoiding hardcoded values.
- Observability layer: Records key events and error summaries to help with integration debugging, without recording full keys or sensitive content.
A generic configuration example, shown here as pseudocode, might look like this:
# Generic configuration example (pseudocode)runtime:api_base_url: ${CHAT_API_BASE_URL}api_key: ${CHAT_API_KEY}timeout_seconds: 30auth:scheme: bearerinject_header: truetest:smoke: truedeep_regression: false
During integration, the authentication key should be injected through a secure mechanism, such as an environment variable, a key management service, or a deployment platform setting. A prompt can state that the key is provided through the runtime environment. Passing the key in plaintext in a conversation over a long period is not recommended. General security practices include applying least privilege, rotating keys regularly, never committing keys to a code repository, and never printing them to logs.
4. Testing Differences After Key Injection
The second-round prompt only added the authentication key. This moved the task from static generation to dynamic integration testing. At this stage, the strategy differences between combinations were most visible:
- Shallow testing: Only checks that the page opens, the request is sent, and the response is displayed. This is fast, but it easily misses authentication failure messages, empty input validation, repeated submissions, and malformed response parsing.
- Deep testing: Actively builds edge cases, such as empty messages, very long messages, repeated clicks, API failures, empty responses, and session switches that leave state inconsistent. It then changes the code based on the failures.
The gap is not fully explained by model capability alone. It also depends on whether the execution framework encourages a plan, execute, verify, and fix loop. A mature execution framework treats testing as part of the task, not as something to skip once the page runs.
The following reusable test checklist summarizes the key cases:
| Test Category | Key Checks | Expected Result |
|---|---|---|
| Connectivity | Send a message with a valid key | The response is displayed correctly |
| Authentication errors | Key is missing or invalid | A clear error message appears without exposing sensitive information |
| Input validation | Empty message or spaces only | Sending is blocked or a warning is shown |
| Repeated submission | Repeated clicks while a message is sending | Only one valid request is triggered |
| Abnormal responses | Timeout, empty response, malformed format | The failure is shown and retry is supported |
| State consistency | Send a message after switching sessions | Messages belong to the correct session without crossover |
| Display robustness | Long text and special characters | The layout holds and the content stays readable |
5. Quality Assessment Framework and Improvement Recommendations
Evaluating a replica should not stop at whether it looks similar. A multi-dimensional framework is needed. It should check whether feature coverage is complete, whether the structure diagram matches the implementation, whether the interactions work, whether the code runs, whether authentication and error handling are secure, whether tests cover edge cases, and whether the code is easy to maintain. For the improved version, teams should also check loading states, empty states, retry on failure, accessibility, and log observability.
Teams applying this approach can follow these recommendations:
- Write requirements as testable specifications to reduce replication based on guesswork.
- Require the generating side to produce the structure diagram and state list before writing code.
- Inject keys through secure configuration, and rotate test keys immediately after integration.
- Use two levels of testing, smoke tests and deep regression tests, to avoid stopping at connectivity checks.
- Record key errors in a structured way to aid debugging, without logging sensitive information.
- Keep change notes and test results to create a reproducible delivery record.
Overall, combining multiple models with execution frameworks can significantly speed up the start of a web client replication. Final quality, however, depends on requirement specifications, testing depth, and a complete engineering loop. Moving from “generating a page” to a full process of documentation, implementation, integration, testing, and improvement is what turns a replica from a demo into a deliverable product.
