The a11y overlay lights up. Someone screenshots the red outlines, drops the PNG into chat, and asks the agent to “fix accessibility.” The model apologizes, rewrites a random div into a button, and misses the actual label association three lines down.
Screenshots are great for humans scanning a page. They’re a lossy encoding for agents. What the model needs is the structured report: rule id, file or selector, message, severity.
I’ve stopped pasting red-outline photography as the primary repro. I paste lint / axe JSON (or a trimmed slice of it) and point at the rule I care about.
Two different JSON shapes (don’t mix them up)
ESLint + eslint-plugin-jsx-a11y is a static pass over JSX/TSX. Run something like eslint -f json path/to/file.tsx and you get an array of file results with messages[]: ruleId, line, column, message, severity. That JSON points at source.
axe-core (Storybook a11y, Playwright @axe-core/playwright, browser extensions) is a runtime pass over the rendered DOM. You get violations[] with id, impact, help, nodes[].target selectors, and HTML snippets. That JSON points at the live tree.
Both beat a screenshot. They are not interchangeable:
- jsx-a11y won’t see contrast on a CSS variable resolved at runtime
- axe won’t tell you the JSX line that forgot
htmlForunless you map selector → source yourself
Use the JSON that matches how you found the bug. If you have both, paste both — labeled.
What to paste (and what to trim)
Agents drown in 200 KB of noise. Trim to the failure you want fixed:
{
"source": "eslint-json",
"filePath": "src/features/billing/InvoiceForm.tsx",
"messages": [
{
"ruleId": "jsx-a11y/label-has-associated-control",
"severity": 2,
"line": 84,
"column": 8,
"message": "A form label must be associated with a control."
}
]
}
Or for axe:
{
"source": "axe-core",
"violations": [
{
"id": "label",
"impact": "critical",
"help": "Form elements must have labels",
"nodes": [
{
"target": ["#invoice-form", "input[name=\"poNumber\"]"],
"html": "<input name=\"poNumber\" />"
}
]
}
]
}
Include: rule id, impact/severity, location (line or selector), short message. Exclude: giant passes[] arrays, unrelated files, decorative incomplete noise you already triaged.
Prompt shape
Fix the accessibility finding below. Do not broaden into a redesign.
Input: eslint JSON (jsx-a11y) for InvoiceForm.tsx
Constraints:
- Fix only the listed ruleId(s)
- Prefer associating the existing <label> with the control (htmlFor / id) over aria hacks
- No `eslint-disable` unless you explain why the rule is a false positive
- Keep the visual layout; this is an a11y fix PR
- Show the before/after for the affected JSX and re-run the same lint command
JSON:
Then paste the trimmed JSON.
The “no eslint-disable” line matters. Agents love silencing rules. You want the association fixed, not the linter muted.
Why screenshots fail as agent input
A PNG of red outlines:
- Loses rule ids (was it contrast, name, or focus order?)
- Loses file paths and line numbers
- Encourages visual guessing (“make the box bigger”)
- Often includes multiple findings the agent “fixes” in the wrong order
Humans still benefit from a screenshot alongside JSON when contrast or focus rings are hard to imagine. Lead with structure; attach the picture as secondary context.
Reject / send back
Reject
-
eslint-disable-next-line jsx-a11y/*as the only change - Rewriting the whole form “while we’re here”
- Fixing a different rule than the one in the pasted JSON
- Aria-label spam on elements that already have visible labels
- Claiming axe is “done” when you only ran jsx-a11y (or the reverse) without saying so
Accept
- Diff scoped to the reported locations
- Same lint / axe command green for those rule ids
- Visible label retained (not replaced by screen-reader-only text without reason)
- Honest note when a finding is
incompleteand needs human judgment (common with contrast)
Tiny habit
Next time someone drops a red-outline screenshot into the agent thread, export the ESLint JSON or axe violations for that surface, trim to the rule you care about, and paste that instead. Keep the screenshot if it helps humans — but let the JSON be the ticket the model actually works from.
Top comments (0)