web-interface-guidelines
AGENTS.md970 starsChanged 40 days agoMITView on GitHub
Concise rules for building accessible, fast, delightful UIs. Use MUST/SHOULD/NEVER to guide decisions.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
108 rules. About 1 is common, 50 are distinctive, and 57 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈50
Distinctive · estimate
This author's own choices. Worth a look.
57
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 7
MUST: Full keyboard support per WAI-ARIA APG
- Very specific: line 8
MUST: Visible, unobscured focus rings (:focus-visible.
- Distinctive: line 9
MUST: Manage focus (trap, move, return) per APG patterns
- Very specific: line 10
NEVER: outline: none without visible focus replacement
- Distinctive: line 14
MUST: Hit target ≥24px (mobile ≥44px).
- Very specific: line 15
MUST: Mobile <input> font-size ≥16px to prevent iOS zoom
- Very specific: line 16
NEVER: Disable browser zoom (user-scalable=no, maximum-scale=1)
- Very specific: line 17
MUST: touch-action: manipulation to prevent double-tap zoom
- Very specific: line 18
SHOULD: Set -webkit-tap-highlight-color to match design
- Distinctive: line 22
MUST: Hydration-safe inputs (no lost focus/value)
- Very specific: line 23
NEVER: Block paste in <input>/<textarea>
- Distinctive: line 24
MUST: Loading buttons show spinner and keep original label
- Very specific: line 25
MUST: Enter submits focused input.
- Distinctive: line 26
MUST: Keep submit enabled until request starts.
- Distinctive: line 27
MUST: Accept free text, validate after—don't block typing
- Distinctive: line 28
MUST: Allow incomplete form submission to surface validation
- Distinctive: line 29
MUST: Errors inline next to fields.
- Very specific: line 30
MUST: autocomplete + meaningful name.
- Very specific: line 31
SHOULD: Disable spellcheck for emails/codes/usernames
- Very specific: line 32
SHOULD: Placeholders end with … and show example pattern
- Distinctive: line 33
MUST: Warn on unsaved changes before navigation
- Common: line 34
MUST: Compatible with password managers & 2FA.
- Distinctive: line 35
MUST: Trim values to handle text expansion trailing spaces
- Distinctive: line 36
MUST: No dead zones on checkboxes/radios.
- Very specific: line 40
MUST: URL reflects state (deep-link filters/tabs/pagination/expanded panels)
- Distinctive: line 41
MUST: Back/Forward restores scroll position
- Very specific: line 42
MUST: Links use <a>/<Link> for navigation (support Cmd/Ctrl/middle-click)
- Very specific: line 43
NEVER: Use <div onClick> for navigation
- Distinctive: line 47
SHOULD: Optimistic UI; reconcile on response.
- Distinctive: line 48
MUST: Confirm destructive actions or provide Undo window
- Very specific: line 49
MUST: Use polite aria-live for toasts/inline validation
- Very specific: line 50
SHOULD: Ellipsis (…) for options opening follow-ups ("Rename…") and loading states ("Loading…")
- Distinctive: line 54
MUST: Generous targets, clear affordances.
- Distinctive: line 55
MUST: Delay first tooltip.
- Very specific: line 56
MUST: overscroll-behavior: contain in modals/drawers
- Very specific: line 57
SHOULD: When suppressing page rubber-band bounce, set overscroll-behavior: none on <html> inside @media (pointer: fine).
- Very specific: line 58
MUST: During drag, disable text selection and set inert on dragged elements
- Very specific: line 59
MUST: Drag/swipe/pinch/path gestures have a tap/click and keyboard alternative unless essential
- Distinctive: line 60
MUST: If it looks clickable, it must be clickable
- Distinctive: line 64
SHOULD: Autofocus on desktop with single primary input.
- Very specific: line 68
MUST: Honor prefers-reduced-motion (provide reduced variant or disable)
- Distinctive: line 69
SHOULD: Prefer CSS > Web Animations API > JS libraries
- Very specific: line 70
MUST: Animate compositor-friendly props (transform, opacity) only
- Very specific: line 71
NEVER: Animate layout props (top, left, width, height)
- Very specific: line 72
NEVER: transition: all—list properties explicitly
- Distinctive: line 73
SHOULD: Animate only to clarify cause/effect or add deliberate delight
- Very specific: line 74
SHOULD: Choose easing to match the change (size/distance/trigger)
- Distinctive: line 75
MUST: Animations interruptible and input-driven.
- Distinctive: line 76
MUST: Autoplay motion >5s alongside other content has pause, stop, or hide controls
- Very specific: line 77
MUST: Correct transform-origin (motion starts where it "physically" should)
- Very specific: line 78
MUST: SVG transforms on <g> wrapper with transform-box: fill-box
- Distinctive: line 82
SHOULD: Optical alignment.
- Very specific: line 83
MUST: Deliberate alignment to grid/baseline/edges—no accidental placement
- Very specific: line 84
SHOULD: Balance icon/text lockups (weight/size/spacing/color)
- Distinctive: line 85
MUST: Verify mobile, laptop, ultra-wide (simulate ultra-wide at 50% zoom)
- Very specific: line 86
MUST: Respect safe areas (env(safe-area-inset-*))
- Distinctive: line 87
MUST: Avoid unwanted scrollbars.
- Distinctive: line 88
SHOULD: Flex/grid over JS measurement for layout
- Distinctive: line 92
SHOULD: Inline help first.
- Distinctive: line 93
MUST: Skeletons mirror final content to avoid layout shift
- Very specific: line 94
MUST: <title> matches current context
- Distinctive: line 95
MUST: No dead ends; always offer next step/recovery
- Very specific: line 96
MUST: Design empty/sparse/dense/error states
- Very specific: line 97
SHOULD: Curly quotes (“ ”).
- Very specific: line 98
MUST: font-variant-numeric: tabular-nums for number comparisons
- Distinctive: line 99
MUST: Redundant status cues (not color-only).
- Distinctive: line 100
MUST: Accessible names exist even when visuals omit labels
- Very specific: line 101
MUST: Use … character (not ...)
- Very specific: line 102
MUST: scroll-margin-top on headings.
- Very specific: line 103
MUST: Resilient to user-generated content (short/avg/very long)
- Very specific: line 104
MUST: Locale-aware dates/times/numbers (Intl.DateTimeFormat, Intl.NumberFormat)
- Very specific: line 105
SHOULD: translate="no" on brand names, code tokens, & identifiers to prevent garbled auto-translation
- Very specific: line 106
MUST: Accurate aria-label.
- Very specific: line 107
MUST: Icon-only buttons have descriptive aria-label
- Very specific: line 108
MUST: Prefer native semantics (button, a, label, table) before ARIA
- Very specific: line 109
MUST: Media has captions/transcripts/descriptions as applicable.
- Very specific: line 110
MUST: Non-breaking spaces: 10 MB, ⌘ K, brand names
- Very specific: line 114
MUST: Text containers handle long content (truncate, line-clamp-*, break-words)
- Very specific: line 115
MUST: Flex children need min-w-0 to allow truncation
- Distinctive: line 116
MUST: Handle empty states—no broken UI for empty strings/arrays
- Distinctive: line 120
SHOULD: Test iOS Low Power Mode and macOS Safari
- Distinctive: line 121
MUST: Measure reliably (disable extensions that skew runtime)
- Distinctive: line 122
MUST: Track and minimize re-renders (React DevTools/React Scan)
- Distinctive: line 123
MUST: Profile with CPU/network throttling
- Distinctive: line 124
MUST: Batch layout reads/writes.
- Very specific: line 125
MUST: Mutations (POST/PATCH/DELETE) target <500ms
- Distinctive: line 126
SHOULD: Prefer uncontrolled inputs.
- Distinctive: line 127
MUST: Virtualize large lists (>50 items)
- Distinctive: line 128
MUST: Preload above-fold images.
- Distinctive: line 129
MUST: Prevent CLS (explicit image dimensions)
- Very specific: line 130
SHOULD: <link rel="preconnect"> for CDN domains
- Very specific: line 131
SHOULD: Critical fonts: <link rel="preload" as="font"> with font-display: swap
- Very specific: line 132
SHOULD: <video autoplay muted loop playsinline> over animated GIF.
- Very specific: line 133
SHOULD: Short non-essential loops include a Safari H.264 MP4 <picture> source, prefers-reduced-motion media condition, and still fallback
- Very specific: line 137
MUST: color-scheme: dark on <html> for dark themes
- Very specific: line 138
SHOULD: <meta name="theme-color"> matches page background
- Very specific: line 139
MUST: Native <select>: explicit background-color and color (Windows fix)
- Very specific: line 143
MUST: Inputs with value need onChange (or use defaultValue)
- Distinctive: line 144
SHOULD: Guard date/time rendering against hydration mismatch
- Distinctive: line 148
SHOULD: Layered shadows (ambient + direct)
- Distinctive: line 149
SHOULD: Crisp edges via semi-transparent borders + shadows
- Distinctive: line 150
SHOULD: Nested radii: child ≤ parent.
- Very specific: line 151
SHOULD: Hue consistency: tint borders/shadows/text toward bg hue
- Distinctive: line 152
MUST: Accessible charts (color-blind-friendly palettes)
- Distinctive: line 153
MUST: Meet contrast—prefer APCA over WCAG 2
- Very specific: line 154
MUST: Increase contrast on :hover/:active/:focus
- Distinctive: line 155
SHOULD: Match browser UI to bg
- Distinctive: line 156
SHOULD: Avoid dark color gradient banding (use background images when needed)
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Concise rules for building accessible, fast, delightful UIs. Use MUST/SHOULD/NEVER to guide decisions.
Interactions
Keyboard
- MUST: Full keyboard support per WAI-ARIA APG
- MUST: Visible, unobscured focus rings (
:focus-visible; group with:focus-within); sticky/fixed elements never cover focus - MUST: Manage focus (trap, move, return) per APG patterns
- NEVER:
outline: nonewithout visible focus replacement
Targets & Input
- MUST: Hit target ≥24px (mobile ≥44px); if visual <24px, expand hit area
- MUST: Mobile
<input>font-size ≥16px to prevent iOS zoom - NEVER: Disable browser zoom (
user-scalable=no,maximum-scale=1) - MUST:
touch-action: manipulationto prevent double-tap zoom - SHOULD: Set
-webkit-tap-highlight-colorto match design
Forms
- MUST: Hydration-safe inputs (no lost focus/value)
- NEVER: Block paste in
<input>/<textarea> - MUST: Loading buttons show spinner and keep original label
- MUST: Enter submits focused input; in
<textarea>, ⌘/Ctrl+Enter submits - MUST: Keep submit enabled until request starts; then disable with spinner
- MUST: Accept free text, validate after—don't block typing
- MUST: Allow incomplete form submission to surface validation
- MUST: Errors inline next to fields; on submit, focus first error
- MUST:
autocomplete+ meaningfulname; correcttypeandinputmode - SHOULD: Disable spellcheck for emails/codes/usernames
- SHOULD: Placeholders end with
…and show example pattern - MUST: Warn on unsaved changes before navigation
- MUST: Compatible with password managers & 2FA; allow pasting codes
- MUST: Trim values to handle text expansion trailing spaces
- MUST: No dead zones on checkboxes/radios; label+control share one hit target
State & Navigation
- MUST: URL reflects state (deep-link filters/tabs/pagination/expanded panels)
- MUST: Back/Forward restores scroll position
- MUST: Links use
<a>/<Link>for navigation (support Cmd/Ctrl/middle-click) - NEVER: Use
<div onClick>for navigation
Feedback
- SHOULD: Optimistic UI; reconcile on response; on failure rollback or offer Undo
- MUST: Confirm destructive actions or provide Undo window
- MUST: Use polite
aria-livefor toasts/inline validation - SHOULD: Ellipsis (
…) for options opening follow-ups ("Rename…") and loading states ("Loading…")
Touch & Drag
- MUST: Generous targets, clear affordances; avoid finicky interactions
- MUST: Delay first tooltip; subsequent peers instant
- MUST:
overscroll-behavior: containin modals/drawers - SHOULD: When suppressing page rubber-band bounce, set
overscroll-behavior: noneon<html>inside@media (pointer: fine); keep coarse-pointer page defaults for pull-to-refresh. Test hybrid touch devices:pointerdescribes the primary input, andnonealso disables scroll chaining and native swipe navigation - MUST: During drag, disable text selection and set
inerton dragged elements - MUST: Drag/swipe/pinch/path gestures have a tap/click and keyboard alternative unless essential
- MUST: If it looks clickable, it must be clickable
Autofocus
- SHOULD: Autofocus on desktop with single primary input; rarely on mobile
Animation
- MUST: Honor
prefers-reduced-motion(provide reduced variant or disable) - SHOULD: Prefer CSS > Web Animations API > JS libraries
- MUST: Animate compositor-friendly props (
transform,opacity) only - NEVER: Animate layout props (
top,left,width,height) - NEVER:
transition: all—list properties explicitly - SHOULD: Animate only to clarify cause/effect or add deliberate delight
- SHOULD: Choose easing to match the change (size/distance/trigger)
- MUST: Animations interruptible and input-driven; autoplay only for muted, non-essential loops
- MUST: Autoplay motion >5s alongside other content has pause, stop, or hide controls
- MUST: Correct
transform-origin(motion starts where it "physically" should) - MUST: SVG transforms on
<g>wrapper withtransform-box: fill-box
Layout
- SHOULD: Optical alignment; adjust ±1px when perception beats geometry
- MUST: Deliberate alignment to grid/baseline/edges—no accidental placement
- SHOULD: Balance icon/text lockups (weight/size/spacing/color)
- MUST: Verify mobile, laptop, ultra-wide (simulate ultra-wide at 50% zoom)
- MUST: Respect safe areas (
env(safe-area-inset-*)) - MUST: Avoid unwanted scrollbars; fix overflows
- SHOULD: Flex/grid over JS measurement for layout
Content & Accessibility
- SHOULD: Inline help first; tooltips last resort
- MUST: Skeletons mirror final content to avoid layout shift
- MUST:
<title>matches current context - MUST: No dead ends; always offer next step/recovery
- MUST: Design empty/sparse/dense/error states
- SHOULD: Curly quotes (“ ”); avoid widows/orphans (
text-wrap: balance) - MUST:
font-variant-numeric: tabular-numsfor number comparisons - MUST: Redundant status cues (not color-only); icons have text labels
- MUST: Accessible names exist even when visuals omit labels
- MUST: Use
…character (not...) - MUST:
scroll-margin-topon headings; "Skip to content" link; hierarchical<h1>–<h6> - MUST: Resilient to user-generated content (short/avg/very long)
- MUST: Locale-aware dates/times/numbers (
Intl.DateTimeFormat,Intl.NumberFormat) - SHOULD:
translate="no"on brand names, code tokens, & identifiers to prevent garbled auto-translation - MUST: Accurate
aria-label; decorative elementsaria-hidden - MUST: Icon-only buttons have descriptive
aria-label - MUST: Prefer native semantics (
button,a,label,table) before ARIA - MUST: Media has captions/transcripts/descriptions as applicable; controls are keyboard-operable; decorative media hidden from assistive tech
- MUST: Non-breaking spaces:
10 MB,⌘ K, brand names
Content Handling
- MUST: Text containers handle long content (
truncate,line-clamp-*,break-words) - MUST: Flex children need
min-w-0to allow truncation - MUST: Handle empty states—no broken UI for empty strings/arrays
Performance
- SHOULD: Test iOS Low Power Mode and macOS Safari
- MUST: Measure reliably (disable extensions that skew runtime)
- MUST: Track and minimize re-renders (React DevTools/React Scan)
- MUST: Profile with CPU/network throttling
- MUST: Batch layout reads/writes; avoid reflows/repaints
- MUST: Mutations (
POST/PATCH/DELETE) target <500ms - SHOULD: Prefer uncontrolled inputs; controlled inputs cheap per keystroke
- MUST: Virtualize large lists (>50 items)
- MUST: Preload above-fold images; lazy-load the rest
- MUST: Prevent CLS (explicit image dimensions)
- SHOULD:
<link rel="preconnect">for CDN domains - SHOULD: Critical fonts:
<link rel="preload" as="font">withfont-display: swap - SHOULD:
<video autoplay muted loop playsinline>over animated GIF; provide still/reduced-motion alternative - SHOULD: Short non-essential loops include a Safari H.264 MP4
<picture>source,prefers-reduced-motionmedia condition, and still fallback
Dark Mode & Theming
- MUST:
color-scheme: darkon<html>for dark themes - SHOULD:
<meta name="theme-color">matches page background - MUST: Native
<select>: explicitbackground-colorandcolor(Windows fix)
Hydration
- MUST: Inputs with
valueneedonChange(or usedefaultValue) - SHOULD: Guard date/time rendering against hydration mismatch
Design
- SHOULD: Layered shadows (ambient + direct)
- SHOULD: Crisp edges via semi-transparent borders + shadows
- SHOULD: Nested radii: child ≤ parent; concentric
- SHOULD: Hue consistency: tint borders/shadows/text toward bg hue
- MUST: Accessible charts (color-blind-friendly palettes)
- MUST: Meet contrast—prefer APCA over WCAG 2
- MUST: Increase contrast on
:hover/:active/:focus - SHOULD: Match browser UI to bg
- SHOULD: Avoid dark color gradient banding (use background images when needed)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

