I had one of those moments last week where I realized I'd been doing something wrong for months, and the worst part wasn't the mistake, it was how obvious the solution was once I saw it. I was reviewing a landing page my team built using Claude with a detailed layout prompt. The site looked sharp, the copy landed, the colors popped. Then I ran it through axe DevTools out of habit and got slapped with eleven failures. Heading levels jumping from h1 to h4. Buttons that were divs. Form inputs with zero labels. The whole thing was technically broken, and I'd been about to ship it.
Here's what killed me: I already knew how to fix these things. I've been writing accessible HTML for years. But somewhere in the velocity of "just get the AI to build it fast," I'd created this mental category of "we'll fix accessibility in post." Except we weren't fixing it in post, because asking Claude to retrofit accessibility almost never works the way you'd expect. It patches symptoms instead of preventing problems. The real fix had to happen upstream, in the initial prompt itself.
Why "Fix It Later" Is a Trap With AI
This is the core insight that stuck with me: AI models don't fundamentally restructure documents when you ask them to add accessibility after the fact. If your first prompt doesn't forbid heading levels that skip, the model will generate h1 → h4 jumps because visually that looks "right" at different scales. Later, if you ask it to fix heading levels, it'll add an h2 and h3 somewhere, but the underlying document structure stays broken. Same thing happens with form labels, interactive elements, contrast ratios.
The model optimizes for what you ask for initially, usually visual appearance and feature delivery. Everything else gets treated as secondary. That means accessibility needs to be a first-class constraint, not a second-pass cleanup task.
The Accessibility Checklist I'm Using Now
I started maintaining a copy-paste block that goes into every new AI-generated page request. These rules are specific enough to actually constrain the model's behavior:
Semantic structure: One h1, logical heading hierarchy, no skipped levels, real button/link elements (not divs with click handlers), proper landmark elements (header, main, footer).
Color and contrast: 4.5:1 for body text and buttons, 3:1 for large headings, tested in both light and dark modes. This gets checked first.
Forms: Every input gets a visible label bound with for/id. Errors are text, never color-only. I use aria-describedby to link error messages to fields.
Keyboard and focus: Tab order works. Focus states are visible and not removed with outline: none. Interactive elements are at least 24×24px with proper spacing.
Images and motion: Alt text is explicit via placeholders, never invented by the model. Animations respect prefers-reduced-motion. No autoplaying video with sound.
Language: The lang attribute is set on the html element. Link text describes where it goes.
This sounds like a lot, but pasting it into the initial prompt takes 30 seconds and saves hours of debugging and rework.
My Take
I'm genuinely impressed by how well models like Claude and ChatGPT handle these constraints when they're baked into the system prompt. It's not like they suddenly become accessibility experts, they're just following instructions. But those instructions have to be there from the start, written clearly enough that the model understands what "one h1" or "no skipped heading levels" means in practice.
What I still wrestle with: how much of this is about the model's limitations versus our own expectations? We've gotten comfortable thinking "AI will figure it out." But accessibility isn't something that emerges from better prompting techniques or smarter models. It's a set of intentional design choices. The model is just a tool that can enforce those choices if we tell it to.
I'd also add one more step to my workflow: after the first draft, I always do a manual keyboard pass and run Lighthouse. The automated tools catch most of it, but nothing beats actually tabbing through a page and seeing if the experience makes sense.
What I'm Doing Differently Now
Every AI page request now starts with that accessibility block. No exceptions. And I'm treating it like any other technical constraint, name the file explicitly, keep the scope tight, one fix per follow-up message if something breaks. The model responds better to that structure anyway.
The question I keep asking myself: why was this my default state to begin with? Why did I assume accessibility was something to handle in post? I think it's because we've normalized treating AI-generated code as "first draft material," which it is, but that doesn't mean it gets a free pass on basic quality standards.
What about you? Have you been shipping AI-generated sites without running them through accessibility checks? Or have you found different constraints that work better than the ones I'm using?
Source: This post was inspired by "Don't Fix Accessibility After the Fact: Constraints to Put in Your First AI Website Prompt" by Dev.to. Read the original article