state-crud

Standardize Redux slice CRUD state with normalized byId/allIds structures.

Updated Apr 27, 2026
One-click install
npx skills add https://github.com/grvpanchal/elegant-opencode --skill state-crud
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: state-crud
Source: https://github.com/grvpanchal/elegant-opencode/tree/main/skills/state-crud
Command: npx skills add https://github.com/grvpanchal/elegant-opencode --skill state-crud

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

State management for CRUD operations on entity slices is repetitive and error-prone; this Skill provides a standardized pattern for naming, action lifecycles, and normalized state structures.

Core Features & Use Cases

  • Consistent action naming following domain/operation conventions (e.g., todos/create, todos/read, todos/update, todos/delete).
  • Normalized state shapes using byId and allIds for O(1) lookups.
  • Ready-to-apply RTK patterns for create, read, update, delete with request/success/failure flow and error handling.
  • Use cases include designing new entity slices, refactoring legacy arrays to normalized forms, and aligning multiple slices to a single convention.

Quick Start

Create a new slice for your entity by following the CRUD pattern and apply normalized state management.

Frequently Asked Questions about state-crud

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize Redux CRUD operations across multiple slices?

To standardize Redux CRUD operations, apply consistent action naming conventions, normalized byId/allIds state structures, and explicit request/success/failure lifecycles across all entity slices for maintainable and scalable state management.

What is the best way to normalize Redux state for O(1) entity lookups?

The best way to normalize Redux state for O(1) lookups is restructuring entities into byId and allIds maps, eliminating legacy arrays and ensuring efficient data access within RTK slices.

How do I handle loading and error states in RTK slices for CRUD tasks?

Handle loading and error states in RTK slices by implementing explicit request, success, and failure lifecycle actions for each create, read, update, and delete operation to track async status accurately.

Can I refactor legacy array state to normalized Redux state without breaking existing actions?

Refactoring legacy arrays to normalized Redux state is supported by mapping existing data to byId/allIds structures and aligning action lifecycles, allowing slice updates while standardizing state access.

When should I use normalized state shapes instead of arrays in Redux?

Use normalized state shapes instead of arrays when managing complex entities requiring O(1) lookups, multiple slice alignment, or standardized CRUD lifecycles to prevent repetitive and error-prone state management.