UI consistency and functional acceptance when rebuilding a product with AI coding

    Rebuilding a live product is not just generating pages and APIs. This article frames product recreation as an engineering process with clear boundaries, checkable acceptance items, journey-based generation, and multi-scheme comparison so prototypes stay observable, comparable, and regressable instead of only looking similar.

    Rebuilding a shipped product is, on the surface, generating pages and APIs. In substance it is reconstructing information architecture, interaction states, and business loops under constraints. AI coding can shorten the path from requirements to a runnable prototype, but without an acceptance contract the result often stops at visual resemblance: layout and copy look close, then a critical path breaks. This article treats recreation as an executable engineering process. The emphasis is observability, comparison, and regression—not a subjective “does it look alike.”

    Define the recreation boundary first

    Recreation is not pixel-for-pixel copying of proprietary assets, and it is not a promise of matching the original product on performance, billing, or internal implementation. A reasonable boundary usually has three layers:

    • Information architecture: whether navigation, lists, details, forms, empty states, and error states are complete.
    • Interaction contract: where input lives, button reachability, when validation runs, submit feedback, loading and disabled states.
    • Business loop: whether primary paths such as login or guest mode, create, query, share, or export can complete independently.

    If the boundary is vague, later comparison turns into a taste argument. Before work starts, record a one-page constraint note: target devices (desktop, mobile, or both), the page list that must be restored, secondary capabilities that may be simplified, and account systems or sensitive data that must not be touched. For login, payment, and permissions, recreate only the interaction shape, use local mock data, and do not connect real user credentials.

    Turn observation into checkable items

    A human glance cannot support regression. A more stable approach is to split observation into checks, each with a pass condition.

    The UI layer cares about layout, not brand decoration: relative position of the main input in the viewport, width and safe-area padding, whether the keyboard covers it, whether fixed regions misalign on scroll. The functional layer cares about the state machine: empty input, overly long input, illegal characters, double submit, network failure, insufficient permission. The data layer cares about traceable fields: list item IDs, timestamps, status enums, and whether pagination cursors stay consistent after refresh.

    A lightweight acceptance sketch can look like this:

    1. case: mobile main input
    2. given: viewport width 390, bottom safe area 34
    3. expect: input bar sits on the bottom and is fully visible; submit control is tappable
    4. case: share entry
    5. given: one shareable record already generated
    6. expect: the link opens a read-only view in a new session and does not depend on the original tab’s memory

    These items do not depend on a vendor-specific private API. Any workflow that can change the frontend and a local service can run them.

    Split tasks and supply context

    Handing an entire site to generation in one shot makes context too long; models tend to drop edge states. Splitting by user journey is more reliable: entry and navigation, create and edit, list and filter, detail and share, exceptions and empty states. Each segment should receive only the constraints it needs: field meaning, validation rules, success and failure copy, and whether offline demo is allowed.

    Supply material as neutral description: spatial relationships from wireframes or screenshots, publicly visible interaction notes, and self-authored sample data. Do not put secrets, internal network addresses, or unpublished API parameters into the prompt. Generated output should land in a version-controlled project: components, style tokens, routes, and mock APIs in layers—not one unmaintainable concatenated page.

    What to compare across multiple schemes

    If several AI coding approaches run in parallel, fix comparison dimensions in advance so “whoever boots first wins” is not the metric. Cover at least:

    • Structural completeness: whether agreed pages and states all have entry points.
    • Geometric consistency: whether position and size of key controls on the target viewport stay within an acceptable threshold—for example a few pixels or one spacing unit versus the reference.
    • Behavioral consistency: whether step counts and feedback on success and failure paths match the constraint note.
    • Maintainability: naming, component reuse, and whether styles can be changed locally instead of breaking globally.
    • Verifiability: whether repeatable checks remain, including conditions that are easy to skip, such as cross-browser behavior and opening a share link in a new session.

    The overall conclusion should state weights. A pixel-tight UI that fails share outside the original tab is not a complete core feature. A detailed report that cannot reproduce the checks is not stable. Promoting notes such as “must accept in another browser or a new session” into formal cases is often more valuable than another visual pass, because it reveals whether state was wrongly bound to memory or the current document.

    Engineering habits to keep during implementation

    Use spacing and type-size tokens instead of scattered magic numbers. Treat responsive layout as breakpoints plus safe area, not tweaks for a single phone width. Connect input, submit, list, and detail with explicit state objects; refresh and share should use the same read path. Mock APIs should return stable IDs and error codes so assertions are possible.

    Call out cross-environment differences separately: browsers differ on viewport height, sticky positioning, and soft keyboards. A share link that only works in the current page’s memory will fail in a new session. Acceptance should include at least one run of “close the original page, then enter from the link.” Local storage is for demo only; do not store real secrets.

    Risk and definition of done

    Recreating publicly visible interaction for learning architecture or an internal prototype should avoid copying protected visual assets and unauthorized APIs. Done is not “generation finished.” It is: every must-do item on the constraint list has a pass record, failures have a reason and a decision on whether simplification is accepted, and the code starts in a clean environment from the instructions. Only after that bar should performance work and a real backend begin, so demo defects do not enter production.

    Used this way, AI coding is an accelerator; the acceptance contract is the source of quality. Write the boundary and checks first, generate in segments, compare geometry and behavior, and verify share and exception paths in a new session. Recreation can then move from “looks like the site” to “the main path is reliable.”