Community编程与开发github.com

peterruiter/claude-build-framework

对每个主页面进行全面的 WCAG 2.2 AA 可访问性检查,涵盖亮色/暗色模式、多种视口、键盘导航和手动测试,并生成修复方案与报告。

claude-build-framework 是什么?

这个技能(SKILL)为基于 Playwright 和 axe-core 的 WCAG 2.2 AA 全量无障碍审计提供了结构化工作流。它系统性地覆盖每一个主页面——包括亮色和暗色模式,以及 1440px、390px 和 320px 等关键视口宽度——并自动检测跳过链接、单一 h1、语言声明、可见且未被遮挡的焦点指示器、24px 目标尺寸和横向滚动。此外,它通过键盘脚本检查弹窗、抽屉和标签页的焦点陷阱与返回逻辑,并执行文本间距、200% 缩放、拖拽替代方案、无障碍认证等手动检查。该技能还包含共享组件的合约测试和主题对比度验证,生成带有原因说明的已知问题清单,并创建符合 WCAG 2.2 AA 标准的无障碍声明页面。适用于 Claude Code、Cursor、Codex 等以 Playwright/Node.js 为后端的 AI 代理平台。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/peterruiter/claude-build-framework/tree/HEAD/skills/a11y-pass

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

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

文档

可访问性检查

参考文件:${CLAUDE_PLUGIN_ROOT}/docs/accessibility.md 和 ${CLAUDE_PLUGIN_ROOT}/docs/design-systems.md。 WCAG 2.2 AA 是每个功能的完成标准的一部分;此检查是额外的全面扫查。

1. 设置

  • 在产品外部固定并安装工具:npm i --prefix <文件夹> playwright@<固定版本> axe-core@<固定版本>;A11Y_TOOLS=<文件夹>。
  • 使用演示数据在临时数据库上本地运行应用,并指定自己的端口。
  • 在 tests/a11y/pages.json 中列出每个主页面(以及通过 open 打开的弹窗),每页带有 lang,并为需要登录的页面提供一个 signIn 模块。
  • 在很少有其他代理运行时执行此检查;对共享组件进行小型定向编辑。

2. 测量(“之前”)

node tests/a11y/axe-pages.mjs --probes --json scratch/a11y-before.json
node tests/a11y/axe-pages.mjs --probes --widths 320 --page <宽页面>
node --test "tests/contracts/*.test.mjs"     # 亮色和暗色模式下的主题对比度

另外,运行应用的键盘脚本(跳过链接 → 主内容、弹窗焦点陷阱与焦点返回、最顶层的 Escape、标签页列表中的箭头键、可点击行上的 Enter)以及手动检查:文本间距(1.4.12)、200% 缩放、拖拽替代方案(2.5.7)、冗余输入(3.3.7)、无障碍认证(3.3.8)、带表格的图表、电子邮件(语言、展示表格、替代文本、暗色模式)。

3. 发现与修复

表格:# | 标准 | 位置 | 严重程度(严重/中等/轻微) | 已修复?。在共享组件级别修复(一个焦点环令牌、一个弹窗按键助手、可点击行、组合键、滚动区域、活动区域、滚动内边距)。将每个新的可访问名称翻译成所有已配置的语言。为新的颜色组合添加对比度对。

4. 防护

  • 共享组件的合约测试(名称、消息之前存在的活动区域、令牌对、减少动画、跳过链接)。
  • 在 tests/a11y/known.json 中保留的发现带有原因,与无障碍声明页面上的已知限制一致(目标 WCAG 2.2 AA、限制、联系方式;使用每种已配置的语言;在每个页脚中链接)。

5. 报告

每个页面的“之前→之后”违规计数、按严重程度计数的违规数(已修复/未修复)、截图、未完成的事项(屏幕阅读器、原生外壳、外部审计)。一条“新增内容”条目。STATE.md 部分。

Individual skills in this repo

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

peterruiter/claude-build-framework

Write one complete agent brief from the framework's template for a single piece of work (feature, fix, polish, translation, accessibility or security item), with context, scope, reserved migration slot, scratch database, ports, file ownership, the standing rules (all configured languages, WCAG 2.2 AA, light and dark, privacy, data residency, What's new, no AI attribution), the gate and the report format. Use when the user or the plan-wave skill needs a brief, or says "write a brief", "brief an agent", "delegate this".

peterruiter/claude-build-framework

Check that every tool a profile needs is installed and recent enough (git, GitHub CLI, Node.js, npm, plus the profile's own - e.g. .NET SDK, PowerShell 7, Azure CLI, Power Platform CLI, LocalDB, k6) and give the exact install command per OS for anything missing. Runs automatically at the start of new-project and quality-gate. Use when the user says "check my tools", "what do I need to install", "is my machine ready", or when a command fails with "not recognized" / "command not found".

peterruiter/claude-build-framework

Build a sync from a SaaS product to customers' Dynamics 365 / Dataverse environments and Customer Insights - Journeys (multi-tenant app with admin consent and an application user, Web API upserts, contact matching, leads, timeline notes, custom triggers, marketing lists, deep links), tested against a stand-in and a marked sandbox. Use when the owner asks for a Dynamics 365, Dataverse, Power Platform or Customer Insights - Journeys integration.

peterruiter/claude-build-framework

Apply, switch or regenerate a project's design system (the one source of colours, fonts, logos, chart, email, document and video styles for every output), check its contrast in light and dark, and add a new design system to the framework from a Claude Design System artifact. Uses scripts/design-system.mjs to generate tokens.css, tokens.ts, a Fluent UI theme, a model-driven app theme, email and chart palettes, the video-tour brand block and an Office theme mapping. Use when the user says "design system", "apply the brand", "use our house style", "switch theme", "rebrand", "regenerate the tokens", "check contrast", or "add a design system".

相关技能