LazyCats-dev/ao3-podfic-posting-helper / .agent/skills/frontend-a11y
frontend-a11y
VerifiedWrite minimal, accessible web UI without over-engineering, adapting to whatever stack the project uses — React, Vue, Svelte, Angular, web components, or plain HTML. Use this skill on every project and every task that writes or reviews markup or components, builds forms, adds interactive elements like buttons, dialogs, accordions, or tabs, or audits code for accessibility — even when the user never mentions accessibility, and even inside a framework, CMS, or design system. It's non-negotiable regardless of project type, stack, or deadline. About to reach for ARIA attributes, a dialog library, a focus-trap package, or a headless UI component? Use this skill first.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 27.7 KB |
| evals/evals.json | config | 12.9 KB |
| references/angular.md | markdown | 2.5 KB |
| references/aria.md | markdown | 503.4 KB |
| references/css.md | markdown | 7.4 KB |
| references/patterns.md | markdown | 8.3 KB |
| references/react.md | markdown | 3.7 KB |
| references/standards.md | markdown | 1.2 KB |
| references/svelte.md | markdown | 2.4 KB |
| references/vue.md | markdown | 2.9 KB |
| references/wcag.json | config | 141.1 KB |
| references/web-components.md | markdown | 2.8 KB |
references/svelte.md
View on GitHub# Svelte (and SvelteKit)
The HTML/CSS rules in `SKILL.md` all hold — Svelte templates are close to plain HTML (`class`, `for`, `aria-*` are written as-is), so most examples transfer verbatim. This file covers the Svelte-specific deltas. Prefer native `<button>`, `<dialog>`, `<details>`, `<label>` here too.
## The compiler lints accessibility — don't silence it
Svelte's compiler emits accessibility warnings (`a11y-*` in Svelte 4, `a11y_*` in Svelte 5) for things like a click handler on a non-interactive element, an `<img>` without `alt`, or a `<label>` with no associated control. These are real defects, not noise. **Fix the markup rather than suppressing the warning** — reaching for `<!-- svelte-ignore -->` should be rare and justified (e.g. a genuinely decorative element), never a reflex.
```svelte
<!-- Triggers a11y warning — and rightly so -->
<div on:click={submit}>Submit</div>
<!-- Fix: use a real button -->
<button type="button" on:click={submit}>Submit</button>
```
## Event / attribute syntax
- Svelte 4: `on:click`, `class:active={isActive}`. Svelte 5: `onclick`, same `class:` directive.
- `aria-*` and `role` are plain attributes and pass through to the DOM, so every ARIA rule applies unchanged. Bind dynamically with `aria-expanded={open}`.
## {@html ...} is an XSS hole
It injects raw markup and skips Svelte's escaping. Avoid it; render text normally. If unavoidable, sanitize first (e.g. DOMPurify) — never pass user or CMS content straight in.
## SvelteKit already handles route focus — verify it
On client-side navigation SvelteKit moves focus to `<body>` (or an element you mark) and announces the new page via a built-in live region that reads the document `<title>`. That baseline is good, but it only works if you give it something to announce:
- Every route must set a unique, descriptive `<svelte:head><title>` and render a single `<h1>`.
- To send focus somewhere more useful than `<body>`, use `afterNavigate` to focus the main heading (`tabindex="-1"`).
## Live regions must be mounted before they update
A `role="alert"`/`role="status"` region is only announced when text enters an **existing** region. Don't create it with `{#if}` at announce time; keep it rendered and change its text.
```svelte
<p role="status">{statusMessage}</p>
```
## Reach elements with bind:this
Use `bind:this={dialogEl}` and then `dialogEl.showModal()` on a native `<dialog>`, or to move focus — not `document.querySelector`.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |