error-handling-recovery
Design error states and recovery workflows that guide users to resolution. Learn context-aware error messages, graceful degradation, and recovery patterns. Use when handling validation errors, network failures, permission issues, or system errors. Triggers on "error handling", "error message", "error state", "recovery", "validation error", "network error".
What this skill does
# Error Handling & Recovery ## Overview Errors are inevitable. The difference between a frustrating product and a caring one is how you handle them. This skill teaches you to design error states that guide users to resolution rather than leaving them stranded. ## Core Philosophy: Never Blame the User The first principle of error design is **never blame the user**. Errors are opportunities to help, not to criticize. **Bad Error Messages:** - "Invalid input" - "Error 404" - "Something went wrong" **Good Error Messages:** - "Please enter a valid email address (e.g., [email protected])" - "We couldn't find that page. Try searching instead." - "Your connection was lost. We saved your work. Reconnect when ready." ## Error Message Anatomy ### The Four Components Every error message should include: 1. **What happened** — Clear, specific description 2. **Why it happened** — Context for the user 3. **What to do** — Actionable next steps 4. **Where to get help** — Support resources if needed ### Example: Complete Error Message ``` ❌ Email already in use This email is already associated with an account. Try: - Sign in with this email instead - Use a different email address - Reset your password if you forgot it Need help? Contact [email protected] ``` ## Error Message Design Principles ### 1. Be Specific, Not Generic ```html <!-- Bad - Generic --> <div class="error">Error: Invalid field</div> <!-- Good - Specific --> <div class="error"> <strong>Password must be at least 8 characters</strong> <p>Include uppercase, lowercase, and numbers</p> </div> ``` ### 2. Use Friendly, Human Language ```html <!-- Bad - Technical jargon --> <div class="error">CORS policy violation detected</div> <!-- Good - Human language --> <div class="error"> We couldn't connect to the server. Check your internet and try again. </div> ``` ### 3. Place Errors Next to the Problem ```html <!-- Bad - Error far from input --> <div class="error-summary">Email is invalid</div> <form> <input type="email" /> </form> <!-- Good - Error next to input --> <form> <div class="form-group"> <label for="email">Email</label> <input id="email" type="email" /> <div class="error">Please enter a valid email</div> </div> </form> ``` ### 4. Use Visual Indicators (Not Color Alone) ```css /* Bad - Color only */ .error-input { border-color: red; } /* Good - Icon + color + text */ .error-input { border-color: var(--error-color); border-width: 2px; } .error-input::before { content: '⚠️'; margin-right: 8px; } ``` ### 5. Provide Constructive Guidance ```html <!-- Bad - Just says what's wrong --> <div class="error">Password too weak</div> <!-- Good - Explains how to fix --> <div class="error"> <strong>Password too weak</strong> <ul> <li>✓ At least 8 characters</li> <li>✗ At least one uppercase letter</li> <li>✓ At least one number</li> <li>✓ At least one special character</li> </ul> </div> ``` ## Error Types and Patterns ### 1. Validation Errors Errors that occur when user input doesn't meet requirements. **Timing:** Show after user leaves the field (blur event) ```javascript // Good - Validate on blur, not while typing const handleBlur = (e) => { const value = e.target.value; if (!isValidEmail(value)) { showError('Please enter a valid email'); } }; // Bad - Validate while typing const handleChange = (e) => { if (!isValidEmail(e.target.value)) { showError('Invalid email'); // Too aggressive } }; ``` ### 2. Network Errors Errors that occur when the server is unreachable or requests fail. **Pattern:** Show error, offer retry, allow offline continuation ```html <div class="error-state"> <span class="error-icon">📡</span> <h3>Connection Lost</h3> <p>We couldn't reach the server. Your changes are saved locally.</p> <button class="button-primary">Retry</button> <button class="button-secondary">Continue Offline</button> </div> ``` ### 3. Permission Errors Errors that occur when user lacks permission to perform an action. **Pattern:** Explain why, offer alternatives, suggest next steps ```html <div class="error-state"> <span class="error-icon">🔒</span> <h3>Permission Denied</h3> <p>You don't have permission to edit this document.</p> <p>Ask the owner to give you edit access.</p> <button class="button-secondary">Request Access</button> </div> ``` ### 4. System Errors Errors that occur due to system failures or unexpected issues. **Pattern:** Apologize, explain impact, offer workarounds ```html <div class="error-state"> <span class="error-icon">⚠️</span> <h3>Something Went Wrong</h3> <p>We're having trouble processing your request. Our team has been notified.</p> <p>Error ID: #12345 (share this if contacting support)</p> <button class="button-primary">Try Again</button> <button class="button-secondary">Contact Support</button> </div> ``` ### 5. 404 Errors Errors that occur when requested resource doesn't exist. **Pattern:** Acknowledge, explain, guide to alternatives ```html <div class="error-state"> <h1>404 - Page Not Found</h1> <p>The page you're looking for doesn't exist or has been moved.</p> <form class="search-form"> <input type="search" placeholder="Search for what you need..." /> <button type="submit">Search</button> </form> <nav class="error-nav"> <a href="/">Home</a> <a href="/help">Help Center</a> <a href="/contact">Contact Us</a> </nav> </div> ``` ## Error Message Styling ### CSS for Error States ```css /* Error container */ .error-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; text-align: center; background: var(--error-bg); border-radius: 8px; border-left: 4px solid var(--error-color); } /* Error icon */ .error-icon { font-size: 48px; margin-bottom: 16px; } /* Error title */ .error-state h3 { font-size: 20px; font-weight: 600; color: var(--error-color); margin-bottom: 8px; } /* Error description */ .error-state p { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; max-width: 400px; } /* Error input */ .error-input { border-color: var(--error-color); border-width: 2px; background-color: var(--error-bg); } .error-input:focus { border-color: var(--error-color); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1); } /* Error message below input */ .error-message { display: flex; align-items: center; margin-top: 8px; font-size: 14px; color: var(--error-color); animation: slideDown 300ms ease-out; } .error-message::before { content: '⚠️'; margin-right: 8px; } @keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } } ``` ## Recovery Workflows ### Pattern 1: Inline Recovery For simple errors, provide recovery action inline. ```html <div class="form-group"> <label for="email">Email</label> <input id="email" type="email" /> <div class="error"> This email is already registered. <button class="link-button">Sign in instead</button> </div> </div> ``` ### Pattern 2: Modal Recovery For critical errors, use a modal to guide recovery. ```html <div class="modal error-modal"> <div class="modal-content"> <h2>Payment Failed</h2> <p>Your card was declined. Please try another payment method.</p> <form> <div class="form-group"> <label>Card Number</label> <input type="text" placeholder="1234 5678 9012 3456" /> </div> <button class="button-primary">Try Again</button> <button class="button-secondary">Use Different Method</button> </form> </div> </div> ``` ### Pattern 3: Progressive Recovery For complex errors, guide users through steps. ```html <div class="recovery-steps"> <div class="step active"> <h3>Step 1: Check Connection</h3> <p>Make sure you're connected to the internet.</p> <button class="button-primary">Retry</b
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.