agentleFS
valkey-iovalkey-io/valkey-admin/.agents/skills/rx-js/SKILL.md

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
  1. Distinctive:

    Use this skill when changing Redux slices, selectors, epics, websocket flows, or frontend data orchestration.

    line 8
  2. Distinctive:

    Use the repo data flow: component -> intent action -> middleware/API -> RTK -> selectors -> component.

    line 12
  3. Distinctive:

    Use middleware/epics for async coordination, websocket transport, debouncing, retries, polling, timers, and action fan-out.

    line 14
  4. Distinctive:

    Keep reducers focused on state updates and compute-pattern derived state.

    line 15
  5. Distinctive:

    Put single-slice selectors near their slice.

    line 21
  6. Distinctive:

    Put cross-slice selectors in a domain selector file.

    line 22
  7. Distinctive:

    Use selectors to expose prepared data for render.

    line 23
  8. Distinctive:

    Do not use hooks as hidden service layers for API orchestration, Redux-derived state, websocket flows, retries, polling, or action chaining.

    line 29
  9. Very specific:

    Avoid useEffect + setState subscriptions unless the source cannot fit a subscribe/getSnapshot model.

    line 31
  10. Very specific:

    Avoid useEffect for app data flow.

    line 32
  11. Very specific:

    Do not add useMemo or useCallback by default.

    line 33
  12. Distinctive:

    Keep epics small and named by workflow.

    line 37
  13. Very specific:

    Use typed action creators and select(...) helpers where available.

    line 38
  14. Distinctive:

    Put error handling at the workflow boundary that decides retry, toast, logging, or fallback behavior.

    line 39
  15. Distinctive:

    Prefer explicit cancellation semantics for long-running streams.

    line 40
  16. Distinctive:

    Avoid nested subscriptions.

    line 41

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 + setState subscriptions unless the source cannot fit a subscribe/getSnapshot model.
  • Avoid useEffect for app data flow.
  • Do not add useMemo or useCallback by 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.