Skip to content

forcedotcom/sf-skills / skills/experience-accessibility-validate

experience-accessibility-validate

Verified

Use this skill to determine whether a Lightning Web Component (LWC) is accessible and meets WCAG accessibility guidelines. TRIGGER when the user asks "is my component accessible?", "does my LWC meet accessibility guidelines?", "is this component WCAG compliant?", "find accessibility problems in this LWC", "is this LWC keyboard accessible?", "does this component work with a screen reader?", "does this component have sufficient color contrast?", "check ARIA usage in this LWC", or "WCAG 2.2 accessibility check". Also TRIGGER when the user wants to fix or improve accessibility (a11y, WCAG, ARIA) in an LWC's HTML, JS, or CSS — semantic markup, focus, keyboard nav, contrast, screen-reader labels, WCAG 2.2 SC. Produces `a11y-review.md` with WCAG-cited findings. DO NOT TRIGGER for general LWC generation (use `experience-lwc-generate`) or SLDS visual/design review not focused on accessibility (use `design-systems-slds-validate`).

FileKindSize
SKILL.mdskill md9.5 KB
references/reviewers/sc-1-1-1-non-text-content.mdmarkdown4.5 KB
references/reviewers/sc-1-3-1-i-lists.mdmarkdown3.6 KB
references/reviewers/sc-1-3-1-ii-tables.mdmarkdown3.2 KB
references/reviewers/sc-1-3-1-iii-form-labels.mdmarkdown4.5 KB
references/reviewers/sc-1-3-1-iv-regions.mdmarkdown1.7 KB
references/reviewers/sc-1-3-1-v-groups.mdmarkdown6.8 KB
references/reviewers/sc-1-3-5-identify-input.mdmarkdown5.3 KB
references/reviewers/sc-1-4-3-contrast.mdmarkdown7.6 KB
references/reviewers/sc-2-1-1-keyboard.mdmarkdown5.8 KB
references/reviewers/sc-2-4-4-link-purpose.mdmarkdown2.7 KB
references/reviewers/sc-2-4-6-headings-labels.mdmarkdown4.6 KB
references/reviewers/sc-2-5-1-pointer-gestures.mdmarkdown3.1 KB
references/reviewers/sc-2-5-2-pointer-cancellation.mdmarkdown4.1 KB
references/reviewers/sc-2-5-3-label-in-name.mdmarkdown6.5 KB
references/reviewers/sc-2-5-7-dragging-movement.mdmarkdown3.6 KB
references/reviewers/sc-3-2-1-on-focus.mdmarkdown3.7 KB
references/reviewers/sc-3-2-2-on-input.mdmarkdown5.1 KB
references/reviewers/sc-3-3-1-error-identification.mdmarkdown8.9 KB
references/reviewers/sc-3-3-2-labels-instructions.mdmarkdown3.3 KB
references/reviewers/sc-3-3-3-error-suggestion.mdmarkdown5.4 KB
references/reviewers/sc-4-1-2-i-name.mdmarkdown14.0 KB
references/reviewers/sc-4-1-2-ii-role.mdmarkdown5.7 KB
references/reviewers/sc-4-1-2-iii-value.mdmarkdown6.0 KB
references/vision/sc-1-1-1-non-text-content.mdmarkdown4.2 KB
references/vision/sc-1-4-1-use-of-color.mdmarkdown5.2 KB
references/vision/sc-1-4-10-resize-reflow.mdmarkdown1022 B
references/vision/sc-1-4-11-non-text-contrast.mdmarkdown2.8 KB
references/vision/sc-1-4-3-contrast.mdmarkdown1.5 KB

references/reviewers/sc-3-3-1-error-identification.md

View on GitHub
## SC 3.3.1 - Error Identification (Level A)

If an input error is automatically detected, the item that is in error is identified and the error is described to the user in text.

## SC: 3.3.1 - Error Identification

Analyze the given file using the following framework:

Review the provided HTML and JS files for accessibility violations per WCAG 2.2 SC 3.3.1, 'Error Identification'. Violations occur when the component contains an input field that has an error, and the error is conveyed or presented to the user with one of the approaches listed below.

Analyze all of the elements in the HTML for which can be the site of an 'input error'. For any such element, you must make sure that the errors are conveyed to the user via a textual indicator. Non-textual methods of conveying the error, such as colors or images are prohibited when not accompanied by a textual indicator.

Elements that can cause an input error, which can be either of the following:

- information that is required by the web page, but has been omitted by the user.
- information that is provided by the user but that falls outside the required data format or allowed values.

You don't need to consider the following scenarios:

- Form/field states before validation and error detection: Anything related to the state of the UI before validation occurs should be ignored.
- This includes required state, disabled state, any WAI-ARIA state.

Always cross-check the HTML and JS files to ensure that form submission or input submission logic correctly handles the error path. Make sure the error path is textually identifiable.
If a submission handling logic and error states isn't reflected textually in the HTML template, then you have a violation.

Use the following scenarios as a guide to determine if a violation has occurred. Flag all violations that occur:

- Error state is ignored after validation. This is when validation occurs but the error path is not handled
- Error is conveyed without a text-based error
- Error state is not surfaced to the end user (console.log, etc.)
- Error state is indicated textually, but the indicator is not conveyed to assistive technology
  - This occurs when `aria-live` announcements or `role="alert"` are missing
