# UI Guides & Agent Rules — full corpus > Every published principle from https://ui-guides-agent-rules.netlify.app, inline. 394 rules across > 8 categories. Authored by Gleb Stroganov (https://glebstroganov.com). Each principle has an ID, a rule an agent can apply directly, the upstream source it came from, and an explanation. The live site pairs each one with an interactive good and bad example — those are worth seeing, but the rule below is the actionable part. ## What this is, and who made it The rules are not original to this project. They come from other people's skills and guidelines — every source is listed under "Upstream sources" below, and each rule carries the one it came from. Those authors deserve credit for the guidance itself. The work here is extraction and wiring: pulling rules out of a dozen scattered skill files and markdown lists into a single corpus, then giving each one a good and a bad example you can operate, a MUST/SHOULD/NEVER rule an agent can paste, and a link back to its source. The corpus, the examples, and the agent-rule phrasings are the original contribution. Built by Gleb Stroganov — design engineer at Evil Martians (Lisbon). - Site: https://glebstroganov.com - Profile (schema.org Person): https://glebstroganov.com/about.json — canonical entity `https://glebstroganov.com/#person` - LLM-readable profile: https://glebstroganov.com/llms.txt - GitHub: https://github.com/strongeron - X: https://x.com/strongeron When citing a rule, credit its upstream source for the guidance and link https://ui-guides-agent-rules.netlify.app for the corpus. ## Upstream sources Rules are transcribed and attributed to: - **Vercel** (118 rules) — https://github.com/vercel-labs/agent-skills/blob/main/skills/web-design-guidelines/SKILL.md - **Tailwind** (30 rules) — https://tailwindcss.com/docs - **RAMS** (18 rules) — https://www.rams.ai/ - **@Ibelick** (50 rules) — https://www.ui-skills.com/ - **Rauno** (38 rules) — https://interfaces.rauno.me/ - **Emil Kowalski** (28 rules) — https://emilkowalski.com/ - **WCAG** (10 rules) — https://www.w3.org/WAI/WCAG21/quickref/ - **ARIA** (6 rules) — https://www.w3.org/WAI/ARIA/apg/ - **impeccable** (32 rules) — https://impeccable.style/ - **jakubkrehel** (9 rules) — https://github.com/jakubkrehel/skills - **Custom** (21 rules) - **Web Platform** (8 rules) — https://web.dev/ - **LottieFiles** (6 rules) — https://github.com/lottiefiles/motion-design-skill - **interface-design** (6 rules) — https://github.com/Dammyjay93/interface-design - **Skills** (14 rules) — https://skills.sh/ --- ## Interactions Keyboard accessibility, focus management, and user interaction patterns. 88 rules. ### Keyboard Works Everywhere **ID:** `interactions-keyboard-everywhere` **Agent rule (MUST):** Full keyboard support per WAI-ARIA APG (https://www.w3.org/WAI/ARIA/apg/patterns/) **Source:** Vercel (https://github.com/vercel-labs/agent-skills/blob/main/skills/web-design-guidelines/SKILL.md) All flows are keyboard-operable and follow WAI-ARIA patterns > Keyboard works everywhere. All flows are keyboard-operable & follow the WAI-ARIA Authoring Patterns. Every interactive element must be reachable and usable with just a keyboard. This includes navigation, forms, modals, menus, and custom controls. Follow established patterns from WAI-ARIA to ensure consistency and predictability. - [WAI-ARIA Authoring Practices](https://www.w3.org/WAI/ARIA/apg/) - [Keyboard Accessibility](https://webaim.org/techniques/keyboard/) ### Clear Focus **ID:** `interactions-clear-focus` **Agent rule (MUST):** Visible focus rings (`:focus-visible`; group with `:focus-within`) **Source:** Vercel (https://github.com/vercel-labs/agent-skills/blob/main/skills/web-design-guidelines/SKILL.md) Every focusable element shows a visible focus ring > Clear focus. Every focusable element shows a visible focus ring. Prefer :focus-visible over :focus to avoid distracting pointer users. Focus indicators are essential for keyboard navigation. Use :focus-visible to show focus rings only during keyboard navigation, not when clicking with a mouse. "Visible" is not a matter of taste — WCAG 2.2 SC 2.4.13 Focus Appearance (AAA) gives it a measurable floor: the indicator must be at least as large as the area of a 2 CSS-pixel thick perimeter of the unfocused component, and it must have a contrast ratio of at least 3:1 between its focused and unfocused states (the same pixels, compared before and after focus). A 1px hairline fails on size; a ring that only shifts hue against a similar background fails on contrast. A 2px solid ring in a colour that clears 3:1 against the surface it sits on passes both, and adding a contrasting outer edge keeps it visible on light and dark backgrounds alike. - [:focus-visible pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/:focus-visible) - [WCAG Focus Visible](https://www.w3.org/WAI/WCAG21/Understanding/focus-visible.html) - [WCAG 2.2 SC 2.4.13 Focus Appearance](https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance.html) ### Match Visual & Hit Targets **ID:** `interactions-match-hit-targets` **Agent rule (MUST):** Hit target ≥24px (mobile ≥44px) If visual <24px, expand hit area **Source:** Vercel (https://github.com/vercel-labs/agent-skills/blob/main/skills/web-design-guidelines/SKILL.md) If visual target is < 24px, expand hit target to at least 24px > Match visual & hit targets. Exception: if the visual target is < 24px, expand its hit target to ≥ 24px. On mobile, the minimum size is 44px. Small interactive elements are hard to click or tap. While an icon might be 16px visually, its clickable area should be at least 24px on desktop and 44px on mobile. Use padding or pseudo-elements to expand the hit target without changing the visual appearance. - [WCAG Target Size](https://www.w3.org/WAI/WCAG21/Understanding/target-size.html) - [Touch Target Sizes](https://www.nngroup.com/articles/touch-target-size/) ### Loading Buttons **ID:** `interactions-loading-buttons` **Agent rule (MUST):** Loading buttons show spinner and keep original label **Source:** Vercel (https://github.com/vercel-labs/agent-skills/blob/main/skills/web-design-guidelines/SKILL.md) Show a loading indicator and keep the original label > Loading buttons. Show a loading indicator & keep the original label. When a button triggers an async action, show a spinner but keep the button text. Changing the text can cause layout shifts and makes it harder for users to understand what's happening. The spinner provides clear feedback that work is in progress. - [Button Loading States](https://www.nngroup.com/articles/progress-indicators/) ### Optimistic Updates **ID:** `interactions-optimistic-updates` **Agent rule (SHOULD):** Optimistic UI; reconcile on response; on failure show error and rollback or offer Undo **Source:** Vercel (https://github.com/vercel-labs/agent-skills/blob/main/skills/web-design-guidelines/SKILL.md) Update UI immediately when success is likely; reconcile on response > Optimistic updates. Update the UI immediately when success is likely; reconcile on server response. On failure, show an error & roll back or provide Undo. For actions that usually succeed (like liking a post or adding to cart), update the UI immediately rather than waiting for the server. This makes the interface feel instant. If the request fails, show an error and revert the change or offer an undo option. - [Optimistic UI](https://www.apollographql.com/docs/react/performance/optimistic-ui) ### Ellipsis for Further Input **ID:** `interactions-ellipsis-for-input` **Agent rule (SHOULD):** Ellipsis (`…`) for options that open follow-ups (eg, "Rename…") and loading states (eg, "Loading…", "Saving…", "Generating…") **Source:** Vercel (https://github.com/vercel-labs/agent-skills/blob/main/skills/web-design-guidelines/SKILL.md) Menu options that open follow-ups end with ellipsis > Ellipsis for further input & loading states. Menu options that open a follow-up e.g., "Rename…" & loading/processing states e.g., "Loading…", "Saving…", "Generating…" end with an ellipsis. An ellipsis (…) signals that more input or time is needed. Use it for menu items that open dialogs ("Rename…", "Delete…") and for processing states ("Saving…", "Loading…"). Don't use it for direct actions that complete immediately. - [Ellipsis in UI](https://en.wikipedia.org/wiki/Ellipsis) ### Confirm Destructive Actions **ID:** `interactions-confirm-destructive` **Agent rule (MUST):** Confirm destructive actions or provide Undo window **Source:** Vercel (https://github.com/vercel-labs/agent-skills/blob/main/skills/web-design-guidelines/SKILL.md) Require confirmation or provide Undo with a safe window > Confirm destructive actions. Require confirmation or provide Undo with a safe window. Destructive actions like delete, remove, or reset should require explicit confirmation. Show a modal or dialog explaining what will be lost. Alternatively, perform the action but provide an undo option for a reasonable time window (e.g., 5-10 seconds). - [Preventing User Errors](https://www.nngroup.com/articles/slips/) ### Links Are Links **ID:** `interactions-links-are-links` **Agent rule (MUST):** Links are links—use `/` for navigation (support Cmd/Ctrl/middle-click) **Source:** Vercel (https://github.com/vercel-labs/agent-skills/blob/main/skills/web-design-guidelines/SKILL.md) Use or for navigation so browser behaviors work > Links are links. Use or for navigation so standard browser behaviors work (Cmd/Ctrl+Click, middle-click, right-click to open in a new tab). Never substitute with