agentleFS
parhambparhamb/design-skills/ux-error-handling/SKILL.md

ux-error-handling

Skill21 starsChanged 5 months agoMITView on GitHub

Error handling UX: destructive action confirmation, undo, empty states, descriptive error messages, crash recovery, and server error handling. This is also the canonical home for empty-state standards. Use when designing or reviewing error states, confirmation dialogs, undo flows, or any screen that needs to handle failure.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every error is a broken promise.

    line 13
  2. Distinctive:

    Every empty state has four parts:

    line 68
  3. Distinctive:

    Never leave a dead end: every empty state offers a next step or a path back.

    line 84
  4. Distinctive:

    Never use "OK" or "Yes" as the label on a destructive confirm button.

    line 95
  5. Distinctive:

    Never reverse the button positions.

    line 96
  6. Distinctive:

    When applying this checklist to a screen, flow, or codebase:

    line 113

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

Error Handling UX

Every error is a broken promise. How you handle it determines whether the user forgives you or leaves. Good error handling is preventive, informative, and always leaves a path forward.


Checklist

ItemGuidance
Destructive action confirmationSingle dialog. Action button is styled red. Cancel appears on the left.
Undo actionSnackbar with an "Undo" button for 5 to 7 seconds after deletions and moves.
Empty state screensEvery empty screen follows the empty-state standards below.
Reduce human errorInputs are constrained, defaults are smart, and validation catches mistakes early.
Descriptive error messagesStates what failed, why if relevant, and what the user can do next.
Crash recoveryApp restores the previous state on relaunch after a crash.
Server error handling5xx and timeout errors show a human-readable message and a Retry button.

Error Message Formula

[What happened] + [Why, if it helps] + [What to do next]

Examples that work:

  • "We couldn't save your post. Check your connection and tap Save again."
  • "Your session expired. Sign in to continue."
  • "This username is already taken. Try adding numbers or a different word."
  • "Payment declined. Your card ending in 4242 was not charged. [Try another card]"

Error Types and UI Patterns

Error typePattern
ValidationInline, below the field. Shown when focus leaves the field.
Recoverable server errorToast or inline message with a Retry button
Blocking server errorFull-screen error page with Retry and Contact Support options
Auth errorRedirect to login. Preserve the user's intended destination.
Permission deniedExplain the issue and link to Settings to resolve it.
Network errorTop banner with offline mode fallback
Empty statePositive framing with an invitation to act
Content not found (404)Friendly message with suggestions and a path to Home
CrashOffer to report the crash and restore the previous state

Empty State Standards

This is the canonical empty-state guidance for the whole skill set — other skills (ux-search, ux-visual-design, ux-help-onboarding) reference it.

Every empty state has four parts:

  1. Visual — an illustration or icon that matches the app's style.
  2. Heading — short, positive, and specific ("No saved articles yet").
  3. Message — one line explaining what this space is for.
  4. Action — an optional primary button inviting the first step ("Browse articles").

Variants and what changes:

VariantFraming
First useInvite the first action: "Add your first task" — never a bare empty list
No search resultsPair "No results for X" with a spelling suggestion and related categories
Error-caused emptyExplain the failure and offer Retry — do not disguise an error as an empty state
Cleared / completedCelebrate: "All caught up" with a positive visual

Never leave a dead end: every empty state offers a next step or a path back.


Confirmation Dialog Standards

Title should state the action and what it affects: "Delete conversation?" Body should state the consequence: "This will permanently remove 48 messages." The confirm button label should match the title verb: "Delete" in red. Cancel should appear on the left, confirm on the right.

Never use "OK" or "Yes" as the label on a destructive confirm button. Never reverse the button positions.


Undo vs Confirm

Use undo whenUse a confirm dialog when
The action can be reversedThe action is permanent or irreversible
The cost of a mistake is lowThe cost of a mistake is high
Speed is importantThe user should slow down and think
Example: archive a messageExample: delete an account

How to Review

When applying this checklist to a screen, flow, or codebase:

  1. Go through every checklist item and mark it Pass, Fail, or N/A — never skip items silently.
  2. Cite specific evidence for each finding: the screen, component, file, or line it applies to.
  3. Tag each failure with a severity: Blocker (breaks the experience), Major (hurts usability), or Minor (polish).
  4. End the review with the top 3 recommended fixes, ranked by user impact.

Related Skills

  • ux-content — error message tone and microcopy patterns
  • ux-network — connectivity-specific error states
  • ux-forms — inline validation and error recovery in forms

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.

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.