Render-and-fix loop with small edits
The agent writes a source file, and a renderer checks the page in a browser and lists every failure with a ✗. The agent then fixes those failures with small edits and renders again. It is told never to rewrite the whole page and never to write its own screenshot scripts. A fixed checker plus small edits keeps fixes cheap and stops the agent from drifting off on its own checks.