Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计未展示

build-modern-redux-apps%2fredux-dataflow构建现代 redux 应用%2fredux 数据流

Agent Skill

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

总安装

549

周安装

22

GitHub Stars

11,194

下载量

178
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:build-modern-redux-apps%2fredux-dataflow(构建现代 redux 应用%2fredux 数据流)
来源仓库:https://github.com/reduxjs/redux-toolkit
仓库路径:skills/build-modern-redux-apps%2Fredux-dataflow
安装命令:
npx skills add https://github.com/reduxjs/redux-toolkit --skill build-modern-redux-apps/redux-dataflow
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/reduxjs/redux-toolkit --skill build-modern-redux-apps/redux-dataflow

简介

用于辅助数据整理、表格处理和指标计算,适合清洗字段、汇总数据和生成统计说明。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中处理 CSV/Excel 分析或图表准备任务。
  • 通过 npx skills add 命令从 GitHub 安装,需确认数据来源和时间范围,避免误用样本当全量。
  • 涉及敏感数据或批量写回时,应先确认权限和脱敏边界,避免越权操作。
  • build-modern-redux-apps%2fredux-dataflow 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Redux Dataflow

Setup

import { configureStore, createSelector, createSlice } from '@reduxjs/toolkit'

const postsSlice = createSlice({
  name: 'posts',
  initialState: {
    items: [] as { id: string; title: string; published: boolean }[],
    filter: 'all' as 'all' | 'published',
  },
  reducers: {
    postAdded(state, action: { payload: { id: string; title: string } }) {
      state.items.push({ ...action.payload, published: false })
    },
    postPublished(state, action: { payload: { id: string } }) {
      const post = state.items.find((item) => item.id === action.payload.id)
      if (post) {
        post.published = true
      }
    },
    filterChanged(state, action: { payload: 'all' | 'published' }) {
      state.filter = action.payload
    },
  },
})

const store = configureStore({
  reducer: {
    posts: postsSlice.reducer,
  },
})

type RootState = ReturnType<typeof store.getState>

const selectPostsState = (state: RootState) => state.posts
const selectVisiblePosts = createSelector([selectPostsState], (postsState) =>
  postsState.filter === 'all'
    ? postsState.items
    : postsState.items.filter((post) => post.published),
)

store.dispatch(postsSlice.actions.postAdded({ id: 'p1', title: 'Draft' }))
store.dispatch(postsSlice.actions.postPublished({ id: 'p1' }))

const visiblePosts = selectVisiblePosts(store.getState())
console.log(visiblePosts)

Core Patterns

Dispatch events, not setters

const postsSlice = createSlice({
  name: 'posts',
  initialState: [] as { id: string; title: string }[],
  reducers: {
    postAdded(state, action: { payload: { id: string; title: string } }) {
      state.push(action.payload)
    },
    postRemoved(state, action: { payload: { id: string } }) {
      return state.filter((post) => post.id !== action.payload.id)
    },
    postUpdated(
      state,
      action: { payload: { id: string; changes: Partial<{ title: string }> } },
    ) {
      const post = state.find((item) => item.id === action.payload.id)
      if (post && action.payload.changes.title) {
        post.title = action.payload.changes.title
      }
    },
  },
})

postsSlice.actions.postAdded({ id: 'p1', title: 'Draft' })

Event-style actions explain what happened in the UI instead of hiding the transition behind a generic setter.

Let reducers combine old store data with new outside data

import { createEntityAdapter, createSlice } from '@reduxjs/toolkit'

const postsAdapter = createEntityAdapter<{ id: string; title: string }>()

const postsSlice = createSlice({
  name: 'posts',
  initialState: postsAdapter.getInitialState(),
  reducers: {
    postsReceived(state, action: { payload: { id: string; title: string }[] }) {
      postsAdapter.upsertMany(state, action.payload)
    },
  },
})

const incomingPosts = [
  { id: 'p1', title: 'Draft' },
  { id: 'p2', title: 'Published' },
]

postsSlice.actions.postsReceived(incomingPosts)

If a transition mixes current store state with new external data, dispatch the new external data and let the reducer own the merge.

Derive values with selectors instead of storing duplicates

import { createSelector } from '@reduxjs/toolkit'

const selectPosts = (state: RootState) => state.posts.items
const selectFilter = (state: RootState) => state.posts.filter

export const selectVisiblePosts = createSelector(
  [selectPosts, selectFilter],
  (posts, filter) =>
    filter === 'all'
      ? posts
      : posts.filter((post) => post.published),
)

Selectors keep a single source of truth in state while still exposing the shapes the UI needs.

Common Mistakes

CRITICAL Mutating selected state outside reducers

Wrong:

const post = selectPostById(store.getState(), 'p1')

if (post) {
  post.title = 'Changed in place'
}

Correct:

store.dispatch(postUpdated({ id: 'p1', changes: { title: 'Changed in place' } }))

Objects read from the store are still store state; mutating them outside reducers breaks immutability and stale-render assumptions.

Source: reduxjs/redux:docs/style-guide/style-guide.md

HIGH Using setter-style actions instead of event-style actions

Wrong:

const nextPosts = [...selectPosts(store.getState()), { id: 'p2', title: 'Write docs' }]
store.dispatch(setPosts(nextPosts))

Correct:

store.dispatch(postAdded({ id: 'p2', title: 'Write docs' }))

Actions should describe events, not ask reducers to blindly replace state with a precomputed value.

Source: reduxjs/redux:docs/style-guide/style-guide.md

HIGH Combining store state before dispatch

Wrong:

const currentPosts = selectPosts(store.getState())
const mergedPosts = [
  ...currentPosts.filter(
    (currentPost) =>
      !incomingPosts.some((incomingPost) => incomingPost.id === currentPost.id),
  ),
  ...incomingPosts,
]

store.dispatch(postsReplaced(mergedPosts))

Correct:

store.dispatch(postsReceived(incomingPosts))

If the next state depends on current store state, the reducer should own that combination logic; only authoritative external snapshots should replace state wholesale.

Source: maintainer interview

HIGH Ignoring current state in async reducers

Wrong:

builder.addCase(fetchPosts.fulfilled, (state, action) => {
  state.status = 'succeeded'
  state.items = action.payload
})

Correct:

builder.addCase(fetchPosts.fulfilled, (state, action) => {
  if (state.status === 'pending') {
    state.status = 'succeeded'
    state.items = action.payload
  }
})

Reducers that treat every lifecycle action as valid can move the slice into impossible states or let stale requests win.

Source: reduxjs/redux:docs/tutorials/essentials/part-5-async-logic.md

MEDIUM Storing derived values in state

Wrong:

const initialState = {
  items: [] as Post[],
  visiblePosts: [] as Post[],
}

Correct:

const selectVisiblePosts = createSelector(
  [selectPosts, selectFilter],
  (posts, filter) =>
    filter === 'all' ? posts : posts.filter((post) => post.published),
)

Derived values drift out of sync quickly; keep the raw state and derive the view shape.

Source: reduxjs/redux:docs/style-guide/style-guide.md

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.72%
按下载量换算62

Claude

28.63%
按下载量换算51

Cursor

18.68%
按下载量换算33

Gemini CLI

9.35%
按下载量换算17

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills