AgentSkillsCN

markup-checker

当您需要检查最低限度的无障碍性(包括标签、焦点、ARIA 属性、标题结构以及键盘操作)时,可调用此技能。在修改表单或交互式 UI 时,同样适用。

SKILL.md
--- frontmatter
name: markup-checker
description: 最低限のアクセシビリティ(ラベル、フォーカス、aria、見出し構造、キーボード操作)のチェックが必要な時に使う。フォームや対話UIの修正時にも使う。

A11y Checker Lite

Quick use

  • Run npm run audit to generate ./report-w3c.txt
  • Review ./dist/**/*.html results in the report (line numbers are for generated HTML)
  • Map issues back to Astro sources by searching for stable snippets/classes
  • Fix Astro files first, then re-run npm run audit for confirmation

Workflow (this project)

  • Use dist HTML for validation (W3C + markuplint) because Astro parsing can raise false syntax errors
  • Read report-w3c.txt and list issues per HTML file with line numbers
  • For each issue, locate source Astro:
    • Open the dist HTML around the line and copy a short snippet
    • Use rg -n "snippet" in src/ to find the Astro component/page
    • Prefer matching by class names, aria attributes, or text content
    • If snippet only appears in build output, trace from src/pages to referenced components
  • Report findings with Astro file paths when found; otherwise include dist path with a note

Output format

  • Findings list with file references (Astro preferred)
  • Fixes applied (what changed + where)
  • Remaining issues (if any)
  • If source not found: include dist file + line and explain how to locate

Execution policy

  • Do not stop after analysis; continue to apply fixes to Astro files
  • If multiple valid fixes exist, choose the simplest one that preserves behavior
  • Only ask for confirmation when the change is ambiguous or risky
  • After fixes, re-run npm run audit and report the new results

References

  • See references/rules.md