hermes

Build or fix an accessible form

Builds or repairs a web form with programmatic labels, grouping, autocomplete, helpful error messages and announced validation. Use for sign-up, checkout, settings or any data-entry form.

context

Forms are where accessibility failures cost the most: a person who cannot complete sign-up or checkout leaves. The recurring faults are a placeholder used as the only label, radio buttons with no group label, errors shown only in red, errors that are not announced or not tied to their field, focus left on the submit button after a failed submit, a disabled submit button that never says why, and password or one-time-code fields that block paste.

task

Build or repair this form (framework: ; if empty, use plain HTML and minimal JavaScript):

  1. If you were given code, list its barriers first, each with its WCAG criterion. If you were given a spec, skip to building.
  2. Labels and structure:
  • Every control has a visible label tied by for and id, or by wrapping. A placeholder is never the label.
  • Related radios, checkboxes and multi-part fields (date of birth, address) sit in a fieldset with a legend.
  • The label text matches the accessible name (2.5.3).
  1. Input purpose (1.3.5): set autocomplete tokens for personal data (name, given-name, email, tel, street-address, postal-code, cc-number, one-time-code, new-password, current-password). Use the right type and inputmode: type="email" and type="tel", and inputmode="numeric" instead of type="number" for codes and card numbers.
  2. Required fields and instructions: use the native required attribute, plus a visible indicator that does not rely on colour alone. Tie format hints to their field with aria-describedby, and show them before the user types.
  3. Errors (3.3.1, 3.3.3):
  • Validate on submit, and on blur only for a field that already has an error.
  • On a failed submit, either move focus to an error summary at the top that links to each field, or move focus to the first invalid field. Pick one and use it consistently.
  • Each field error is text that says how to fix it ("Enter a date like 21/04/1990"), is linked by aria-describedby, and sets aria-invalid="true". Clear it as soon as the input becomes valid.
  • Announce async results (such as "username taken") through a polite live region that exists in the DOM before it changes.
  1. Do not disable the submit button to signal invalid input. Do not block paste in password or code fields (3.3.8). Do not ask again for information already given in the same process (3.3.7). Keep targets at least 24 by 24 CSS pixels (2.5.8).
  2. Keep the existing visual design and validation rules. Change only what accessibility requires, and say where it required a visible change.
constraints
  • Native HTML first. Add ARIA only where HTML cannot express it.
  • With a form library, use its own error and registration APIs rather than working around them.
  • Do not invent validation rules the form or spec did not have. List any you think are missing in one line each.
  • Read the relevant code before making a claim about it. Do not guess what a file, function or config contains.
  • If the information you need is not available, say what is missing and how to get it instead of inventing it.
output format

Issues

| # | Problem | WCAG SC | Field or line | Fix | Write "Built from spec" instead when no code was given.

Code

The complete fixed or new form.

Validation behaviour

Numbered: when validation runs, where focus goes, and what is announced.

Test checklist

Keyboard-only and screen-reader checks for filling, failing, fixing and submitting the form.

1 required value still a placeholder; the assistant will ask for it.

details

kind
Prompt: a task you run by name to get one finished thing back
domain
Software engineering
category
Accessibility
level
Intermediate
made for
Frontend engineer, Full-stack engineer
needs
repo-read, file-write
risk
edits-files
version
v1.0.0 · incubating
reviewed
2026-10-02
works in
Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md

Edit on GitHubReport a problem

use in

Hodios CLI
npx @hermes-hq/hodios install fix-form-accessibility --target claude-code
Agent Skills
npx skills add hermes-hq/hodios-dist --skill fix-form-accessibility -a claude-code
Add the Hodios marketplace (once)
claude plugin marketplace add hermes-hq/hodios-dist
Install the software-engineering plugin
claude plugin install hodios-software-engineering@hodios

The plugin brings every entry in this domain at once.

pairs well with

All of Accessibility
PersonaAccessibility

Accessibility specialist

Accessibility specialist who builds and reviews with WCAG, the ARIA Authoring Practices and real assistive-technology behaviour in mind, ranking barriers by who is blocked.

accessibility-specialist
PromptAccessibility

Audit web accessibility against WCAG 2.2

Audits markup or components against WCAG 2.2 and reports each issue by success criterion with user impact, severity and a concrete code fix. Use before a release or a compliance review.

audit-web-accessibility
PromptAccessibility

Audit a mobile screen for accessibility

Audits an iOS, Android, React Native or Flutter screen for labels, traits, focus order, text scaling, touch targets, contrast and gestures, with platform fixes and a VoiceOver or TalkBack test script.

audit-mobile-accessibility
PromptAccessibility

Build an accessible ARIA widget

Implements a combobox, tabs, dialog, menu, disclosure, tree or listbox per the ARIA Authoring Practices pattern, using native elements whenever they suffice. Use for custom interactive widgets.

build-aria-widget
PromptAccessibility

Fix keyboard navigation in a component

Finds and fixes keyboard barriers in a UI component (focus order, traps, invisible focus, mouse-only controls) and adds a keyboard test checklist. Use when a widget fails without a mouse.

fix-keyboard-navigation
PromptAccessibility

Review colour contrast and fix the palette

Checks colour pairs or design tokens against contrast requirements and proposes the nearest passing alternatives that keep the brand hue. Use when defining or auditing a palette or theme.

review-color-contrast