Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add mae616/design-skills --skill "accessibility-engineer"
Install specific skill from multi-skill repository
# Description
Apply semantic HTML/JSX and WAI-ARIA correctly and minimally. Apply when implementing any UI, especially forms, interactive components, or when accessibility is mentioned.
# SKILL.md
name: accessibility-engineer
description: Apply semantic HTML/JSX and WAI-ARIA correctly and minimally. Apply when implementing any UI, especially forms, interactive components, or when accessibility is mentioned.
user-invocable: false
metadata:
tags: accessibility, a11y, aria, semantic-html, screen-reader, keyboard
Accessibility Engineer Skill
When to Apply
Apply this skill when the request involves:
- Accessibility, a11y, WAI-ARIA, screen reader support, semantic HTML, keyboard navigation, focus management
- アクセシビリティ対応、WAI-ARIA、スクリーンリーダー対応、セマンティックHTML、キーボード操作、フォーカス管理
- Any UI implementation (should be applied alongside other skills)
Core Principles (Most Important)
- Native elements first. Solve with proper HTML elements (
button,a,label,input, etc.) before reaching for ARIA. - ARIA is minimal. Don't add
role/aria-*to make things "seem" accessible. Only add when there's a real requirement. - Operable = Communicable. Not just visually—assistive tech must receive state, name, and purpose. This is the Definition of Done.
- Keyboard is the baseline. Mouse-only UI is incomplete. Design focus movement and operations first.
Implementation Rules
1) Semantic Structure
- Maintain heading order (
h1→h2→ ...). Don't skip levels for styling. - Create landmarks for main regions (
header,nav,main,footer,asideif needed). - Use
ul/ol/lifor lists,dl/dt/ddfor definitions—notdivsubstitutes.
2) Accessible Names
- Buttons, links, inputs need "names" (labels read by screen readers).
- Priority: Visible text
- Fallback:
aria-label(when visible text isn't possible) - Composition:
aria-labelledby(referencing existing elements) - Icon-only buttons/links MUST have names (e.g., "Search", "Close").
3) Forms (Required)
- Associate
labelwithinput(for/id). Never use placeholder as the only label. - Communicate required/optional, errors, hints machine-readably (e.g.,
aria-describedbyfor helper text). - Errors must explain: what's wrong, why, and how to fix.
4) States and Announcements (Dynamic UI)
- Use native
disabledattribute first (button disabled, etc.). - For toggles, use
aria-pressed/aria-expandedonly when native elements aren't sufficient. - Use
aria-livefor async completion/failure announcements—but don't overuse.
5) Keyboard Operation and Focus
- Design DOM order so tab sequence is logical. Don't force reorder with
tabindex. tabindex="0": minimal use to make something focusable.tabindex="-1": only for programmatic focus movement.- Always preserve visible focus (
focus-visible). Never hide it. - Dialogs/modals: define focus destination on open and return destination on close. Implement focus trap if needed.
6) Images and Media
- Use
altbased on purpose (decorative images get emptyalt=""). - For video/audio: confirm controls (play/stop) and alternatives (captions/transcript). Ask if unclear.
Anti-Patterns (Never Do This)
divwithonClickacting as button (breaks keyboard/role).- Using
role="button"as a workaround (use nativebutton). - Adding
aria-labeleverywhere (causes duplicate announcements when visible label exists). - Removing focus ring (invisible focus = inoperable).
Clarification Questions (Don't Assume)
- Must this UI be completable with keyboard only? (If yes, enumerate operation steps and agree.)
- For modal/drawer: what gets focus on open? What gets focus on close?
- When are errors announced? Immediately? After submit?
- Does video/audio need captions or text alternatives?
Output Format (For Implementation)
- Semantic structure (landmarks, headings, lists)
- Keyboard operation (Tab order, Enter, Space, Escape)
- ARIA usage (only where needed, with justification)
- States (disabled/loading/error) and announcements (aria-live if needed)
- Accessibility checklist self-assessment (OK / needs work)
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.