Reproducing a Chat Web App Across Multiple Models: A Controlled Engineering Method

    Reproducing a chat web app is a product-engineering task, not a visual copy. This article explains how to align scope and information architecture, ship a working page, then improve it from real calls—using the same materials, rounds, and acceptance criteria across models so results reflect engineering quality rather than prompt luck.

    Background: Reproduction Is Not a Visual Copy

    The core of a conversational web product is not a chat layout. It is the full path from input and context through streaming output, error handling, and session management. Asking a coding agent to “make something that looks like this page” often yields a similar layout with broken behavior: lost history, streams that cannot resume, silent auth failures, and long replies that break the layout.

    A more reliable approach treats reproduction as a controlled product-engineering task: align capability boundaries and information architecture first, implement a runnable page second, and improve it from real calls last. Several models and execution environments can run in parallel, but the task, materials, rounds, and acceptance criteria must be the same. Otherwise you are comparing prompt luck, not engineering ability.

    Split the Task into Three Deliverables

    The first deliverable is a functional specification and a structure diagram. The spec should cover roles, the main path, exception paths, and data objects—not slogans. The diagram should at least show page regions, where state comes from, and request direction: session list, message area, input area, model or parameter area if the product needs one, and a system status bar. A simple block diagram is enough; the point is clear boundaries.

    The second is a web page reproduced from public behavior. The goal is a working main path: create or continue a session, send a message, show the assistant reply, and handle loading and failure. Visual similarity is fine, but do not invent capabilities that were not in the requirements just to look alike—for example a plugin marketplace, file parsing, or voice that never appeared in the spec.

    The third is an improved page based on what you learned. Each change must be explainable and tied to a problem the reproduction already exposed, such as unrecoverable errors, incomplete keyboard use, poor readability of long text, or duplicate submits. Every improvement maps to a user pain point and should still allow falling back to the baseline behavior.

    Evaluation Design: Same Materials, Different Strategies Allowed

    Fix the following inputs so groups do not see unequal information:

    • Role: a senior product and front-end implementation perspective, not an open-ended creative writer.
    • Reference: the target page’s public interactions, plus confirmed official or internal chat API documentation. Browsing may be manual notes or read-only viewing in an already signed-in environment, but secrets must not be written into the first-round prompt.
    • Output order: documentation and structure first, then the reproduction page, then the improved page, so requirements do not drift while you code.
    • Constraints: the stack may be chosen freely, but the run instructions must be stated; do not call unauthorized APIs; do not commit secrets or put them in front-end plaintext.

    Executor strategies may differ. One group may only smoke-test connectivity; another may add edge cases and go back to change the code. Record behavioral differences. Do not “catch up” afterward with a different prompt. Operators should use the same prompts and the same timing for issuing credentials, or the comparison will not hold.

    Two Prompt Rounds: Requirements First, Credentials Later

    Round one provides only the goal and materials, not credentials. Ask the model to output user stories, page information architecture, API call sequence, assumptions about error-code handling, and a list of open questions. This step shows whether the model invents API fields. Parameters that do not appear in the documentation should be marked as unconfirmed, not written straight into the request body.

    Round two then provides call credentials and a minimal environment note, such as the base URL, the auth header form, and whether streaming is supported. The prompt should state that credentials are for local verification only and must not be echoed into the page, logs, or documentation examples. At acceptance, check source and build artifacts and confirm that secrets come from environment variables or local config that is not committed.

    Separating the rounds splits “understanding the product” from “making the call work.” If credentials are given up front, the model often skips information architecture and stacks an input box that can merely send a request.

    A schematic front-end call should stay generic; fields must follow the actual documentation:

    1. async function sendMessage(messages, { signal } = {}) {
    2. const res = await fetch("/api/chat", {
    3. method: "POST",
    4. headers: { "Content-Type": "application/json" },
    5. body: JSON.stringify({ messages, stream: true }),
    6. signal
    7. });
    8. if (!res.ok) throw new Error(`request_failed:${res.status}`);
    9. return res.body;
    10. }

    A proxy layer reads credentials from the server environment and forwards the request so the browser never sees the secret. Stream the response with a readable stream, updating the UI in chunks, and abort when the component unmounts so state is not updated after the user leaves the page.

    How to Tell a Shallow Test from a Deep One

    Under the same operator procedure, differences come mainly from execution strategy.

    A shallow test typically sends one short message in round two and stops when anything comes back. It does not check empty input, oversized input, repeated clicks, network interruption, non-2xx responses, or a stream that drops midway. The document and the page disagree—for example the spec says multi-turn context, but the implementation sends only the last sentence.

    A deep test asks follow-up questions in the same session and checks whether history is included in the request; whether a refresh keeps the session as designed or clearly does not; whether a failure leaves the input retryable without inserting a half message; whether stop-generation during streaming actually cancels the request; and whether long replies, code blocks, and lists do not overlap. When a defect is found, change the implementation and record the reason in the notes, rather than only admitting the problem in a comment.

    Use one table for the record: scenario, expected, actual, whether it regressed, and the corresponding change. Do not treat a subjective “more intelligent” as a conclusion.

    Engineering Baselines the Reproduction Page Should Hold

    Be explicit about the session model. If the product is multi-turn, the request body should carry history after a truncation policy, and that policy should be stated so context does not grow without limit. Append messages immutably in the UI: a user message enters a “sending” state, is marked complete on success, and stays retryable on failure instead of disappearing.

    Separate “generating” from “completed” in the stream UI. While generating, disable controls that would start concurrent requests, or assign a sequence number to each send and drop stale responses so an older request cannot overwrite a newer reply.

    Show errors in layers. Auth failure, quota or rate limits, parameter errors, and gateway timeouts need different copy for users and different logs for developers. Do not surface internal stacks to users. On the developer side, record a request identifier so it can be matched to server logs.

    Accessibility and the keyboard path are basic: the input can be focused, the Enter-to-send versus newline convention is written down, and loading state is not conveyed by color alone. These changes are cheap and decide whether the page is a product or a demo.

    The Improved Page: Change Only Problems You Have Evidence For

    Experience-based improvement easily slides into feature pile-up. Constrain the scope:

    • Defects that failed in this round of testing come first.
    • Experience items that are common in chat products and do not change the API contract are allowed, such as stop generation, copy reply, and whether auto-scroll follows the user.
    • Capabilities the documentation does not provide are out of scope, so evaluation does not become an imagination contest.

    Describe each improvement in one sentence as a before-and-after difference. For example: “After a stream breaks, keep the generated fragment and offer retry, instead of clearing the whole reply.” Reviewers can then check the claim rather than accept a new look that cannot be regression-tested.

    Checklist: Documentation and Implementation Stay Aligned

    Before submission, at least verify:

    1. Every main path in the functional spec has a matching action on the reproduction page.
    2. Every request in the structure diagram has a single exit in code, not ad hoc assembly in several places.
    3. Every sample request field can be found in the API documentation; missing fields are removed or marked unimplemented.
    4. Secrets are not in the repository, screenshots, or the front-end bundle.
    5. The list of differences between the improved page and the reproduction page is complete, and each item can be reproduced manually.
    6. Records cover at least four cases: successful multi-turn, failed retry, cancel generation, and empty-input blocking.

    If a group only finished a smoke test, mark coverage as insufficient in the conclusion. Do not compare that result directly with a group that finished boundary tests and call one “higher quality.” Coverage itself is a capability dimension.

    Fitting This into a Team Workflow

    The process can be a fixed pipeline: freeze materials, produce a read-only first round, inject credentials, run automated and manual acceptance, then review differences. Agents are useful for speeding up document drafts and page skeletons; they do not replace contract checks. API fields, error semantics, and whether the API is streaming follow confirmed documentation. When the documentation is vague, write the gap into the open-question list instead of letting the model fill in a field that “looks reasonable.”

    If the page needs to be hosted with a reverse proxy and logs, generic object storage, application hosting, access control, and log search are enough. The proxy owns authentication and rate limiting; the page owns state and presentation. The reproduction can then leave a single chat session and become front-end engineering that can be deployed, reviewed, and regression-tested.

    Summary

    Reproducing a chat web app across multiple models is not a contest over who looks most like the original site. It is about who, given the same materials, makes the information architecture, the API contract, and the exception paths real. Two prompt rounds separate understanding from calling. Three deliverables separate specification, reproduction, and improvement. One acceptance table records shallow tests and deep tests explicitly. Followed this way, the team gets a repeatable practice for product reproduction and quality judgment, not a one-off demo page.