|
| 1 | +--- |
| 2 | +name: ui5-best-practices-accessibility |
| 3 | +description: > |
| 4 | + This skill should be used when the user asks to audit, fix, check, review, or |
| 5 | + improve accessibility, a11y, ARIA, landmarks, labeling, heading levels, |
| 6 | + keyboard shortcuts, screen reader support, invisible messaging, reading order, |
| 7 | + or touch target size in UI5 application files (views, fragments, controllers). |
| 8 | + Also use when the user creates a new UI5 view, fragment, or controller and |
| 9 | + wants it to be accessible, or asks whether a specific control (Dialog, Table, |
| 10 | + Panel, etc.) meets accessibility requirements. |
| 11 | +allowed-tools: Read Bash AskUserQuestion |
| 12 | +--- |
| 13 | + |
| 14 | +# Accessibility Review |
| 15 | + |
| 16 | +Accessibility in UI5 is incorporated in two levels: framework and application. |
| 17 | +This review supports what application developers must still provide explicitly |
| 18 | +to improve the accessibility of their application. |
| 19 | + |
| 20 | +## Step 1 — Find the files |
| 21 | + |
| 22 | +If `$ARGUMENTS` lists specific files, review only those. |
| 23 | + |
| 24 | +Otherwise, discover all app source files automatically: |
| 25 | + |
| 26 | +```! |
| 27 | +find . \( -name "*.view.xml" -o -name "*.fragment.xml" -o -name "*.controller.js" \) \ |
| 28 | + -not -path "*/node_modules/*" \ |
| 29 | + -not -path "*/dist/*" \ |
| 30 | + -not -path "*/test/*" \ |
| 31 | + -not -path "*/resources/*" \ |
| 32 | + | sort |
| 33 | +``` |
| 34 | + |
| 35 | +If more than 15 files are found, use `AskUserQuestion` to let the user choose: |
| 36 | +- Review everything (may take a moment) |
| 37 | +- Focus on a specific folder or area |
| 38 | + |
| 39 | +Read each file in scope. |
| 40 | + |
| 41 | +## Step 2 — Review |
| 42 | + |
| 43 | +Check the code against the eight topics below. For each topic where you find a gap, |
| 44 | +**read the corresponding topic file before writing the fix** — it contains the correct |
| 45 | +API pattern and wrong/correct examples. |
| 46 | + |
| 47 | +| # | Topic | What to detect | Topic file | |
| 48 | +|---|-------|---------------|------------| |
| 49 | +| 1 | Landmarks | `DynamicPage`, `Page`, `Panel`, `ObjectPage`, `FlexibleColumnLayout` missing `landmarkInfo` or `accessibleRole`; landmark role set without its corresponding label (e.g. `rootRole` without `rootLabel`) | `${CLAUDE_SKILL_DIR}/references/landmark.md` | |
| 50 | +| 2 | Labeling | Inputs without `<Label labelFor>` (except inside `SimpleForm`); Tables without `ariaLabelledBy`; icon-only `Button` without `tooltip`; standalone `Icon` without `alt` and not marked `decorative`; `Image` with `decorative=false` and no `alt`; `Dialog` with `showHeader:false` and no `ariaLabelledBy` | `${CLAUDE_SKILL_DIR}/references/labeling.md` | |
| 51 | +| 3 | Heading levels | `<Title>` without explicit `level`; heading level jumps (e.g. H1 → H3) within a view | `${CLAUDE_SKILL_DIR}/references/heading.md` | |
| 52 | +| 4 | Focus handling | `Dialog` or `Popover` without `initialFocus` when a specific starting element is required; larger composite areas that act as distinct logical regions and need a `sap-ui-fastnavgroup` `CustomData` entry; `tabindex` values greater than 0 in rendered HTML | `${CLAUDE_SKILL_DIR}/references/keyboard.md` | |
| 53 | +| 5 | Keyboard shortcuts | Action buttons (save, delete, etc.) using plain `press=".onX"` that should support keyboard shortcuts but have no `CommandExecution` | `${CLAUDE_SKILL_DIR}/references/shortcut.md` | |
| 54 | +| 6 | Invisible messaging | Dynamic state changes (save confirmations, errors, filter results) that are visible-only with no `InvisibleMessage.announce()` call in the handler | `${CLAUDE_SKILL_DIR}/references/invisible-message.md` | |
| 55 | +| 7 | Reading order | Controls visually reordered via CSS/layout but out of sequence in XML; `ariaDescribedBy` pointing to IDs that appear later in the DOM | `${CLAUDE_SKILL_DIR}/references/reading-order.md` | |
| 56 | +| 8 | Target size | `Link`, `ObjectIdentifier`, `ObjectStatus`, `ObjectNumber`, `ObjectMarker`, `ObjectAttribute` inside an interactive container without `reactiveAreaMode`; or in other dense layout without spacing | `${CLAUDE_SKILL_DIR}/references/target-size.md` | |
| 57 | + |
| 58 | +## Step 3 — Report |
| 59 | + |
| 60 | +For each gap found: |
| 61 | + |
| 62 | +**Issue**: one line — names the control and the missing property/association |
| 63 | +**Impact**: `critical` (blocks AT users entirely) | `serious` (significant barrier) | `moderate` (partial barrier) | `minor` (best practice, low direct impact) |
| 64 | +**Why**: one sentence on user impact |
| 65 | +**Fix**: minimal corrected XML or JS snippet (only the changed part) |
| 66 | + |
| 67 | +Group findings by topic, critical/serious first within each group. End with a summary count by impact level. |
| 68 | +If no gaps are found, say so. |
0 commit comments