AgentSkillsCN

state-ux-flow-builder

标准化数据获取流程的UX状态(加载、错误、空、成功)和复杂的多视图UI模式。提供状态机方法建议、加载骨架、错误边界和空状态组件。在实现“加载状态”、“错误处理”、“空状态”或“状态机”时使用。

SKILL.md
--- frontmatter
name: state-ux-flow-builder
description: Standardizes UX states for data fetching flows (loading, error, empty, success) and complex multi-view UI patterns. Provides state machine approach recommendations, loading skeletons, error boundaries, and empty state components. Use when implementing "loading states", "error handling", "empty states", or "state machines".

State & UX Flow Builder

Create consistent UX flows for all application states: loading, error, empty, and success.

Output Components

Every implementation includes: (1) Loading skeletons, (2) Error state with retry, (3) Empty state with action, (4) Success view, (5) Error boundary, (6) State management pattern (useState/XState/server).

Key Patterns

Data Fetching Flow: Check loading → Handle error → Show empty → Display data State Machine: XState for complex flows with multiple states and transitions Optimistic Updates: Instant UI feedback with rollback on error Progressive Loading: Show content incrementally as it loads

Best Practices

Always handle all states, prefer skeletons over spinners, provide retry mechanisms, use consistent error/empty UI, add ARIA live regions, implement error boundaries.