跳到正文
Skillpedia
网站与界面(前端)8.0k · #12650

antislop-human

它能做什么

为 AI 编程助手提供界面的无障碍规则,例如文字对比度、键盘操作和焦点。适用于希望应用或网站能照顾到不同需求用户的开发者。

适用场景

  • ✓开发者制作或修改用户必须阅读和点击的网站或应用界面的时候。
  • ✓开发者需要检查文字或按钮颜色的对比度是否足够的时候。
  • ✓开发者希望界面支持键盘操作并有清晰焦点状态的时候。

技能链接

https://github.com/miqdadbadjuber/anti-slop/blob/main/skills/antislop-human/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/miqdadbadjuber/anti-slop/blob/main/skills/antislop-human/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请检查我的注册表单的颜色和键盘支持,确保每个人都能使用。”

每周 5 个新技能,1 分钟读完。

工作原理

该技能检查界面中可能把人拒之门外的问题,例如对比度低、缺少焦点和状态不清。它包含一个对比度检查工具,用来测试颜色组合。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

antislop-human

Anti Slop: Rules for AI Coding Agents. Human skill

Part of the antislop system. Read together with antislop.md (the core). This skill deep-dives the human concern: the UI must stay usable by people with different eyes, hands, and setups. Contrast, keyboard, focus, states, and the mobile details that exclude people.

How to use this skill

  • Load together with antislop.md whenever the task builds or edits UI. The core holds the mechanism (the purpose test, the three tiers, the Delivery Gate); this skill holds the human-side depth: the parts of a UI that exclude people with different eyes, hands, and setups.
  • Every entry has the same shape: Tell (the pattern), Why (who it excludes, and why it reads as unfinished), Fix (what to do instead), with the governing core rule cited as R-XX.
  • Accessibility is not a checklist of extras bolted on at the end. It is part of the core promise that "the UI holds up" (C-4). The Delivery Gate in the core remains the gate; the "Human Skill Checklist" at the end of this file is the supplement to run alongside it.
  • The contrast checker (formula + reference table + script) lives in this skill. Use it for every color pairing you cannot verify by eye.
  • This skill keeps only the mobile details that exclude people: zooming, and the on-screen keyboard.

Color & Contrast

Low-Contrast Text

  • Tell: light grey text on a white or near-white background, thin body text, muted labels chosen because they look "elegant" but are hard to read.
  • Why: it excludes low-vision users and everyone in bright light. It is a visual choice made without checking the standard, which is exactly the kind of default the filter exists to catch.
  • Fix: meet WCAG AA minimums (R-25): 4.5:1 for normal text, 3:1 for large text (18px+). Compute the ratio; do not eyeball it.

Text Over a Photo or Gradient

  • Tell: white text placed directly over an image or gradient that is light in some areas, checked at one bright spot only.
  • Why: contrast is local. Where the image is light, the text drops below 4.5:1 even if the hero still "looks" fine. R-25 requires testing the whole area the text passes over, not a single point.
  • Fix: add a scrim or a solid color block behind the text, then verify the worst spot, not the best. If any part of the text area fails, the treatment fails.

The Grey-on-Grey Hallucination

  • Tell: "dark grey on black" or "light grey on white" claimed to pass AA without a computation.
  • Why: this is the most common accessibility hallucination. The eye overestimates contrast on grey pairs, and agents repeat the claim because it sounds plausible. #555555 on black is 2.8:1. It fails.
  • Fix: never assert a pairing passes. Run the contrast checker (below) or apply the formula. When neither is possible, use the reference table.

Non-Text Contrast

  • Tell: interactive components (buttons, icons, input borders, focus indicators, chart segments) distinguished from their background by less than 3:1.
  • Why: non-text UI carries information by shape and edge. When the edge is a hair of tint, low-vision users cannot find the control. The same bar applies to states like hover and selected.
  • Fix: give every component boundary and every status indicator a 3:1 ratio against adjacent colors (WCAG 1.4.11). Pair icons with a text label that meets 4.5:1.

The Contrast Checker

The home of the contrast checker. Three layers, from most to least convenient:

The script. When a script runtime is available and the file is present, run it instead of computing by hand. The script ships in this skill's folder (contrast-check.py, next to this SKILL.md). Run it with python3 on macOS and Linux, python on Windows:

python3 "${CLAUDE_SKILL_DIR}/contrast-check.py" "#FFFFFF" "#777777"
# normal text: FAIL (4.48 < 4.5)
# large text:  PASS (4.48 >= 3.0)

If the ${CLAUDE_SKILL_DIR} variable is not available in this agent, point the script path at this skill's folder directly. The script exists so agents stop hallucinating AA. It takes two hex colors and prints the ratio and the verdict for both text sizes. If the file is missing, the formula and table below are complete on their own. Never block on the script.

The formula (WCAG 2.x).

  1. Contrast ratio = (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter relative luminance and L2 the darker.
  2. Relative luminance L of one color: convert each channel to 0-1
常见问题

它包含对比度检查工具吗?

包含。该技能提供对比度检查工具,用于检验肉眼无法判断的颜色组合。

它涵盖手机使用吗?

涵盖。它包括可能让人无法使用的移动端细节,例如缩放和屏幕键盘。

它需要核心 antislop 文件吗?

需要。它应与主 antislop 文件一起使用,主文件包含共享规则。

详情

作者的原始描述

Human and accessibility skill for antislop. Contrast, keyboard, focus, states, and interaction affordances for real people. Includes the contrast checker.

repo: miqdadbadjuber/anti-slop

热度

GitHub 星标
8.0k
排名
#12650
许可证
MIT
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能