Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问clear审计未展示

accessibility-standards无障碍标准

Agent Skill

用于辅助无障碍访问检查、页面可用性审计和前端可访问性改进。它适合让 Agent 检查语义标签、键盘操作、颜色对比、ARIA 属性和自动化检测结果。使用时需要结合真实页面和浏览器验证,不应只依赖静态文本判断;涉及修复建议时,应兼顾设计系统、组件复用和 WCAG 等通用无障碍规范。

总安装

13,659

周安装

471

GitHub Stars

1,565

下载量

4,695
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:accessibility-standards(无障碍标准)
来源仓库:https://github.com/maxritter/claude-codepro
仓库路径:skills/accessibility-standards
安装命令:
npx skills add https://github.com/maxritter/claude-codepro --skill 'Accessibility Standards'
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/maxritter/claude-codepro --skill 'Accessibility Standards'

简介

用于辅助无障碍访问检查、页面可用性审计和前端可访问性改进。

  • 适合检查语义标签、键盘操作、颜色对比、ARIA 属性和自动化检测结果。
  • 使用时需结合真实页面和浏览器验证,不应只依赖静态文本判断。
  • 涉及修复建议时,应兼顾设计系统、组件复用和 WCAG 等通用无障碍规范。
  • accessibility-standards 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Accessibility Standards

Core Rule: Build accessible interfaces that work for all users, including those using assistive technologies.

When to use this skill

  • When creating or modifying frontend components (React, Vue, Svelte, web components, etc.)
  • When writing HTML templates or JSX/TSX component markup
  • When implementing forms and ensuring all inputs have proper labels
  • When adding images and needing to provide descriptive alt text
  • When building interactive elements that need keyboard navigation support
  • When implementing focus management in modals, dialogs, or single-page applications
  • When ensuring color contrast ratios meet WCAG standards (4.5:1 for normal text)
  • When adding ARIA attributes to enhance complex component accessibility
  • When creating proper heading hierarchies (h1-h6) for document structure
  • When testing components with screen readers or accessibility testing tools
  • When building navigation menus, buttons, or links that need to be keyboard accessible

This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle frontend accessibility.

Semantic HTML First

Use native HTML elements that convey meaning to assistive technologies.

Correct elements:

<!-- Navigation -->
<nav><a href="/about">About</a></nav>

<!-- Buttons that perform actions -->
<button onClick={handleSubmit}>Submit</button>

<!-- Links that navigate -->
<a href="/profile">View Profile</a>

<!-- Main content area -->
<main><article>...</article></main>

<!-- Form structure -->
<form>
  <label for="email">Email</label>
  <input id="email" type="email" />
</form>

Avoid:

<!-- BAD - div/span without semantic meaning -->
<div onClick={navigate}>Go to page</div>
<span onClick={handleClick}>Submit</span>

When to use each element:

  • <button>: Actions (submit, open modal, toggle)
  • <a>: Navigation to different pages/sections
  • <nav>: Navigation landmarks
  • <main>: Primary page content
  • <header>, <footer>, <aside>: Page structure
  • <article>, <section>: Content grouping

Keyboard Navigation

All interactive elements must be keyboard accessible.

Requirements:

  • Tab key moves focus through interactive elements
  • Enter/Space activates buttons and links
  • Escape closes modals and dialogs
  • Arrow keys navigate menus and lists (when appropriate)
  • Focus indicators are clearly visible

Implementation:

// Native elements are keyboard accessible by default
<button onClick={handleClick}>Click me</button>

// Custom interactive elements need tabIndex
<div
  role="button"
  tabIndex={0}
  onClick={handleClick}
  onKeyDown={(e) => {
    if (e.key === 'Enter' || e.key === ' ') {
      handleClick();
    }
  }}
>
  Custom button
</div>

// Focus styles must be visible
button:focus {
  outline: 2px solid blue;
  outline-offset: 2px;
}