- Form state is altered or reset after an invalid input is detected. This causes the user to lose context about the field or fields that caused the error. Make sure to check the logic of the form reset and make sure that resets only happens after the form submission is successful. If a form is reset within the control flow of an error case, then this is a violation.

Situations that may seem like violations, but are not and should not be flagged, examples below:

- **The error is not the result of user input.** SC 3.3.1 applies only to _input errors_ — information the user supplied (or omitted) that the page cannot accept. It does **not** apply to background/system errors that no user action triggered: init-time capability or permission probes, CRUD/FLS access checks, network or service-availability failures, data-load errors, etc. If no user-supplied input produced the error, do not flag it under 3.3.1 (a silent background failure may be a concern under a different criterion or none, but it is out of scope here).
- An optional field (i.e., not marked with `required` or `aria-required="true"`) is left empty by the user. This is expected behavior. DO NOT flag an empty optional field as a violation.
- A form state is altered or reset, but the form submission was **successful**. This is perfectly acceptable. Make sure to check the logic of the function before flagging a violation for form state mutation
- Error message isn't descriptive or isn't announced, but individual fields convey their own state (e.g. `aria-invalid="true"` is set on all errored fields). This is acceptable and not a violation
- Errors that aren't announced, but are visually and programmatically tied to a field (e.g. message is positioned beneath the field and use `aria-describedby`). This is acceptable.

- DO NOT flag for lightning base components if there is no form field validation or eror handling. They have built-in, accessible error handling and field validation that complies with WCAG standards.
  For conditional templates, also check the contents for the behavior you're looking for. Sometimes the `<template>` content contains the correct behavior so that an error only occurs in the conditional state. In these cases, the code is compliant and **no** violation should be flagged.

When a global error message is used, check that the following are true. Flag a violation for any of the following isn't true:

- The global message describes each field that's in an error state and the user can identify the field where the error occurred.
- The global message is announced via assistive technology when the error occurs. Assistive technology announcements can include, `aria-live` or `role="alert"` attributes on the error element or its parent.
  **Note: Generic error messages like "Please correct" are violations unless the field with the error explicitly marks the invalid state. Review all generic errors to ensure that they meet this criteria, or flag this as a violation.**

If the global error message does not satisfy these criteria, then you must flag as a violation

Be sure to ALWAYS track these error messages down to the source of the literal message content. This may cross HTML in to JS, and even across multiple JS references. It's important that you ensure that the error being surfaced is descriptive enough for the situation it's used in.

In order to fix an identified violation, use the following sufficient techniques for the two relevant scenarios in order to decide upon an appropriate fix:

- Providing text descriptions to identify required fields that were not completed:
- Two approaches exist:
  - Client-side: Show alert dialog identifying missing fields
  - Server-side: Re-display form with text descriptions for missing fields
- Identifying a required field with the `aria-required` property:
  - The objective of this technique is to provide programmatic indication that a form field (which shown through presentation to be required) is mandatory for successful submission of a form.
  - The WAI-ARIA `aria-required` property indicates that user input is required before submission. It can take values true or false. E.g., if a user must fill in a field, then `aria-required="true"`.
- Using `aria-invalid` to indicate an error field:
  - It's preferable to associate error messages with the failed field, but it may not always be feasible, so authors may programmatically set `aria-invalid` to 'true' on fields that have failed validation. This is interpretable mainly by assistive technologies (like screen readers / screen magnifiers) employed by users who are vision impaired.
- Using ARIA `role=alert` or live regions to identify errors:
  - The purpose of this technique is to notify Assistive Technologies (AT) when an input error occurs. The `aria-live` or `role="alert"` (which are interchangeable) attribute makes it possible for an AT (such as a screen reader) to be notified when error messages are injected into a Live Region container. The content within the `aria-live` region is automatically read by the AT, without the AT having to focus on the place where the text is displayed.
- Providing a text description when the user provides information that is not in the list of allowed values:
  - When users enter input that is validated, and errors are detected, the nature of the error needs to be described to the user in manner they can access. This can be with an alert dialog that describes fields with errors, or it could also be, when validation is done by the server, to return the form (with form state preserved) and a text description that indicates that there was a validation problem, describes the problem, and provides ways to locate the problematic field(s).

It is important to find all violations of this rule in order for all users of the component to be able to properly interact with it, and be notified of any issues in detail such that they can take the required actions to resolve them.

Rules to follow:

- Find all violations of SC 3.3.1 in the provided HTML and JS files.
  - For each issue found, provide a separate, detailed report.
- Keep issues concise, avoid duplicated issues or unnecessary or non-applicable problems.
- Assume that any imported functionality works as expected and was already analyzed.
- Components do not supplement or provide global functionalities.
- Associate error text with the actual focusable control. An `aria-describedby` or `aria-errormessage` on a non-focusable wrapper does not reach a composite editor's internal control unless the wrapper forwards it. A disabled control cannot receive focus, so attaching the only error explanation to it also cannot make that explanation available on focus. Use an adjacent visible message, a live region where appropriate, or the control's supported error-association API.
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall