web-interface-guidelines

A set of rules for building web interfaces that work well with keyboards, touch devices, forms, and assistive technology.

In plain words
What is it for?
Use it when creating or reviewing accessible, responsive, fast-loading user interfaces.
Why use it?
It prevents common usability problems such as missing focus indicators, blocked pasting, hard-to-tap controls, and confusing form behavior.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/gokulkrishh/.cursor/web-interface-guidelines
Clone the repo
git clone --depth 1 https://github.com/gokulkrishh/.cursor
Per session 1,640 This file is loaded in full into every session.
When invoked 1,640 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01640 $0.01640
Opus 5 $0.00820 $0.00820
Sonnet 5 $0.00328 $0.00328
Haiku 4.5 $0.00164 $0.00164

Measured 2d ago against content hash d17baa335822, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

web-interface-guidelines scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/web-interface-guidelines.mdc · 119 lines

How it starts

The opening of the file, as written. The whole thing — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Interactions

  • Keyboard
    • MUST: Full keyboard support per WAI-ARIA APG
    • MUST: Visible focus rings (:focus-visible; group with :focus-within)
    • MUST: Manage focus (trap, move, and return) per APG patterns
  • Targets & input
    • MUST: Hit target ≥24px (mobile ≥44px) If visual <24px, expand hit area
    • MUST: Mobile <input> font-size ≥16px or set:
      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover">
      
    • NEVER: Disable browser zoom
    • MUST: touch-action: manipulation to prevent double-tap zoom; set -webkit-tap-highlight-color to match design
  • Inputs & forms (behavior)
    • 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 text input In <textarea>, ⌘/Ctrl+Enter submits; Enter adds newline
    • MUST: Keep submit enabled until request starts; then disable, show spinner, use idempotency key
    • MUST: Don’t block typing; accept free text and validate after
    • MUST: Allow submitting incomplete forms to surface validation
    • MUST: Errors inline next to fields; on submit, focus first error
    • MUST: autocomplete + meaningful name; correct type and inputmode
    • SHOULD: Disable spellcheck for emails/codes/usernames
    • SHOULD: Placeholders end with ellipsis and show example pattern (eg, +1 (123) 456-7890, sk-012345…)
    • MUST: Warn on unsaved changes before navigation
    • MUST: Compatible with password managers & 2FA; allow pasting one-time codes
    • MUST: Trim values to handle text expansion trailing spaces
    • MUST: No dead zones on checkboxes/radios; label+control share one generous hit target
  • State & navigation
    • MUST: URL reflects state (deep-link filters/tabs/pagination/expanded panels) Prefer libs like nuqs
    • MUST: Back/Forward restores scroll
    • MUST: Links are links—use <a>/<Link> for navigation (support Cmd/Ctrl/middle-click)
  • Feedback
    • SHOULD: Optimistic UI; reconcile on response; on failure show error and rollback or offer Undo
    • MUST: Confirm destructive actions or provide Undo window
    • MUST: Use polite aria-live for toasts/inline validation
    • SHOULD: Ellipsis () for options that open follow-ups (eg, “Rename…”)
  • Touch/drag/scroll
    • MUST: Design forgiving interactions (generous targets, clear affordances; avoid finickiness)
    • MUST: Delay first tooltip in a group; subsequent peers no delay
    • MUST: Intentional overscroll-behavior: contain in modals/drawers
    • MUST: During drag, disable text selection and set inert on dragged element/containers
    • MUST: No “dead-looking” interactive zones—if it looks clickable, it is
  • Autofocus
    • SHOULD: Autofocus on desktop when there’s a single primary input; rarely on mobile (to avoid layout shift)

Read the full file on GitHub · 119 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 119 lines · 1,640 tokens per session scan A d17baa335822

Subscribe to this mod's changes

web-interface-guidelines is a cursor rule published in the GitHub repository gokulkrishh/.cursor (3 stars, last pushed 7mo ago), licensed MIT. It adds 1,640 tokens to every session, about $0.0082 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.