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.24: repair the reference snippets, complete WCAG AAA, align the release surfaces
miqdadbadjuber13883c779a45
diff --git a/GUIDE.md b/GUIDE.mdindex 25825b5..4060343 100644--- a/GUIDE.md+++ b/GUIDE.md@@ -574,6 +574,7 @@ Load it when the AI builds or restyles anything you can see: color, layout, card| App & Dashboard | Default Dashboard Shell, Stat Cards With Invented Numbers, Filler Activity Feed, Charts Without a Question, Generic Table Columns, Filler Data in Fields and Columns, Placeholder Empty and Loading States || Motion | Endless Pulses and Loops, Template Animations Stacked || Performance | Unsized Media That Shifts the Layout, Hero Image Loaded Like Any Other Image, Render-Blocking Third-Party Script |+| Page Basics | Web Baseline Checklist |### antislop-copywritingdiff --git a/README.md b/README.mdindex c497a5c..9b16dcd 100644--- a/README.md+++ b/README.md@@ -164,9 +164,9 @@ The core prevents slop but cannot invent direction. `DESIGN.md` (yours) supplies| Skill | Covers | Pick it for ||-------|--------|-------------|| antislop | The core filter: rules, tiers, the Delivery Gate, liveliness | Everything. Always loaded |-| antislop-ui | Layout, color, components, decoration, motion, structure | UI and visual work |+| antislop-ui | Layout, color, components, decoration, motion, structure, performance | UI and visual work || antislop-copywriting | Headlines, CTAs, tone, fake stats, anti-AI writing, markdown hygiene | Copy and text |-| antislop-human | Contrast, keyboard, focus, states | Accessibility |+| antislop-human | Contrast, keyboard, focus, states, interaction affordances | Accessibility || antislop-layoutmobile | Reflow across screen widths, breakpoints, grids, overflow, tap targets | Responsive work || antislop-code | AI-slop comments: which to remove, which to keep | Comment cleanup |diff --git a/antislop.md b/antislop.mdindex a2b8b4a..968c311 100644--- a/antislop.md+++ b/antislop.md@@ -426,9 +426,9 @@ If an element genuinely cannot have a destination yet, remove it instead of ship#### R-39 — Accessible Semantics & Interaction Affordances-Every control the task builds or edits must say what it is and that it can be used. Keyboard operation and the focus indicator are R-32; touch target size is R-03.+Every control and image the task builds or edits must say what it is; every control must also show that it can be used. Keyboard operation and the focus indicator are R-32; touch target size is R-03.-- **REQUIRED**: every enabled interactive element (`a[href]`, `button`, `summary`, `select`, `label[for]`, checkbox, radio, custom `role="button"`/`tab`/`switch`) shows `cursor: pointer`, set once in the base CSS layer; disabled controls show `cursor: not-allowed`+- **REQUIRED**: every enabled interactive element (`a[href]`, `button`, `summary`, `select`, `label[for]`, a label wrapping its checkbox or radio, checkbox, radio, custom `role="button"`/`tab`/`switch`) shows `cursor: pointer`, set once in the base CSS layer; disabled controls show `cursor: not-allowed`- **REQUIRED**: actions are `<button>`, navigation is `<a href>` to a real destination; no clickable `div`/`span`, and a custom control that cannot be native also meets R-32- **REQUIRED**: every control has an accessible name (icon-only buttons get `aria-label` or visually hidden text, the icon gets `aria-hidden="true"`); every image has `alt` (empty `alt=""` when decorative); every form field has a visible `<label>`- **REQUIRED**: distinct hover, active, and disabled states, never color alone@@ -691,8 +691,8 @@ Before declaring the design done, answer every question below. All answers must- [ ] Are there any fabricated security, compliance, performance, or customer claims? *(R-36)*- [ ] Was the design built without direction and not labeled *"draft without direction"* with honest default dials ENERGY 1 / RHYTHM 1 / MOTION 1? *(R-37)*- [ ] Is there any realistically-styled content that was fabricated (testimonials, features, statistics, ghost links, fictional team) without a real source? *(R-38)*-- [ ] Does any control lack `cursor: pointer`, a native element, an accessible name, or hover/active/disabled states; any field a visible label or image its `alt`; does motion ignore `prefers-reduced-motion`; or does a whole document lack `lang`, `<title>`, or landmarks, or block zoom? *(R-39)*-- [ ] Does any media element ship without dimensions, the hero image load lazily or without `fetchpriority="high"`, a third-party script block render in `<head>`, or a performance number get reported that was not measured? *(R-40)*+- [ ] Does any control lack `cursor: pointer`, a native element, an accessible name, or hover/active/disabled states; any field a visible label or image its `alt`; does motion ignore `prefers-reduced-motion` or run longer than 5 seconds without a pause control; does ARIA contradict the native role; or does a whole document lack `lang`, `<title>`, or landmarks, or block zoom? *(R-39)*+- [ ] Does any media element ship without dimensions, any late content without reserved space, the hero image load lazily or without `fetchpriority="high"`, a third-party script block render in `<head>`, or a performance number get reported that was not measured? *(R-40)*### Block 2: Purpose-Gate (technique allowed, reason required)diff --git a/skills/antislop-human/SKILL.md b/skills/antislop-human/SKILL.mdindex a7d096e..8816efc 100644--- a/skills/antislop-human/SKILL.md+++ b/skills/antislop-human/SKILL.md@@ -1,6 +1,6 @@---name: antislop-human-description: "Human and accessibility skill for antislop. Contrast, keyboard, focus, and states for real people. Includes the contrast checker."+description: "Human and accessibility skill for antislop. Contrast, keyboard, focus, states, and interaction affordances for real people. Includes the contrast checker."allowed-tools: Bash(python *) Bash(python3 *) Read Write Edit Glob Grep---# antislop-humandiff --git a/skills/antislop-human/references/A11Y-PATTERNS.md b/skills/antislop-human/references/A11Y-PATTERNS.mdindex 8d74a49..3c8a4fd 100644--- a/skills/antislop-human/references/A11Y-PATTERNS.md+++ b/skills/antislop-human/references/A11Y-PATTERNS.md@@ -12,6 +12,7 @@ Set once, in the base CSS layer, so no component has to remember it (R-39). A CS```cssa[href], button, summary, select, label[for],+label:has(> input[type="checkbox"], > input[type="radio"]),[role="button"], [role="link"], [role="tab"], [role="menuitem"], [role="option"], [role="switch"],input[type="checkbox"], input[type="radio"], input[type="file"],input[type="submit"], input[type="button"], input[type="reset"], input[type="range"], input[type="color"] {@@ -20,39 +21,47 @@ input[type="submit"], input[type="button"], input[type="reset"], input[type="ran:disabled, [aria-disabled="true"] { cursor: not-allowed; }```-Text inputs keep `cursor: text`, and drag handles use `grab` / `grabbing`.+Text inputs keep `cursor: text`, and drag handles use `grab` / `grabbing`. An implicit label that wraps a checkbox or radio is included, since clicking it toggles the control.## Modal focus trapTrap keyboard focus inside a modal dialog so Tab/Shift+Tab cycle through its focusable elements and Escape closes it.```javascript-function openModal(modal) {- const focusableElements = modal.querySelectorAll(+function trapFocus(modal, onClose) {+ const focusable = modal.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');- const firstElement = focusableElements[0];- const lastElement = focusableElements[focusableElements.length - 1];-- modal.addEventListener('keydown', (e) => {- if (e.key === 'Tab') {- if (e.shiftKey && document.activeElement === firstElement) {- e.preventDefault();- lastElement.focus();- } else if (!e.shiftKey && document.activeElement === lastElement) {- e.preventDefault();- firstElement.focus();- }+ if (focusable.length === 0) return () => {};++ const first = focusable[0];+ const last = focusable[focusable.length - 1];++ function onKeydown(e) {+ if (e.key === 'Escape') return onClose();+ if (e.key !== 'Tab') return;+ if (e.shiftKey && document.activeElement === first) {+ e.preventDefault();+ last.focus();+ } else if (!e.shiftKey && document.activeElement === last) {+ e.preventDefault();+ first.focus();}- if (e.key === 'Escape') {- closeModal();- }- });+ }- firstElement.focus();+ modal.addEventListener('keydown', onKeydown);+ first.focus();+ return () => modal.removeEventListener('keydown', onKeydown);}```+Call the returned function when the dialog closes, or a second open stacks a second listener:++```javascript+const release = trapFocus(dialog, () => dialog.close());+dialog.addEventListener('close', release, { once: true });+```+The native `<dialog>` element handles focus trapping automatically, prefer it when browser support allows.---@@ -95,6 +104,7 @@ Announce errors to screen readers and focus the first invalid field on submit.```html<form novalidate>+ <div id="error-summary" tabindex="-1" hidden></div><div class="field" aria-live="polite"><label for="email">Email</label><input type="email" id="email"@@ -108,20 +118,23 @@ Announce errors to screen readers and focus the first invalid field on submit.``````javascript+const form = document.querySelector('form');+const summary = document.getElementById('error-summary');+form.addEventListener('submit', (e) => {- const firstError = form.querySelector('[aria-invalid="true"]');- if (firstError) {- e.preventDefault();- firstError.focus();-- const errorSummary = document.getElementById('error-summary');- errorSummary.textContent =- `${errors.length} errors found. Please fix them and try again.`;- errorSummary.focus();- }+ const invalid = [...form.querySelectorAll('[aria-invalid="true"]')];+ if (invalid.length === 0) return;++ e.preventDefault();+ summary.textContent =+ `${invalid.length} errors found. Please fix them and try again.`;+ summary.hidden = false;+ invalid[0].focus();});```+This handler reports what the validation already marked: set `aria-invalid="true"` and the field's error text before submit runs.+---## Form labels@@ -213,12 +226,12 @@ Use `aria-live` to announce dynamic content changes to screen readers without mo```html<!-- Status updates (polite, waits for pause in speech) -->-<div aria-live="polite" aria-atomic="true" class="status">+<div id="polite-announcer" aria-live="polite" aria-atomic="true" class="status"><!-- Content updates announced to screen readers --></div><!-- Urgent alerts (assertive, interrupts) -->-<div role="alert" aria-live="assertive">+<div id="assertive-announcer" role="alert" aria-live="assertive"><!-- Interrupts current announcement --></div>```diff --git a/skills/antislop-human/references/WCAG.md b/skills/antislop-human/references/WCAG.mdindex 34ce8a3..3ea90ba 100644--- a/skills/antislop-human/references/WCAG.md+++ b/skills/antislop-human/references/WCAG.md@@ -73,7 +73,13 @@| Criterion | Description ||-----------|-------------|+| **1.2.6** Sign Language (Prerecorded) | Pre-recorded video has a sign language interpretation |+| **1.2.7** Extended Audio Description (Prerecorded) | Video pauses long enough for audio description to convey the visuals |+| **1.2.8** Media Alternative (Prerecorded) | A text alternative covers everything the pre-recorded media shows |+| **1.2.9** Audio-only (Live) | Live audio-only content has a text alternative |+| **1.3.6** Identify Purpose | Icons and regions have a programmatically determined purpose || **1.4.6** Contrast (Enhanced) | 7:1 for normal text, 4.5:1 for large text |+| **1.4.7** Low or No Background Audio | Speech stays understandable over background sound || **1.4.8** Visual Presentation | Foreground/background colors can be selected || **1.4.9** Images of Text (No Exception) | No images of text || **2.1.3** Keyboard (No Exception) | All functionality keyboard accessible |@@ -88,6 +94,8 @@| **2.4.10** Section Headings | Sections have headings || **2.4.12** Focus Not Obscured (Enhanced) | No part of the focused element is hidden by author-created content || **2.4.13** Focus Appearance | Focus indicator has sufficient area, contrast, and is not obscured |+| **2.5.5** Target Size (Enhanced) | Interactive targets are at least 44×44 CSS pixels |+| **2.5.6** Concurrent Input Mechanisms | Content does not restrict which input modality a person uses || **3.1.3** Unusual Words | Definitions available for unusual words || **3.1.4** Abbreviations | Abbreviations expanded || **3.1.5** Reading Level | Alternative content for complex text |diff --git a/skills/antislop-ui/SKILL.md b/skills/antislop-ui/SKILL.mdindex 5398431..b11bc8c 100644--- a/skills/antislop-ui/SKILL.md+++ b/skills/antislop-ui/SKILL.md@@ -1,6 +1,6 @@---name: antislop-ui-description: "UI and visual skill for antislop. Use when building or editing any interface: color, layout, components, motion. Load with the core."+description: "UI and visual skill for antislop. Use when building or editing any interface: color, layout, components, motion, and page performance. Load with the core."allowed-tools: Read Write Edit Glob Grep---# antislop-ui@@ -312,9 +312,15 @@ A page that looks finished but shifts under the thumb or shows its main image la- **Why:** nothing paints until someone else's server answers, which on a phone on a slow network is the whole first impression (R-40).- **Fix:** `defer`/`async`, or load on interaction.-### Web Baseline (optional)+## Page Basics-[references/WEB-BASELINE.md](references/WEB-BASELINE.md) lists page basics and security defaults (doctype, mixed content, client secrets). It is a checklist to run when the task asks for it, not a gate.+Optional page-level checks. Not a gate.++### Web Baseline Checklist++- **Tell:** a page shipped with no doctype, mixed `http://` content, a secret in client code, or an unpinned third-party script.+- **Why:** none of it shows in a screenshot, so it is the first thing skipped, and each one is expensive to find after launch.+- **Fix:** run the checklist in [references/WEB-BASELINE.md](references/WEB-BASELINE.md) when the task asks for a production-ready page or a web-quality review.## UI Skill Checklistdiff --git a/skills/antislop/SKILL.md b/skills/antislop/SKILL.mdindex d8d0a68..41e691d 100644--- a/skills/antislop/SKILL.md+++ b/skills/antislop/SKILL.md@@ -431,9 +431,9 @@ If an element genuinely cannot have a destination yet, remove it instead of ship#### R-39 — Accessible Semantics & Interaction Affordances-Every control the task builds or edits must say what it is and that it can be used. Keyboard operation and the focus indicator are R-32; touch target size is R-03.+Every control and image the task builds or edits must say what it is; every control must also show that it can be used. Keyboard operation and the focus indicator are R-32; touch target size is R-03.-- **REQUIRED**: every enabled interactive element (`a[href]`, `button`, `summary`, `select`, `label[for]`, checkbox, radio, custom `role="button"`/`tab`/`switch`) shows `cursor: pointer`, set once in the base CSS layer; disabled controls show `cursor: not-allowed`+- **REQUIRED**: every enabled interactive element (`a[href]`, `button`, `summary`, `select`, `label[for]`, a label wrapping its checkbox or radio, checkbox, radio, custom `role="button"`/`tab`/`switch`) shows `cursor: pointer`, set once in the base CSS layer; disabled controls show `cursor: not-allowed`- **REQUIRED**: actions are `<button>`, navigation is `<a href>` to a real destination; no clickable `div`/`span`, and a custom control that cannot be native also meets R-32- **REQUIRED**: every control has an accessible name (icon-only buttons get `aria-label` or visually hidden text, the icon gets `aria-hidden="true"`); every image has `alt` (empty `alt=""` when decorative); every form field has a visible `<label>`- **REQUIRED**: distinct hover, active, and disabled states, never color alone@@ -696,8 +696,8 @@ Before declaring the design done, answer every question below. All answers must- [ ] Are there any fabricated security, compliance, performance, or customer claims? *(R-36)*- [ ] Was the design built without direction and not labeled *"draft without direction"* with honest default dials ENERGY 1 / RHYTHM 1 / MOTION 1? *(R-37)*- [ ] Is there any realistically-styled content that was fabricated (testimonials, features, statistics, ghost links, fictional team) without a real source? *(R-38)*-- [ ] Does any control lack `cursor: pointer`, a native element, an accessible name, or hover/active/disabled states; any field a visible label or image its `alt`; does motion ignore `prefers-reduced-motion`; or does a whole document lack `lang`, `<title>`, or landmarks, or block zoom? *(R-39)*-- [ ] Does any media element ship without dimensions, the hero image load lazily or without `fetchpriority="high"`, a third-party script block render in `<head>`, or a performance number get reported that was not measured? *(R-40)*+- [ ] Does any control lack `cursor: pointer`, a native element, an accessible name, or hover/active/disabled states; any field a visible label or image its `alt`; does motion ignore `prefers-reduced-motion` or run longer than 5 seconds without a pause control; does ARIA contradict the native role; or does a whole document lack `lang`, `<title>`, or landmarks, or block zoom? *(R-39)*+- [ ] Does any media element ship without dimensions, any late content without reserved space, the hero image load lazily or without `fetchpriority="high"`, a third-party script block render in `<head>`, or a performance number get reported that was not measured? *(R-40)*### Block 2: Purpose-Gate (technique allowed, reason required)