antislop-code
Code comment hygiene for AI coding agents: remove generic AI-slop comments, keep the valuable…
Human and accessibility skill for antislop. Contrast, keyboard, focus, and states for real people. Includes the contrast checker.
$ npx -y skills add miqdadbadjuber/anti-slop --skill antislop-human --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/antislop-humanContext preview
The summary Claude sees to decide when to auto-load this skill.
Human and accessibility skill for antislop. Contrast, keyboard, focus, and states for real people. Includes the contrast checker.
name: antislop-human description: "Human and accessibility skill for antislop. Contrast, keyboard, focus, and states for real people. Includes the contrast checker." allowed-tools: Bash(python *) Bash(python3 *) Read Write Edit Glob Grep
> 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.
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 (`c = hex / 255`), then linearize: if `c <= 0.03928`, `c_lin = c / 12.92`; otherwise `c_lin = ((c + 0.055) / 1.055)^2.4`. 3. `L = 0.2126*R + 0.7152*G + 0.0722*B`. 4. Round the ratio to two decimals and compare: 4.5:1 for normal text, 3:1 for large text (18px+, per R-25). The maximum ratio is 21.0 (black on white).
**The reference table** (common pairings, computed with the formula):
| Pairing (text on background) | Ratio | Normal text (4.5) | Large text (3.0) | |------------------------------|-------|-------------------|------------------| | Black on white | 21.00 | Pass | Pass | | White on black | 21.00 | Pass | Pass | | White on #333333 | 12.63 | Pass | Pass | | White on #666666 | 5.74 | Pass | Pass | | #777777 on white | 4.48 | Fail | Pass | | White on #888888 | 3.54 | Fail | Pass | | White on #999999 | 2.85 | Fail | Fail | | #555555 on black | 2.82 | Fail | Fail |
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.
Rules for an AI coding agent to filter out generic AI-generated UI designs, text, and code.
Repo: miqdadbadjuber/anti-slop
Code comment hygiene for AI coding agents: remove generic AI-slop comments, keep the valuable…
Copy and text skill for antislop. Use when writing or editing prose: headlines, tone, CTAs,…
Mobile layout skill for antislop. Use for layouts that reflow across screen sizes, phone to…
UI and visual skill for antislop. Use when building or editing any interface: color, layout,…
Anti Slop: Rules for AI Coding Agents. The core filter. Load always to stop generic AI slop.