forcedotcom/sf-skills / skills/experience-accessibility-validate
experience-accessibility-validate
VerifiedUse 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`).
references/reviewers/sc-2-5-2-pointer-cancellation.md
View on GitHub## SC 2.5.2 - Pointer Cancellation (Level A)
For functionality that can be operated using a single pointer, at least one of the following is true: no down-event is used to execute any part of the function; abort or undo is available; the up-event reverses any outcome of the preceding down-event; or completing the function on the down-event is essential.
## SC: 2.5.2 - Pointer Cancellation
Analyze the given file using the following framework:
Review the provided JS and HTML for accessibility violations per WCAG 2.2 SC 2.5.2, 'Pointer Cancellation'. Violations occur when a single pointer operable HTML element does not satisfy one of the conditions set forth by 2.5.2, defined below.
You should analyze all elements in the HTML which are operable via a 'single pointer'- this is defined as "pointer input that operates with one point of contact with the screen, including single taps and clicks, double-taps and clicks, long presses, and path-based gestures" (w3.org).
For each of these elements, check if any of the following conditions of SC 2.5.2 are true:
1. The down event is not used to operate the function. This is the single most preferable behavior for this rule whenever is possible.
2. There is a method made available to cancel or abort the action.
3. The up-event reverses any action taken by the down event.
4. The down event is strictly required and ESSENTIAL to the functionality of the code.
If any of the conditions are satisfied, then you can ignore the element and move on, as it complies with the Success Criterion. If none of the conditions are satisfied, YOU MUST flag this as a violation.
Note that typically a violation occurs when an element, as defined above, operates on a down event and does not have an associated cancellation technique.
In order to fix a violation for a given element, you must examine the given component code and apply the most logical fix available such that the element satisfies one of the following conditions of SC 2.5.2:
1. The down event is not used to operate the function. This is the single most preferable behavior for this rule whenever is possible.
2. There is a method made available to cancel or abort the action.
3. The up-event reverses any action taken by the down event.
4. The down event is strictly required and ESSENTIAL to the functionality of the code.
Note that the first satisfiable condition listed is the most commonly preferable technique to comply with SC 2.5.2.
Provide your review in a clear, concise manner, listing each issue separately with its corresponding explanation and correction.
Rules to follow:
- Find all violations of SC 2.5.2 'Pointer Cancellation' in the provided HTML and JS.
- Components do not inherently provide or supplement global functionalities. They are designed to operate within their defined scope, focusing on reusable UI components rather than global behaviors.
- `onclick`, `onmouseup`, `onpointerup`, and `onkeyup` handlers fire on the **up-event**, which already satisfies condition 1 (the down-event is not used to operate the function). Do NOT flag an element for 2.5.2 merely because it is interactive — only flag handlers bound to a **down-event** (`onpointerdown`, `onmousedown`, `ontouchstart`) that lack a cancel, abort, or reverse mechanism. An `<a>`, `<button>`, `<li>`, or `<div>` activated via `onclick` is compliant; move on.
- An anchor's `href` value is not within the scope of 2.5.2 — it does not determine the down/up-event behavior. In particular, `href="#"` paired with a click handler that calls `event.preventDefault()` performs no navigation or scroll, so it is not a pointer-cancellation issue. This is the canonical SLDS interactive-link pattern (e.g. `slds-path__link` with `role="option"`). Do not flag it. If you do recommend changing an anchor, never suggest `href="javascript:void(0)"` (see general rules).
- 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.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |