Communitygithub.com

curiositech/windags-skills

实现 WCAG 2.2 AA/AAA 合规性的自动化测试、键盘导航、屏幕阅读器支持和焦点管理。在以下情况激活:无障碍性审计、WCAG 合规性、键盘导航、屏幕阅读器、ARIA 属性、axe-core、焦点陷阱。不适用于:设计层面的无障碍性审查(使用 design-accessibility-auditor),仅颜色对比度问题(使用 css-in-js-architect)。

windags-skills 是什么?

该技能专注于通过自动化测试和最佳实践实施 WCAG 2.2 AA/AAA 合规性,适合开发者集成到 CI/CD 流程中。它支持 axe-core 集成(如 Playwright 和 React 组件)、键盘导航实现(包括 roving tabindex 和焦点群组)、屏幕阅读器优化(ARIA 角色、实时区域和 aria-label)以及焦点管理(尤其是模态框的焦点陷阱和关闭后焦点恢复)。技能提供了多种架构模式,包括使用 Playwright + axe-core 的自动化无障碍性测试、焦点陷阱的 React hooks 实现以及用于动态内容通知的 ARIA 实时区域。它还包含一个质量检查清单,确保代码满足无障碍性要求,并指出了常见反模式,如错误使用 div 代替 button、过度使用 aria-label 以及隐藏焦点轮廓。该技能适用于 Cursor、Claude Code 和 Codex 等 AI 编码助手,在检测到无障碍性审计失败时自动激活提供指导。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/curiositech/windags-skills/tree/HEAD/skills/accessibility-automation-expert

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

无障碍性自动化专家

通过自动化测试、键盘导航、ARIA 模式、屏幕阅读器优化和焦点管理,实现和执行 WCAG 2.2 AA/AAA 合规性。

激活触发器

在以下情况激活: 无障碍性审计失败、WCAG 合规性要求、键盘导航中断、屏幕阅读器未播报内容、axe-core 违规、模态框/对话框的焦点陷阱、aria-* 属性问题、跳过导航链接。

不适用于: 设计层面的无障碍性审查(颜色选择、布局决策)——请使用 design-accessibility-auditor。纯颜色对比度检查——请使用 css-in-js-architect(配合 OKLCH)。

快速开始

  1. 运行 axe-core -- npx @axe-core/cli http://localhost:3000 或在开发模式下集成 @axe-core/react 以在控制台中显示警告。
  2. 首先修复严重违规 -- 缺少替代文本、缺少表单标签、对比度不足、缺少地标。
  3. 实现键盘导航 -- 每个可交互元素必须能够通过 Tab、Enter、Space、Escape 和方向键到达并操作。
  4. 添加焦点管理 -- 在模态框中限制焦点,关闭时恢复焦点,在路由变化时管理焦点。
  5. 使用屏幕阅读器测试 -- VoiceOver(macOS)、NVDA(Windows)或 TalkBack(Android)进行真实验证。

核心能力

领域技术关键模式
自动化测试axe-core、Lighthouse、jest-axe、Playwright axeCI/CD 无障碍性门禁
键盘导航tabindex、onKeyDown、roving tabindex方向键导航、焦点群组
屏幕阅读器ARIA 角色、实时区域、aria-label播报、状态变化、描述
焦点管理focus-visible、焦点陷阱、inert 属性模态框焦点锁定、跳过链接、路由变化焦点
语义 HTML<main>、<nav>、<article>、<aside>地标、标题层级、列表
表单<label>、aria-describedby、aria-invalid错误播报、必填字段、字段集

架构模式

模式 1:CI 中的自动化 axe-core

// e2e/accessibility.spec.ts (Playwright + axe-core)
import { test, expect } from '@playwright/test';
import AxeBuilder from '@axe-core/playwright';

const pages = ['/', '/products', '/checkout', '/account'];

for (const path of pages) {
  test(`${path} 没有无障碍性违规`, async ({ page }) => {
    await page.goto(path);
    await page.waitForLoadState('networkidle');

    const results = await new AxeBuilder({ page })
      .withTags(['wcag2a', 'wcag2aa', 'wcag22aa'])  // WCAG 2.2 AA
      .analyze();

    expect(results.violations).toEqual([]);
  });
}
// 开发模式:React 中的 axe-core(在控制台中显示违规)
// app/layout.tsx
if (process.env.NODE_ENV === 'development') {
  import('@axe-core/react').then((axe) => {
    axe.default(React, ReactDOM, 1000);
  });
}

模式 2:模态框的焦点管理

import { useEffect, useRef, useCallback } from 'react';

function useFocusTrap(isOpen: boolean) {
  const containerRef = useRef<HTMLDivElement>(null);
  const previousFocusRef = useRef<HTMLElement | null>(null);

  useEffect(() => {
    if (!isOpen) return;

    // 保存当前焦点以便稍后恢复
    previousFocusRef.current = document.activeElement as HTMLElement;

    // 聚焦第一个可聚焦元素
    const container = containerRef.current;
    if (!container) return;

    const focusable = container.querySelectorAll<HTMLElement>(
      'a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])'
    );
    focusable[0]?.focus();

    // 在容器内限制焦点
    const handleKeyDown = (e: KeyboardEvent) => {
      if (e.key !== 'Tab') return;
      const first = focusable[0];
      const last = focusable[focusable.length - 1];

      if (e.shiftKey && document.activeElement === first) {
        e.preventDefault();
        last?.focus();
      } else if (!e.shiftKey && document.activeElement === last) {
        e.preventDefault();
        first?.focus();
      }
    };

    container.addEventListener('keydown', handleKeyDown);

    // 对背景内容使用 inert
    const mainContent = document.querySelector('main');
    mainContent?.setAttribute('inert', '');

    return () => {
      container.removeEventListener('keydown', handleKeyDown);
      mainContent?.removeAttribute('inert');
      previousFocusRef.current?.focus(); // 恢复焦点
    };
  }, [isOpen]);

  return containerRef;
}

模式 3:动态内容的 ARIA 实时区域

// 向屏幕阅读器播报表单错误、加载状态和更新
function useAnnounce() {
  const announce = useCallback((message: string, priority: 'polite' | 'assertive' = 'polite') => {
    const el = document.getElementById(`aria-live-${priority}`);
    if (el) {
      el.textContent = '';  // 先清除以触发重新播报
      requestAnimationFrame(() => { el.textContent = message; });
    }
  }, []);

  return announce;
}

// 在布局中挂载一次:
function AriaLiveRegions() {
  return (
    <>
      <div id="aria-live-polite" aria-live="polite" aria-atomic="true" className="sr-only" />
      <div id="aria-live-assertive" aria-live="assertive" aria-atomic="true" className="sr-only" />
    </>
  );
}
  ┌─ 无障碍性测试金字塔 ────────────────────┐
  │                                                     │
  │          ▲  手动屏幕阅读器测试                     │
  │         ╱ ╲  (VoiceOver、NVDA — 每季度)            │
  │        ╱───╲                                        │
  │       ╱     ╲  Playwright + axe-core E2E            │
  │      ╱  E2E  ╲  (每个页面,CI 门禁)                 │
  │     ╱─────────╲                                     │
  │    ╱           ╲  jest-axe 组件测试                 │
  │   ╱  组件      ╲  (每个可交互组件)                  │
  │  ╱───────────────╲                                  │
  │ ╱                 ╲  ESLint jsx-a11y                │
  │╱    静态 lint     ╲  (每次提交)                     │
  │╲___________________╱                                │
  └─────────────────────────────────────────────────────┘

反模式

  1. 使用 div 和 onClick 代替 button -- divs 没有键盘交互、没有角色、没有焦点。请使用语义化的 <button> 或 <a> 元素。如果必须使用 div,请添加 role="button"、tabindex="0" 以及 Enter/Space 键的 onKeyDown 处理。
  2. 到处使用 aria-label -- 过度标记会对屏幕阅读器用户造成噪音。优先使用可见的文本标签;仅在无法使用可见文本时使用 aria-label。
  3. 隐藏焦点轮廓 -- 没有替代方案的 outline: none 会使键盘导航不可见。使用 :focus-visible 为纯键盘操作提供焦点指示器,避免在鼠标点击时显示。
  4. 缺少跳过导航链接 -- 键盘用户每次都必须通过 Tab 键遍历整个导航。添加 <a href="#main" class="sr-only focus:not-sr-only">跳到主要内容</a> 作为第一个可聚焦元素。
  5. 没有实时区域的 Toast 通知 -- 屏幕阅读器无法检测到动态添加的 Toast。使用 aria-live="polite" 区域播报它们。

