compose-accessibility

compose-accessibility is a cursor rule for Cursor from baijum/ukulele-companion. It costs 0 tokens per session (801 once invoked), scanned A, original, MIT.

A set of rules for making Jetpack Compose Android interfaces usable with TalkBack, Android's screen reader.

In plain words
What is it for?
Use it when building or reviewing Compose screens with icons, headings, Canvas drawings, live updates, focus handling, dialogs, and other accessibility-sensitive elements.
Why use it?
It helps prevent interface changes from hiding labels, headings, chart information, focus behavior, or state changes from people using assistive technology.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/baijum/ukulele-companion/compose-accessibility
Clone the repo
git clone --depth 1 https://github.com/baijum/ukulele-companion

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for compose-accessibility

README.md
[![agentmods](https://agentmods.dev/badge/rules/baijum/ukulele-companion/compose-accessibility.svg)](https://agentmods.dev/rules/baijum/ukulele-companion/compose-accessibility)
Your own site
<a href="https://agentmods.dev/rules/baijum/ukulele-companion/compose-accessibility"><img src="https://agentmods.dev/badge/rules/baijum/ukulele-companion/compose-accessibility.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 801 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00801
Opus 5 $0.00000 $0.00400
Sonnet 5 $0.00000 $0.00160
Haiku 4.5 $0.00000 $0.00080

Measured 5d ago against content hash d023255202ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

compose-accessibility scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/compose-accessibility.mdc · 89 lines

How it starts

The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Compose Accessibility Rules

A core user base relies on TalkBack. Every UI change must preserve and improve accessibility. Breaking accessibility is treated as seriously as breaking functionality.

Rule 1: Icons need contentDescription

Interactive/informative icons MUST have a descriptive contentDescription. Decorative-only icons (inside a labeled button where text suffices) may use null. Use conditional descriptions for toggle states.

Icon(
    imageVector = if (isPlaying) Icons.Filled.Stop else Icons.Filled.PlayArrow,
    contentDescription = if (isPlaying) "Stop" else "Play"
)

Rule 2: Headings and navigation semantics

Screen titles and section headers MUST have Modifier.semantics { heading() }. Navigation containers should use Modifier.semantics { role = Role.Navigation }.

Text("Tuner", style = MaterialTheme.typography.titleLarge,
    modifier = Modifier.semantics { heading() })

Rule 3: Canvas needs text alternatives

Any Canvas conveying information MUST use clearAndSetSemantics with a data-driven description.

Canvas(modifier = Modifier.fillMaxWidth().height(200.dp)
    .clearAndSetSemantics { contentDescription = "Tuning meter, 5 cents sharp" }
) { /* drawing */ }

Rule 4: Dynamic content needs live regions

Use LiveRegionMode.Polite for frequent updates (pitch, cents). Use LiveRegionMode.Assertive for important state changes (in tune, correct answer, error).

Text(detectedNote, modifier = Modifier.semantics {
    liveRegion = LiveRegionMode.Polite
})

Rule 5: Interactive elements must be focusable and described

Clickable composables need a content description or visible label. Custom interactive components must include role = Role.Button. Reflect state changes in stateDescription.

Box(modifier = Modifier.clickable { onFretTap(string, fret) }.semantics {
    contentDescription = "$stringName string, fret $fretNumber, $noteName"
    role = Role.Button
    if (isSelected) stateDescription = "selected"
})

Read the full file on GitHub · 89 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 89 lines · 0 tokens per session scan A d023255202ba

Subscribe to this mod's changes

compose-accessibility is a cursor rule published in the GitHub repository baijum/ukulele-companion (13 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 801 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.