Rules for an AI coding agent to filter out generic AI-generated UI designs, text, and code.
JavaScript accessibilityagent-skillsai-agentsai-coding-agentai-slopanti-slopclaude-codecopywritingdesign-rulesui-design
v3.2.21: read the contrast threshold from the unrounded ratio (#43)
a22riz77e1920ad5e5
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonindex 1593d1f..8ddf767 100644--- a/.claude-plugin/marketplace.json+++ b/.claude-plugin/marketplace.json@@ -8,7 +8,7 @@{"name": "antislop","source": "./",- "version": "3.2.20",+ "version": "3.2.21","description": "Anti Slop: Rules for AI Coding Agents. Stops generic AI slop in generated UI, copy, and code. Loads as six skills."}]diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex 8b559be..8fa334d 100644--- a/.claude-plugin/plugin.json+++ b/.claude-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "antislop","displayName": "antislop",- "version": "3.2.20",+ "version": "3.2.21","description": "Anti Slop: Rules for AI Coding Agents. Stops generic AI slop in generated UI, copy, and code. Loads as six skills.","author": {"name": "miqdadbadjuber"diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.jsonindex 24048f1..d25ea1b 100644--- a/.codex-plugin/plugin.json+++ b/.codex-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "antislop",- "version": "3.2.20",+ "version": "3.2.21","description": "Anti Slop: Rules for AI Coding Agents. Stops generic AI slop in generated UI, copy, and code. Loads as six skills.","author": {"name": "miqdadbadjuber"diff --git a/.cursor-plugin/plugin.json b/.cursor-plugin/plugin.jsonindex 39905de..0a5b243 100644--- a/.cursor-plugin/plugin.json+++ b/.cursor-plugin/plugin.json@@ -2,7 +2,7 @@"name": "antislop","displayName": "antislop","description": "Anti Slop: Rules for AI Coding Agents. Stops generic AI slop in generated UI, copy, and code. Loads as six skills.",- "version": "3.2.20",+ "version": "3.2.21","author": {"name": "miqdadbadjuber"},diff --git a/.kimi-plugin/plugin.json b/.kimi-plugin/plugin.jsonindex 4a9cb99..f3e3609 100644--- a/.kimi-plugin/plugin.json+++ b/.kimi-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "antislop",- "version": "3.2.20",+ "version": "3.2.21","description": "Anti Slop: Rules for AI Coding Agents. Stops generic AI slop in generated UI, copy, and code. Loads as six skills.","author": {"name": "miqdadbadjuber"diff --git a/.omp-plugin/marketplace.json b/.omp-plugin/marketplace.jsonindex 1593d1f..8ddf767 100644--- a/.omp-plugin/marketplace.json+++ b/.omp-plugin/marketplace.json@@ -8,7 +8,7 @@{"name": "antislop","source": "./",- "version": "3.2.20",+ "version": "3.2.21","description": "Anti Slop: Rules for AI Coding Agents. Stops generic AI slop in generated UI, copy, and code. Loads as six skills."}]diff --git a/GUIDE.md b/GUIDE.mdindex 6284327..130535f 100644--- a/GUIDE.md+++ b/GUIDE.md@@ -185,7 +185,7 @@ npx antislop-aiAnswer the questions exactly as you did the first time. When it reaches folders you already have, it prints what it found before asking anything:```-▲ Already here: antislop 3.2.19. This installer carries 3.2.20.+▲ Already here: antislop 3.2.20. This installer carries 3.2.21.```Then it asks one extra question:diff --git a/README.md b/README.mdindex 538f547..90f962c 100644--- a/README.md+++ b/README.md@@ -205,11 +205,10 @@ A folder that goes deeper into one concern, holding a `SKILL.md` with its rules.## Roadmap-**v3.2.20** adds opt-in usage-mode preferences and announces the active mode and its source. It builds on the v3.2.19 changes:+**v3.2.21** reads the contrast threshold from the unrounded ratio, so a pairing that computes to 4.4983:1 no longer reports 4.50 and passes 4.5:1, and the boundary is pinned in the reference table. It builds on the v3.2.20 changes:-- **The community files.** CONTRIBUTING.md, CODE_OF_CONDUCT.md, issue templates, and a pull request template, so the repository reads as one you can join and not only one you can install.-- **A README rebuilt.** One heading per install route, and the detail that used to be repeated here moved to the guide, where it is written out in more depth.-- **A guide rebuilt.** One section per route, so install, update, and removal sit together instead of being written out three times, and a catalogue of every named pattern generated from the skills themselves and checked in CI.+- **Usage modes as a saved preference.** Saving a mode is opt-in, a saved mode announces its source, an explicit choice in the current session still wins, and `--mode ask` restores the question.+- **A guide that covers it.** The Usage modes section walks the commands, the settings file on each platform, and what an unsaved preference means.Every earlier release, and what comes next, is in [ROADMAP.md](ROADMAP.md).@@ -223,7 +222,7 @@ Thanks to everyone who helps make antislop better.<p align="center"><a href="https://github.com/miqdadbadjuber/anti-slop/graphs/contributors">- <img src="https://contrib.rocks/image?repo=miqdadbadjuber/anti-slop&v=3.2.20" alt="antislop contributors" />+ <img src="https://contrib.rocks/image?repo=miqdadbadjuber/anti-slop&v=3.2.21" alt="antislop contributors" /></a></p>diff --git a/ROADMAP.md b/ROADMAP.mdindex 81d90b4..71958a4 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -11,7 +11,7 @@## Where we are-The latest release is **v3.2.20**. antislop is a packaged system: a lean, always-loaded core plus five additive skills, each a standard agent skill folder at `skills/<name>/SKILL.md`.+The latest release is **v3.2.21**. antislop is a packaged system: a lean, always-loaded core plus five additive skills, each a standard agent skill folder at `skills/<name>/SKILL.md`.- **The core.** 38 rules in three tiers (Hard Gate, Purpose-Gate, Quality Locks), a Liveliness Toolkit, a mandatory Delivery Gate, and two usage modes (During / After). The single-file `antislop.md` is the same filter, pasteable into any chat window.- **Usage-mode preferences.** Saving a global mode is opt-in. Without a settings file, every session still asks during or after. Saved modes announce their source, explicit session choices take precedence, and `--mode ask` restores the question.@@ -61,6 +61,7 @@ Up to v3.0.0 each +0.1 shipped exactly one new skill, which kept the filter pull| v3.2.18 | Oh My Pi plugin door, also verified on a real install. The catalog is documented and the manifest was not, so `.omp-plugin/` ships only the catalog. || v3.2.19 | The community files (CONTRIBUTING.md, CODE_OF_CONDUCT.md, the issue templates, and a pull request template), a README and a guide read end to end for the first time since v3.0.0, and a skill catalogue generated into the guide. || v3.2.20 | Usage modes become a saved preference, opt-in and announced with its source, with a session choice still winning. From community PR #29. |+| v3.2.21 | The contrast checker reads the threshold from the unrounded ratio, so a pairing between 4.495 and 4.5 no longer reports 4.50 and passes 4.5:1. From community PR #43. |## What's next@@ -74,7 +75,7 @@ Every door is verified against the vendor's current documentation before its ver| Version | Item | What it means ||---------|------|---------------|-| v3.2.21 | Maintenance | A macOS probe, because none of the door probes above ran on it, so a report from that platform can be split into what the installer got wrong and what the agent's own configuration explains. No new agent: a `windows-latest` CI job, because CI runs on Linux alone while this repository is developed on Windows, plus a re-check of the plugin-door probes against real installs and probes for the three doors the installer still cannot see (Kimi Code, Cline, and Oh My Pi), so the notice that follows an install names all seven rather than four. |+| v3.2.22 | Maintenance | A macOS probe, because none of the door probes above ran on it, so a report from that platform can be split into what the installer got wrong and what the agent's own configuration explains. No new agent: a `windows-latest` CI job, because CI runs on Linux alone while this repository is developed on Windows, plus a re-check of the plugin-door probes against real installs and probes for the three doors the installer still cannot see (Kimi Code, Cline, and Oh My Pi), so the notice that follows an install names all seven rather than four. |Beyond the numbered plan, with no promised version:diff --git a/cli/lib/banner.mjs b/cli/lib/banner.mjsindex 6450b69..d529762 100644--- a/cli/lib/banner.mjs+++ b/cli/lib/banner.mjs@@ -15,7 +15,7 @@ export function banner() {...LOGO,'',' ' + pc.dim('Anti Slop: Rules for AI Coding Agents'),- ' ' + pc.dim('installer v3.2.20'),+ ' ' + pc.dim('installer v3.2.21'),'',].join('\n')}diff --git a/cli/package-lock.json b/cli/package-lock.jsonindex ba13791..32f9605 100644--- a/cli/package-lock.json+++ b/cli/package-lock.json@@ -1,12 +1,12 @@{"name": "antislop-ai",- "version": "3.2.20",+ "version": "3.2.21","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "antislop-ai",- "version": "3.2.20",+ "version": "3.2.21","license": "MIT","dependencies": {"@clack/prompts": "^1.7.0",diff --git a/cli/package.json b/cli/package.jsonindex 2359076..894584f 100644--- a/cli/package.json+++ b/cli/package.json@@ -1,6 +1,6 @@{"name": "antislop-ai",- "version": "3.2.20",+ "version": "3.2.21","description": "Interactive installer for the antislop skills. Anti Slop: Rules for AI Coding Agents.","type": "module","bin": {diff --git a/package.json b/package.jsonindex db2c22b..516e3e8 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "antislop",- "version": "3.2.20",+ "version": "3.2.21","private": true,"type": "module","description": "Anti Slop: Rules for AI Coding Agents.",diff --git a/skills/antislop-human/SKILL.md b/skills/antislop-human/SKILL.mdindex 0287951..273bbf9 100644--- a/skills/antislop-human/SKILL.md+++ b/skills/antislop-human/SKILL.md@@ -62,7 +62,7 @@ If the `${CLAUDE_SKILL_DIR}` variable is not available in this agent, point the1. 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).+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).**The reference table** (common pairings, computed with the formula):@@ -73,10 +73,13 @@ If the `${CLAUDE_SKILL_DIR}` variable is not available in this agent, point the| White on #333333 | 12.63 | Pass | Pass || White on #666666 | 5.74 | Pass | Pass || #777777 on white | 4.48 | Fail | Pass |+| #777777 on #070707 | 4.50 | Fail | Pass || White on #888888 | 3.54 | Fail | Pass || White on #999999 | 2.85 | Fail | Fail || #555555 on black | 2.82 | Fail | Fail |+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.+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.## Keyboarddiff --git a/skills/antislop-human/contrast-check.py b/skills/antislop-human/contrast-check.pyindex 4c93693..63287d6 100644--- a/skills/antislop-human/contrast-check.py+++ b/skills/antislop-human/contrast-check.py@@ -122,9 +122,12 @@ def selftest():failures = 0for row in rows:color_a, color_b = parse_pairing(row["pairing"])- computed = round(contrast_ratio(color_a, color_b), 2)- expected_normal = "Pass" if computed >= 4.5 else "Fail"- expected_large = "Pass" if computed >= 3.0 else "Fail"+ # The verdicts read the unrounded ratio, exactly as main() does. Rounding first+ # turns a 4.498:1 pairing into a displayed 4.50 that would pass 4.5:1 on paper.+ raw = contrast_ratio(color_a, color_b)+ computed = round(raw, 2)+ expected_normal = "Pass" if raw >= 4.5 else "Fail"+ expected_large = "Pass" if raw >= 3.0 else "Fail"if f"{computed:.2f}" != f"{row['ratio']:.2f}":failures += 1print(f"selftest: {row['pairing']}: table says {row['ratio']}, the formula says {computed:.2f}")diff --git a/skills/antislop-human/contrast-mcp.py b/skills/antislop-human/contrast-mcp.pyindex 77ebec9..54206a7 100644--- a/skills/antislop-human/contrast-mcp.py+++ b/skills/antislop-human/contrast-mcp.py@@ -8,7 +8,7 @@ import sysPROTOCOL_VERSION = "2024-11-05"SERVER_NAME = "antislop-contrast"-SERVER_VERSION = "3.2.20"+SERVER_VERSION = "3.2.21"TOOLS = [{@@ -40,17 +40,20 @@ def relative_luminance(hex_color):def contrast_ratio(fg, bg):+ """The unrounded WCAG ratio. Callers decide what to print, never what to compare."""l1, l2 = relative_luminance(fg), relative_luminance(bg)lighter, darker = max(l1, l2), min(l1, l2)- return round((lighter + 0.05) / (darker + 0.05), 2)+ return (lighter + 0.05) / (darker + 0.05)def check_contrast(fg, bg):+ # The threshold is read from the raw ratio: 4.498:1 fails 4.5:1 even though it+ # displays as 4.50 once rounded, and a rounded verdict would report the opposite.ratio = contrast_ratio(fg, bg)return {"foreground": fg,"background": bg,- "ratio": ratio,+ "ratio": round(ratio, 2),"normal_text": {"threshold": 4.5, "pass": ratio >= 4.5},"large_text": {"threshold": 3.0, "pass": ratio >= 3.0},}diff --git a/skills/antislop/VERSION b/skills/antislop/VERSIONindex 476df44..66870d9 100644--- a/skills/antislop/VERSION+++ b/skills/antislop/VERSION@@ -1 +1 @@-3.2.20+3.2.21