质量检查清单

  • axe-core CI 门禁在所有页面上以零违规通过
  • eslint-plugin-jsx-a11y 已启用且无警告
  • 所有图像都有描述性的 alt 文本(装饰性图像使用 alt="")
  • 所有表单输入都有关联的 <label> 元素(不仅仅是占位符文本)
  • 标题层级是连续的(h1 > h2 > h3,无跳级)
  • 页面地标存在:<main>、<nav>、<header>、<footer>
  • 跳过导航链接是第一个可聚焦元素
  • 所有可交互元素上焦点可见(定义了 :focus-visible 样式)
  • 模态框限制焦点并在关闭时恢复焦点
  • 动态内容变化通过 aria-live 区域播报
  • 颜色对比度满足 WCAG AA(普通文本 4.5:1,大文本 3:1)
  • 所有功能仅通过键盘即可操作(Tab、Enter、Space、Escape、方向键)

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

curiositech/windags-skills

Expert in 2000s-era music visualization (Milkdrop, AVS, Geiss) and modern WebGL implementations. Specializes in Butterchurn integration, Web Audio API AnalyserNode FFT data, GLSL shaders for audio-reactive visuals, and psychedelic generative art. Activate on "Milkdrop", "music visualization", "WebGL visualizer", "Butterchurn", "audio reactive", "FFT visualization", "spectrum analyzer". NOT for simple bar charts/waveforms (use basic canvas), video editing, or non-audio visuals.

curiositech/windags-skills

Expert legal research agent for finding and scraping expungement data state by state. Knows authoritative sources, URL patterns, Firecrawl configuration, and 2026 legal landscape.

curiositech/windags-skills

Expert in 3D computer vision labeling tools, workflows, and AI-assisted annotation for LiDAR, point clouds, and sensor fusion. Covers SAM4D/Point-SAM, human-in-the-loop architectures, and vertical-specific training strategies. Activate on '3D labeling', 'point cloud annotation', 'LiDAR labeling', 'SAM 3D', 'SAM4D', 'sensor fusion annotation', '3D bounding box', 'semantic segmentation point cloud'. NOT for 2D image labeling (use clip-aware-embeddings), general ML training (use ml-engineer), video annotation without 3D (use computer-vision-pipeline), or VLM prompt engineering (use prompt-engineer).

curiositech/windags-skills

Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time estimation, dopamine-aware task design, and building systems that actually work for neurodivergent minds.

curiositech/windags-skills

Designs digital experiences for ADHD brains using neuroscience research and UX principles. Expert in reducing cognitive load, time blindness solutions, dopamine-driven engagement, and compassionate design patterns. Activate on 'ADHD design', 'cognitive load', 'accessibility', 'neurodivergent UX', 'time blindness', 'dopamine-driven', 'executive function'. NOT for general accessibility (WCAG only), neurotypical UX design, or simple UI styling without ADHD context.

curiositech/windags-skills

>- Apply crisis decision-making research to agent routing, uncertainty triage, and coordination failure analysis in time-pressured systems. Use when diagnosing handoff failures, analytical paralysis, or expert judgment under incomplete information. NOT for routine coding, simple CRUD design, or static single-agent tasks with complete information.

curiositech/windags-skills

Extend and modify the admin dashboard, developer portal, and operations console. Use when adding new admin tabs, metrics, monitoring features, or internal tools. Activates for dashboard development, analytics, user management, and internal tooling.

curiositech/windags-skills

Conversation patterns and interaction protocols for multi-agent systems. Covers request/response, pub/sub, blackboard, delegation chains, debate, critique, consensus, fan-out/fan-in, supervisor-worker, and peer negotiation. Deep analysis of AutoGen conversation patterns, CrewAI delegation, LangGraph state passing, and FIPA-ACL performatives. Teaches how to design what agents say to each other and in what order. Activate on: "agent conversation", "agent protocol", "multi-agent debate", "agent delegation", "supervisor worker pattern", "agent voting", "consensus protocol", "fan-out fan-in", "agent negotiation", "blackboard pattern", "agent dialogue", "conversation topology", "agent handoff". NOT for: wire format or serialization (use agent-interchange-formats), orchestration infrastructure (use agentic-infrastructure-2026), single agent behavior (use agentic-patterns).

curiositech/windags-skills

Meta-agent for creating new custom agents, skills, and MCP integrations. Expert in agent design, MCP development, skill architecture, and rapid prototyping. Activate on 'create agent', 'new skill', 'MCP server', 'custom tool', 'agent design'. NOT for using existing agents (invoke them directly), general coding (use language-specific skills), or infrastructure setup (use deployment-engineer).

curiositech/windags-skills

