ux-best-practices
UX Best Practices
This skill covers UX patterns for creating exceptional user experiences — visual hierarchy, error handling, loading states, and empty states.
Use-When
This skill activates when:
- Agent designs page layouts
- Agent builds forms with validation
- Agent creates async operations with loading states
- Agent displays lists that might be empty
- Agent handles API errors
Core Rules
- ALWAYS use consistent spacing from the design system
- ALWAYS show loading states during async operations
- ALWAYS provide clear, specific error messages
- ALWAYS provide empty states for lists/collections
- ALWAYS allow error recovery when possible
Common Agent Mistakes
- Inconsistent spacing throughout the layout
- Generic error messages like "An error occurred"
- Not disabling buttons during form submission
- Showing empty tables without helpful messaging
Examples
✅ Correct
// Consistent spacing
<div className="space-y-4">
<h1 className="text-2xl font-bold">Title</h1>
<p>Content</p>
<Button disabled={isLoading}>
{isLoading ? "Loading..." : "Submit"}
</Button>
</div>
// Specific error message
catch {
toast.error("Failed to save. Please try again.")
}
❌ Wrong
// Random spacing
<div className="p-2">
<h1 className="mb-3">Title</h1>
<p className="mb-6">Content</p>
</div>
// Generic error
catch {
toast.error("An error occurred")
}
References
More from moderndegree/agent-skills
design-systems
Design tokens, spacing scales, color systems, and typography for building consistent UIs. Use when creating design systems, theming, or establishing UI foundations.
8motion-animation
Motion design principles, when to animate, transitions, and accessibility. Use when adding animations, micro-interactions, or ensuring accessibility for motion.
6dialogs-modals
Modal and dialog patterns, confirmations, destructive actions, and focus management. Use when building modals, dialogs, or confirmation dialogs.
6form-design
Form UX patterns, field types, multi-step wizards, and layout. Use when building forms, registration flows, or any data collection interfaces.
5a11y-best-practices
Comprehensive accessibility patterns for building, testing, and fixing accessible interfaces. Use when building UI components, forms, pages, or auditing code for accessibility issues.
5notifications-feedback
Toast notifications, alerts, feedback messages, and their timing. Use when adding user feedback, success messages, or alerts.
5