Expert guidance for Project Reactor (reactor-core 3.6+, BOM 2024.0+) on the JVM. Triggers when the user writes, reviews, or debugs reactive code involving Mono, Flux, Publisher, Subscriber, Sinks, or reactive pipelines: operator selection (flatMap, concatMap, switchMap, switchIfEmpty, handle, expand, zip, merge, cache, share, replay), Schedulers and threading (publishOn, subscribeOn, boundedElastic, parallel), backpressure (onBackpressureBuffer/Drop/Latest, limitRate, prefetch), Reactor Context and tracing/MDC/security propagation, blocking-to-reactive bridging (fromCallable, fromFuture, BlockHound), Kotlin coroutine/Flow interop, Spring WebFlux, R2DBC, reactor-netty WebClient, StepVerifier/TestPublisher/PublisherProbe/virtual time, debugging (checkpoint, log, Hooks.onOperatorDebug, ReactorDebugAgent), and choosing between Reactor and JDK 21 virtual threads. Does not apply to non-reactive Spring MVC or plain JDBC/imperative code unless they bridge into a reactive pipeline.
Ships in project-reactor. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Identify the mode, then jump to the relevant section:
references/virtual-threads-decision.md.references/bridging.md.Use Reactor when:
Prefer virtual threads (JDK 21+) when:
Mixed case: reactive at the transport layer (WebFlux + WebClient), synchronous or virtual-thread internals at the service boundary.
Full decision tree: references/virtual-threads-decision.md.
Check all of these — issues compound across dimensions.
subscribe() inside another subscribe() or inside an operator callback — breaks error propagation and backpressureThread.sleep, JDBC, blocking HTTP) inside a reactive chain on a non-boundedElastic threadMono/Flux (no subscriber)doOnNext/map without synchronizationCatalog: references/anti-patterns.md.
publishOn to shift execution after assembly; subscribeOn to shift where subscription starts (I/O sources)Mono.fromCallable(...) on Schedulers.boundedElastic()Details: references/schedulers-and-threading.md.
onBackpressureBuffer, onBackpressureDrop, or onBackpressureLatestprefetch tuned for the workload (flatMap(fn, concurrency, prefetch))Details: references/backpressure.md.
Context (not ThreadLocal) for MDC/tracing/security across operatorsReactorContextAccessor registered for Micrometer tracingReactiveSecurityContextHolder (not SecurityContextHolder) in WebFluxDetails: references/context-propagation.md.
doOnError is for side effects only; recover with onErrorResume / onErrorReturnonErrorResume that re-emits the same error is a no-op and hides intentFlux.using() or doFinally()StepVerifier everywhere; never block() in testsdelay, interval) tested with virtual timeDetails: references/testing.md.
When recommending an operator, cover: marble behavior, why it beats alternatives, threading and backpressure implications.
| Goal | Operator | Why not the others |
|---|---|---|
| Parallel I/O, results may interleave | flatMap | concatMap is sequential; switchMap cancels previous |
| Sequential, order preserved | concatMap | flatMap doesn't guarantee order |
| Latest-wins (search-as-you-type) | switchMap | flatMap accumulates all; concatMap queues all |
| Mono → Flux (one item produces a stream) | flatMapMany | flatMap returns Flux<Flux<T>> without this |
| Default value / 404 handling | switchIfEmpty | defaultIfEmpty only works for scalar values |
| Map + filter in one pass | handle | Cleaner than chaining map + filter |
| Recursive / tree traversal | expand | No clean alternative |
Key behaviors to remember:
flatMap — concurrent, unordered; default concurrency 256 (Queues.SMALL_BUFFER_SIZE); use flatMap(fn, maxConcurrency) to cap.concatMap — sequential, ordered; next inner waits for previous to complete.switchMap — cancels current inner on each new upstream signal.switchIfEmpty — fallback subscribed only on empty completion; cold (not eager).cache / share / replay — cold→hot conversion: cache() replays all, share() multicasts to current subscribers, replay(n) replays last n.handle — (value, sink) callback; emit, error, or skip — more expressive than map + filter.expand — breadth-first traversal; ends when produced publishers complete empty.Full catalog with marble descriptions: references/operators.md.
For programmatic emission (callback bridges, hot streams, request-reply) use Sinks — the modern replacement for the deprecated EmitterProcessor / FluxProcessor / MonoProcessor. See references/sinks.md.
When translating, always show both versions side by side so equivalence is verifiable. Patterns covered in references/bridging.md:
switchIfEmpty + flatMapManyMono.fromCallable(...).subscribeOn(Schedulers.boundedElastic())CompletableFuture → Mono.fromFuture(supplier) (lazy) vs Mono.fromFuture(future) (eager).block() — only at composition roots (CLI main, integration test fixtures); never in a controller or inside a chain@Async interop and MVC + WebFlux coexistenceDrive test assertions with StepVerifier (Section I), not .block(). Use BlockHound (Section J) to catch accidental blocking in CI.
When code is Kotlin, evaluate coroutines/Flow before reaching for Reactor directly.
Prefer coroutines/Flow when:
Use Reactor in Kotlin when:
Mono/Fluxexpand, handle, groupBy are requiredInterop touchpoints: awaitSingle / awaitSingleOrNull, Flux.asFlow() / Flow.asFlux(), mono { ... } / flux { ... } builders. Full patterns including awaitFirst, structured concurrency, and Flow backpressure: references/kotlin-interop.md.
API choices:
DatabaseClient — SQL-level control with manual row mappingR2dbcEntityTemplate — higher-level, type-safe queriesMono/FluxThings that bite:
initialSize, maxSize, maxIdleTime in ConnectionPoolConfiguration.R2dbcTransactionManager (default when Spring Data R2DBC is on the classpath), @Transactional on a Mono/Flux method propagates through Reactor Context. Use TransactionalOperator for programmatic control. Never block inside a reactive transaction.flatMap a second query or write a join in DatabaseClient.Code examples (declarative vs programmatic transactions, pool tuning, repository composition): references/r2dbc-patterns.md.
Production WebClient call must include: per-status onStatus handlers, bodyToMono, timeout, and a filtered retryWhen with backoff (e.g., Retry.backoff(3, Duration.ofMillis(100)).filter(ex -> ex instanceof IOException || ex instanceof TimeoutException)).
Configuration to tune:
ReactorClientHttpConnector with custom ConnectionProvider (maxConnections, pendingAcquireMaxCount, pendingAcquireTimeout)maxInMemorySize on WebClientCodecCustomizer to avoid DataBufferLimitException on large bodiesreactor.netty.http.client meters via MicrometerFull patterns: references/reactor-netty-http.md.
Never .block() in tests. Always StepVerifier. Patterns covered in references/testing.md:
expectNext / expectNextMatches + verifyCompleteexpectError(...).verify()StepVerifier.withVirtualTime(...) with thenAwaitTestPublisher (emit, complete, error)PublisherProbe (assertWasSubscribed, assertWasRequested)WebTestClientWhen something breaks, reach for tooling before reading code:
log() — logs onSubscribe, request, onNext, onError, onComplete to SLF4J on the named publisher.checkpoint("description") — adds a labeled boundary; appears in assembly traces.Hooks.onOperatorDebug() in development (significant overhead) or ReactorDebugAgent.init() (production-safe via -javaagent).*__checkpoint is a boundary in your code; the error propagated through each on its way out.BlockHound.install() in test/dev startup throws BlockingOperationError on a blocking call from a non-blocking thread; allowlist JVM/ClassLoader false positives via BlockHound.builder().allowBlockingCallsInside(...).Setup, false positives, and production strategies: references/debugging.md.
concatMap over flatMap, what ordering buys.block() inside a reactive chain — only at composition rootsdoOnError is logging, not recoverysubscribeOn as a generic "fix" for blocking I/O without explaining that boundedElastic is sized for blocking work, not a magic escape hatchWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/project-reactor:project-reactorfrom project-reactor
npx claudepluginhub adityamparikh/project-reactor-skill --plugin project-reactor