CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

statelyai/state-management

Model, review, and refactor application state so source state stays minimal, derived state is computed instead of synchronized, impossible states are not representable, and each piece of state lives in the right place. Use this whenever the user mentions state management, reducers, stores, Redux, Zustand, React state, Vue state, Pinia, selectors, derived state, duplicated state, boolean flags, invalid states, async status, useEffect soup, forms, wizards, filters, URL state, server state, or confusing UI logic, even if they do not explicitly ask for a "state model."

Quality

87%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

Overview
Quality
Evals
Security
Files

redux.mdreferences/

Redux

Use this reference for Redux and Redux Toolkit codebases.

Strong defaults

  • Treat reducers as transition logic, not random field setters.
  • Prefer domain events for action names.
  • Keep state serializable and normalized where relational data is involved.
  • Put derived reads in selectors.
  • Keep most form state out of Redux unless multiple distant consumers truly need it.

State shape

Prefer state that looks like:

  • entity collections keyed by ID
  • explicit status fields for request or workflow modes
  • small, authoritative source facts

Avoid:

  • deeply nested relational data with manual syncing
  • storing filtered/sorted arrays that can be derived
  • storing both entity objects and parallel copies elsewhere in the tree

Action guidance

Prefer events like:

  • checkout.started
  • checkout.submitted
  • checkout.succeeded
  • checkout.failed

Be careful with setter-shaped actions like:

  • setLoading
  • setItems
  • setError

Those often leak implementation details and make invalid combinations easy to create.

Selectors

Selectors are where derived state belongs:

  • filtered and sorted views
  • aggregate counts
  • permission checks
  • canSubmit and similar booleans
  • joining normalized entities

Do not store selector results back into Redux state.

Async and server state

Redux can model async workflows, but do not force all remote data concerns into Redux just because Redux exists. If the problem is mainly remote caching, freshness, invalidation, retries, and background refetching, a dedicated server-state tool may be the better fit.

Common Redux smells

  • slices that mix entities, UI flags, and transient form state without boundaries
  • duplicated request flags instead of one explicit status
  • selectors that are trivial because derived state was stored instead
  • reducers that can create combinations like "loading and succeeded"
  • large stores where ownership and write paths are unclear

LICENSE

README.md

SKILL.md

tile.json