AI-powered calendar management and agent-based scheduling coordination. Covers calendar APIs (Google Calendar, CalDAV/iCal), AI scheduling assistants (Reclaim, Clockwise, Motion, Cal.com), building custom calendar agents with MCP, multi-calendar merging, timezone management, focus block protection, meeting fatigue detection, and agent-to-agent meeting negotiation protocols. Activate on: "calendar agent", "AI scheduling", "calendar coordination", "meeting scheduling", "calendar API", "focus time protection", "calendar optimization", "Google Calendar MCP", "Reclaim", "Clockwise", "Motion", "Cal.com", "smart scheduling", "calendar-aware agent", "timezone scheduling", "agent negotiation meetings". NOT for: manual calendar UI component design (use form-validation-architect), project management scheduling or Gantt charts (use project-management-guru-adhd), general time-tracking or pomodoro apps (use adhd-daily-planner for time-awareness), building the agent itself from scratch (use agent-creator).

curiositech/windags-skills

Build and adopt production AI agent infrastructure in 2026. Covers framework selection (LangGraph, CrewAI, AutoGen, MCP), orchestration patterns, evaluation, observability, memory systems, and tool use. Also covers the SOCIAL dimension: how to sell agent infrastructure internally, change management, measuring ROI, building trust in autonomous systems, and scaling adoption across teams. Activate on: "agent infrastructure", "agent framework comparison", "which agent framework", "sell AI tools internally", "agent adoption", "agent observability", "agent evaluation", "MCP architecture", "agentic mesh", "enterprise AI agents", "AI change management", "agent ROI". NOT for: building specific agents (use ai-engineer), designing agent behavior patterns (use agentic-patterns), prompt tuning (use prompt-engineer).

curiositech/windags-skills

Fundamental patterns for effective agentic behavior. Teaches decomposition, tool orchestration, error recovery, context management, quality self-assessment, and knowing when to stop. Model-agnostic principles that make any agent more effective regardless of domain. Activate on: "how should I structure this agent", "agentic workflow", "agent patterns", "multi-step task", "tool orchestration", "/agentic-patterns", "decompose this", "agent best practices", "chain of actions", "when should the agent stop", "agent loop design". NOT for: creating agent infrastructure (use agent-creator), building DAGs (use windags-architect), specific tool implementation.

curiositech/windags-skills

Automated discovery and matching of agent skills for dynamic task routing and capability assessment

curiositech/windags-skills

Cryptographic security for agentic systems — zero-trust agent networking, signed message envelopes (JWS/JWE), capability-based security (ocaps), Merkle tree audit trails, WASM sandboxing, and formal verification. Covers CLI dev tool security, mTLS between agents, permission boundaries (least privilege for AI agents), and supply chain security for skills/plugins. Activate on: "agent security", "zero trust agents", "secure agent communication", "capability-based security", "ocap", "signed messages between agents", "agent audit trail", "sandbox agent execution", "agent permissions", "mTLS agents", "cryptographic verification", "agent supply chain", "OWASP agentic", "prove agent did X", "tamper-proof agent logs". NOT for: application-level SAST scanning (use security-auditor), network firewall rules (use infrastructure), SOC2/HIPAA compliance (organizational), or prompt injection defense (use prompt-engineer).

curiositech/windags-skills

Data structures and serialization formats for agent-to-agent communication. Covers message envelopes, structured output schemas, capability declarations, task handoff payloads, error/retry signaling, and context windows as data structures. Deep comparison of A2A protocol, MCP, OpenAI function calling, and LangChain message types. Teaches when to use rigid schemas vs free-form with validation, typed vs untyped, streaming vs batch. Activate on: "agent message format", "agent communication schema", "agent-to-agent protocol", "A2A protocol", "MCP message format", "structured output for agents", "agent interop", "interchange format", "agent serialization", "task handoff format", "capability declaration". NOT for: what agents say to each other (use agent-conversation-protocols), orchestration topology (use multi-agent-coordination), building agent infrastructure (use agentic-infrastructure-2026).

curiositech/windags-skills

Logic-based agent programming language implementing BDI architecture for practical autonomous agent development

curiositech/windags-skills

>- Design AgentSpeak(L)-style BDI agents with context-guarded plans, selection functions, and intention stacks. Use for interruptible autonomy, agent policy, and multi-agent orchestration in dynamic environments. NOT for simple rule engines, static planners, or centralized workflows.

curiositech/windags-skills

Foundational concurrent computation model where actors communicate exclusively through asynchronous message passing

curiositech/windags-skills

Build production-ready LLM applications, advanced RAG systems, and intelligent agents. Implements vector search, multimodal AI, agent orchestration, and enterprise AI integrations. Use PROACTIVELY for LLM features, chatbots, AI agents, or AI-powered applications.

curiositech/windags-skills

license: Apache-2.0 NOT for unrelated tasks outside this domain.

相关技能