Multi-Model Webpage Recreation: AI Agent Practices and Boundaries

    This article documents a controlled webpage recreation experiment using multiple AI models and testing frameworks. It covers authorization and credential boundaries, prompt design, shallow versus deep validation, context and tool management, code quality checks, and the limits of AI-assisted development. The focus is on reproducible evaluation, risk control, and the areas that still require human oversight.

    1. Experiment Prerequisites: Authorization and Credential Boundaries

    This article documents a webpage recreation experiment conducted on an authorized test site. All credentials used were sandbox test keys, and the page data had been anonymized. No real credentials are shown here. If the target is a third-party public product, obtain written authorization before attempting to recreate it, and confirm that the scope does not involve its accounts, user data, or paid APIs.

    The experiment combined multiple models with testing frameworks. Given only a page URL and API documentation, each combination had to independently deliver three outputs:

    1. Product documentation
    2. A high-fidelity recreation of the webpage
    3. An enhanced version with new functionality

    These outputs correspond to three stages: requirements analysis, technical implementation, and iterative optimization.

    2. Prompt Design: Layered and Testable

    The value of a prompt lies in imposing constraints in the right order. The prompts used in this experiment contained four main parts.

    Role and Scope

    The model was assigned the role of a product manager, with the target page and relevant API documentation clearly specified. The more precise the scope, the less likely the model was to search for unrelated information.

    Deliverable Specifications

    The product documentation had to include a feature list and a structural diagram. The recreation had to match the original page in layout, text, and interaction behavior. The enhanced version could add new functionality within a reasonable scope, but every new feature had to include its rationale.

    Acceptance Criteria

    Each deliverable included verifiable requirements. For example:

    • Every entry in the feature list must correspond to an element on the page.
    • The fields in an API response must match the examples in the documentation.

    Without acceptance criteria, it is difficult for a model to determine whether the task is complete.

    Engineering Constraints

    The prompts required modular code organization, necessary comments, and compliance with accessibility (A11y) guidelines. These requirements do not take effect automatically. They must be included in the prompt and checked individually during acceptance testing.

    For reproducibility, the following information should also be recorded. Without it, results cannot be compared reliably across experiments:

    • Model name and version
    • Testing framework and version
    • Tool permissions, including whether the model can browse pages, send HTTP requests, and write files
    • Context window size and compression strategy
    • Prompt version and change history
    • Number of failed retries and timeout settings

    3. Differences Between Two Validation Strategies

    In the prompt for the second stage, the experiment informed the models about the keys they were expected to use. Their behavior then diverged noticeably into two broad patterns.

    Comparison Shallow Validation Deep Validation
    Validation scope Call the API and confirm that it returns successfully Test normal flows, invalid inputs, and boundary parameters
    Issues observed Usually not triggered Parameter overflow, abnormal display of long text, and conflicts caused by concurrent submissions
    Delivery risk More likely to fail in exception scenarios Takes longer but allows fewer defects into the deliverables
    Suitable scenarios Prototype demonstrations and low-risk functionality Features involving transactions, accounts, or user data

    These observations came from a limited number of experiments. The sample size is not sufficient to prove that any model is inherently more rigorous. Explanations involving training data or reasoning mechanisms remain hypotheses that require additional controlled experiments.

    When selecting a model, teams should test it against their own task sets rather than relying on a single demonstration.

    4. Engineering Considerations

    1. Context Management

    During long tasks, page analysis completed early in the process may be forgotten during implementation. Three practical measures can help:

    • Persist intermediate artifacts: Save the feature list, structural diagram, and API examples as files so they can be loaded again during coding.
    • Compress when the limit is near: When the context approaches its window limit, summarize completed analysis while preserving the original acceptance criteria in full.
    • Split the task: If compression still cannot maintain consistency across stages, divide the work into subtasks and execute them separately.

    2. Tool-Call Failures and Troubleshooting

    The model may need to browse the page, analyze its structure, generate documentation, write code, and validate API calls in sequence. An error at any stage can interrupt the workflow. Common situations and responses include:

    • Authentication failure, such as a 401 or 403 response: Check whether the key has expired and whether it has sufficient permissions. Stop subsequent API calls immediately after an authentication failure instead of allowing the model to retry repeatedly.
    • Failure to locate an element: Selectors may become invalid after a page redesign. Use semantic locators instead, such as locating elements by text or role.
    • Request timeout: Use exponential backoff and retry no more than three times.
    • Failure after retries: Record the logs and hand the issue over for manual handling.

    3. Code Quality Checks

    Because the generation process is often opaque, generated code requires additional review. Basic checks can be delegated to automated tools, such as using axe-core to scan for accessibility issues and ESLint to check code style.

    Human reviewers should focus on areas that automated tools cannot fully cover, including interaction logic and business rules.

    5. Implementation Checklist

    • The experimental page is authorized, sandbox keys are used, and data has been anonymized
    • Each deliverable has testable acceptance criteria
    • Boundary cases are covered, including empty input, long text, network interruption, duplicate submissions, and concurrent operations
    • Every tool call is logged, including parameters, return codes, and duration
    • The code passes accessibility scanning and style checks
    • Changes involving production environments are manually reviewed before merging

    6. Appropriate Boundaries

    This experiment indicates that, for controlled and verifiable subtasks, large models can take on parts of the development workflow. Examples include organizing feature lists, generating page scaffolding, and writing API-call code.

    However, humans must remain responsible for requirements trade-offs, security decisions, and release approval.

    The sample size was limited, so these conclusions should not be generalized to every project. When introducing AI-assisted development into a team, start with a low-risk module. Use the checklist above to record the results, and expand the scope gradually.