Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Interaction Patterns

ASecurity

Use when deciding how users interact with UI elements — expand vs navigate, modal vs bottom sheet, swipe gestures, tap targets, optimistic UI, loading patterns, or undo for destructive actions. Use before features get built so every screen inherits the same rules.

3 stars
0 votes
0 copies
0 views
Added 5/28/2026
developmentgobackendsecurity

Works with

cli

Security Analysis

A100/100

Scanned 5/28/2026

$npx -y skills add aneja5/forge-skills --skill interaction-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Interaction Patterns?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Interaction Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aneja5-interaction-patterns/badge)](https://www.skillsdirectory.com/skills/aneja5-interaction-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: interaction-patterns
description: Use when deciding how users interact with UI elements — expand vs navigate, modal vs bottom sheet, swipe gestures, tap targets, optimistic UI, loading patterns, or undo for destructive actions. Use before features get built so every screen inherits the same rules.
---

# Interaction Patterns

## Overview

Define the canonical interaction for every UI primitive *before* features get built. Output is `.forge/interaction-patterns.md` — the decision tree for each interaction (expand vs navigate, modal vs bottom sheet, optimistic vs pessimistic UI, undo vs confirm), the tap-target minimums, the keyboard and scroll behavior, and the documented anti-patterns. Paired with `design-system` (which defines the look) and `accessibility` (which defines the floor).

## When to Use

- A new product or major feature is being designed and no interaction conventions exist
- Mobile and desktop are drifting (centered modals on mobile, no swipe affordances)
- Destructive actions have inconsistent UX (some have confirm, some have undo, some have neither)
- A new component category is being introduced (e.g., first time adding command palette, drawer, popover)
- Loading states are inconsistent (skeletons on one page, spinners on another)

## When NOT to Use

- A single interaction tweak inside one screen — that's `incremental-implementation`
- Backend-only services
- Accessibility-specific decisions (those go in `accessibility`)

## Common Rationalizations

| Thought | Reality |
|---------|---------|
| "Desktop patterns work on mobile" | Centered dialogs on mobile are unreachable with one thumb. Modal trap UX on a touchscreen is hostile. |
| "Users will figure it out" | If it needs figuring out, it's broken. Every interaction that needs explanation costs a support ticket. |
| "We don't need loading states for fast operations" | Fast on your dev machine is slow on a train in rural India. The user can't see your machine. |
| "Undo is too complex" | Undo is cheaper than a confirmation dialog and faster than user anxiety. The only complex undo is the one nobody designed for. |
| "Swipe is obvious from native apps" | Swipe with no visual affordance is a hidden feature. Discoverability requires a hint. |
| "Optimistic UI is risky" | The risk is *rollback messaging*, not optimism. Pessimistic UI is a 300ms spinner every interaction. |

## Red Flags

- A centered dialog on mobile (should be a bottom sheet or full-screen)
- Tap targets smaller than 44pt on touch
- An async action with no loading state (the button "completes" but nothing visibly changed)
- A destructive action (delete, archive, send) with neither undo nor confirmation
- A swipe gesture with no visual affordance hinting it's swipeable
- A horizontal scroll container with no scroll indicator or fade edge
- A modal stacked on top of another modal
- A list item that's both tappable and has tappable children with no clear hierarchy

## Core Process

### Step 1: Inventory the interaction primitives in the product

List every distinct interaction shape: expand vs navigate, modal, bottom sheet, drawer, popover, toast, command palette, swipe action, long-press, drag-to-reorder, pull-to-refresh, infinite scroll, paginated load, optimistic update, undo, confirm dialog, inline edit, keyboard shortcut.

### Step 2: Assign one canonical pattern per category

Examples (project decides the actual values):

- **Modal vs bottom sheet:** desktop = centered modal. Mobile = bottom sheet, always. No exceptions.
- **Expand vs navigate:** 1-3 fields of detail → expand inline. More than that → navigate to a detail view.
- **Confirm vs undo for destructive:** reversible within 30s → optimistic + undo toast. Irreversible (account delete, payment send) → confirm dialog with typed confirmation for the highest-stakes ones.
- **Loading:** content-shaped wait (lists, cards) → skeleton. Action-shaped wait (button click) → spinner-in-button + disabled state. Page-shaped wait → skeleton page, never a centered spinner.
- **Optimistic UI:** allowed when the failure mode is rollback-friendly (revert + toast). Forbidden for payments, identity, security.

### Step 3: Tap target + touch rules

- Minimum 44pt tap target on touch devices (Apple HIG / Material baseline).
- Hit areas can exceed visual size — a 24pt icon can have a 44pt invisible padding.
- No two tap targets within 8pt of each other.
- Hover-only interactions are forbidden — every hover must have a touch-equivalent (tap, long-press, or explicit action).

### Step 4: Keyboard + scroll behavior

- `Esc` closes any modal, drawer, popover, command palette.
- `Tab` order is visual order; never tab-trap inside disabled regions.
- Focus returns to the trigger when a modal closes.
- Scroll restoration on back-navigation — the user returns to where they were.
- Horizontal scroll has a visual affordance (fade edge, indicator dots, or "next" button).

### Step 5: Decision tree, in `.forge/interaction-patterns.md`

For every interaction the product uses, write the decision logic that engineers can apply without asking design. Format: "When X, do Y, because Z."

Example excerpts:
- "When showing a confirmation on mobile, do bottom sheet. Because: thumb-reachable, native-feeling, no accidental dismissal."
- "When a list item has 5+ fields of detail, do navigate. Because: expand obscures siblings, navigate gives breathing room and a back button."
- "When the action is reversible within 30 seconds, do optimistic + undo toast. Because: confirm dialog interrupts; undo respects momentum."

### Step 6: Document the anti-patterns

In the same file, the list of things that look reasonable but are wrong: modal on top of modal, spinner inside button without disabling, swipe without affordance, hover-only interactions, irreversible action behind a single click.

## Verification

- [ ] `.forge/interaction-patterns.md` written
- [ ] Every modal on mobile is a bottom sheet (or has an ADR explaining why)
- [ ] Every destructive action has either undo (reversible) or confirm (irreversible) — never neither
- [ ] No tap target smaller than 44pt (verified via Storybook accessibility addon or manual audit)
- [ ] Every list-with-detail has an "expand vs navigate" decision logged
- [ ] Every async action has a loading state appropriate to its shape (skeleton, spinner-in-button, or page skeleton)
- [ ] `Esc` closes every overlay
- [ ] Focus returns to the trigger when an overlay closes
- [ ] No hover-only interaction in the codebase (grep `:hover` for forbidden patterns)
- [ ] Horizontal scroll containers all have a visual affordance

Attribution

aneja5aneja5
View sourceSee grades on GitHubMore from aneja5 →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Clean Code

Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

304955 votes

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

286712 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2222 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Writing Plans

Use when you have a spec or requirements for a multi-step task, before touching code

2927051 votes
View all in development →