accessibility
3
总安装量
2
周安装量
#59584
全站排名
安装命令
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-ux-design --skill accessibility
Agent 安装分布
codex
2
claude-code
2
kilo
1
zencoder
1
cline
1
Skill 文档
Accessibility Skill
Atomic Skill: Ensure digital experiences are usable by everyone through WCAG compliance
Purpose
This skill provides comprehensive guidance on accessibility standards, testing, and remediation.
Skill Invocation
Skill("custom-plugin-ux-design:accessibility")
Parameter Schema
Input Parameters
interface AccessibilityParams {
// Required
task: "audit" | "remediate" | "design" | "test";
target: string;
// Optional
level?: "A" | "AA" | "AAA";
scope?: "component" | "page" | "flow" | "application";
platform?: "web" | "mobile" | "desktop";
assistive_tech?: string[];
}
Validation Rules
task:
type: enum
required: true
values: [audit, remediate, design, test]
target:
type: string
required: true
min_length: 3
level:
type: enum
default: "AA"
values: [A, AA, AAA]
Execution Flow
ACCESSIBILITY EXECUTION
ââââââââââââââââââââââââââââââââââââââââââââ
Step 1: SCOPE ASSESSMENT
âââ Identify target scope
âââ Determine compliance level
âââ Select testing methods
Step 2: AUDIT
âââ Automated testing
âââ Manual testing
âââ Assistive tech testing
âââ Document findings
Step 3: CATEGORIZE ISSUES
âââ Critical (blockers)
âââ Serious (major barriers)
âââ Moderate (difficulties)
âââ Minor (inconveniences)
Step 4: REMEDIATE
âââ Prioritize by severity
âââ Implement fixes
âââ Verify corrections
âââ Document solutions
Step 5: VALIDATE
âââ Re-test all issues
âââ Certify compliance
âââ Create maintenance plan
ââââââââââââââââââââââââââââââââââââââââââââ
Retry Logic
retry_config:
max_attempts: 3
backoff_type: exponential
initial_delay_ms: 500
max_delay_ms: 5000
retryable_errors:
- SCANNER_TIMEOUT
- AT_CONNECTION_LOST
Logging Hooks
interface AccessibilityLog {
timestamp: string;
event: "audit_start" | "issue_found" | "remediated" | "verified";
wcag_criterion: string;
severity: string;
element: string;
status: "open" | "fixed" | "verified";
}
Learning Modules
Module 1: WCAG Fundamentals
POUR PRINCIPLES
âââ Perceivable
â âââ Text alternatives
â âââ Time-based media
â âââ Adaptable content
â âââ Distinguishable
âââ Operable
â âââ Keyboard accessible
â âââ Enough time
â âââ Seizure safe
â âââ Navigable
âââ Understandable
â âââ Readable
â âââ Predictable
â âââ Input assistance
âââ Robust
âââ Compatible
âââ Name, role, value
Module 2: Screen Reader Support
SCREEN READER BASICS
âââ Semantic HTML
â âââ Headings (h1-h6)
â âââ Landmarks (nav, main, etc.)
â âââ Lists (ul, ol, dl)
â âââ Tables (proper markup)
âââ ARIA
â âââ Roles
â âââ States
â âââ Properties
âââ Focus management
â âââ Focus order
â âââ Focus trapping
â âââ Focus restoration
âââ Live regions
âââ aria-live
âââ Announcements
âââ Status updates
Module 3: Keyboard Navigation
KEYBOARD REQUIREMENTS
âââ All interactive elements focusable
âââ Logical focus order
âââ Visible focus indicators
âââ No keyboard traps
âââ Skip links provided
âââ Shortcuts documented
COMMON PATTERNS
âââ Tab: Move forward
âââ Shift+Tab: Move backward
âââ Enter/Space: Activate
âââ Arrow keys: Navigate within
âââ Escape: Close/cancel
âââ Home/End: First/last
Module 4: Visual Accessibility
COLOR & CONTRAST
âââ Text contrast (4.5:1 normal, 3:1 large)
âââ UI component contrast (3:1)
âââ Focus indicator contrast (3:1)
âââ Color not sole indicator
âââ Dark mode considerations
MOTION & ANIMATION
âââ Reduce motion preference
âââ Pause/stop controls
âââ No autoplay
âââ Seizure-safe content
âââ Animation alternatives
Module 5: Testing Methods
AUTOMATED TESTING
âââ Axe DevTools
âââ WAVE
âââ Lighthouse
âââ Pa11y
âââ HTML validators
MANUAL TESTING
âââ Keyboard-only navigation
âââ Zoom to 200%
âââ High contrast mode
âââ Color blindness simulation
âââ Form error states
ASSISTIVE TECH TESTING
âââ NVDA (Windows)
âââ JAWS (Windows)
âââ VoiceOver (Mac/iOS)
âââ TalkBack (Android)
âââ Switch access
Error Handling
| Error Code | Description | Recovery |
|---|---|---|
A11Y-001 |
Missing alt text | Add descriptive alt |
A11Y-002 |
Contrast failure | Adjust colors |
A11Y-003 |
Keyboard trap | Add escape mechanism |
A11Y-004 |
Missing label | Add visible/hidden label |
A11Y-005 |
Invalid ARIA | Fix ARIA usage |
WCAG Quick Reference
Contrast Requirements
| Content Type | AA Ratio | AAA Ratio |
|---|---|---|
| Normal text | 4.5:1 | 7:1 |
| Large text (18pt+) | 3:1 | 4.5:1 |
| UI components | 3:1 | 3:1 |
| Focus indicators | 3:1 | 3:1 |
Touch Target Sizes
| Platform | Minimum | Recommended |
|---|---|---|
| Web | 24x24px | 44x44px |
| iOS | 44x44pt | 44x44pt |
| Android | 48x48dp | 48x48dp |
Troubleshooting
Problem: Screen reader announces wrong content
Diagnosis:
âââ Check: ARIA labels
âââ Check: DOM order
âââ Check: Hidden content
âââ Solution: Align ARIA with visual
Steps:
1. Test with screen reader
2. Check aria-label accuracy
3. Verify DOM = visual order
4. Remove incorrect aria-hidden
Problem: Focus not visible
Diagnosis:
âââ Check: outline: none in CSS
âââ Check: :focus styles
âââ Check: Custom components
âââ Solution: Add visible focus
Steps:
1. Remove outline removal
2. Add :focus-visible styles
3. Ensure 3:1 contrast
4. Test all interactive elements
Unit Test Templates
describe("AccessibilitySkill", () => {
describe("audit", () => {
it("should detect missing alt text", async () => {
const result = await invoke({
task: "audit",
target: "<img src='photo.jpg'>"
});
expect(result.issues).toContainEqual(
expect.objectContaining({ code: "A11Y-001" })
);
});
});
describe("contrast checking", () => {
it("should calculate contrast ratio", async () => {
const result = await invoke({
task: "audit",
target: { text: "#666666", background: "#ffffff" }
});
expect(result.contrast_ratio).toBeCloseTo(5.74, 1);
});
});
describe("remediation", () => {
it("should suggest fix for contrast failure", async () => {
const result = await invoke({
task: "remediate",
target: { issue: "A11Y-002", colors: ["#999", "#fff"] }
});
expect(result.suggested_color).toMatch(/^#[0-9A-F]{6}$/i);
expect(result.new_contrast).toBeGreaterThanOrEqual(4.5);
});
});
});
Quality Metrics
| Metric | Target | Measurement |
|---|---|---|
| WCAG compliance | > 95% | Criteria met |
| Critical issues | 0 | Blockers found |
| Keyboard navigable | 100% | All elements |
| Screen reader compatible | > 95% | AT testing |
Version History
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | 2025-12-30 | Production-grade upgrade |