Skip to content

NetFabric/intelligentium / plugins/dotnet-rx/.apm/skills/reactiveui

reactiveui

Verified

Design, implement, migrate, debug, review, and test ReactiveUI 24+ applications. USE FOR: ReactiveObject; WhenAnyValue; ObservableAsPropertyHelper/ToProperty; ReactiveCommand; WhenActivated; Bind/OneWayBind/BindCommand; Interaction; routing and view location; RxAppBuilder; source generators; ReactiveUI.Primitives vs *.Reactive distributions; schedulers; DynamicData; validation; WPF, Avalonia, MAUI, WinUI, WinForms, Blazor. DO NOT USE FOR: generic Rx.NET pipelines without MVVM (use dotnet-rx); unrelated MVVM frameworks; visual UI design.

ReactiveUI

Build testable MVVM applications by expressing state, work, and lifetime as observable relationships. Verify examples against the installed package version: ReactiveUI 24 introduced a distribution split that makes many older imports and type signatures incomplete.

Anatomy

FilePurposeTarget Size
SKILL.mdRouting, workflow, distribution choice, and invariants<100 lines
references/*.mdReactiveUI-specific APIs, platform setup, examples, and review checks<200 lines each

Workflow

  1. Use available code-indexing tools for structural codebase queries; read project files directly only for configuration or non-indexed text.
  2. Inspect the target framework, UI platform, ReactiveUI version, package graph, trimming/AOT requirements, DI container, and public uses of Unit, IScheduler, subjects, or ReactiveUI.Primitives types.
  3. Choose one v24 distribution before writing imports or package references; keep core, platform, routing, and testing packages in that family.
  4. Initialize ReactiveUI once at the composition root with RxAppBuilder and the platform extension. Prefer explicit view registration when trimming or Native AOT matters.
  5. Model writable state, derived state, commands, interactions, collections, and navigation with the owning ReactiveUI abstraction; keep controls and dialogs in views.
  6. Put view bindings, interaction handlers, event subscriptions, and other view-owned work inside WhenActivated; dispose each returned handle with the activation scope.
  7. Make UI/background transitions explicit and inject time or schedulers used by testable behavior. A command's output scheduler does not schedule its execution body.
  8. Test view models without UI objects; control time, execute commands by subscribing or awaiting, handle interactions in the test, and assert errors and disposal.

Choose the Distribution First

NeedPackage familyPublic reactive types
New, lean, trimming-friendly applicationReactiveUI, ReactiveUI.<Platform>RxVoid, ISequencer, Signal<T>
Existing System.Reactive API or source compatibilityReactiveUI.Reactive, ReactiveUI.<Platform>.ReactiveUnit, IScheduler, Subject<T>

The families share the ReactiveUI feature set but expose different namespaces and interop types. Do not combine sibling families accidentally. Use ReactiveUI/ReactiveUI.Builder for the default family and ReactiveUI.Reactive/ReactiveUI.Reactive.Builder for the System.Reactive family; verify platform namespaces from the installed package.

Ownership Map

ConcernPreferred abstraction
Writable view-model stateReactiveObject plus [Reactive] or RaiseAndSetIfChanged
Derived read-only stateWhenAnyValue pipeline plus OAPH/ToProperty or [ObservableAsProperty]
User-triggered or asynchronous workReactiveCommand, CanExecute, IsExecuting, ThrownExceptions
Dialog or UI response requested by a view modelInteraction<TInput, TOutput> handled by the active view
View lifetimeIViewFor<T>, WhenActivated, DisposeWith
Dynamic collection projectionDynamicData source plus change-set operators; marshal only immediately before Bind
View-model-first navigationIScreen, RoutingState, IRoutableViewModel, view location, routed host

Guardrails

  • ReactiveCommand.Execute() and Interaction.Handle() are lazy; subscribe or await them.
  • Handle expected command failures through ThrownExceptions; an unobserved failure reaches the default exception handler and crashes by default.
  • A command excludes only its own concurrent executions. Coordinate separate commands that mutate one resource, and pass each execution token through admission, active work, and linked timeouts.
  • Keep CanExecute non-failing and on the UI context when its source can emit elsewhere.
  • Treat OAPH as a subscription: handle source errors upstream and choose its notification scheduler deliberately.
  • Give application-lifetime view models deterministic teardown when they own commands, OAPHs, subscriptions, subjects, or asynchronous resources.
  • Use WhenAnyValue only on properties with supported change notification; nested null intermediates suppress emissions until the chain becomes evaluable.
  • Prefer ReactiveUI.SourceGenerators for new code. Treat ReactiveUI.Fody and manual global initialization as migration paths, not defaults.
  • Explicit view registration removes assembly scanning; it does not remove v24 trimming/dynamic-code annotations from expression-based observation and binding APIs. Validate the published artifact.
  • Load the Rx.NET skill for generic observable contracts, operator semantics, multicasting, backpressure limits, and System.Reactive testing details.

Reference Files

FileLoad When
references/packages-startup-and-platforms.mdSelecting a v24 distribution, packages, namespaces, RxAppBuilder, DI integration, platform setup, trimming, or AOT registration
references/view-model-state-and-generators.mdDesigning ReactiveObject state, WhenAnyValue, OAPH, computed properties, or source-generator declarations
references/commands-and-errors.mdCreating, invoking, canceling, scheduling, composing, or testing ReactiveCommand; handling ThrownExceptions
references/activation-and-lifetimes.mdOwning subscriptions, bindings, handlers, and start/stop behavior with activation and disposal
references/views-bindings-and-events.mdImplementing IViewFor<T>, typed bindings, converters, command binding, generated observable events, or platform view bases
references/interactions-routing-and-location.mdRequesting UI responses, navigating, registering views, resolving contracts, or choosing routing boundaries
references/collections-validation-and-services.mdUsing DynamicData, ReactiveUI.Validation, dependency injection, logging, or application services
references/scheduling-and-testing.mdControlling UI delivery, background work, virtual time, test schedulers, commands, interactions, and lifecycle tests
references/migration-and-review.mdUpgrading legacy ReactiveUI code or reviewing architecture, threading, errors, leaks, AOT, and package consistency
references/sources.mdRechecking versions and claims against ReactiveUI source, package metadata, handbook pages, and ecosystem repositories
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 319kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 319kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 319kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 196kUpdated Claude CodeCodexVerifiedInstall