Expert guidance on modern React patterns including hooks, composition, state management, and concurrent features. Use when implementing React components or refactoring existing code.
Provides expert guidance on modern React patterns including hooks, composition, state management, and concurrent features. Use when implementing React components or refactoring existing code.
/plugin marketplace add majesticlabs-dev/majestic-marketplace/plugin install majestic-sales@majestic-marketplaceThis skill is limited to using the following tools:
resources/examples.mdExpert guidance for implementing modern React patterns using hooks, component composition, state management, and concurrent features.
| Priority | Description |
|---|---|
| Component Composition | Build complex UIs from simple, reusable pieces |
| Separation of Concerns | Business logic in hooks, presentation in components |
| Explicit over Implicit | Clear data flow and state management |
| Performance | Minimize re-renders, optimize heavy computations |
| Accessibility | Build inclusive, keyboard-navigable interfaces |
| Pattern | Use Case | Example |
|---|---|---|
| Compound Components | Flexible component APIs with shared context | Accordion, Tabs, Menu |
| Render Props | Share logic between components | MouseTracker, Scroll position |
| Higher-Order Components | Wrap components to add functionality | withAuth, withLoading |
See resources/examples.md for full code examples.
| Hook | Purpose |
|---|---|
useApi | Data fetching with loading/error states |
useForm | Form state management with validation |
useDebounce | Debounce rapidly changing values |
usePrevious | Access previous value of state/prop |
useLocalStorage | Persist state to localStorage |
See resources/examples.md for implementations.
| Type | When to Use | Examples |
|---|---|---|
| useState | Simple UI state | Toggles, form inputs, pagination |
| useReducer | Complex state logic | Multi-step forms, shopping cart |
| Context | Theme, auth, app-wide settings | User session, feature flags |
| URL State | Shareable/bookmarkable state | Filters, search params, tabs |
| Server State | API data (React Query/SWR) | User profiles, product catalogs |
| Global Store | Cross-feature coordination | Zustand/Redux for complex apps |
Context + useReducer Pattern: Best for complex state with multiple actions that need to be shared across components. See resources/examples.md.
| Tool | Use When |
|---|---|
useMemo | Expensive calculations (sorting, filtering large arrays) |
useCallback | Functions passed to memoized children or used in deps |
memo | Pure components that re-render often with same props |
| Level | Implementation |
|---|---|
| Route-level | lazy(() => import('./pages/Dashboard')) |
| Component-level | Heavy components like charts, editors |
| Conditional | Features behind feature flags |
Always wrap lazy components in <Suspense> with appropriate fallback.
| Strategy | Scope |
|---|---|
| Error Boundaries | Component tree errors (class components) |
| try/catch | Async operations, event handlers |
| React Query onError | API errors with automatic retry |
Error Boundary Placement: App-level for fatal errors, feature-level for graceful degradation.
| Requirement | Implementation |
|---|---|
| Focus Management | Return focus to trigger on modal close |
| Keyboard Navigation | Support Tab, Enter, Escape in interactive elements |
| ARIA Labels | Icon buttons, form inputs without visible labels |
| Semantic HTML | Use <nav>, <main>, <button> appropriately |
See resources/examples.md for accessible modal implementation.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.