Don't Fix Accessibility After the Fact: Constraints to Put in Your First AI Website Prompt
Disclosure: I am on the team behind VibUI, a paid prompt library for websites. You will see one mention of it in the last tool section. The accessibility rules here do not depend on it. Short answer: if you want an AI-built page to pass a basic accessibility check, put the accessibility rules in th

Disclosure: I am on the team behind VibUI, a paid prompt library for websites. You will see one mention of it in the last tool section. The accessibility rules here do not depend on it.
Short answer: if you want an AI-built page to pass a basic accessibility check, put the accessibility rules in the first prompt, not in a cleanup message after the layout is finished. Name the contrast target, heading order, form-label behaviour, keyboard focus, image alt rules, landmarks and a prefers-reduced-motion fallback up front. Then run a keyboard pass and an automated scan (Lighthouse or axe) before you call the page done. This applies the same way in v0, Lovable, Bolt, Cursor, Windsurf, Claude, ChatGPT, Gemini, Replit, GitHub Copilot, Framer AI, Google Stitch, Readdy, Aura.build and OpenAI Codex.
Most models will happily add alt attributes and a focus ring if you ask later. They will also leave in place the decisions that caused the failures:
A cleanup prompt rarely rewrites the document structure. It patches symptoms. If the first prompt already forbids those patterns, the first draft is much closer to usable.
Paste a block like this into every new-page request. Adjust the contrast figure if your legal or design team has a stricter target.
Accessibility constraints (do not skip): - One h1 on the page. Headings follow a logical order (h2 then h3). Do not skip levels for visual size. - Colour contrast: body text and buttons at least 4.5:1 against their background; large headings at least 3:1.
Check both the default theme and any dark variant. - Every form control has a visible <label> bound with for/id. Do not use placeholder as the only label. Errors are text, not colour alone, and are linked to the field with aria-describedby. - All interactive elements are real buttons or links, reachable by keyboard, with a visible focus state that is not outline: none unless a clearer replacement is provided. - Images: informative images have specific alt text from [ALT] placeholders I provide.
Decorative images use alt="". Do not invent descriptions of people or places. - Landmarks: a <header>, <main> and <footer>, plus a "Skip to main content" link as the first focusable element. - Target size: interactive elements at least 24px by 24px, with adequate spacing. - Motion: respect prefers-reduced-motion and provide a static fallback. No autoplaying video with sound.
If a carousel exists, it does not auto-advance, and previous/next controls are keyboard accessible. - Language: set lang on the html element. Link text describes the destination; no "click here". Enter fullscreen mode Exit fullscreen mode The [ALT] placeholders matter.
If you let the model write alt text, it will invent a scene that may not match the photo you later drop in.
Here is a compact example for a product marketing page. Swap the product details; keep the constraints.
Work through this table after the first draft. One failure per follow-up message.
Automated tools catch a lot. They will not catch a misleading heading, a vague link ("learn more" repeated six times), or alt text that does not match the image. Those need a human pass.
Yes, with a small difference in where the result lands.
None of these tools is "the accessible one." The prompt and the review are what change the outcome.
If a fix would change the brand colours, take it to the design tokens, not to a one-off override on a single button. Otherwise the next generated section will bring the old contrast back.
You can keep the block above in a snippet file and paste it yourself, which is what I do for one-off pages. If you generate a lot of pages and want starting points for common sections (forms, pricing, FAQs, headers) that you can adapt, that is what VibUI is for: 2,852 website prompt templates (775 full pages, 1,100 sections, 817 components and 160 animated backgrounds), and roughly 1,000 of those entries ship with source code. You pay once, and the plan does not renew by itself: $48 quarterly, $99 yearly, or $179 for lifetime access. Sixty samples are visible without paying, and a free login can copy 2 prompts, which is enough to judge the style. The accessibility review above is still required; a library does not replace a keyboard pass.
Is WCAG 2.2 AA a realistic target for an AI-generated marketing page? For a simple marketing or docs page, yes, if the constraints are in the first prompt and you review the result. Complex widgets (date pickers, custom selects, live filters) still need extra care and often a specialist review.
Should I ask the model to "make it WCAG compliant"? That phrase is too vague. Models will claim compliance without checking contrast or keyboard behaviour. Spell out the rules, then measure.
Do I need a dark theme for accessibility? No. You need sufficient contrast in the theme you actually ship. If you do offer dark mode, test both. A light theme that passes can fail when inverted carelessly.
Will this slow the build down? The first prompt is a few extra lines. The keyboard and Lighthouse pass is about ten minutes. Reworking a finished visual design to fix structure usually takes longer.