ronjunevaldoz/kmp-agent-skills/kmp-compose-accessibility
Claude Code and agent skill by ronjunevaldoz/kmp-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Accessibility (a11y) for Kotlin Multiplatform Compose — semantic roles and mergeDescendants, contentDescription on interactive and image elements, screen reader traversal order, minimum touch target size, Roborazzi accessibility snapshot tests, reduced-motion support, and a Compose a11y audit checklist.
Install
npx vskill@latest install ronjunevaldoz/kmp-agent-skills/kmp-compose-accessibilitySKILL.md
The same SKILL.md was published earlier as ronjunevaldoz/kmp-agent-skills/kmp-compose-accessibility.
When to Use This Skill
Use when:
- A screen must be navigable by TalkBack (Android) or VoiceOver (iOS)
- Interactive elements (buttons, links, custom composables) need meaningful labels
- Touch targets need to meet the 48×48dp minimum size requirement
- Adding accessibility snapshot tests alongside visual screenshots
- An existing screen is failing an a11y audit
Trigger keywords: accessibility, a11y, TalkBack, VoiceOver, contentDescription, semantics, screen reader, semantic role, mergeDescendants, touch target, WCAG, accessibility test, Roborazzi a11y, traversal order, live region, role = button, accessibility label, semantic tree, accessible, screen reader support, accessible app, a11y compliance, accessibility audit, accessible design, make accessible.
Freshness rule: Roborazzi a11y snapshot support (captureRoboImage with accessibilityCapture()) was added in Roborazzi 1.7. The Compose semantics { } API is stable; ExperimentalComposeUiApi attributes were promoted to stable in Compose 1.6. WCAG 2.2 is the current standard — refer to SC 1.1.1, SC 2.4.3, and SC 1.4.3 for the rules most relevant to mobile.
Recommendation First
Accessibility should be built in, not bolted on. Follow these three rules for every screen:
- Every interactive element has a
contentDescriptionorsemantics { contentDescription }label - Custom clickable composables declare
role = Role.Button(or the appropriate role) - Non-decorative images have
contentDescription; purely decorative images havecontentDescription = null
Run the Compose a11y checker and Roborazzi a11y snapshot on every screen in CI.
Content descriptions
Semantic roles on custom composables
mergeDescendants — group related elements
Traversal order (traversalIndex)
By default, TalkBack and VoiceOver traverse composables in layout order. Override when visual layout differs from logical reading order:
Minimum touch target — 48×48dp
Live regions — dynamic content announcements
State descriptions
Roborazzi accessibility snapshot
The accessibility dump snapshot shows the semantic tree overlaid on the screen — review it to spot missing labels, incorrect roles, and traversal order issues.
Compose a11y audit checklist
Run this checklist per screen before shipping:
| Check | Rule | |
|---|---|---|
Every IconButton has a non-null contentDescription | WCAG 1.1.1 | |
Every AsyncImage / Image with meaningful content has a description | WCAG 1.1.1 | |
Every custom clickable has role = Role.Button (or Link, Checkbox, etc.) | WCAG 4.1.2 | |
| Touch targets are ≥ 48×48dp | WCAG 2.5.5 | |
| Color is not the only way to convey information (e.g., errors also have a label) | WCAG 1.4.1 | |
| Focus order matches logical reading order | WCAG 2.4.3 | |
Dynamic content updates have liveRegion | WCAG 4.1.3 | |
Screen title is announced (TopAppBar title or heading = true on a Text) | WCAG 2.4.2 | |
Animations respect rememberReduceMotion() (expect/actual, kmp-compose-animation) | WCAG 2.3.3 |
This checklist is a Compose binding of WCAG, not a Compose-specific standard — every row above cites the real WCAG success criterion because the requirement itself is framework-agnostic; only the API used to satisfy it changes per platform:
| WCAG criterion | Compose | Web (ts-accessibility) | |
|---|---|---|---|
| 1.1.1 (non-text content) | contentDescription | alt, aria-label | |
| 4.1.2 (name, role, value) | Modifier.semantics { role = Role.Button } | native <button>, or role="button" | |
| 2.5.5 (target size) | 48×48dp minimum | 44×44 CSS px minimum | |
| 4.1.3 (status messages) | liveRegion | aria-live | |
| 2.3.3 (animation from interactions) | rememberReduceMotion() expect/actual over each platform's setting | prefers-reduced-motion media query |
If a project ships both a KMP/Compose app and a web frontend, the accessibility requirement is identical across both — verify against this table and ts-accessibility together rather than re-deriving the WCAG mapping twice.
Screen heading announcement
Common Anti-Patterns
- Icon without `contentDescription` —
Icon(Icons.Default.Share, contentDescription = null)
is a silent element; TalkBack reads nothing; every interactive icon must have a label
- `contentDescription` that mirrors the visible text —
Text("Save")next to a button
labeled "Save" with contentDescription = "Save" is redundant; merge with semantics(mergeDescendants = true) so the button label suffices
- Custom composable without `role` — a
Boxwith.clickable {}is announced as
"double-tap to activate" with no role; add semantics { role = Role.Button }
- Relying only on color for errors — red text without an accompanying error icon or
label fails WCAG 1.4.1; always pair color with a label or icon
- Unconstrained touch targets — icon buttons sized 24dp are too small for users with
motor impairments; always use Modifier.size(48.dp) or minimumInteractiveComponentSize()
Related Skills
kmp-roborazzi— a11y snapshot tests extend the Roborazzi setup;
captureRoboImage with CaptureType.Dump generates the semantic tree overlay
kmp-compose-animation—respectsReducedMotion()check is an a11y
requirement; link both skills when adding animations to a screen
kmp-compose-design-system— color contrast ratios must meet WCAG AA (4.5:1
for normal text, 3:1 for large text); verify in the design system token definitions
Output Style
When implementing accessibility, respond in this order:
- Audit findings — list what is missing on the target screen using the checklist
- contentDescription fixes — icons, images, interactive elements
- Role declarations — custom clickable composables
- Touch target fixes —
minimumInteractiveComponentSize()or explicitsize(48.dp) - mergeDescendants — group related row/card children
- Roborazzi a11y snapshot — one test per screen
- Checklist — confirm each row is satisfied
Changelog
| Date | Change | |
|---|---|---|
| 2026-09-27 | Reduced-motion rows pointed at LocalAccessibilityManager.isReduceMotionEnabled, which doesn't exist in Compose's common AccessibilityManager (only calculateRecommendedTimeoutMillis). Now point at kmp-compose-animation's rememberReduceMotion() expect/actual. | |
| 2026-08-24 | Added a "WCAG criterion → Compose / Web" table right after the a11y checklist — user asked to extract the accessibility guidance into generic, framework-agnostic form. The checklist already cited real WCAG criteria per row; the gap was stating explicitly that the requirement is universal and cross-referencing ts-accessibility for the web binding, not re-deriving the mapping. |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/kmp-compose-accessibility/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ronjunevaldoz/kmp-agent-skills/kmp-compose-accessibility)