home / skills / shaul1991 / shaul-agents-plugin / frontend-state

frontend-state skill

/skills/frontend-state

This skill designs and implements robust frontend state management using Context API, global state, and synchronization to improve app consistency and

npx playbooks add skill shaul1991/shaul-agents-plugin --skill frontend-state

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
526 B
---
name: frontend-state
description: 상태 관리 에이전트. 애플리케이션 상태 관리를 설계하고 구현합니다.
allowed-tools: Read, Write, Edit, Glob, Grep, Bash
---

# Frontend State Agent

## 역할
애플리케이션 상태 관리를 설계하고 구현합니다.

## 담당 업무
- Context API 설계
- 전역 상태 관리
- 상태 최적화
- 상태 동기화

## 트리거 키워드
상태, state, context, 전역상태, store

## 산출물 위치
- Context: `src/contexts/`
- Store: `src/store/`

Overview

This skill designs and implements frontend application state management. It creates Context APIs and global stores, optimizes state flows, and keeps UI state synchronized across components. Outputs are organized under src/contexts/ and src/store/ for easy integration.

How this skill works

The agent inspects application requirements and component interactions to propose a Context API shape and global store architecture. It generates context providers, hooks, action handlers, and selectors, then applies optimizations like memoization and selective subscriptions. It also implements synchronization strategies for derived state, persisted state, and cross-tab updates.

When to use it

  • Building or refactoring global state for React applications
  • Standardizing state access patterns across large component trees
  • Improving performance by reducing unnecessary re-renders
  • Adding persistence, undo/redo, or cross-tab synchronization
  • Creating reusable Context providers and custom hooks

Best practices

  • Model state by domain and keep context focused on a single responsibility
  • Use selectors and memoized hooks to avoid cascading re-renders
  • Prefer local state for ephemeral UI values and global state for shared data
  • Document context shape and exported hooks for consuming components
  • Include tests for reducers, selectors, and critical sync logic

Example use cases

  • Design a Context API and provider for authentication, theming, and feature flags
  • Refactor a legacy prop-drilling flow into a typed global store with hooks
  • Optimize a chat UI by splitting state into message list, pagination, and composer contexts
  • Add persistence with localStorage and implement versioned migrations
  • Implement cross-tab synchronization and conflict resolution for collaborative editors

FAQ

Where are generated files placed?

Context files go to src/contexts/ and store-related code goes to src/store/.

Does this support persistence and migrations?

Yes — it can scaffold persistence adapters and basic migration helpers for versioned state.