chill-agent 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/.agents/rules/ponytail.md +30 -0
  2. package/.claude-plugin/contrast-mcp-launcher.mjs +31 -0
  3. package/.claude-plugin/marketplace.json +17 -0
  4. package/.claude-plugin/plugin.json +8 -3
  5. package/.cline-plugin/plugin.js +6 -0
  6. package/.clinerules/ponytail.md +30 -0
  7. package/.codex-plugin/plugin.json +4 -3
  8. package/.cursor/rules/ponytail.mdc +36 -0
  9. package/.cursor-plugin/marketplace.json +16 -0
  10. package/.cursor-plugin/plugin.json +2 -2
  11. package/.devin-plugin/plugin.json +2 -2
  12. package/.grok-plugin/marketplace.json +16 -0
  13. package/.kimi-plugin/plugin.json +11 -29
  14. package/.kiro/steering/ponytail.md +35 -0
  15. package/.omp-plugin/marketplace.json +15 -0
  16. package/.openclaw/skills/ponytail/SKILL.md +47 -0
  17. package/.openclaw/skills/ponytail-audit/SKILL.md +100 -0
  18. package/.openclaw/skills/ponytail-debt/SKILL.md +43 -0
  19. package/.openclaw/skills/ponytail-gain/SKILL.md +51 -0
  20. package/.openclaw/skills/ponytail-help/SKILL.md +76 -0
  21. package/.openclaw/skills/ponytail-review/SKILL.md +98 -0
  22. package/.opencode/command/ponytail-audit.md +5 -0
  23. package/.opencode/command/ponytail-debt.md +5 -0
  24. package/.opencode/command/ponytail-gain.md +5 -0
  25. package/.opencode/command/ponytail-help.md +5 -0
  26. package/.opencode/command/ponytail-review.md +5 -0
  27. package/.opencode/command/ponytail.md +5 -0
  28. package/.opencode/plugins/index.js +4 -0
  29. package/.opencode/plugins/ponytail-frontmatter.cjs +63 -0
  30. package/.opencode/plugins/ponytail.mjs +206 -0
  31. package/.qoder-plugin/plugin.json +12 -26
  32. package/.windsurf/rules/ponytail.md +30 -0
  33. package/AGENTS.md +32 -0
  34. package/__init__.py +228 -0
  35. package/assets/antislop-banner.png +0 -0
  36. package/assets/band/band.png +0 -0
  37. package/assets/band/board.png +0 -0
  38. package/assets/benchmark-3model.svg +21 -0
  39. package/assets/benchmark-agentic.svg +62 -0
  40. package/assets/codex-icon.png +0 -0
  41. package/assets/compare/code/after.webp +0 -0
  42. package/assets/compare/code/before.webp +0 -0
  43. package/assets/compare/text/after.webp +0 -0
  44. package/assets/compare/text/before.webp +0 -0
  45. package/assets/compare/ui/w-all.webp +0 -0
  46. package/assets/compare/ui/w-antislop.webp +0 -0
  47. package/assets/compare/ui/w-design.webp +0 -0
  48. package/assets/compare/ui/without.webp +0 -0
  49. package/assets/logo-dark.png +0 -0
  50. package/assets/logo-dark.svg +115 -0
  51. package/assets/logo-greenpt-dark.svg +27 -0
  52. package/assets/logo-greenpt.svg +27 -0
  53. package/assets/logo.png +0 -0
  54. package/assets/photoreunion-logo-dark.svg +4 -0
  55. package/assets/photoreunion-logo-light.svg +4 -0
  56. package/assets/profile.png +0 -0
  57. package/assets/retriever-logo-dark.svg +4 -0
  58. package/assets/retriever-logo-light.svg +4 -0
  59. package/assets/stories-banner.png +0 -0
  60. package/assets/v5/audit-es.png +0 -0
  61. package/assets/v5/audit-ja.png +0 -0
  62. package/assets/v5/audit-ko.png +0 -0
  63. package/assets/v5/audit-zh-CN.png +0 -0
  64. package/assets/v5/audit.png +0 -0
  65. package/assets/v5/beforeafter-es.png +0 -0
  66. package/assets/v5/beforeafter-ja.png +0 -0
  67. package/assets/v5/beforeafter-ko.png +0 -0
  68. package/assets/v5/beforeafter-zh-CN.png +0 -0
  69. package/assets/v5/beforeafter.png +0 -0
  70. package/assets/v5/chart-es.png +0 -0
  71. package/assets/v5/chart-ja.png +0 -0
  72. package/assets/v5/chart-ko.png +0 -0
  73. package/assets/v5/chart-zh-CN.png +0 -0
  74. package/assets/v5/chart.png +0 -0
  75. package/assets/v5/hero-es.jpg +0 -0
  76. package/assets/v5/hero-ja.jpg +0 -0
  77. package/assets/v5/hero-ko.jpg +0 -0
  78. package/assets/v5/hero-zh-CN.jpg +0 -0
  79. package/assets/v5/hero.jpg +0 -0
  80. package/assets/v5/ladder-es.png +0 -0
  81. package/assets/v5/ladder-ja.png +0 -0
  82. package/assets/v5/ladder-ko.png +0 -0
  83. package/assets/v5/ladder-zh-CN.png +0 -0
  84. package/assets/v5/ladder.png +0 -0
  85. package/assets/v5/review-es.png +0 -0
  86. package/assets/v5/review-ja.png +0 -0
  87. package/assets/v5/review-ko.png +0 -0
  88. package/assets/v5/review-zh-CN.png +0 -0
  89. package/assets/v5/review.png +0 -0
  90. package/assets/v5/tests-es.png +0 -0
  91. package/assets/v5/tests-ja.png +0 -0
  92. package/assets/v5/tests-ko.png +0 -0
  93. package/assets/v5/tests-zh-CN.png +0 -0
  94. package/assets/v5/tests.png +0 -0
  95. package/assets/waitlist-banner-es.png +0 -0
  96. package/assets/waitlist-banner-ja.png +0 -0
  97. package/assets/waitlist-banner-ko.png +0 -0
  98. package/assets/waitlist-banner-zh-CN.png +0 -0
  99. package/assets/waitlist-banner.png +0 -0
  100. package/benchmarks/.env.example +2 -0
  101. package/benchmarks/agentic/README.md +201 -0
  102. package/benchmarks/agentic/answer.py +288 -0
  103. package/benchmarks/agentic/compare.py +93 -0
  104. package/benchmarks/agentic/complete.py +178 -0
  105. package/benchmarks/agentic/judge.py +198 -0
  106. package/benchmarks/agentic/run.py +543 -0
  107. package/benchmarks/agentic/tasks.py +1544 -0
  108. package/benchmarks/arms/baseline.js +2 -0
  109. package/benchmarks/arms/caveman-SKILL.md +67 -0
  110. package/benchmarks/arms/caveman.js +8 -0
  111. package/benchmarks/arms/ponytail.js +8 -0
  112. package/benchmarks/behavior.js +54 -0
  113. package/benchmarks/behavior.yaml +40 -0
  114. package/benchmarks/correctness.js +291 -0
  115. package/benchmarks/loc.js +17 -19
  116. package/benchmarks/promptfooconfig.gemini.yaml +32 -0
  117. package/benchmarks/promptfooconfig.gpt-newest.yaml +33 -0
  118. package/benchmarks/promptfooconfig.yaml +41 -0
  119. package/benchmarks/results/2026-06-12-caveman-vs-ponytail.md +71 -0
  120. package/benchmarks/results/2026-06-12-v4-hardening-vs-caveman.md +125 -0
  121. package/benchmarks/results/2026-06-15-llama3.2-local.md +82 -0
  122. package/benchmarks/results/2026-06-16-correctness-gate-fix.md +113 -0
  123. package/benchmarks/results/2026-06-16-robustness-audit.md +135 -0
  124. package/benchmarks/results/2026-06-17-agentic-safety.md +164 -0
  125. package/benchmarks/results/2026-06-17-cost-verification.md +93 -0
  126. package/benchmarks/results/2026-06-18-agentic.md +219 -0
  127. package/benchmarks/results/2026-06-22-issue-245-217-comprehension.md +98 -0
  128. package/benchmarks/results/2026-10-07-agentic.md +186 -0
  129. package/cli/index.mjs +241 -0
  130. package/cli/lib/banner.mjs +21 -0
  131. package/cli/lib/install.mjs +498 -0
  132. package/cli/lib/settings.mjs +48 -0
  133. package/cli/package-lock.json +87 -0
  134. package/cli/package.json +42 -0
  135. package/cli/scripts/smoke-test.mjs +95 -0
  136. package/cli/scripts/smoke-worker.mjs +411 -0
  137. package/cli/scripts/sync-skills.mjs +81 -0
  138. package/commands/ponytail-audit.toml +2 -0
  139. package/commands/ponytail-debt.toml +2 -0
  140. package/commands/ponytail-gain.toml +2 -0
  141. package/commands/ponytail-help.toml +2 -0
  142. package/commands/ponytail-review.toml +2 -0
  143. package/commands/ponytail.toml +2 -0
  144. package/examples/email-validation.md +156 -0
  145. package/examples/group-by.md +35 -0
  146. package/examples/infinite-scroll.md +58 -0
  147. package/examples/number-formatting.md +37 -0
  148. package/examples/rate-limit.md +272 -0
  149. package/examples/react-countdown.md +390 -0
  150. package/examples/url-params.md +41 -0
  151. package/gemini-extension.json +2 -2
  152. package/hooks/band/board.ts +560 -0
  153. package/hooks/band/logo.ts +3 -0
  154. package/hooks/band/metrics.ts +311 -0
  155. package/hooks/band/register.tsx +495 -0
  156. package/hooks/band/types.d.ts +34 -0
  157. package/hooks/chill-statusline.ps1 +1 -1
  158. package/hooks/claude-band.json +6 -0
  159. package/hooks/claude-codex-hooks.json +34 -4
  160. package/hooks/copilot-hooks.json +12 -2
  161. package/hooks/cursor-hooks.json +2 -2
  162. package/hooks/ponytail-activate.js +201 -0
  163. package/hooks/ponytail-band-import.js +274 -0
  164. package/hooks/ponytail-config.js +175 -0
  165. package/hooks/ponytail-instructions.js +98 -0
  166. package/hooks/ponytail-map.js +111 -0
  167. package/hooks/ponytail-mode-tracker.js +216 -0
  168. package/hooks/ponytail-runtime.js +182 -0
  169. package/hooks/ponytail-statusline.ps1 +24 -0
  170. package/hooks/ponytail-statusline.sh +18 -0
  171. package/hooks/ponytail-subagent.js +94 -0
  172. package/hooks/qoder-hooks.json +19 -4
  173. package/i18n/README.ko.md +230 -0
  174. package/package.json +17 -6
  175. package/pi-extension/index.js +254 -0
  176. package/pi-extension/package.json +8 -0
  177. package/pi-extension/test/extension.test.js +367 -0
  178. package/pi-extension/test/helpers.test.js +179 -0
  179. package/plugin.yaml +21 -12
  180. package/rules/antislop.mdc +18 -0
  181. package/scripts/build-openclaw-skills.js +60 -0
  182. package/scripts/check-repo.mjs +389 -0
  183. package/scripts/check-rule-copies.js +74 -0
  184. package/scripts/check-versions.js +77 -0
  185. package/scripts/cursor-hooks.js +145 -0
  186. package/scripts/generate-chillslop.mjs +42 -0
  187. package/scripts/generate-examples.mjs +149 -0
  188. package/scripts/generate-plugin-doors.mjs +108 -0
  189. package/scripts/publish-openclaw-skills.js +75 -0
  190. package/scripts/skill-index.mjs +81 -0
  191. package/scripts/sync-ponytail.mjs +65 -0
  192. package/scripts/uninstall.js +92 -0
  193. package/skills/antislop/SKILL.md +700 -0
  194. package/skills/antislop/VERSION +1 -0
  195. package/skills/antislop-code/SKILL.md +128 -0
  196. package/skills/antislop-copywriting/SKILL.md +407 -0
  197. package/skills/antislop-human/LICENSE-web-quality-skills +21 -0
  198. package/skills/antislop-human/SKILL.md +204 -0
  199. package/skills/antislop-human/contrast-check.py +168 -0
  200. package/skills/antislop-human/contrast-mcp.py +121 -0
  201. package/skills/antislop-human/references/A11Y-PATTERNS.md +249 -0
  202. package/skills/antislop-human/references/WCAG.md +127 -0
  203. package/skills/antislop-layoutmobile/SKILL.md +170 -0
  204. package/skills/antislop-ui/LICENSE-web-quality-skills +21 -0
  205. package/skills/antislop-ui/SKILL.md +344 -0
  206. package/skills/antislop-ui/references/CORE-WEB-VITALS.md +181 -0
  207. package/skills/antislop-ui/references/WEB-BASELINE.md +28 -0
  208. package/skills/plugin.json +5 -0
  209. package/skills/ponytail/SKILL.md +52 -0
  210. package/skills/ponytail-audit/SKILL.md +103 -0
  211. package/skills/ponytail-debt/SKILL.md +44 -0
  212. package/skills/ponytail-gain/SKILL.md +52 -0
  213. package/skills/ponytail-help/SKILL.md +76 -0
  214. package/skills/ponytail-review/SKILL.md +101 -0
  215. package/src/package.json +3 -0
  216. package/tests/activation-map.test.js +63 -0
  217. package/tests/band-import.test.js +111 -0
  218. package/tests/band.test.tsx +520 -0
  219. package/tests/behavior.test.js +80 -0
  220. package/tests/commands.test.js +94 -0
  221. package/tests/copilot-plugin.test.js +35 -0
  222. package/tests/correctness.test.js +245 -0
  223. package/tests/cursor-hooks.test.js +343 -0
  224. package/tests/gemini-extension.test.js +91 -0
  225. package/tests/grok-plugin.test.js +39 -0
  226. package/tests/hermes-plugin.test.js +403 -0
  227. package/tests/hooks-windows.test.js +205 -0
  228. package/tests/hooks.test.js +1005 -0
  229. package/tests/kimi-plugin.test.js +25 -0
  230. package/tests/loc.test.js +18 -0
  231. package/tests/map.test.js +30 -0
  232. package/tests/openclaw-skills.test.js +26 -0
  233. package/tests/opencode-plugin.test.js +340 -0
  234. package/tests/package-scripts.test.js +35 -0
  235. package/tests/package.test.js +23 -0
  236. package/tests/qoder-plugin.test.js +84 -0
  237. package/tests/uninstall.test.js +202 -0
  238. /package/bin/{chill-agent.js → chill-agent.mjs} +0 -0
  239. /package/tests/{manifests.test.js → manifests.test.mjs} +0 -0
  240. /package/tests/{rules.test.js → rules.test.mjs} +0 -0
@@ -0,0 +1,204 @@
1
+ ---
2
+ name: antislop-human
3
+ description: "Human and accessibility skill for antislop. Contrast, keyboard, focus, states, and interaction affordances for real people. Includes the contrast checker."
4
+ allowed-tools: Bash(python *) Bash(python3 *) Read Write Edit Glob Grep
5
+ ---
6
+ # antislop-human
7
+
8
+ > Anti Slop: Rules for AI Coding Agents. Human skill
9
+
10
+ > 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.
11
+
12
+ ## How to use this skill
13
+
14
+ - 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.
15
+ - 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.
16
+ - 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.
17
+ - The contrast checker (formula + reference table + script) lives in this skill. Use it for every color pairing you cannot verify by eye.
18
+ - This skill keeps only the mobile details that exclude people: zooming, and the on-screen keyboard.
19
+
20
+ ## Color & Contrast
21
+
22
+ ### Low-Contrast Text
23
+
24
+ - **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.
25
+ - **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.
26
+ - **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.
27
+
28
+ ### Text Over a Photo or Gradient
29
+
30
+ - **Tell:** white text placed directly over an image or gradient that is light in some areas, checked at one bright spot only.
31
+ - **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.
32
+ - **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.
33
+
34
+ ### The Grey-on-Grey Hallucination
35
+
36
+ - **Tell:** "dark grey on black" or "light grey on white" claimed to pass AA without a computation.
37
+ - **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.
38
+ - **Fix:** never assert a pairing passes. Run the contrast checker (below) or apply the formula. When neither is possible, use the reference table.
39
+
40
+ ### Non-Text Contrast
41
+
42
+ - **Tell:** interactive components (buttons, icons, input borders, focus indicators, chart segments) distinguished from their background by less than 3:1.
43
+ - **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.
44
+ - **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.
45
+
46
+ ### The Contrast Checker
47
+
48
+ The home of the contrast checker. Three layers, from most to least convenient:
49
+
50
+ **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:
51
+
52
+ ```bash
53
+ python3 "${CLAUDE_SKILL_DIR}/contrast-check.py" "#FFFFFF" "#777777"
54
+ # normal text: FAIL (4.48 < 4.5)
55
+ # large text: PASS (4.48 >= 3.0)
56
+ ```
57
+
58
+ 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.
59
+
60
+ **The formula (WCAG 2.x).**
61
+
62
+ 1. Contrast ratio = (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter relative luminance and L2 the darker.
63
+ 2. Relative luminance L of one color: convert each channel to 0-1 (`c = hex / 255`), then linearize: if `c <= 0.03928`, `c_lin = c / 12.92`; otherwise `c_lin = ((c + 0.055) / 1.055)^2.4`.
64
+ 3. `L = 0.2126*R + 0.7152*G + 0.0722*B`.
65
+ 4. Compare the unrounded ratio: 4.5:1 for normal text, 3:1 for large text (18px+, per R-25). Round only for display, so a pairing at 4.498:1 prints as 4.50 and still fails 4.5:1. The maximum ratio is 21.0 (black on white).
66
+
67
+ **The reference table** (common pairings, computed with the formula):
68
+
69
+ | Pairing (text on background) | Ratio | Normal text (4.5) | Large text (3.0) |
70
+ |------------------------------|-------|-------------------|------------------|
71
+ | Black on white | 21.00 | Pass | Pass |
72
+ | White on black | 21.00 | Pass | Pass |
73
+ | White on #333333 | 12.63 | Pass | Pass |
74
+ | White on #666666 | 5.74 | Pass | Pass |
75
+ | #777777 on white | 4.48 | Fail | Pass |
76
+ | #777777 on #070707 | 4.50 | Fail | Pass |
77
+ | White on #888888 | 3.54 | Fail | Pass |
78
+ | White on #999999 | 2.85 | Fail | Fail |
79
+ | #555555 on black | 2.82 | Fail | Fail |
80
+
81
+ The `#777777 on #070707` row is the near-threshold case: 4.4983:1 rounds to 4.50 for display and still fails 4.5:1.
82
+
83
+ Read the table as a sanity check, not as a substitute. Any pairing not listed, or anything near a threshold, goes through the formula or the script.
84
+
85
+ ## Keyboard
86
+
87
+ ### Removed Focus Outline
88
+
89
+ - **Tell:** `outline: none` or `outline: 0` with no replacement focus style.
90
+ - **Why:** keyboard users cannot see where they are. It is the fastest way to make a UI unusable without a mouse, and R-32 forbids it outright.
91
+ - **Fix:** keep or replace the outline with a visible `:focus-visible` style that meets the same contrast bar (3:1 against its neighbors). Never set `outline: none` without a replacement.
92
+
93
+ ### Mouse-Only Patterns
94
+
95
+ - **Tell:** menus that open on hover only, dropdowns that click-open but do not keyboard-open, drag-and-drop with no keyboard fallback.
96
+ - **Why:** each one excludes keyboard and assistive-technology users (R-32). If a control cannot be reached and operated by Tab, Enter, or Space, it does not exist for a whole group of people.
97
+ - **Fix:** every interactive element is reachable and operable by keyboard (R-32): logical tab order following visual order, activation with Enter or Space, and dialogs closable with Escape (R-26).
98
+
99
+ ### Broken Tab Order
100
+
101
+ - **Tell:** focus jumps around the page, skips content, or lands on hidden elements because the DOM order does not match the visual order.
102
+ - **Why:** tab order that reads the code order instead of the visual order makes navigation unpredictable (R-32). Users lose their place and the page feels broken.
103
+ - **Fix:** keep the source order matching the visual order, add skip links for long pages, and never give real content `tabindex="-1"` unless it is part of a controlled focus trap such as a dialog.
104
+
105
+ ## Focus & States
106
+
107
+ ### Weak or Invisible Focus Indicator
108
+
109
+ - **Tell:** a focus ring the same color as the background, a ring that only appears on hover, or an indicator thinner than a 1px border.
110
+ - **Why:** the focus indicator is how keyboard users know where they are. If it fails the contrast bar or only shows on hover, keyboard-only use breaks (R-32, R-34).
111
+ - **Fix:** a visible focus indicator on every interactive element, 3:1 against adjacent colors, in every theme you ship. Check it in dark and light mode.
112
+
113
+ ### Color-Only Feedback
114
+
115
+ - **Tell:** success, error, and status communicated only by color: red error text, green success border, a tinted chip, with no icon, label, or text.
116
+ - **Why:** it excludes color-blind and low-vision users, and it disappears entirely in forced-colors mode. A status that depends on seeing hue is not a status (C-4).
117
+ - **Fix:** pair every color signal with text, an icon, or a pattern. Error states are text first: "Password must be at least 8 characters", not just a red border.
118
+
119
+ ### Missing UI States
120
+
121
+ - **Tell:** a data view with no empty, loading, or error state, or states that exist but are invisible: a spinner with no text, an empty screen with no explanation.
122
+ - **Why:** R-27 requires the three states; the accessibility angle is that each must be perceivable and informative, not decorative. A loading spinner with no context reads as a frozen page to screen-reader users.
123
+ - **Fix:** every data view has all three states (R-27), each announced or visible: an explicit empty message, a loading state with text, and an error state that says what happened and how to proceed.
124
+
125
+ ## Zoom & Mobile Use
126
+
127
+ The layout mechanics behind mobile (breakpoints, scale, grids, overflow, tap targets) are the concern of `antislop-layoutmobile`. This section keeps only the mobile details that exclude people: zooming, and the on-screen keyboard.
128
+
129
+ ### Text That Cannot Zoom
130
+
131
+ - **Tell:** fixed pixel font sizes, or containers with `overflow: hidden` that clip text at 200% zoom.
132
+ - **Why:** users must be able to resize text (WCAG 1.4.4). If zooming to 200% clips the content or forces horizontal scroll, the text is not resizable in practice.
133
+ - **Fix:** fluid type that reflows with zoom, no clipping containers on text, and verify the layout holds at 200% zoom on a narrow viewport (R-35).
134
+
135
+ ### Mobile Keyboard Covers the Form
136
+
137
+ - **Tell:** inputs at the bottom of the viewport hidden behind the on-screen keyboard, with no scroll-into-view and no room for the input.
138
+ - **Why:** a form the user cannot see or reach is a form they cannot complete. It is a mobile-only exclusion (R-03).
139
+ - **Fix:** when an input is focused, it scrolls into view above the keyboard, with enough bottom padding that the focused field is never covered. Test with a real device or an emulated keyboard.
140
+
141
+ ## Interaction Affordances
142
+
143
+ Enforced by R-39: the small signals that tell a person "this can be used". Keyboard and focus stay with R-32, target size with R-03.
144
+
145
+ ### Clickable Without a Pointer Cursor
146
+
147
+ - **Tell:** a `<button>`, a `<summary>`, a `<label>` for a checkbox, a custom `[role="button"]`, a clickable card, or a styled `<select>` that keeps the arrow cursor. Common after a CSS reset (Tailwind preflight resets `button` to `cursor: default`).
148
+ - **Why:** the cursor is the first affordance a mouse user reads. An arrow over a control says "this is text", so people hesitate or never click. It reads as a template that was styled but never used.
149
+ - **Fix:** every enabled interactive element gets `cursor: pointer`, set once in the base layer, not per component; disabled controls get `cursor: not-allowed`. Never put `cursor: pointer` on something that does nothing (R-26). The base-layer selector list is in [references/A11Y-PATTERNS.md](references/A11Y-PATTERNS.md).
150
+
151
+ ### Div or Span Pretending to Be a Control
152
+
153
+ - **Tell:** `<div onClick>`, `<span onClick>`, or `<a>` without `href` used as a button; `<a href="#" onClick>` used for an action.
154
+ - **Why:** it has no role, so a screen reader does not announce it as a control, and it drops out of keyboard use.
155
+ - **Fix:** an action is a `<button type="button">`, a navigation is an `<a href>` to a real destination. A custom control that cannot be native gets a `role`, its state attributes (`aria-pressed`, `aria-expanded`), and full keyboard support (R-32).
156
+
157
+ ### Icon-Only Control With No Name
158
+
159
+ - **Tell:** a close, menu, search, or social button that contains only an SVG or icon font, with no text, `aria-label`, or visually hidden label.
160
+ - **Why:** a screen reader announces "button" and nothing else. Voice-control users cannot say its name.
161
+ - **Fix:** give it an accessible name (`aria-label="Close dialog"` or a `.sr-only` span) that matches the visible word, and mark the icon `aria-hidden="true"`.
162
+
163
+ ### No Hover, Active, or Disabled State
164
+
165
+ - **Tell:** buttons and links that look identical at rest, on hover, while pressed, and when disabled; a disabled button that is only greyed out and still clickable.
166
+ - **Why:** state feedback tells people their action registered. Without it a click feels lost and a disabled control looks broken.
167
+ - **Fix:** distinct `:hover`, `:active`, and disabled styles, held to the Non-Text Contrast bar above. Prefer the `disabled` attribute; a disabled control that must stay focusable uses `aria-disabled="true"` and blocks the action in code.
168
+
169
+ ### Motion That Ignores the User Setting
170
+
171
+ - **Tell:** parallax, auto-playing carousels, scroll-jacking, or large entrance animations that still run under `prefers-reduced-motion: reduce`.
172
+ - **Why:** motion can trigger nausea and vestibular disorders, and an auto-advancing carousel moves content away from slow readers.
173
+ - **Fix:** wrap non-essential motion in `@media (prefers-reduced-motion: no-preference)`, and give anything that moves for more than 5 seconds a visible pause control.
174
+
175
+ ### Form Field Without a Real Label
176
+
177
+ - **Tell:** a placeholder as the only label, or a label not tied to its input.
178
+ - **Why:** the placeholder disappears on typing, and an unlabeled input is announced as "edit text".
179
+ - **Fix:** a visible `<label for>` on every field. Error text follows Color-Only Feedback above.
180
+
181
+ ### Missing Page-Level Semantics (whole documents only)
182
+
183
+ - **Tell:** a page with no `lang` on `<html>`, no `<main>`, headings chosen for size instead of order, or a generic `<title>`.
184
+ - **Why:** screen-reader users move by landmarks, headings, and the title; without them the page is one undifferentiated stream, read in the wrong voice.
185
+ - **Fix:** applies only when the task produces a whole document, never to a single component: `<html lang>`, one `<main>` with `<header>`/`<nav>`/`<footer>`, one `<h1>` and no skipped levels, and a unique `<title>`. Skip links are under Broken Tab Order (R-32).
186
+
187
+ ## WCAG 2.2 Depth
188
+
189
+ Read on demand, instead of guessing a success criterion:
190
+
191
+ - [references/A11Y-PATTERNS.md](references/A11Y-PATTERNS.md): copy-ready markup for the pointer-cursor base layer, modal focus traps, skip links, form labels, error announcement, dragging alternatives, ARIA tabs, and live regions.
192
+ - [references/WCAG.md](references/WCAG.md): every WCAG 2.2 success criterion by level, for checking a conformance claim. A Lighthouse score alone never proves conformance (R-36).
193
+
194
+ ## Human Skill Checklist
195
+
196
+ Run these alongside the core Delivery Gate when the task involves UI. All answers must be **yes**:
197
+
198
+ - [ ] Is every text and background pairing verified against the contrast checker (formula, table, or script), including text over images and gradients? (R-25)
199
+ - [ ] Does every interactive component boundary and status indicator meet 3:1 against its background? (non-text contrast)
200
+ - [ ] Is the focus indicator visible, high-contrast, and present on every interactive element in every theme? (R-32, R-34)
201
+ - [ ] Is every interactive element reachable and operable by keyboard, with dialogs closable via Escape and no `outline: none` without a replacement? (R-32, R-26)
202
+ - [ ] Are the empty, loading, and error states of every data view present and perceivable, not color-only? (R-27, C-4)
203
+ - [ ] Can text be resized to 200% without being clipped, and does the mobile keyboard never cover a focused input? (R-35)
204
+ - [ ] Does every enabled control show `cursor: pointer`, use a native element, carry an accessible name and a visible label, and respect `prefers-reduced-motion`? (R-39)
@@ -0,0 +1,168 @@
1
+ #!/usr/bin/env python3
2
+ """WCAG 2.x contrast checker, home of the antislop-human contrast checker.
3
+
4
+ Usage:
5
+ python3 contrast-check.py "#FFFFFF" "#777777"
6
+ python3 contrast-check.py FFFFFF 777777
7
+ python3 contrast-check.py --selftest
8
+
9
+ Prints the contrast ratio and a PASS/FAIL verdict for normal text (4.5:1)
10
+ and large text (3:1, 18px+ per antislop R-25). Exit code 0 only when both
11
+ verdicts pass, so scripts can chain on it.
12
+
13
+ --selftest parses the reference table out of the SKILL.md next to this script
14
+ (the skill doc is the source of truth, not a list copied into this script) and
15
+ recomputes every row with the formula, checking the ratio and both verdicts.
16
+ """
17
+
18
+ import os
19
+ import re
20
+ import sys
21
+
22
+ REFERENCE_HEADER = "| Pairing (text on background) | Ratio | Normal text (4.5) | Large text (3.0) |"
23
+ NAMED_COLORS = {"black": (0, 0, 0), "white": (255, 255, 255)}
24
+
25
+
26
+ def parse_hex(value):
27
+ value = value.strip().lstrip("#")
28
+ if len(value) == 3:
29
+ value = "".join(ch * 2 for ch in value)
30
+ if not re.fullmatch(r"[0-9A-Fa-f]{6}", value):
31
+ raise ValueError(f"expected a hex color like #FFFFFF, got {value!r}")
32
+ return tuple(int(value[i:i + 2], 16) for i in (0, 2, 4))
33
+
34
+
35
+ def parse_pairing(pairing):
36
+ """Turn 'White on #333333' or '#555555 on black' into two RGB tuples."""
37
+ colors = []
38
+ for token in re.split(r"\s+on\s+", pairing):
39
+ token = token.strip()
40
+ match = re.search(r"#[0-9A-Fa-f]{3,6}", token)
41
+ if match:
42
+ colors.append(parse_hex(match.group(0)))
43
+ elif token.lower() in NAMED_COLORS:
44
+ colors.append(NAMED_COLORS[token.lower()])
45
+ else:
46
+ raise ValueError(f"cannot parse {token!r} from pairing {pairing!r}")
47
+ if len(colors) != 2:
48
+ raise ValueError(f"expected two colors in pairing {pairing!r}")
49
+ return tuple(colors)
50
+
51
+
52
+ def linearize(channel):
53
+ c = channel / 255.0
54
+ if c <= 0.03928:
55
+ return c / 12.92
56
+ return ((c + 0.055) / 1.055) ** 2.4
57
+
58
+
59
+ def luminance(rgb):
60
+ r, g, b = (linearize(ch) for ch in rgb)
61
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b
62
+
63
+
64
+ def contrast_ratio(color_a, color_b):
65
+ lum_a, lum_b = luminance(color_a), luminance(color_b)
66
+ lighter, darker = sorted((lum_a, lum_b), reverse=True)
67
+ return (lighter + 0.05) / (darker + 0.05)
68
+
69
+
70
+ def reference_doc_path():
71
+ here = os.path.dirname(os.path.abspath(__file__))
72
+ candidate = os.path.join(here, "SKILL.md")
73
+ return candidate if os.path.isfile(candidate) else None
74
+
75
+
76
+ def parse_reference_rows(path):
77
+ """Reference table rows from SKILL.md, with the ratio already a float.
78
+
79
+ A row that does not split into four cells is dropped silently, not raised.
80
+ """
81
+ rows = []
82
+ with open(path, encoding="utf-8") as handle:
83
+ in_table = False
84
+ for raw in handle:
85
+ line = raw.rstrip("\n")
86
+ if line.startswith(REFERENCE_HEADER):
87
+ in_table = True
88
+ continue
89
+ if not in_table:
90
+ continue
91
+ if not line.startswith("|"):
92
+ break
93
+ if line.startswith("|---"):
94
+ continue
95
+ cells = [cell.strip() for cell in line.strip().strip("|").split("|")]
96
+ if len(cells) != 4:
97
+ continue
98
+ pairing, ratio, normal, large = cells
99
+ rows.append({
100
+ "pairing": pairing,
101
+ "ratio": float(ratio),
102
+ "normal": normal,
103
+ "large": large,
104
+ })
105
+ return rows
106
+
107
+
108
+ def selftest():
109
+ doc = reference_doc_path()
110
+ if doc is None:
111
+ print("selftest: SKILL.md not found next to the script; cannot check the table")
112
+ return 2
113
+ try:
114
+ rows = parse_reference_rows(doc)
115
+ except (OSError, ValueError) as exc:
116
+ print(f"selftest: could not read the table from SKILL.md: {exc}")
117
+ return 1
118
+ if not rows:
119
+ print("selftest: no reference rows found in SKILL.md")
120
+ return 1
121
+
122
+ failures = 0
123
+ for row in rows:
124
+ color_a, color_b = parse_pairing(row["pairing"])
125
+ # The verdicts read the unrounded ratio, exactly as main() does. Rounding first
126
+ # turns a 4.498:1 pairing into a displayed 4.50 that would pass 4.5:1 on paper.
127
+ raw = contrast_ratio(color_a, color_b)
128
+ computed = round(raw, 2)
129
+ expected_normal = "Pass" if raw >= 4.5 else "Fail"
130
+ expected_large = "Pass" if raw >= 3.0 else "Fail"
131
+ if f"{computed:.2f}" != f"{row['ratio']:.2f}":
132
+ failures += 1
133
+ print(f"selftest: {row['pairing']}: table says {row['ratio']}, the formula says {computed:.2f}")
134
+ if row["normal"] != expected_normal:
135
+ failures += 1
136
+ print(f"selftest: {row['pairing']}: normal text marked {row['normal']}, should be {expected_normal}")
137
+ if row["large"] != expected_large:
138
+ failures += 1
139
+ print(f"selftest: {row['pairing']}: large text marked {row['large']}, should be {expected_large}")
140
+
141
+ if failures:
142
+ return 1
143
+ print(f"selftest: {len(rows)} reference pairs OK")
144
+ return 0
145
+
146
+
147
+ def main(argv):
148
+ if len(argv) == 1 and argv[0] == "--selftest":
149
+ return selftest()
150
+ if len(argv) != 2:
151
+ print("usage: python3 contrast-check.py <hex1> <hex2> | --selftest")
152
+ return 2
153
+ try:
154
+ ratio = contrast_ratio(parse_hex(argv[0]), parse_hex(argv[1]))
155
+ except ValueError as exc:
156
+ print(f"error: {exc}")
157
+ return 2
158
+
159
+ normal = ratio >= 4.5
160
+ large = ratio >= 3.0
161
+ print(f"ratio: {ratio:.2f}:1")
162
+ print(f"normal text (4.5:1): {'PASS' if normal else 'FAIL'}")
163
+ print(f"large text (3.0:1): {'PASS' if large else 'FAIL'}")
164
+ return 0 if normal and large else 1
165
+
166
+
167
+ if __name__ == "__main__":
168
+ sys.exit(main(sys.argv[1:]))
@@ -0,0 +1,121 @@
1
+ #!/usr/bin/env python3
2
+ """Minimal MCP stdio server exposing the antislop contrast checker as a tool.
3
+
4
+ All logging goes to stderr; stdout is reserved for JSON-RPC responses.
5
+ """
6
+ import json
7
+ import sys
8
+
9
+ PROTOCOL_VERSION = "2024-11-05"
10
+ SERVER_NAME = "antislop-contrast"
11
+ SERVER_VERSION = "3.2.26"
12
+
13
+ TOOLS = [
14
+ {
15
+ "name": "check_contrast",
16
+ "description": "Compute the WCAG contrast ratio between two hex colors and the pass or fail verdict for normal and large text. Use this instead of guessing whether a color pairing meets AA.",
17
+ "inputSchema": {
18
+ "type": "object",
19
+ "properties": {
20
+ "foreground": {"type": "string", "description": "Hex color of the text, for example #777777"},
21
+ "background": {"type": "string", "description": "Hex color of the background, for example #FFFFFF"},
22
+ },
23
+ "required": ["foreground", "background"],
24
+ },
25
+ }
26
+ ]
27
+
28
+
29
+ def _channel(c):
30
+ c = c / 255.0
31
+ return c / 12.92 if c <= 0.03928 else ((c + 0.055) / 1.055) ** 2.4
32
+
33
+
34
+ def relative_luminance(hex_color):
35
+ h = hex_color.strip().lstrip("#")
36
+ if len(h) == 3:
37
+ h = "".join(ch * 2 for ch in h)
38
+ r, g, b = (int(h[i : i + 2], 16) for i in (0, 2, 4))
39
+ return 0.2126 * _channel(r) + 0.7152 * _channel(g) + 0.0722 * _channel(b)
40
+
41
+
42
+ def contrast_ratio(fg, bg):
43
+ """The unrounded WCAG ratio. Callers decide what to print, never what to compare."""
44
+ l1, l2 = relative_luminance(fg), relative_luminance(bg)
45
+ lighter, darker = max(l1, l2), min(l1, l2)
46
+ return (lighter + 0.05) / (darker + 0.05)
47
+
48
+
49
+ def check_contrast(fg, bg):
50
+ # The threshold is read from the raw ratio: 4.498:1 fails 4.5:1 even though it
51
+ # displays as 4.50 once rounded, and a rounded verdict would report the opposite.
52
+ ratio = contrast_ratio(fg, bg)
53
+ return {
54
+ "foreground": fg,
55
+ "background": bg,
56
+ "ratio": round(ratio, 2),
57
+ "normal_text": {"threshold": 4.5, "pass": ratio >= 4.5},
58
+ "large_text": {"threshold": 3.0, "pass": ratio >= 3.0},
59
+ }
60
+
61
+
62
+ def _send(msg):
63
+ sys.stdout.write(json.dumps(msg) + "\n")
64
+ sys.stdout.flush()
65
+
66
+
67
+ def _text(content):
68
+ return {"content": [{"type": "text", "text": content}], "isError": False}
69
+
70
+
71
+ def _error(message):
72
+ return {"content": [{"type": "text", "text": message}], "isError": True}
73
+
74
+
75
+ def _reply(msg_id, result):
76
+ _send({"jsonrpc": "2.0", "id": msg_id, "result": result})
77
+
78
+
79
+ def main():
80
+ for line in sys.stdin:
81
+ line = line.strip()
82
+ if not line:
83
+ continue
84
+ try:
85
+ msg = json.loads(line)
86
+ except json.JSONDecodeError:
87
+ continue
88
+
89
+ msg_id = msg.get("id")
90
+ method = msg.get("method")
91
+
92
+ if method == "initialize":
93
+ _reply(msg_id, {
94
+ "protocolVersion": PROTOCOL_VERSION,
95
+ "capabilities": {"tools": {}},
96
+ "serverInfo": {"name": SERVER_NAME, "version": SERVER_VERSION},
97
+ })
98
+ elif method == "notifications/initialized":
99
+ pass
100
+ elif method == "ping":
101
+ _reply(msg_id, {})
102
+ elif method == "tools/list":
103
+ _reply(msg_id, {"tools": TOOLS})
104
+ elif method == "tools/call":
105
+ params = msg.get("params") or {}
106
+ name = params.get("name")
107
+ args = params.get("arguments") or {}
108
+ if name == "check_contrast":
109
+ try:
110
+ result = check_contrast(args["foreground"], args["background"])
111
+ _reply(msg_id, _text(json.dumps(result)))
112
+ except Exception as exc:
113
+ _reply(msg_id, _error("check_contrast failed: " + str(exc)))
114
+ else:
115
+ _reply(msg_id, _error("Unknown tool: " + str(name)))
116
+ elif msg_id is not None:
117
+ _reply(msg_id, {})
118
+
119
+
120
+ if __name__ == "__main__":
121
+ main()