Communitygithub.com

無障礙自動化專家

透過自動化測試、鍵盤導航、螢幕閱讀器支援和焦點管理,實作並強制執行 WCAG 2.2 AA/AAA 合規性。啟動於:無障礙審計、WCAG 合規性、鍵盤導航、螢幕閱讀器、aria 屬性、axe-core、焦點陷阱。不適用於:設計層級的無障礙審查(請使用 design-accessibility-auditor)、僅顏色對比度(請使用 css-in-js-architect)。

無障礙自動化專家 是什麼?

這項技能是開發者的無障礙自動化專家,專注於透過工具和程式碼模式實作 WCAG 2.2 AA/AAA 標準。它整合了 axe-core、Playwright 和 jest-axe 進行 CI/CD 管線中的自動化測試,並提供 React 中的焦點管理(如模態對話框的焦點陷阱)、ARIA 即時區域用於動態內容宣告,以及語意化 HTML 模式。它支援現代前端框架(React、JavaScript、TypeScript)和測試框架(Playwright、Jest),並在 VS Code、JetBrains 和終端機環境中運作。該技能透過提供經過實戰測試的程式碼範例(如焦點陷阱 Hook 和即時區域元件)和反模式警示(如無法存取的 div 點擊處理器和缺少跳過導覽連結),協助開發者避免常見的無障礙錯誤。

相容平台~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錯誤宣告、必填欄位、fieldset

架構模式

模式 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} has no accessibility violations`, 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 -- div 沒有鍵盤互動、沒有角色、也沒有焦點。請使用語意化的 <button> 或 <a> 元素。如果必須使用 div,請加入 role="button"、tabindex="0" 和處理 Enter/Space 的 onKeyDown。
  2. 到處使用 aria-label -- 過度標籤會對螢幕閱讀器使用者造成干擾。優先使用可見文字標籤;僅在無法使用可見文字時才使用 aria-label。
  3. 隱藏焦點外框 -- 沒有替代方案的 outline: none 會使鍵盤導航無法被察覺。請使用 :focus-visible 僅在鍵盤操作時顯示焦點指示器,滑鼠點擊時不顯示。
  4. 缺少跳過導覽連結 -- 鍵盤使用者在每個頁面上都必須逐項瀏覽整個導覽列。請加入 <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.

相關技能