소스 정보
- 저장소
- Dev-Toolbelt/dev-team-agents
- 최근 소스 활동
- 2026년 5월 11일 16:18
- 감지된 SKILL.md 언어
- 영어
- 스타
- 4
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/Dev-Toolbelt/dev-team-agents --skill state-management명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | state-management |
| description | Frontend state — where it lives, library selection, architecture. |
Apply this hierarchy before reaching for a library:
Is the state used by only one component?
└─ Yes → useState / ref / signal (local state)
Is the state shared between a parent and a few children?
└─ Yes → lift to the nearest common ancestor (prop drilling is fine up to 2 levels)
Is the state shared across distant components in the same feature?
└─ Yes → Context / provide-inject / feature-scoped store
Is the state global app state (auth, theme, cart)?
└─ Yes → global store (Zustand, Pinia, NgRx, etc.)
Is the state data fetched from a server?
└─ Yes → server state library (TanStack Query, SWR, Apollo, RTK Query)
NOT a global store — server state has its own lifecycle
The most common mistake: putting server data in a global store and manually managing loading/error/stale states. Let the server state library own it.
Server state (data that lives on a backend) must be managed by a dedicated library (TanStack Query, SWR, Apollo, RTK Query). Never copy it into a useState or store slice — it creates synchronization bugs and stale data.
If a value can be computed from existing state, compute it — don't store it separately.
// bad — selectedCount gets out of sync
const [items, setItems] = useState([])
const [selectedCount, setSelectedCount] = useState(0)
// good — derived on render, always accurate
const selectedCount = items.filter(i => i.selected).length
Global state has a maintenance cost. Resist the pull to globalize everything. Promote state up the tree only when a second consumer appears (YAGNI).
Never mutate state directly. Always produce a new reference. This enables reliable change detection in every framework.
State changes must go through a defined action, mutation, or setter — not direct property assignment from outside the store. This makes state changes traceable and debuggable.
useCartStore, useAuthStore) — not one mega storesubscribeWithSelector for derived state that depends on a slice of the storecart.ts → useCartStore)$patch for batch updates; avoid multiple $state mutations in sequencekeepAlive).value directlycreateFeatureSelector + createSelector for memoized derived statecreateSlice — never write reducers manuallycreateAsyncThunk for async operations; createApi (RTK Query) for server statecreateEntityAdapter| Anti-Pattern | Problem |
|---|---|
| Copying server response into a store slice | Duplicates state, creates staleness bugs |
| Storing derived values alongside source values | Source and derived drift out of sync |
| One global store for everything | Unrelated components re-render on unrelated changes |
Direct state mutation (state.count++) | Breaks change detection in every framework |
Reading store state inside useEffect dependencies | Creates infinite loops or stale closures |
| Async logic inside a reducer | Reducers must be pure; side effects belong in actions/effects/thunks |