agentleFS
swyxioswyxio/skills/app-ux-paradigms/SKILL.md

app-ux-paradigms

Skill176 starsChanged 7 months agoMITView on GitHub

Apply conventional interaction behavior for keyboard shortcuts, focus, dialogs, overlays, menus, forms, and asynchronous controls. Use when those interaction mechanics are being built or reviewed; do not use for general page aesthetics, information architecture, or visualization quality.

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Call event.preventDefault() on Esc when handling it so nested browser UI does not steal the key.

    line 40
  2. Very specific:

    Avoid shortcut conflicts: check !event.shiftKey / !event.altKey when the chord is specific (e.g.

    line 43
  3. Distinctive:

    Use a consistent close model across comparable overlays.

    line 65
  4. Distinctive:

    Hover cards / tooltips: Do not trap Esc unless they are modal.

    line 71
  5. Distinctive:

    Required fields: when the touched form has them, validate on submit and focus the first invalid field.

    line 78
  6. Distinctive:

    Unavailable states: when primary content cannot be produced, do not show the normal success workspace with irrelevant export, share, …

    line 87
  7. Very specific:

    Use type="search" where appropriate.

    line 95
  8. Distinctive:

    Do not rely on color alone for status (use text labels or pills).

    line 111

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

App UX: keyboard shortcuts and common paradigms

User preference

Match desktop-app and modern web conventions by default. Users should not need to hunt for close affordances or discover shortcuts only by accident.

Apply only the patterns relevant to the interaction being built or reviewed. This skill does not authorize unrelated UI changes, and its tables are defaults, not a product-wide acceptance checklist. Accessibility, prevention of unintended destructive action, and avoiding silent data loss remain blocking where the touched interaction creates those risks. Stop when the requested interaction works in its relevant input and state variants; report adjacent consistency improvements as follow-ups.

Pair with the sync-url-navigation skill for bookmarkable nav/filter state.

Keyboard shortcuts

Common expectations for touched interactions

Key / chordExpected behavior
EscClose the topmost overlay: modal, drawer, popover, context menu, inline edit. Do not close if a destructive save is in flight—block Esc while saving or show a clear state.
⌘/Ctrl+EnterSubmit primary form or send message in chat/composer (when focus is in a text field).
EnterSubmit single-line fields; in multi-line fields, Enter = newline unless Shift+Enter is documented as send.
⌘/Ctrl+letterUse for global toggles (e.g. ⌘/Ctrl+J = open assistant panel). Always support both metaKey (Mac) and ctrlKey (Windows/Linux).

Recommended implementation notes

  • Attach document-level keydown listeners when an overlay opens; remove on unmount.
  • Call event.preventDefault() on Esc when handling it so nested browser UI does not steal the key.
  • Show shortcuts in title tooltips on icon buttons (e.g. Close (Esc)).
  • Surface the same shortcuts in an in-app Help section with <kbd> styling.
  • Avoid shortcut conflicts: check !event.shiftKey / !event.altKey when the chord is specific (e.g. Ctrl+J vs Ctrl+Shift+K).

Optional but valued

PatternUse when
⌘/Ctrl+KCommand palette / quick open (if the app has one)
⌘/Ctrl+Shift+KSecondary global action (e.g. clear chat / reset context)—only if distinct from Ctrl+K
?Toggle keyboard shortcut help (when not typing in an input)
/Focus search (when not in an input)

Modals and overlays

ParadigmExpected behavior when applicable
EscCloses modal (see above).
Backdrop clickClicking outside may close lightweight dialogs; keep explicit confirmation dialogs or forms with unsaved work open when dismissal would be unsafe.
× controlTop-right (or consistent corner), type="button", labeled title with Esc hint.
Click propagationstopPropagation on panel content so inner clicks do not close.
FocusMove focus into modal on open; return focus to trigger on close when practical.
ScrollLock or contain body scroll for full-screen overlays; allow scroll inside tall forms.

Use a consistent close model across comparable overlays. Do not add every close mechanism when it would discard unsaved work or weaken an explicit confirmation.

Menus and transient UI

  • Context menus: Esc closes; click outside closes (mousedown on document).
  • Hover cards / tooltips: Do not trap Esc unless they are modal; dismiss on pointer leave or Esc if sticky.
  • Inline edit (e.g. grid cell): Esc cancels edit without saving.

Forms and async actions

  • Disable primary submit while saving; label button Saving….
  • Show inline error under the form, not only alert.
  • Required fields: when the touched form has them, validate on submit and focus the first invalid field.
  • Clear resets filters to empty defaults and syncs URL if using query-param routing.

Lists, tables, and selection

  • Row click opens editor or expands detail (consistent per table).
  • Shift+click multi-select when desktop bulk selection is in scope; show selection chrome and a bulk action bar.
  • ID chips: click copies to clipboard with brief status feedback (Copied).
  • Empty states: explain why no rows (no data vs no matches vs filters too narrow).
  • Unavailable states: when primary content cannot be produced, do not show the normal success workspace with irrelevant export, share, filter, or edit controls. Explain the missing prerequisite and offer the most useful recovery action. Analytical publishability belongs to data-visualization-quality.
  • Load more for long tables instead of rendering thousands of rows at once.

Search and filters

  • Use type="search" where appropriate.
  • Changing filters resets pagination/limit to the first page.
  • Debounce URL sync is optional; immediate URL sync is fine for admin tools.

Feedback and safety

  • Status line or toast for export, save, copy, undo—not silent success.
  • Undo for reversible schedule/data edits when the backend supports it.
  • Destructive actions (delete, rollback): confirm in-modal or confirm(); never rely only on icon buttons.
  • Role-gated UI: hide or disable edit actions for viewers; explain in help text.

Accessibility baseline

  • Visible focus rings on interactive elements.
  • Buttons for actions; avoid div onClick without role and keyboard support.
  • Meaningful title / aria-label on icon-only controls.
  • Do not rely on color alone for status (use text labels or pills).

Selective review lens

Select only items relevant to the changed interaction. Unselected items are not failed gates, and a review request does not authorize implementation.

  • Esc closes overlay / menu / inline edit
  • Backdrop + × use same close handler
  • Global shortcuts use ⌘ and Ctrl
  • Shortcuts documented in tooltips and Help
  • Submit disabled while saving; Esc blocked if close would lose in-flight save
  • Click-outside closes non-modal menus
  • Primary action discoverable without reading source

Anti-patterns

  • Ordinary dismissible modal with only × and no keyboard or safe outside-dismiss path
  • Shortcut only in README, not in UI
  • Mac-only metaKey with no ctrlKey
  • Esc closes modal but leaves a nested context menu open underneath
  • Silent failures on save/export/copy

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

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.