rx-js
Skill156 starsChanged 7 months agoApache-2.0View on GitHub
Guidance for Redux Toolkit and RxJS middleware patterns. Use when changing slices, selectors, epics, websocket action flows, async orchestration, frontend data flow, retries, polling, or middleware-driven API workflows.
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 12 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill when changing Redux slices, selectors, epics, websocket flows, or frontend data orchestration.
- Distinctive: line 12
Use the repo data flow: component -> intent action -> middleware/API -> RTK -> selectors -> component.
- Distinctive: line 14
Use middleware/epics for async coordination, websocket transport, debouncing, retries, polling, timers, and action fan-out.
- Distinctive: line 15
Keep reducers focused on state updates and compute-pattern derived state.
- Distinctive: line 21
Put single-slice selectors near their slice.
- Distinctive: line 22
Put cross-slice selectors in a domain selector file.
- Distinctive: line 23
Use selectors to expose prepared data for render.
- Distinctive: line 29
Do not use hooks as hidden service layers for API orchestration, Redux-derived state, websocket flows, retries, polling, or action chaining.
- Very specific: line 31
Avoid useEffect + setState subscriptions unless the source cannot fit a subscribe/getSnapshot model.
- Very specific: line 32
Avoid useEffect for app data flow.
- Very specific: line 33
Do not add useMemo or useCallback by default.
- Distinctive: line 37
Keep epics small and named by workflow.
- Very specific: line 38
Use typed action creators and select(...) helpers where available.
- Distinctive: line 39
Put error handling at the workflow boundary that decides retry, toast, logging, or fallback behavior.
- Distinctive: line 40
Prefer explicit cancellation semantics for long-running streams.
- Distinctive: line 41
Avoid nested subscriptions.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
RxJS And RTK Skill
Use this skill when changing Redux slices, selectors, epics, websocket flows, or frontend data orchestration.
Data Flow
- Use the repo data flow: component -> intent action -> middleware/API -> RTK -> selectors -> component.
- Components should not orchestrate API calls, websocket sends, retries, polling, timers, or chained actions.
- Use middleware/epics for async coordination, websocket transport, debouncing, retries, polling, timers, and action fan-out.
- Keep reducers focused on state updates and compute-pattern derived state.
- Normalize incoming API and Valkey responses before components consume them.
Selectors
- Components should consume named selectors instead of anonymous
useSelector((state) => ...)functions. - Put single-slice selectors near their slice.
- Put cross-slice selectors in a domain selector file. Create a shared/global selector file only when the selector does not belong to one domain.
- Use selectors to expose prepared data for render. Avoid repeated component-local transforms.
- Derived values may live in Redux when intentionally computed for render speed, consistency, or shared use.
Hooks
- Hooks are for reusable component-local behavior, browser/DOM integration, and small UI interaction state.
- Do not use hooks as hidden service layers for API orchestration, Redux-derived state, websocket flows, retries, polling, or action chaining.
- For external stores and subscription-based runtime state, prefer
useSyncExternalStore. - Avoid
useEffect + setStatesubscriptions unless the source cannot fit a subscribe/getSnapshot model. - Avoid
useEffectfor app data flow. - Do not add
useMemooruseCallbackby default. Prefer selectors, compute steps, stable component boundaries, and React Compiler.
RxJS Practices
- Keep epics small and named by workflow.
- Use typed action creators and
select(...)helpers where available. - Put error handling at the workflow boundary that decides retry, toast, logging, or fallback behavior.
- Prefer explicit cancellation semantics for long-running streams.
- Avoid nested subscriptions. Compose streams with RxJS operators.
Error Handling
- Represent expected API/domain failures as error objects or rejected workflow actions.
- Pattern-match error shapes before deciding UI, retry, or logging behavior.
- Redact secrets from logs and websocket payload diagnostics.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