Never:

  • Remove focus outlines without providing alternative indicators
  • Use tabIndex values other than 0 or -1
  • Create keyboard traps (user can't escape with keyboard)

Form Labels and Inputs

Every form input must have an associated label.

Correct patterns:

<!-- Explicit label association -->
<label for="username">Username</label>
<input id="username" type="text" />

<!-- Implicit label wrapping -->
<label>
  Email
  <input type="email" />
</label>

<!-- aria-label for icon-only buttons -->
<button aria-label="Close dialog">
  <CloseIcon />
</button>

<!-- aria-describedby for help text -->
<label for="password">Password</label>
<input
  id="password"
  type="password"
  aria-describedby="password-help"
/>
<span id="password-help">Must be at least 8 characters</span>

Required attributes:

  • id on input, matching for on label
  • type attribute on inputs (text, email, password, etc.)
  • aria-label or aria-labelledby when visual label isn't present
  • aria-describedby for additional context or error messages

Alternative Text for Images

Provide descriptive alt text that conveys the image's purpose.

Guidelines:

<!-- Informative images -->
<img src="chart.png" alt="Sales increased 40% in Q4 2024" />

<!-- Functional images (buttons, links) -->
<a href="/search">
  <img src="search-icon.svg" alt="Search" />
</a>

<!-- Decorative images -->
<img src="decoration.png" alt="" />
{/* or */}
<img src="decoration.png" role="presentation" />

<!-- Complex images need longer descriptions -->
<img
  src="architecture.png"
  alt="System architecture diagram"
  aria-describedby="arch-description"
/>
<div id="arch-description">
  The system consists of three layers: frontend React app,
  Node.js API server, and PostgreSQL database...
</div>

Alt text rules:

  • Describe the content and function, not "image of"
  • Keep concise (under 150 characters when possible)
  • Use empty alt (alt="") for purely decorative images
  • Don't include "image", "picture", "photo" (screen readers announce this)

Color Contrast

Maintain sufficient contrast ratios for readability.

WCAG Requirements:

  • Normal text (< 18pt): 4.5:1 contrast ratio
  • Large text (≥ 18pt or ≥ 14pt bold): 3:1 contrast ratio
  • UI components and graphics: 3:1 contrast ratio

Don't rely on color alone:

// BAD - color only
<span style={{color: 'red'}}>Error</span>

// GOOD - color + icon + text
<span style={{color: 'red'}}>
  <ErrorIcon aria-hidden="true" />
  Error: Invalid email format
</span>

// BAD - color-coded status
<div style={{backgroundColor: status === 'active' ? 'green' : 'red'}} />

// GOOD - color + text label
<div>
  <StatusBadge color={status === 'active' ? 'green' : 'red'}>
    {status === 'active' ? 'Active' : 'Inactive'}
  </StatusBadge>
</div>

Tools to verify contrast:

  • Browser DevTools (Chrome, Firefox have built-in checkers)
  • WebAIM Contrast Checker
  • Axe DevTools extension

ARIA Attributes

Use ARIA to enhance semantics when HTML alone isn't sufficient.

Common ARIA patterns:

// Roles for custom components
<div role="dialog" aria-modal="true">
  <h2 id="dialog-title">Confirm Action</h2>
  <div aria-describedby="dialog-desc">...</div>
</div>

// States and properties
<button aria-expanded={isOpen} aria-controls="menu">
  Menu
</button>
<ul id="menu" hidden={!isOpen}>...</ul>

// Live regions for dynamic content
<div aria-live="polite" aria-atomic="true">
  {statusMessage}
</div>

// Hide decorative elements
<span aria-hidden="true">→</span>

ARIA rules:

  1. Use semantic HTML first, ARIA second
  2. Don't override native semantics (<button role="link"> is wrong)
  3. All interactive ARIA roles need keyboard support
  4. Test with actual screen readers

Common ARIA attributes:

  • aria-label: Accessible name for element
  • aria-labelledby: References element(s) that label this one
  • aria-describedby: References element(s) that describe this one
  • aria-expanded: Whether element is expanded (true/false)
  • aria-hidden: Hide from assistive tech (use sparingly)
  • aria-live: Announce dynamic content changes (polite/assertive)

Heading Hierarchy

Use heading levels (h1-h6) in logical order to create document structure.

Correct structure:

<h1>Page Title</h1>
  <h2>Section 1</h2>
    <h3>Subsection 1.1</h3>
    <h3>Subsection 1.2</h3>
  <h2>Section 2</h2>
    <h3>Subsection 2.1</h3>

Rules:

  • One <h1> per page (page title)
  • Don't skip levels (h2 → h4 is wrong)
  • Don't choose headings based on visual size (use CSS for styling)
  • Headings create an outline for screen reader navigation

Styling headings:

/* Separate semantic level from visual appearance */
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }

