LLM-Based Page Generation: Benchmark Results and Troubleshooting Guide
This article reports a hands-on test of using an AI coding tool to generate a multi-page HTML site from a long Markdown document and a few static images. It breaks the workflow into five verifiable stages, shows where the test failed (blank pages, broken layouts, incomplete fixes), and explains why reporting "done" is not the same as being usable. You will find a reusable benchmark method, prompt and constraint design tips, stability practices for long-running tasks, and pseudocode for automated render and visual-regression checks. The key takeaway: treat scripted acceptance checks plus manual spot checks as the delivery standard, not the model's completion claim.
1. Background: Why “It Generated” Does Not Mean “It Works”
Putting a complete long-form document (referred to as script.md in the example) and a few static images into a new project directory, then asking an AI coding tool to generate multi-page HTML, is one of the most common scenarios for evaluating code generation today. It tests four things at once: parsing the source material, planning the project structure, controlling the style system, and most importantly, the ability to self-repair across multiple rounds.
The test showed a typical pattern. The tool loaded the skill extension, scanned the files in the directory, and correctly identified the intent to generate pages. After more than six minutes, it reported completion in the first round, but only the first page rendered correctly while the rest were blank. After a follow-up prompt, the second round took about fifteen minutes; the pages displayed, but the styling was generally broken. When three pages with obvious misalignment were pointed out via screenshots, the tool stalled midway, resumed after an interruption and restart, and reported the fix complete after roughly fourteen more minutes, yet components were still shifted as a whole and content was still cut off. The final round lasted twenty-four minutes, the problems remained, and pages that had not been named were never proactively checked.
This is not a single-point bug but a systemic risk in long-chain generation tasks. The following sections break it into measurable and improvable stages.
2. Breaking a Generation Task into Five Verifiable Stages
- Material parsing: whether heading levels, paragraphs, lists, and image references are fully extracted into a structured intermediate artifact.
- Structure planning: whether the number of pages, the content boundary of each page, and the navigation and order are reasonable.
- Style system: whether design tokens (colors, spacing, font sizes, grid) are defined first and then reused across pages, instead of writing a separate set for each page.
- Render validation: whether automated checks for “opens correctly, no blank pages, no overflow” run before submission.
- Regression repair: whether a problem pointed out by the user is generalized into a full scan for similar issues.
Most failures concentrate in stages four and five: the lack of a validation loop creates a huge gap between “reported complete” and “actually usable.”
3. A Reusable Benchmark Method (Recommended to Standardize)
Reusing the same task for side-by-side comparison is the lowest-cost, highest-signal approach. Fixed variables include the same script.md, the same image, the same skill extension and prompts, and the same directory structure. Recorded metrics include first-round time, total time, number of rounds, number of blank pages, number of pages with style anomalies, fix rate for pages the user pointed out, and proactive discovery rate for pages the user did not point out.
It is recommended to make acceptance a scripted check, for example:
# Pseudocode: basic per-page health check after buildfor f in dist/*.html; do# 1) Can it be parsed, and does a root node exist?# 2) Do key containers have content (prevent blank pages)?# 3) Is there horizontal overflow (prevent misalignment)?check_render "$f" || echo "FAIL: $f"done
Once “blank page,” “overflow,” and “content truncation” become automatically determinable signals, the model’s self-repair has a clear target instead of relying on repeated human screenshots.
4. Prompt and Constraint Design: Define Boundaries Before Code
- Define deliverables clearly: page list, per-page content mapping table, shared style file, and asset directory conventions.
- Define design tokens clearly: first output a variable table (spacing 4/8/12/16, primary and neutral colors, heading and body font-size scale), and allow all subsequent pages to reference variables only.
- Define prohibitions clearly: no inline magic numbers, no copy-pasting styles page by page, and no declaring completion before verification.
- Define a self-check list clearly: before submission, confirm page by page that there is content, no horizontal scrolling, images have alternative text, and anchors are clickable.
- Define a repair strategy clearly: when the user points out a problem on a page, first output a “scan result for similar issues,” then fix page by page.
5. Stability Engineering for Long-Chain Tasks
Long tasks stalling is not occasional. Engineering can mitigate it in three ways: first, split a large task into small steps, each producing a checkable intermediate artifact (structure list, token table, single-page draft); second, introduce timeouts and resumable checkpoints to avoid one-off long reasoning; third, keep rollback-able version snapshots so every fix can be compared and undone. Combined with general cloud capabilities such as logging services and monitoring alerts, “time spent, failed rounds, and artifact differences” can be accumulated as trend metrics rather than one-time impressions.
6. Visual Regression: Turning “Looks Wrong” into Something Measurable
Style problems (overall shift, incomplete display) are essentially broken layout constraints. Feasible approaches include taking multi-size snapshot comparisons at a fixed viewport width; asserting that key containers have non-zero width and height; detecting text overflow; and validating the number of grid columns. Example:
// Pseudocode: health assertions for key containersconst boxes = await page.$eval('[data-slot]', els =>els.map(e => ({ w: e.offsetWidth, h: e.offsetHeight })));const bad = boxes.filter(b => b.w === 0 || b.h === 0);if (bad.length) throw new Error('Empty container found, suspected blank page or truncation');
7. Retrospective and Practical Recommendations
The test exposed three core weaknesses: missing validation, non-generalized repair, and long tasks that are easy to interrupt. The corresponding improvements are: script the acceptance checks, templatize the repair workflow, and split tasks into smaller pieces with resume support. The practical advice for developers is: do not use “the model says it is done” as the delivery standard; use “all automated checks green plus manual spot checks passed.” Require at least one full scan for similar issues for the same problem, and treat design tokens and the page mapping table as mandatory prerequisites. Only then can AI coding tools truly move from “usable in a demo” to “usable in engineering.”
