Svelte A11y

A command for svelte workflows.

CommandsvelteMIT1 source files

Before you use this component

This is a third-party source bundle, not an installation into your account. UI Discovery has checked the available redistribution license evidence; runtime behavior has not been tested. Review all files, use a disposable project first, and do not enable scripts or hooks until you understand their permissions.

Some integrations require separately installed software, API keys or paid services. Credentials and subscriptions are not included. These are Claude Code resources; other clients may require adaptation.

Extract the ZIP into a temporary folder, inspect its entry file and supporting resources, then follow the original instructions. Do not overwrite an existing project configuration blindly. Keep the bundled license and attribution notices.

Source publisher
Claude Code Templates
Creator supplied by source
Not listed in source
Pinned source version
a344359459263d73d8948651c789244093c02e4e
License evidence
LICENSE

Source preview

cli-tool/components/commands/svelte/svelte-a11y.md

# /svelte:a11y

Audit and improve accessibility in Svelte/SvelteKit applications, ensuring WCAG compliance and inclusive user experiences.

## Instructions

You are acting as the Svelte Development Agent focused on accessibility. When improving accessibility:

1. **Accessibility Audit**:
   - Run automated accessibility tests
   - Check WCAG 2.1 AA/AAA compliance
   - Test with screen readers
   - Verify keyboard navigation
   - Analyze color contrast
   - Review ARIA usage

2. **Common Issues & Fixes**:
   
   **Component Accessibility**:
   ```svelte
   <!-- Bad -->
   <div onclick={handleClick}>Click me</div>
   
   <!-- Good -->
   <button onclick={handleClick} aria-label="Action description">
     Click me
   </button>
   ```
   
   **Form Accessibility**:
   ```svelte
   <label for="email">Email Address</label>
   <input 
     id="email"
     type="email"
     required
     aria-describedby="email-error"
   />
   {#if errors.email}
     <span id="email-error" role="alert">
       {errors.email}
     </span>
   {/if}
   ```

3. **Navigation & Focus**:
   ```javascript
   // Skip links
   <a href="#main" class="skip-link">Skip to main content</a>
   
   // Focus management
   onMount(() => {
     if (shouldFocus) {
       element.focus();
     }
   });
   
   // Keyboard navigation
   function handleKeydown(event) {
     if (event.key === 'Escape') {
       closeModal();
     }
   }
   ```

4. **ARIA Implementation**:
   - Use semantic HTML first
   - Add ARIA labels for clarity
   - Implement live regions
   - Manage focus properly
   - Announce dynamic changes

5. **Testing Tools**:
   - Svelte a11y warnings
   - axe-core integration
   - Pa11y CI setup
   - Screen reader testing
   - Keyboard navigation testing

6. **Accessibility Checklist**:
   - [ ] All interactive elements keyboard accessible
   - [ ] Proper heading hierarchy
   - [ ] Images have alt text
   - [ ] Color contrast meets standards
   - [ ] Forms have proper labels
   - [ ] Error messages announced
   - [ ] Focus indicators visible
   - [ ] Page has unique title
   - [ ] Landmarks properly used
   - [ ] Animations respect prefers-reduced-motion

## Example Usage

User: "Audit my e-commerce site for accessibility issues"

Assistant will:
- Run automated accessibility scan
- Check product cards for proper markup
- Verify cart keyboard navigation
- Test checkout form accessibility
- Review color contrast on CTAs
- Add ARIA labels where needed
- Implement focus management
- Create accessibility test suite
- Provide WCAG compliance report

Preview capped at 60,000 characters. Download the bundle for every original file and notice.

Read the redistribution license
MIT License

Copyright (c) 2025 Daniel (San) Ávila

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Bundle SHA-256: a4f8930916cc6a07377d53e48dc5724c9ade36d38f1fac432cd406c403a14cef. Files are served as downloads and are never executed by this page.