/ 目录 / 演练场 / ai-friendly-web-design-skill
● 社区 ianho7 ⚡ 即开即用

ai-friendly-web-design-skill

作者 ianho7 · ianho7/ai-friendly-web-design-skill

14 design principles plus auto-review for building web UIs that AI agents can navigate reliably — semantic HTML, stable test IDs, no hidden interactions.

A Claude Code skill enforcing 14 design principles that make UIs usable by both humans and automation/agents: semantic HTML, ARIA, stable data-testid / data-ai-action locators, native form controls, pagination over infinite scroll, explicit loading states, URL deep links, clear errors, dual UI+API entry points. Auto-applies whenever Claude builds or reviews a UI component.

为什么要用

核心特性

实时演示

实际使用效果

ai-friendly-web-design-skill.replay ▶ 就绪
0/0

安装

作者仓库 · Claude Skills 官方文档

使用场景

实战用法: ai-friendly-web-design-skill

Audit an existing component for agent-readiness

👤 Web devs shipping to customers who'll hit the page with agents ⏱ ~30 min beginner

何时使用: Your support chatbot or QA agent keeps missing the right button.

步骤
  1. Feed Claude the component
    Review this Checkout.tsx against ai-friendly-web-design principles. Flag severity.✓ 已复制
    → Ranked list: critical (hover-only submit) -> minor (missing aria-live)
  2. Apply the fixes
    Apply all critical + major fixes, keep visuals identical.✓ 已复制
    → Patched component + a diff summary

结果: A component that's still pretty for humans and reachable for agents.

注意事项
  • Adding data-testid everywhere without convention — Follow the skill's naming convention (data-testid='<area>-<action>') or they drift
搭配使用: chrome-devtools

Build a new form with native controls and proper ARIA

👤 Frontend devs building high-stakes forms (checkout, onboarding) ⏱ ~45 min intermediate

何时使用: A new form where you can't afford to block screen readers or agents.

步骤
  1. Scaffold from principles
    Build a billing address form using ai-friendly-web-design. Native input types, labels, aria-describedby for errors, explicit loading on submit.✓ 已复制
    → Form with HTML native types (email, tel), no custom combobox hacks
  2. Add deep-linking + URL state
    Make the form step reflect in the URL so agents can open step 2 directly.✓ 已复制
    → step param in URL, state restored on load

结果: A form both assistive tech and agents navigate cleanly.

Replace infinite scroll with predictable pagination

👤 Product engineers where agents fail to get past page 1 ⏱ ~30 min intermediate

何时使用: Your list page uses infinite scroll and agents never reach items below the fold.

步骤
  1. Refactor to paginated route
    Replace the infinite-scroll list with URL-based pagination (?page=N). Keep scroll behavior feel.✓ 已复制
    → Addressable pages, prev/next with ARIA

结果: A list an agent can walk deterministically.

注意事项
  • Breaking SEO by removing the old scroll entirely — Keep scroll load within each page — just make the page boundary explicit

组合

与其他 MCP 搭配,撬动十倍杠杆

ai-friendly-web-design-skill + chrome-devtools

Test the component live and confirm agent locators work

Load the patched component in devtools, verify data-testid values and aria attributes render.✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
review_component component path/source Any UI PR or audit 0
apply_principles component + findings After review 0
scaffold_agent_friendly UI spec Greenfield UI 0

成本与限制

运行它的成本

API 配额
None
每次调用 Token 数
Moderate — component + review
费用
Free
提示
Run review at PR time, not every keystroke

安全

权限、密钥、影响范围

凭据存储: None
数据出站: None

故障排查

常见错误与修复

Review says no issues but agents still miss buttons

Run with Chrome DevTools snapshot; shadow DOM may hide from the static review

data-testid names clash with existing tests

Provide your naming convention to the skill before it auto-names

替代方案

ai-friendly-web-design-skill 对比其他方案

替代方案何时用它替代权衡
Manual a11y review + LighthouseYou only care about accessibility, not agent navigationMisses agent-specific concerns like stable locators

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills