Expert guidance for any AI coding tool that supports the Agent Skills open format — covering RxSwift, RxCocoa, and RxRelay for iOS development.
This repository distills practical RxSwift guidance into actionable, concise references for agents and code-review workflows. A thin SKILL.md routes to focused references/*.md files (Progressive Disclosure), so the agent loads only what each task needs instead of dumping the full RxSwift documentation into context.
- iOS developers writing or maintaining RxSwift codebases.
- Teams reviewing reactive code for memory leaks, race conditions, or threading bugs.
- Engineers structuring testable ViewModels with MVVM Input/Output or ReactorKit.
- Anyone bridging RxSwift with Swift's
async/awaitmodel.
Install this skill with a single command — works with Claude Code, Codex, Gemini, Cursor, Windsurf, and other Agent-Skills-compatible AI tools:
npx skills add https://github.com/kimkyuchul/RxSwift-Skill --skill rxswiftThen use the skill in your AI agent, for example:
Use the rxswift skill and review this ViewModel for memory leaks and the right
flatMapvariant.
To install this Skill for your personal use in Claude Code:
-
Add the marketplace:
/plugin marketplace add kimkyuchul/RxSwift-Skill
-
Install the Skill:
/plugin install rxswift@rxswift-skill
If Claude Code still shows an older version after a new GitHub release, refresh the marketplace before reinstalling or updating the Skill:
/plugin marketplace update rxswift-skillClaude Code reads available plugin versions from your local marketplace copy, so updating the marketplace is what pulls the latest .claude-plugin/marketplace.json.
To automatically provide this Skill to everyone working in a repository, configure the repository's .claude/settings.json:
{
"enabledPlugins": {
"rxswift@rxswift-skill": true
},
"extraKnownMarketplaces": {
"rxswift-skill": {
"source": {
"source": "github",
"repo": "kimkyuchul/RxSwift-Skill"
}
}
}
}When team members open the project, Claude Code will prompt them to install the Skill.
- Clone this repository.
- Install or symlink the
rxswift/folder following your tool's official skills installation docs (see links below). - Use your AI tool as usual and ask it to use the
rxswiftskill for RxSwift tasks.
Follow your tool's official documentation. A few popular ones:
- Claude: Using Skills
- Codex: Where to save skills
- Cursor: Enabling Skills
How to verify:
Your agent should reference the Workflow Decision Tree in rxswift/SKILL.md and jump into the relevant file in rxswift/references/ (e.g., references/operators.md for a flatMap question).
This skill gives your AI coding tool comprehensive RxSwift guidance. It can:
- Diagnose Observable lifecycle issues, including Cold vs Hot semantics and the "fires twice" bug, with the right
share/share(replay:scope:)strategy. - Choose between Subjects (Publish/Behavior/Replay/Async) and Relays (Publish/Behavior/Replay) based on whether terminal events matter.
- Pick the correct operator: the flatMap family decision matrix (
flatMap/flatMapLatest/flatMapFirst/concatMap) anddebouncevsthrottlecomparisons. - Apply Traits to enforce intent at the type level:
Single/Maybe/Completablefor one-shot async,Driver/Signalfor safe UI streams.
- Apply DisposeBag patterns correctly per owner (VC, View, Cell with
prepareForReuse). - Choose between
[weak self],[unowned self], and the RxSwift 6+subscribe(with:)/bind(with:onNext:)/drive(with:onNext:)family. - Place
subscribe(on:)andobserve(on:)correctly — the placement rules that determine where work runs. - Spot 20 common anti-patterns as Bad → Good pairs during code review.
- Bind UIKit controls reactively with
bind(to:)/drive(_:)/emit(to:). - Distinguish
ControlProperty(state) fromControlEvent(events). - Wire
UITableView/UICollectionViewwithrx.items(without RxDataSources). - Build custom
Binders and useNotificationCenter.rx/URLSession.rx/ KVO bridges.
- Implement MVVM Input/Output with the
ViewModelTypeprotocol and a puretransform(input:) -> Outputfunction. - Implement ReactorKit's Action / Mutation / State unidirectional flow with
@Pulsefor one-shot events and stub-based View testing. - Compare the two patterns side-by-side and follow a selection guide for new screens.
- Use
RxTest'sTestSchedulerfor virtual time (deterministicdebounce/throttle/delaytests). - Use
RxBlockingfor synchronous-style assertions on small Observables and Singles. - Test
Driver/Signaloutputs withSharingScheduler.mock. - Test ReactorKit Reactors with the built-in stub.
- Use the RxSwift 6.5+ bridges:
observable.values,single.value,infallible.values,asyncStream.asObservable(). - Wrap async functions as
Single.create { try await doWork() }. - Understand the cancellation interplay between
TaskandDisposable. - Apply
Sendableand@MainActornotes for Swift 6 strict concurrency.
Source-grounded: Built from a full sweep of the ReactiveX/RxSwift Documentation/ folder (GettingStarted, Traits, Schedulers, Subjects, UnitTests, HotAndColdObservables, SwiftConcurrency, Tips, Warnings, Examples) plus the ReactorKit reference docs. Every operator, trait, and scheduler claim is traceable to upstream.
Non-Opinionated: Covers MVVM Input/Output and ReactorKit as equal first-class architectures. Doesn't push migration to Combine or Swift Concurrency — selectively bridges to async/await only when the project mixes both worlds.
RxSwift 6.x ready: Uses the modern API surface throughout — catch (not catchError), catchAndReturn (not catchErrorJustReturn), subscribe(with:) / bind(with:onNext:) for safe self-capture, and Swift Concurrency interop (.values, Single.create { try await }). RxSwift 5 → 6 renames are flagged inline where relevant.
Practical and concise: Thin SKILL.md routes to 13 focused references — each ≤ 2.5k words, each self-contained, with a "Worked example" capstone where it pays off (e.g., the full async + loading + dispose validation pattern in rxcocoa-bindings.md).
rxswift/
├── SKILL.md # Entry point with Workflow Decision Tree
└── references/
├── _index.md # Navigation + problem router
├── glossary.md # Terms & concepts (no code)
├── observables.md # Observable lifecycle, Cold vs Hot, multicasting
├── subjects-and-relays.md # 4 Subjects + 3 Relays + decision table
├── operators.md # Operator catalog + flatMap matrix + debounce vs throttle
├── traits.md # Single / Maybe / Completable / Driver / Signal
├── schedulers.md # Scheduler types + observe(on:) vs subscribe(on:)
├── disposal-and-memory.md # DisposeBag, retain cycles, take-until
├── error-handling.md # Terminal events, catch / retry / materialize
├── rxcocoa-bindings.md # UIKit bindings, Binder, Foundation extensions
├── architecture.md # MVVM Input/Output + ReactorKit
├── swift-concurrency-interop.md # RxSwift 6.5+ ↔ async/await bridges
├── testing.md # RxTest, RxBlocking, ReactorKit stub
└── anti-patterns.md # Bad → Good pairs for code review
This skill is based on:
- ReactiveX/RxSwift — RxSwift / RxCocoa / RxRelay / RxTest / RxBlocking source and the
Documentation/folder (canonical specs for Schedulers, Subjects, Traits, Hot vs Cold, Unit Tests). Documentation/SwiftConcurrency.md— the official RxSwift ↔ async/await interop spec (RxSwift 6.5+).- ReactorKit/ReactorKit — Action / Mutation / State,
Viewprotocol,@Pulse, stub-based testing. - Agent Skills open format — the cross-tool skill spec this repo conforms to.
Contributions are welcome — corrections, additional operator coverage, more anti-pattern pairs, clearer worked examples. This repository follows the Agent Skills open format, which has specific structural requirements.
Please read CONTRIBUTING.md for the workflow, quality standards, and PR process.
Created by kimkyuchul. PRs and feedback welcome via the issue tracker.
This skill is open-source and available under the MIT License. See LICENSE for details.