/* If you need h3 to look like h1 */
.h3-large {
  font-size: 2rem;
}

Focus Management

Manage focus in dynamic interfaces to maintain keyboard navigation flow.

Modal dialogs:

function Modal({ isOpen, onClose, children }) {
  const modalRef = useRef();

  useEffect(() => {
    if (isOpen) {
      // Save previously focused element
      const previousFocus = document.activeElement;

      // Move focus to modal
      modalRef.current?.focus();

      // Trap focus within modal
      // (use library like focus-trap-react)

      return () => {
        // Restore focus when modal closes
        previousFocus?.focus();
      };
    }
  }, [isOpen]);

  return (
    <div
      ref={modalRef}
      role="dialog"
      aria-modal="true"
      tabIndex={-1}
    >
      {children}
      <button onClick={onClose}>Close</button>
    </div>
  );
}

Dynamic content:

// Announce content changes to screen readers
<div aria-live="polite">
  {loading ? 'Loading...' : `Loaded ${items.length} items`}
</div>

// Move focus to new content after navigation
function handlePageChange(newPage) {
  loadPage(newPage);
  // Focus the main heading of new content
  document.querySelector('h1')?.focus();
}

Verification Checklist

Before marking UI work complete:

  • All interactive elements are keyboard accessible
  • Focus indicators are visible on all focusable elements
  • All images have appropriate alt text
  • All form inputs have associated labels
  • Color contrast meets WCAG standards (4.5:1 for text)
  • Heading hierarchy is logical (no skipped levels)
  • ARIA attributes are used correctly (if needed)
  • Modals and dialogs manage focus appropriately
  • No information conveyed by color alone
  • Tested with keyboard navigation (Tab, Enter, Escape)

Common Mistakes to Avoid

Using divs/spans for buttons:

// BAD
<div onClick={handleClick}>Submit</div>

// GOOD
<button onClick={handleClick}>Submit</button>

Missing form labels:

// BAD
<input type="text" placeholder="Username" />

// GOOD
<label for="username">Username</label>
<input id="username" type="text" />

Removing focus outlines:

/* BAD */
button:focus { outline: none; }

/* GOOD - provide alternative indicator */
button:focus {
  outline: 2px solid blue;
  outline-offset: 2px;
}

Redundant ARIA:

// BAD - button already has button role
<button role="button">Click</button>

// GOOD - use native semantics
<button>Click</button>

Inaccessible custom components:

// BAD - no keyboard support
<div onClick={handleClick}>Custom button</div>

// GOOD - full keyboard support
<div
  role="button"
  tabIndex={0}
  onClick={handleClick}
  onKeyDown={(e) => {
    if (e.key === 'Enter' || e.key === ' ') {
      e.preventDefault();
      handleClick();
    }
  }}
>
  Custom button
</div>

Testing Accessibility

Manual testing:

  1. Navigate entire interface using only keyboard
  2. Verify all interactive elements are reachable and activatable
  3. Check focus indicators are visible
  4. Test with browser zoom at 200%
  5. Use browser DevTools accessibility inspector

Automated testing:

  • Axe DevTools browser extension
  • Lighthouse accessibility audit
  • WAVE browser extension
  • eslint-plugin-jsx-a11y (for React)

Screen reader testing:

  • macOS: VoiceOver (Cmd+F5)
  • Windows: NVDA (free) or JAWS
  • Test critical user flows with screen reader enabled

Remember: Automated tools catch ~30% of issues. Manual testing is essential.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

26.25%
按下载量换算1,232

Cursor

24.87%
按下载量换算1,168

OpenCode

19.02%
按下载量换算893

Codex

12.59%
按下载量换算591

Gemini CLI

8.05%
按下载量换算378

windsurf

3.28%
按下载量换算154

安全审计

暂无安全审计结果可展示。

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源字段存在多来源差异,先按来源优先级自动处理,无法消解时进入异常复核队列。

来源信息

继续浏览同类 Skills