Internal skill. Use cc10x-router for all development tasks.
View on GitHubSelect agents to install to:
npx add-skill https://github.com/romiluz13/cc10x/blob/main/plugins/cc10x/skills/frontend-patterns/SKILL.md -a claude-code --skill frontend-patternsInstallation paths:
.claude/skills/frontend-patterns/# Frontend Patterns
## Overview
User interfaces exist to help users accomplish tasks. Every UI decision should make the user's task easier or the interface more accessible.
**Core principle:** Design for user success, not aesthetic preference.
**Violating the letter of this process is violating the spirit of frontend design.**
## Focus Areas (Reference Pattern)
- **React component architecture** (hooks, context, performance)
- **Responsive CSS** with Tailwind/CSS-in-JS
- **State management** (Redux, Zustand, Context API)
- **Frontend performance** (lazy loading, code splitting, memoization)
- **Accessibility** (WCAG compliance, ARIA labels, keyboard navigation)
## Approach (Reference Pattern)
1. **Component-first thinking** - reusable, composable UI pieces
2. **Mobile-first responsive design** - start small, scale up
3. **Performance budgets** - aim for sub-3s load times
4. **Semantic HTML** and proper ARIA attributes
5. **Type safety** with TypeScript when applicable
## Component Output Checklist
**Every frontend deliverable should include:**
- [ ] Complete React component with props interface
- [ ] Styling solution (Tailwind classes or styled-components)
- [ ] State management implementation if needed
- [ ] Basic unit test structure
- [ ] Accessibility checklist for the component
- [ ] Performance considerations and optimizations
**Focus on working code over explanations. Include usage examples in comments.**
## The Iron Law
```
NO UI DESIGN BEFORE USER FLOW IS UNDERSTOOD
```
If you haven't mapped what the user is trying to accomplish, you cannot design UI.
## Loading State Order (CRITICAL)
**Always handle states in this order:**
```typescript
// CORRECT order
if (error) return <ErrorState error={error} onRetry={refetch} />;
if (loading && !data) return <LoadingState />;
if (!data?.items.length) return <EmptyState />;
return <ItemList items={data.items} />;
```
**Loading State Decision Tree:**
```
Is there an error? → Yes: Show error with retry