redux-saga
Skill2 starsChanged 3 months agoMITView on GitHub
Redux-Saga best practices, patterns, and API guidance for building, testing, and debugging generator-based side-effect middleware in Redux applications. Covers effect creators, fork model, channels, testing with redux-saga-test-plan, concurrency, cancellation, and modern Redux Toolkit integration. Baseline: redux-saga 1.5.1. Triggers on: saga files, redux-saga imports, generator-based middleware, mentions of "saga", "takeEvery", "takeLatest", "fork model", or "channels".
1 other project uses a version of this.
Adopted by
Most recently taken up by
- intent-hq/cloudlands-fetheir own version, first seen Nov 14, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- intent-hq/cloudlands-fe★ 9same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 133
Only take/takeMaybe may omit the argument entirely — take() matches all actions.
- Distinctive: line 141
Read individual rule files for detailed explanations and code examples:
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
Redux-Saga
IMPORTANT: Your training data about redux-saga may be outdated or incorrect — API behavior, middleware setup patterns, and RTK integration have changed. Always rely on this skill's rule files and the project's actual source code as the source of truth. Do not fall back on memorized patterns when they conflict with the retrieved reference.
When to Use Redux-Saga
Sagas are for workflow orchestration — complex async flows with concurrency, cancellation, racing, or long-running background processes. For simpler patterns, prefer:
| Need | Recommended Tool |
| Data fetching + caching | RTK Query |
| Simple async (submit → status) | createAsyncThunk |
| Reactive logic within slices | createListenerMiddleware |
| Complex workflows, parallel tasks, cancellation, channels | Redux-Saga |
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
| 1 | Effects & Yielding | CRITICAL | effect- |
| 2 | Fork Model & Concurrency | CRITICAL | fork- |
| 3 | Error Handling | HIGH | error- |
| 4 | Recipes & Patterns | MEDIUM | recipe- |
| 5 | Channels & External I/O | MEDIUM | channel- |
| 6 | RTK Integration | MEDIUM | rtk- |
| 7 | Troubleshooting | LOW | troubleshoot- |
Quick Reference
1. Effects & Yielding (CRITICAL)
effect-always-yield— Every effect must be yielded; missing yield freezes the appeffect-use-call— Useyield call()for async functions; never call directlyeffect-take-concurrency— ChoosetakeEvery/takeLatest/takeLeadingbased on concurrency needseffect-select-usage— Use selector functions withselect(); never access state paths directlyeffect-race-patterns— Useracefor timeouts and cancellation; only blocking effects inside
2. Fork Model & Concurrency (CRITICAL)
fork-attached-vs-detached—forkshares lifecycle/errors with parent;spawnis independentfork-error-handling— Errors from forks bubble to parent's caller; can't catch at fork sitefork-no-race— Never useforkinsiderace; fork is non-blocking and always winsfork-nonblocking-login— Use fork+take+cancel for auth flows that stay responsive to logout
3. Error Handling (HIGH)
error-saga-cleanup— Usetry/finallywithcancelled()for proper cancellation cleanuperror-root-saga— Usespawnin root saga for error isolation; avoidallfor critical watchers
4. Recipes & Patterns (MEDIUM)
recipe-throttle-debounce— Rate-limiting withthrottle,debounce,retry, exponential backoffrecipe-polling— Cancellable polling with error backoff using fork+take+cancelrecipe-optimistic-update— Optimistic UI with undo using race(undo, delay)
5. Channels & External I/O (MEDIUM)
channel-event-channel— Bridge WebSockets, DOM events, timers into sagas viaeventChannelchannel-action-channel— Buffer Redux actions for sequential or worker-pool processing
6. RTK Integration (MEDIUM)
rtk-configure-store— Integrate saga middleware with RTK'sconfigureStorewithout breaking defaultsrtk-with-slices— Use action creators fromcreateSlicefor type-safe saga triggers
7. Troubleshooting (LOW)
troubleshoot-frozen-app— Frozen apps, missed actions, bad stack traces, TypeScript yield types
Effect Creators Quick Reference
| Effect | Blocking | Purpose |
take(pattern) | Yes | Wait for matching action |
takeMaybe(pattern) | Yes | Like take, receives END |
takeEvery(pattern, saga) | No | Concurrent on every match |
takeLatest(pattern, saga) | No | Cancel previous, run latest |
takeLeading(pattern, saga) | No | Ignore until current completes |
put(action) | No | Dispatch action |
putResolve(action) | Yes | Dispatch, wait for promise |
call(fn, ...args) | Yes | Call, wait for result |
apply(ctx, fn, [args]) | Yes | Call with context |
cps(fn, ...args) | Yes | Node-style callback |
fork(fn, ...args) | No | Attached fork |
spawn(fn, ...args) | No | Detached fork |
join(task) | Yes | Wait for task |
cancel(task) | No | Cancel task |
cancel() | No | Self-cancel |
select(selector) | No | Query store state |
actionChannel(pattern) | No | Buffer actions |
flush(channel) | No | Drain buffered messages |
cancelled() | Yes | Check cancellation in finally |
delay(ms) | Yes | Pause execution |
throttle(ms, pattern, saga) | No | Rate-limit |
debounce(ms, pattern, saga) | No | Wait for silence |
retry(n, delay, fn) | Yes | Retry with backoff |
race(effects) | Yes | First wins |
all([effects]) | If any child blocks | Parallel, wait all |
setContext(props) / getContext(prop) | No / Yes | Saga context |
Pattern Matching
take, takeEvery, takeLatest, takeLeading, throttle, debounce accept:
| Pattern | Matches |
'*' | All actions |
'ACTION_TYPE' | Exact action.type match |
[type1, type2] | Any type in array |
fn => boolean | Custom predicate |
Only take/takeMaybe may omit the argument entirely — take() matches all actions. For
takeEvery, takeLatest, takeLeading, throttle, and debounce the pattern is a required
parameter; use '*' for a catch-all watcher.
Taking from a multicastChannel also requires a pattern: take(chan, '*'), not take(chan).
How to Use
Read individual rule files for detailed explanations and code examples:
rules/effect-always-yield.md
rules/fork-attached-vs-detached.mdEach rule file contains:
- Brief explanation of why it matters
- Incorrect code example with explanation
- Correct code example with explanation
- Additional context and decision tables
References
| Priority | Reference | When to read |
| 1 | references/effects-and-api.md | Writing or debugging any saga |
| 2 | references/fork-model.md | Concurrency, error propagation, cancellation |
| 3 | references/testing.md | Writing or reviewing saga tests |
| 4 | references/channels.md | External I/O, buffering, worker pools |
| 5 | references/recipes.md | Throttle, debounce, retry, undo, batching, polling |
| 6 | references/anti-patterns.md | Common mistakes to avoid |
| 7 | references/troubleshooting.md | Debugging frozen apps, missed actions, stack traces |
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
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.

