Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Redux Pro

ASecurity

Manage complex state with Redux Toolkit: slices, thunks, RTK Query, selectors, and DevTools. Use for large apps needing strict state conventions.

2 stars
0 votes
0 copies
0 views
Added 9/29/2026
ai-agentsgoapi

Works with

cliapi

Security Analysis

A100/100

Scanned 9/29/2026

$npx -y skills add aicodedecode/awesome-muse-skills --skill redux-pro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Redux Pro?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Redux Pro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aicodedecode-redux-pro/badge)](https://www.skillsdirectory.com/skills/aicodedecode-redux-pro)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: redux-pro
description: Manage complex state with Redux Toolkit: slices, thunks, RTK Query, selectors, and DevTools. Use for large apps needing strict state conventions.
category: development
---

# Redux Pro

A practical guide to modern Redux via Redux Toolkit (RTK): slices, async thunks, RTK Query for server state, memoized selectors, and DevTools — the disciplined approach for large apps where state changes must be predictable and auditable.

## Overview

Modern Redux = **Redux Toolkit**, full stop. `configureStore` (good defaults: thunk, DevTools), `createSlice` (reducers + actions together, Immer-powered "mutative" syntax), `createAsyncThunk` (async flows), and **RTK Query** (server-state caching built in). Hand-written reducers, switch statements, and action-type constants are legacy — if a tutorial shows them, it's outdated.

Redux earns its boilerplate when: many parts of the app read/write the same state, state transitions need auditing (who changed what, when), or middleware (logging, persistence, analytics) must observe everything.

## When to use

- Large apps with complex shared client state (multi-step flows, editors, dashboards).
- State changes that must be traceable/auditable.
- Teams needing strict conventions across many developers.
- Server-state caching via RTK Query as the data layer.
- NOT for: simple UI toggles (useState/Zustand), or server state alone (TanStack Query).

## Core concepts

- **Store.** `configureStore({ reducer: { auth: authSlice.reducer, ... } })` — one store, slices per domain. Infer `RootState`/`AppDispatch` types from it.
- **Slices.** `createSlice({ name: 'cart', initialState, reducers: { addItem(state, action: PayloadAction<Item>) { state.items.push(action.payload); } } })` — Immer lets you "mutate" safely.
- **Thunks.** `createAsyncThunk('cart/checkout', async (args, { getState, rejectWithValue }) => {...})` — pending/fulfilled/rejected lifecycles handled in `extraReducers`.
- **RTK Query.** `createApi({ reducerPath, baseQuery: fetchBaseQuery({ baseUrl }), endpoints: builder => ({ getUser: builder.query<User, string>({ query: id => `/users/${id}` }) }) })` — generates hooks (`useGetUserQuery`), caching, invalidation via tags.
- **Selectors.** `createSelector` (reselect) for memoized derived data. Select narrowly in components (`useSelector(s => s.cart.items)`).
- **Tags.** RTK Query `providesTags`/`invalidatesTags` — declarative cache invalidation ("mutating a Todo invalidates the Todo list").
- **DevTools.** Time-travel, action log, state diff — the audit trail that justifies Redux.

## Practical workflow

**1. Setup.**
```ts
// store.ts
import { configureStore } from '@reduxjs/toolkit';
import { api } from './services/api';

export const store = configureStore({
  reducer: { cart: cartSlice.reducer, [api.reducerPath]: api.reducer },
  middleware: (gDM) => gDM().concat(api.middleware),
});
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;
// hooks.ts: typed useAppDispatch/useAppSelector
```

**2. Slice.**
```ts
const cartSlice = createSlice({
  name: 'cart',
  initialState: { items: [], status: 'idle' } as CartState,
  reducers: {
    addItem: (state, action: PayloadAction<Item>) => { state.items.push(action.payload); },
    removeItem: (state, action: PayloadAction<string>) => {
      state.items = state.items.filter(i => i.id !== action.payload);
    },
  },
  extraReducers: (builder) => {
    builder.addCase(checkout.fulfilled, (state) => { state.items = []; });
  },
});
```

**3. RTK Query endpoints.** Define queries/mutations with tags; use generated hooks in components; invalidate on mutations.

**4. Selectors.**
```ts
export const selectCartTotal = createSelector(
  [(s: RootState) => s.cart.items],
  (items) => items.reduce((sum, i) => sum + i.price, 0)
);
```

## Common pitfalls

- **Legacy Redux patterns.** Switch reducers, `connect()`, hand-written action creators — RTK replaces all of it. Don't mix eras.
- **Untyped dispatch/selector.** Always export typed hooks; untyped `useDispatch` loses thunk types and payload checking.
- **Non-serializable state.** Putting class instances, Dates-as-objects, or functions in the store breaks DevTools/time-travel and triggers warnings. Keep state serializable (store IDs, derive the rest).
- **Mutating outside Immer.** "Mutative" syntax only works inside `createSlice` reducers. Elsewhere, it's a real mutation bug.
- **Selector churn.** Inline selectors returning new objects (`useSelector(s => s.items.filter(...))`) re-render constantly. Memoize with `createSelector`.
- **Thunks for everything.** Simple sync updates don't need thunks. Reserve thunks for async/side-effectful flows.
- **RTK Query vs thunks confusion.** Fetching data? RTK Query. Orchestrating complex async business logic? Thunk. Don't fetch in thunks and hand-manage the cache.
- **Store as a junk drawer.** Unrelated state crammed into one slice. One domain per slice; compose at the store.

Attribution

aicodedecodeaicodedecode
View sourceSee grades on GitHubMore from aicodedecode →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →