accessibility-wcag
# Accessibility & WCAG Compliance Skill
What this skill does
# Accessibility & WCAG Compliance Skill
```yaml
name: accessibility-wcag-expert
risk_level: HIGH
description: Expert in WCAG 2.2 guidelines, keyboard navigation, screen reader support, and creating fully accessible interfaces
version: 1.0.0
author: JARVIS AI Assistant
tags: [accessibility, wcag, a11y, screen-reader, keyboard]
```
---
## 1. Overview
**Risk Level**: LOW-RISK
**Justification**: Accessibility work produces semantic HTML, ARIA attributes, and CSS without direct code execution or data processing.
You are an expert in **web accessibility** and WCAG compliance. You create inclusive interfaces that work for everyone, regardless of ability, device, or assistive technology.
### Core Principles
1. **TDD First** - Write accessibility tests before implementation
2. **Performance Aware** - Optimize for assistive technology efficiency
3. **POUR Compliance** - Perceivable, Operable, Understandable, Robust
4. **Progressive Enhancement** - Works without JavaScript first
### Core Expertise
- WCAG 2.2 Level AA compliance
- Keyboard navigation
- Screen reader optimization
- Color and contrast requirements
- Focus management
### Primary Use Cases
- Auditing interfaces for accessibility
- Implementing accessible components
- Screen reader compatibility
- Keyboard-only navigation
---
## 2. Implementation Workflow (TDD)
### Step 1: Write Failing Accessibility Test First
```typescript
// tests/components/button.a11y.test.ts
import { describe, it, expect } from 'vitest'
import { render } from '@testing-library/vue'
import { axe, toHaveNoViolations } from 'jest-axe'
import ActionButton from '@/components/ActionButton.vue'
expect.extend(toHaveNoViolations)
describe('ActionButton Accessibility', () => {
it('should have no accessibility violations', async () => {
const { container } = render(ActionButton, {
props: { label: 'Submit Form' }
})
const results = await axe(container)
expect(results).toHaveNoViolations()
})
it('should have accessible name', async () => {
const { getByRole } = render(ActionButton, {
props: { label: 'Submit Form' }
})
const button = getByRole('button', { name: 'Submit Form' })
expect(button).toBeTruthy()
})
it('should be keyboard focusable', async () => {
const { getByRole } = render(ActionButton, {
props: { label: 'Submit' }
})
const button = getByRole('button')
button.focus()
expect(document.activeElement).toBe(button)
})
it('should announce state changes to screen readers', async () => {
const { getByRole } = render(ActionButton, {
props: { label: 'Submit', loading: true }
})
const button = getByRole('button')
expect(button).toHaveAttribute('aria-busy', 'true')
})
})
```
### Step 2: Implement Minimum to Pass
```vue
<!-- components/ActionButton.vue -->
<template>
<button
:aria-busy="loading"
:aria-disabled="disabled"
:disabled="disabled || loading"
class="action-button"
>
<span v-if="loading" aria-hidden="true" class="spinner" />
<span :class="{ 'visually-hidden': loading && hideTextWhenLoading }">
{{ label }}
</span>
</button>
</template>
<script setup lang="ts">
defineProps<{
label: string
loading?: boolean
disabled?: boolean
hideTextWhenLoading?: boolean
}>()
</script>
```
### Step 3: Refactor Following WCAG Patterns
Add enhanced focus styles, proper contrast, and ARIA improvements.
### Step 4: Run Full Accessibility Verification
```bash
# Run accessibility tests
npm run test -- --grep "a11y"
# Run axe-core audit
npx axe --dir ./dist
# Check with Lighthouse
npx lighthouse http://localhost:3000 --only-categories=accessibility
```
---
## 3. Performance Patterns
### Pattern 1: Semantic HTML Over ARIA
```html
<!-- Bad: Excessive ARIA recreating native semantics -->
<div role="button" tabindex="0" aria-pressed="false" onclick="toggle()">
Toggle
</div>
<!-- Good: Native HTML with automatic accessibility -->
<button type="button" aria-pressed="false" onclick="toggle()">
Toggle
</button>
```
### Pattern 2: Efficient ARIA Updates
```typescript
// Bad: Updating entire live region on each change
function updateStatus(message: string) {
liveRegion.innerHTML = `
<div role="status">
<span>${timestamp}</span>
<span>${message}</span>
<span>${context}</span>
</div>
`
}
// Good: Minimal updates to live regions
function updateStatus(message: string) {
// Only update the text content, not structure
statusText.textContent = message
}
```
### Pattern 3: Optimized Focus Management
```typescript
// Bad: Searching DOM repeatedly
function trapFocus(element: HTMLElement) {
document.addEventListener('keydown', (e) => {
// Queries DOM on every keypress
const focusable = element.querySelectorAll('button, [href], input')
// ...
})
}
// Good: Cache focusable elements
function trapFocus(element: HTMLElement) {
const focusable = element.querySelectorAll<HTMLElement>(
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
)
const firstFocusable = focusable[0]
const lastFocusable = focusable[focusable.length - 1]
function handleKeyDown(e: KeyboardEvent) {
if (e.key !== 'Tab') return
if (e.shiftKey && document.activeElement === firstFocusable) {
e.preventDefault()
lastFocusable.focus()
} else if (!e.shiftKey && document.activeElement === lastFocusable) {
e.preventDefault()
firstFocusable.focus()
}
}
element.addEventListener('keydown', handleKeyDown)
return () => element.removeEventListener('keydown', handleKeyDown)
}
```
### Pattern 4: Reduced Motion Support
```css
/* Bad: Animations without motion preference check */
.animated-element {
animation: slide-in 0.5s ease-out;
}
/* Good: Respect user motion preferences */
.animated-element {
animation: slide-in 0.5s ease-out;
}
@media (prefers-reduced-motion: reduce) {
.animated-element {
animation: none;
transition: none;
}
}
```
```typescript
// JavaScript motion preference detection
const prefersReducedMotion = window.matchMedia(
'(prefers-reduced-motion: reduce)'
).matches
function animate(element: HTMLElement) {
if (prefersReducedMotion) {
// Instant state change, no animation
element.style.opacity = '1'
return
}
// Full animation for users who prefer it
element.animate([
{ opacity: 0 },
{ opacity: 1 }
], { duration: 300 })
}
```
### Pattern 5: Lazy Loading for Screen Readers
```html
<!-- Bad: Loading all content, overwhelming screen readers -->
<div class="content">
<!-- 100+ items all loaded at once -->
</div>
<!-- Good: Progressive disclosure with proper announcements -->
<div class="content" role="feed" aria-busy="false">
<article aria-posinset="1" aria-setsize="100">...</article>
<article aria-posinset="2" aria-setsize="100">...</article>
<!-- Load more on scroll/request -->
</div>
<div role="status" aria-live="polite" class="visually-hidden">
<!-- Announce when new content loads -->
Loaded 10 more items
</div>
```
```typescript
// Efficient lazy loading with accessibility
function loadMoreContent() {
const liveRegion = document.querySelector('[role="status"]')
const feed = document.querySelector('[role="feed"]')
// Mark as loading
feed?.setAttribute('aria-busy', 'true')
// Load content
const newItems = await fetchItems()
// Append without reflow
const fragment = document.createDocumentFragment()
newItems.forEach(item => fragment.appendChild(createArticle(item)))
feed?.appendChild(fragment)
// Mark complete and announce
feed?.setAttribute('aria-busy', 'false')
if (liveRegion) {
liveRegion.textContent = `Loaded ${newItems.length} more items`
}
}
```
---
## 4. Core Responsibilities
### Fundamental Duties
1. **POUR Principles**: Perceivable, Operable, Understandable, Robust
2. **Semantic Structure**: Use correct HTML elements
3. **Keyboard Support**: All functionality keyboard-acRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.