/shiny:shiny-corefrom shiny
Core infrastructure, hosting, DI, key-value stores, lifecycle hooks, screen info and foldable posture, and platform abstractions for Shiny on .NET MAUI, Avalonia, Uno Platform, iOS, Android, Mac Catalyst, macOS, Windows, Linux, and Blazor WebAssembly
Ships in shiny. 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.
Read when SKILL.md points to them.
Shiny.Core is the foundational library for the Shiny ecosystem. It provides the hosting model, platform abstractions, lifecycle hooks, connectivity/battery monitoring, and the AOT-friendly type registry that all other Shiny modules build upon. Storage and DI registration are layered on via the Shiny.Extensions.DependencyInjection and Shiny.Extensions.Stores source-generated packages — these are pulled in transitively by Shiny.Core so you don't add them manually.
IHost, HostBuilder, or UseShinyIKeyValueStore, settings, secure store) via Shiny.Extensions.Stores[Bind] partial properties or a service-attributed DI registration with [Service] / [Singleton] / [Scoped] / [Transient]IPlatform, directories, main thread invocation)IAndroidLifecycle, IIosLifecycle, IMacLifecycle)IShinyStartupTask, ShinyLifecycleTask)AccessState, permission handling, or PermissionExceptionIConnectivity) or battery status (IBattery)IRepository, IRepositoryEntity) — provided by Shiny.Extensions.StoresIRemoteConfigurationProvider) or Shiny.Extensions.ConfigurationINotifyReadOnlyCollection<T>, INotifyCollectionChanged<T>, BindingList<T>)| Item | Value |
|---|---|
| NuGet | Shiny.Core (pulls in Shiny.Extensions.DependencyInjection + Shiny.Extensions.Stores) |
| Namespace | Shiny, Shiny.Hosting, Shiny.Net, Shiny.Power, Shiny.Collections, Shiny.Extensions.Stores (storage), Shiny.Extensions.Configuration (remote config) |
| Platforms | iOS, tvOS, Mac Catalyst, macOS, Android, Windows, Linux, Blazor WebAssembly, plain .NET |
tvOS reuses the iOS platform layer wholesale — the same ShinyAppDelegate (from Shiny.Hosting.Native), IosPlatform, IosLifecycleExecutor and IIosLifecycle.* hooks. There is no tvOS-specific hosting code to write, and there is no MAUI on tvOS, so a tvOS head always hosts through Shiny.Hosting.Native — never generate UseShiny() / MauiProgram.cs guidance for tvOS.
Two Core APIs differ on tvOS:
IIosLifecycle.INotificationHandler does not exist on tvOS. A tvOS notification can only change the app icon badge, so there is no UNNotificationResponse and nothing is presented in the foreground. Code implementing it must be inside #if !TVOS.IBattery reports BatteryState.Full / Level 1.0 / PowerSource AC / EnergySaverStatus Off permanently. An Apple TV is mains powered and UIDevice carries no battery API on tvOS. IBattery.Changed never fires there.A complete UIKit tvOS host is in samples/Sample.tvOS — use its AppDelegate as the shape for tvOS hosting guidance.
Modules with a net10.0-tvos target: Shiny.Core, Shiny.Hosting.Native, Shiny.BluetoothLE, Shiny.Net.Discovery, Shiny.Jobs, Shiny.Net.Http, Shiny.Push, Shiny.ScreenRecorder, Shiny.Data.Sync. Modules with no tvOS target, because Apple withholds the underlying API: Shiny.BluetoothLE.Hosting (no peripheral role), Shiny.Net.Wifi (no NetworkExtension hotspot APIs), Shiny.Gps / Shiny.Geofencing / Shiny.Locations (no CLMonitor geofencing), Shiny.Notifications, Shiny.Contacts, Shiny.Calendar.
| NuGet | Namespace | Purpose |
|---|---|---|
Shiny.Hosting.Maui | Shiny | MAUI hosting integration (UseShiny) |
Shiny.Hosting.Native | Shiny | Native hosting base classes (ShinyAppDelegate, ShinyAndroidApplication, ShinyAndroidActivity) |
Shiny.Hosting.Avalonia | Shiny | Avalonia hosting (AppBuilder.UseShiny, ShinyAvaloniaMainActivity) |
Shiny.Hosting.Uno | Shiny | Uno Platform hosting over Uno.Extensions.Hosting (IHostBuilder.UseShiny, IShinyUnoApplication, GetShinyBuilder, Android StartShiny<TApp>) |
Shiny.Hosting.Uno.WebAssembly | Shiny | IJSRuntime for Shiny's browser modules on Uno's WebAssembly head (UseShinyWebAssembly) |
Shiny.Extensions.DependencyInjection | Shiny | Source-generated [Service] / [Singleton] / [Scoped] / [Transient] DI registration. Pulled in by Shiny.Core. |
Shiny.Extensions.Stores | Shiny.Extensions.Stores | IKeyValueStore, IRepository, source-generated [Bind] partial-property persistence, static Shiny.Stores.Default/Secure accessor. Pulled in by Shiny.Core. |
Shiny.Extensions.Serialization | Shiny.Extensions.Serialization | AOT-safe System.Text.Json serializer extensions used by Shiny modules |
Shiny.Extensions.Configuration | Shiny.Extensions.Configuration | Remote configuration provider and platform preferences |
In MauiProgram.cs, call UseShiny() on the MauiAppBuilder. This registers all core infrastructure services, the platform key/value stores, and lifecycle wiring automatically:
using Shiny;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseShiny(); // Registers Shiny core services, stores, and lifecycle hooks
// Register your own services from [Service]/[Singleton]/[Scoped]/[Transient] attributes
builder.Services.AddGeneratedServices();
// Add device monitoring (these are no-ops if already registered)
// Optional on platform TFMs: AddJob / AddHttpTransfers / AddDataSync add them automatically.
builder.Services.AddConnectivity();
builder.Services.AddBattery();
return builder.Build();
}
}
UseShiny() also covers macOS (AppKit) MAUI apps built on Microsoft.Maui.Platforms.MacOS - Shiny.Hosting.Maui ships a net10.0-macos target, so call it after UseMauiAppMacOS<App>() like any other head. Never hand-roll an IMauiInitializeService that news up Shiny.Hosting.Host or call AddShinyCoreServices() yourself - that is what UseShiny() does. (Doing both is harmless - Host.Run() ignores a second run over the same service provider and AddShinyCoreServices() is idempotent - but it is dead code.) The macOS MAUI backend has no lifecycle events for remote notifications, so a macOS head that uses push forwards application:didRegisterForRemoteNotificationsWithDeviceToken: and friends from its MacOSMauiApplication subclass to Host.Lifecycle (see samples/Sample.MacOS/Main.cs). Only add those methods when the app actually uses push - implementing them is what tells Apple the app uses push, and App Review flags apps that implement them without it. Shiny deliberately ships no base delegate that overrides them.
Reference Shiny.Hosting.Avalonia (Avalonia 12+). AppBuilder.UseShiny(Action<HostBuilder>?) builds and runs the Shiny host in Avalonia's AfterPlatformServicesSetup - before the Application is created - so Host.Current / Host.ServiceProvider are ready in Initialize() and OnFrameworkInitializationCompleted(). Avalonia has no DI container of its own, so the services Shiny builds are the app's container: register your own services in the same callback and resolve them through Host.ServiceProvider. Put the registrations in one static method every head shares:
public static class ShinyStartup
{
public static void Configure(HostBuilder builder)
{
builder.Services.AddConnectivity();
#if PLATFORM
builder.Services.AddNotifications<MyNotificationDelegate>();
#endif
}
}
// desktop - Program.cs
public static AppBuilder BuildAvaloniaApp() => AppBuilder
.Configure<App>()
.UsePlatformDetect()
.UseShiny(ShinyStartup.Configure);
// Android - Avalonia runs CustomizeAppBuilder from Application.OnCreate, so Shiny is up for background launches too
[Application]
public class MainApplication : AvaloniaAndroidApplication<App>
{
public MainApplication(IntPtr handle, JniHandleOwnership ownership) : base(handle, ownership) { }
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
=> base.CustomizeAppBuilder(builder).UseShiny(ShinyStartup.Configure);
}
[Activity(MainLauncher = true, LaunchMode = LaunchMode.SingleTop, Theme = "@style/Theme.AppCompat.DayNight.NoActionBar")]
public class MainActivity : ShinyAvaloniaMainActivity { }
// iOS - Avalonia runs CustomizeAppBuilder from didFinishLaunching
[Register("AppDelegate")]
public class AppDelegate : AvaloniaAppDelegate<App>
{
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
=> base.CustomizeAppBuilder(builder).UseShiny(ShinyStartup.Configure);
// only when the app uses Shiny.Net.Http background transfers
[Export("application:handleEventsForBackgroundURLSession:completionHandler:")]
public void HandleEventsForBackgroundUrl(UIApplication application, string sessionIdentifier, Action completionHandler)
=> Host.Lifecycle.OnHandleEventsForBackgroundUrl(sessionIdentifier, completionHandler);
}
ShinyAvaloniaMainActivity (or override OnCreate, OnNewIntent, OnActivityResult and OnRequestPermissionsResult on an AvaloniaMainActivity and forward each to Host.Lifecycle). Without the permission forward every Shiny permission request hangs; without OnCreate / OnNewIntent notification taps never reach their delegate. On Android, set IActivityApplicationLifetime.MainViewFactory in OnFrameworkInitializationCompleted rather than creating the view eagerly - the process may have been started in the background.application:didRegisterForRemoteNotificationsWithDeviceToken:, ...didFailToRegister..., application:didReceiveRemoteNotification:fetchCompletionHandler:) are [Export]ed on the app's own AvaloniaAppDelegate<TApp> subclass only when the app uses push, forwarding to Host.Lifecycle - Shiny ships no delegate base for them. Avalonia's ContinueUserActivity is non-virtual and Avalonia 12 is scene-based, so IIosLifecycle.IContinueActivity handlers are not reached.net10.0, so it gets NetPlatform (not MacPlatform / WindowsPlatform) and the plain .NET module implementations; UseShiny points NetPlatform.MainThreadHandler at Dispatcher.UIThread. A head that targets net10.0-windows10.0.19041.0 gets WindowsPlatform instead, with its MainThreadHandler set the same way.A complete three-head sample is samples/Sample.Avalonia.
Reference Shiny.Hosting.Uno (Uno.Sdk 6.7+ with the Hosting feature). Shiny runs inside the Uno.Extensions.Hosting container - there is one container, so view models and app services inject Shiny services like any other. IHostBuilder.UseShiny(Action<IServiceCollection>?) adds Shiny's core services and starts the Shiny host through Uno's IServiceInitialize the moment the container is built (started or not). The app's App implements IShinyUnoApplication; its static ConfigureApp(IApplicationBuilder) holds everything the template does between CreateBuilder(args) and NavigateAsync, and OnLaunched calls this.GetShinyBuilder(args) in place of this.CreateBuilder(args):
public partial class App : Application, IShinyUnoApplication
{
protected Window? MainWindow { get; private set; }
protected IHost? Host { get; private set; }
// once per process - on Android from Application.OnCreate (possibly a background start): no UI here
public static void ConfigureApp(IApplicationBuilder builder) => builder
.UseToolkitNavigation()
.Configure(host => host // never Configure((host, window) => ...) - throws on Android
.UseNavigation(RegisterRoutes)
#if __WASM__
.UseShinyWebAssembly() // Shiny.Hosting.Uno.WebAssembly, WASM head only
#endif
.UseShiny(services =>
{
services.AddConnectivity();
services.AddNotifications<MyNotificationDelegate>();
})
);
protected override async void OnLaunched(LaunchActivatedEventArgs args)
{
var builder = this.GetShinyBuilder(args); // NOT this.CreateBuilder(args)
MainWindow = builder.Window;
Host = await builder.NavigateAsync<Shell>(); // returns the host already built on Android
}
}
// Android - Platforms/Android/Main.Android.cs
[global::Android.App.Application(Theme = "@style/AppTheme")]
public class Application : Microsoft.UI.Xaml.NativeApplication
{
public Application(IntPtr javaReference, JniHandleOwnership transfer)
: base(() => new App(), javaReference, transfer) { }
public override void OnCreate()
{
base.OnCreate();
this.StartShiny<App>(); // builds the host before any activity - jobs/push/geofences in the background
}
}
[Activity(MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges)]
public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity
{
protected override void OnCreate(Bundle? bundle) { base.OnCreate(bundle); Host.Lifecycle.OnActivityOnCreate(this, bundle); }
protected override void OnNewIntent(Intent? intent) { base.OnNewIntent(intent); Host.Lifecycle.OnNewIntent(this, intent); }
protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent? data)
{
base.OnActivityResult(requestCode, resultCode, data);
Host.Lifecycle.OnActivityResult(this, requestCode, resultCode, data);
}
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Permission[] grantResults)
{
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
Host.Lifecycle.OnRequestPermissionsResult(this, requestCode, permissions, grantResults);
}
}
OnLaunched only once an ApplicationActivity starts, and with the Skia renderer (the Uno 6 template default) it does not even create the App until then. A host built only in OnLaunched never exists when Android starts the process for a job, push or geofence. StartShiny<App>() builds it in Application.OnCreate; GetShinyBuilder later returns the same builder, window and host.NativeApplication / ApplicationActivity are different types (different assemblies) under the Skia and native renderers, so the app keeps its own subclasses and adds the one StartShiny line plus the four activity forwards. Without the permission forward every Shiny permission request hangs; without OnCreate / OnNewIntent notification taps never reach their delegate.AndroidNotification.LaunchActivityFlags (NewTask | ClearTask) recreates it - a blank screen after the tap. Send an AndroidNotification with LaunchActivityFlags = ActivityFlags.NewTask | ActivityFlags.ClearTop | ActivityFlags.SingleTop.GetShinyBuilder returns Shiny's own IApplicationBuilder (same CreateDefaultBuilder + delegates as Uno's). Build() builds once; App / Arguments are filled in by OnLaunched (read launch args from OnLaunched's args). Configure((host, window) => ...) throws when built from Android's OnCreate (no window yet) - resolve the scoped Window navigation registers instead. Uno's ApplicationBuilder.OnCreate dev-tooling hook does not fire.OnLaunched from didFinishLaunching (background launches included). Uno's Application is the UIApplicationDelegate, so push methods are [Export]ed on App (under #if __IOS__) only when the app uses push.net10.0 - NetPlatform and the plain .NET module implementations; Shiny's main thread is Uno's DispatcherQueue (also on the Windows head, via WindowsPlatform). AddBattery() registers nothing on macOS/Windows desktop - resolve IBattery optionally.IJSRuntime. Reference Shiny.Hosting.Uno.WebAssembly from the net10.0-browserwasm head only and call UseShinyWebAssembly() (a no-op outside the browser). It registers an IJSRuntime over the runtime's [JSImport]/[JSExport] interop + Microsoft.JSInterop's JS dispatcher (module imports, in-process object references, DotNetObjectReference callbacks) and an IStartupService that holds the first navigation until the browser monitors load - the Uno equivalent of Blazor's await services.UseShiny().Uno.Extensions.IDispatcher, not DispatcherQueue.GetForCurrentThread().A complete four-head sample (Android, iOS, Skia desktop, WebAssembly) is samples/Sample.Uno.
For native iOS apps, inherit from ShinyAppDelegate:
[Register("AppDelegate")]
public class AppDelegate : ShinyAppDelegate
{
protected override IHost CreateShinyHost()
{
var builder = HostBuilder.Create();
// Register services on builder.Services
return builder.Build();
}
}
For native Android apps, inherit from ShinyAndroidApplication and use ShinyAndroidActivity:
[Application]
public class MainApplication : ShinyAndroidApplication
{
public MainApplication(IntPtr handle, JniHandleOwnership transfer) : base(handle, transfer) {}
protected override IHost CreateShinyHost()
{
var builder = HostBuilder.Create();
// Register services on builder.Services
return builder.Build();
}
}
[Activity(MainLauncher = true)]
public class MainActivity : ShinyAndroidActivity { }
There are no Shiny.Core.Linux or Shiny.Core.Blazor packages any more - Shiny.Core's plain net10.0 build carries the Linux and Blazor WebAssembly implementations and AddConnectivity() / AddBattery() pick one at runtime with OperatingSystem.IsBrowser() / OperatingSystem.IsLinux(). On plain .NET, IConnectivity is the browser monitor on Blazor and System.Net.NetworkInformation everywhere else; IBattery is the browser Battery Status API on Blazor, sysfs on Linux, and not registered on plain .NET for Windows or macOS (register your own if a module such as AddJob needs one). A Linux GTK MAUI app (Microsoft.Maui.Platforms.Linux.Gtk4) uses UseShiny() from Shiny.Hosting.Maui like any other MAUI head - call it after AddLinuxGtk4Essentials(); it runs the host and points NetPlatform.MainThreadHandler at the GTK MAUI dispatcher. A console, service or non-MAUI GTK app uses the same HostBuilder.Create() flow. Modules that need device monitoring (AddJob, AddHttpClientTransfers, AddDataSync) add it themselves on every target.
For Blazor WASM, reference Shiny.Core (its JS modules are served from _content/Shiny.Core/), call builder.Services.AddShinyCoreServices() (namespace Shiny.Infrastructure) to register IPlatform (NetPlatform) - nothing else does on plain net10.0 - and call AddConnectivity() / AddBattery() to wire navigator-based monitoring. NetPlatform.UserAgent / UserAgentVersion give the browser user agent and a best-effort parsed browser version (null outside a browser); inject NetPlatform for them. These, plus IPlatform.AppVersion / CultureChanged / TimeZoneChanged, replace the members of Shiny.Extensions.BlazorHosting's IAppSupport; its screen and viewport sizes are now IScreenInfo.Metrics and BrowserScreenInfo.ViewportWidth / ViewportHeight (namespace Shiny.Infrastructure), so nothing is left of it. Both monitors load a JS module before they can report anything, so they self-start on the first property read or Changed subscription and report Unknown until that completes. Always call await host.Services.UseShiny() after Build() and before RunAsync() - it runs the Shiny host (every IShinyStartupTask, including the in-process job runner, which otherwise never starts) and then starts the monitors up front. Only Chromium-based browsers expose the Network Information and Battery Status APIs — elsewhere ConnectionTypes and BatteryState stay Unknown (Access still works, it is navigator.onLine). Storage comes from Shiny.Extensions.Stores (its net10.0 build includes the localStorage stores - AddLocalStorageKeyValueStore() / AddLocalStorageRepository(); Shiny.Extensions.Stores.Web no longer exists) and needs a call to host.Services.UseShinyStores() after Build() so the static Shiny.Stores accessor snapshots the IJSRuntime-backed LocalStorageKeyValueStore.
Modules that depend on device monitoring add it for you on every target: AddJob adds both, AddHttpTransfers / AddHttpClientTransfers / AddDataSync add IConnectivity, and the Blazor AddBlazorHttpTransfers / AddBlazorDataSync add both. None of them replace an existing registration, so to substitute your own implementation register it before the module call:
builder.Services.AddSingleton<Shiny.Net.IConnectivity, MyConnectivity>(); // first - wins
builder.Services.AddSingleton<Shiny.Power.IBattery, MyBattery>();
builder.Services.AddJob<MyJob>(); // TryAdd skips its defaults
Registering yours after the module call adds a second descriptor; GetService returns the last one, but anything enumerating IEnumerable<IConnectivity> sees both, so always register first.
When generating code that uses Shiny.Core, follow these conventions:
UseShiny() in MAUI apps or inherit the proper native base classes. This is required before any Shiny module works.Shiny.Extensions.DependencyInjection — [Service(ServiceLifetime.Singleton)], or the shortcuts [Singleton], [Scoped], [Transient]. The source generator emits services.AddGeneratedServices() — call it once during host build. Multiple interfaces, keyed services, and open generics are honoured automatically.[Bind] partial-property pattern from Shiny.Extensions.Stores for persisted settings instead of an INotifyPropertyChanged base class. The generator emits getters/setters that round-trip through the store with zero reflection — fully AOT/trim safe.IShinyStartupTask for code that should run immediately after the DI container is built. Register it with services.AddSingleton<IShinyStartupTask, MyTask>() or tag it [Singleton] and explicitly add the IShinyStartupTask interface.ShinyLifecycleTask for startup tasks that also need foreground/background application-lifecycle events. It composes IAndroidLifecycle.IApplicationLifecycle, IIosLifecycle.IApplicationLifecycle, IMacLifecycle.IApplicationLifecycle, and IShinyStartupTask into one base class.IAndroidLifecycle.*, IIosLifecycle.*, or IMacLifecycle.* sub-interfaces for platform-specific lifecycle hooks. Register them in DI and the lifecycle executor dispatches to them automatically.
await androidPlatform.StartActivityForResult(intent, ct), which returns ActivityResult(Activity, RequestCode, ResultCode, Data) with IsOk; a system service that hands back an IntentSender (CompanionDeviceManager) goes through await androidPlatform.StartIntentSenderForResult(sender, ct), same result. Every forwarded result is also raised as AndroidPlatform.ActivityResultReceived and dispatched to IAndroidLifecycle.IOnActivityResult. Shiny.Hosting.Maui forwards results automatically; Shiny.Hosting.Native needs the activity to derive from ShinyAndroidActivity. Never generate a transparent "result" activity of your own.IKeyValueStore from Shiny.Extensions.Stores via [FromKeyedServices(StoreKeys.Default)] IKeyValueStore store (or StoreKeys.Secure). The store factory is also available via IKeyValueStoreFactory.Get(alias).Shiny.Stores.Default / Shiny.Stores.Secure accessors for one-off reads/writes outside DI contexts — the accessor self-bootstraps on first use after AddShinyStores() has run (call host.Services.UseShinyStores() after Build() on Blazor WASM).IPlatform to access AppData, Cache, Public directories and InvokeOnMainThread(), and for device/app info: AppVersion, ApplicationIdentifier (string? - bundle identifier on Apple, package name on Android, package identity name on packaged Windows, Flatpak app ID / Snap name on Linux; null when there is no such identity, so always null-check it), DeviceManufacturer, DeviceModel, PlatformVersion, Platform (Android, iOS, MacCatalyst, tvOS, macOS, Windows, Linux, Browser), DeviceFormFactor (Shiny.DeviceFormFactor - Unknown, Phone, Tablet, Desktop, TV, Watch, Car; named so it never collides with MAUI's Microsoft.Maui.Devices.DeviceIdiom - do not generate DeviceIdiom against IPlatform), CurrentCulture / CultureChanged, CurrentTimeZone / TimeZoneChanged (native listeners start with the first subscriber; raised off the UI thread - marshal before touching UI) and OpenAppSettings(). These are implemented natively with no MAUI, and replace the members removed from Shiny.Extensions.MauiHosting's IAppSupport - never generate them against IAppSupport.IScreenInfo (registered by every host, like IPlatform) for the main display and orientation - it replaces IAppSupport.CurrentOrientation / OrientationChanged / SetOrientation / ResetOrientation from Shiny.Extensions.MauiHosting and the Blazor screen sizes. Metrics is a ScreenMetrics(Width, Height, Density, Orientation, RefreshRate) snapshot in physical pixels (WidthIndependent / HeightIndependent divide by density); MetricsChanged / OrientationChanged start watching with the first subscriber and may be raised off the UI thread. The orientation enum is Shiny.DeviceOrientation (Unknown, Portrait, Landscape) - not MAUI's DisplayOrientation and not Android's ScreenOrientation. SetOrientation(...) returns whether it applied: Android uses the current Activity; iOS 16+ needs the app delegate to return Shiny.IosOrientationLock.Supported from application:supportedInterfaceOrientationsForWindow: to hold it; Windows sets the auto-rotation preference (tablets only); Blazor only locks a full-screen page or installed app; Mac Catalyst, macOS, tvOS and Linux return false. Linux and console hosts report ScreenMetrics.Empty.IScreenPosture (registered by every host, separate from IScreenInfo) for foldables - Android foldables (Jetpack WindowManager, current Activity), iPhone Duo (iOS 27.1+, key window; not Mac Catalyst) and Chromium on Blazor WASM (Device Posture + Viewport Segments). Current is a ScreenPosture(State, Orientation, Fold, IsSeparating, Hinge, HingeAngleDegrees, Occlusions): FoldState is None (no fold in the window - a non-folding device, a foldable shown closed on its outer screen, or a window that does not reach the fold), Flat or HalfOpen; FoldOrientation.Vertical is book (left/right panes) and Horizontal is tabletop (top/bottom); Fold is a ScreenRect? in window coordinates, dp / points / CSS px and is null unless the fold divides the window. Lay out two panes when IsSeparating is true and use posture.Segments(new ScreenSize(w, h)) for the two rectangles (null when nothing separates them); IsTabletop / IsBook are shortcuts. Decide layout from State / Fold only - HingeAngleDegrees (iOS only) is for live effects, and Hinge is Unknown on Android whenever the fold is not in the window. Occlusions are the iPhone Duo camera housings (empty elsewhere). Changed starts watching with the first subscriber and is raised on the main thread on Android/iOS. IsSupported says whether the platform can report posture, not whether the device folds - SupportedPostures is empty until a fold/hinge is known. The geometry types are Shiny.ScreenRect / Shiny.ScreenSize - never generate Rect / Size against this API (those are MAUI's Microsoft.Maui.Graphics types). On Android posture only streams live when the Activity handles ScreenSize | SmallestScreenSize | ScreenLayout | Orientation config changes (MAUI's template MainActivity does). On Blazor call UseShiny() so the JS module is loaded before the first read; CSS-only layouts can use @media (device-posture: folded) / env(viewport-segment-*) instead.public class TwoPaneViewModel(IScreenPosture posture) : IDisposable
{
public void Start() => posture.Changed += OnPosture; // raised on the main thread (Android/iOS)
void OnPosture(object? sender, ScreenPosture p)
{
if (p.Segments(new ScreenSize(windowWidth, windowHeight)) is { } panes)
ShowTwoPanes(panes.First, panes.Second, tabletop: p.IsTabletop);
else
ShowOnePane();
}
public void Dispose() => posture.Changed -= OnPosture;
}
IAppStartupInstaller (register with services.AddAppStartupInstaller(o => ...)) to put the app in the OS launch-at-login list: HKCU\...\Run on unpackaged Windows, SMAppService login items on macOS 13+ / Mac Catalyst 16+, and on Linux an XDG autostart entry or a systemd unit chosen by AppStartupOptions.LinuxMode (XdgAutostart, SystemdGraphicalSession, SystemdUser, SystemdSystem - the last needs root). Check IsSupported before showing a toggle; Register() returns the state the OS settled on (Enabled, DisabledByUser, DisabledByPolicy, RequiresApproval on macOS) - bind UI to that or a fresh GetState(), never cache it, and call OpenSettings() when the user has to finish in the OS. Android/iOS/tvOS report NotSupported. It replaces Shiny.Extensions.MauiHosting's IStartupService / AddStartupService - never generate those.AccessState enum and state.Assert() extension method to validate permissions before proceeding with platform operations.Changed C# events on IConnectivity and IBattery to react to network or battery state — these are no longer observable. Rx has been removed from Shiny.Core and Shiny.Jobs; only Shiny.BluetoothLE retains reactive streams. Subscribe with += handler and unsubscribe in your Dispose / page-leave hook.IRepository for entity persistence, with entities implementing IRepositoryEntity (must have an Identifier property). The default implementation is a filesystem JSON store registered by services.AddDefaultRepository() and used internally by Locations, Notifications, and HTTP Transfers.host.Services.UseShinyStores() immediately after builder.Build() so the static Shiny.Stores accessor captures the DI-resolved LocalStorageKeyValueStore (it needs IJSRuntime).[Singleton] attribute is the right default.partial class with [Bind] partial properties from Shiny.Extensions.Stores.Tasks/ or Infrastructure/ folder.Settings/ or Models/ folder.AccessState.Denied, AccessState.Disabled, and AccessState.NotSetup gracefully.IBattery covers what .NET MAUI Essentials' IBattery does — PowerSource and EnergySaverStatus alongside Status / Level — so prefer it over Essentials when you want battery state without a MAUI dependency (a Linux or console host, a library).IConnectivity.Changed, IBattery.Changed) over Rx — Rx is intentionally absent from Core.Shiny namespace are available when the appropriate package is referenced.When using Shiny in a MAUI app, several Shiny types collide with MAUI implicit usings. Do NOT add all Shiny namespaces as global usings. Use explicit namespaces or FQNs for these:
| Type | Shiny Namespace | MAUI Namespace | Resolution |
|---|---|---|---|
IConnectivity | Shiny.Net | Microsoft.Maui.Networking | Use Shiny.Net.IConnectivity FQN |
IBattery | Shiny.Power | Microsoft.Maui.Devices | Use Shiny.Power.IBattery FQN |
BatteryState, BatteryPowerSource, EnergySaverStatus | Shiny.Power | Microsoft.Maui.Devices | Use Shiny.Power.* FQN (in the global namespace in 5.7.1 only — see below) |
DeviceInfo | Shiny.BluetoothLE | Microsoft.Maui.Devices | Use FQN for whichever you need |
Permissions (Windows only) | Shiny | Microsoft.Maui.ApplicationModel | Use the Microsoft.Maui.ApplicationModel.Permissions FQN |
Safe global usings (won't conflict with MAUI):
global using Shiny;
global using Shiny.Extensions.Stores; // IKeyValueStore, StoreKeys, [Bind]
global using Shiny.Jobs;
global using Shiny.Locations;
global using Shiny.BluetoothLE;
// Do NOT globally use: Shiny.Net, Shiny.Power, Shiny.Notifications, Shiny.Push, Shiny.BluetoothLE.Hosting
Shiny 5.7.1 only: BatteryState, BatteryPowerSource, EnergySaverStatus (Core), AccessRequestFlags (Notifications) and GeofenceServiceCollectionExtensions (Locations) shipped in the global namespace by mistake. A global type beats one imported by using, so in a MAUI app an unqualified BatteryState resolved to Shiny's enum instead of Microsoft.Maui.Devices.BatteryState. From 5.7.2 they are back in Shiny.Power, Shiny.Notifications and Shiny — always write the namespace import or FQN, never rely on the global resolution.
UseShiny() must be called in the builder chain before building the MAUI app. For native apps, the host must be created and Run() called in the application startup.[Singleton]/[Scoped]/[Transient] and let the Shiny.Extensions.DependencyInjection source generator emit AddGeneratedServices(). AOT-clean, no reflection at startup, multiple interfaces handled.[Bind] partial properties for persisted settings instead of INotifyPropertyChanged plumbing. The generator emits getters/setters that round-trip through the configured IKeyValueStore.IShinyStartupTask.Start() runs synchronously on the main thread at startup.StoreKeys.Default for general preferences (backed by SharedPreferences / NSUserDefaults / ApplicationData.LocalSettings / localStorage), StoreKeys.Secure for sensitive data (Android Keystore / iOS Keychain / Windows secure storage).Shiny.Stores.Default / Shiny.Stores.Secure / Shiny.Stores.Keyed(alias) accessor for one-off reads/writes outside DI.[FromKeyedServices] and resolve the plain service type instead. AddShinyStores() registers the default IKeyValueStore unkeyed as well, so Shiny's own platform types still build on those containers. In your code, use the static Shiny.Stores.Secure / Shiny.Stores.Keyed(...) accessor rather than [FromKeyedServices] for non-default stores when the app uses a non-Microsoft container — a container that drops the key will inject the wrong store (or fail with UnableToFindCtorWithAllResolvableArgs).Host.IsInitialized before accessing Host.Current in code that may run before initialization.BindingList<T> for thread-safe observable collections that can be bound to UI.Shiny.Extensions.Serialization with your own — Shiny.Jobs, Shiny.Gps, Shiny.Geofencing, Shiny.Notifications, and Shiny.Net.Http each ship their own JsonSerializerContext for AOT safety.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub shinyorg/skills --plugin shiny57 skills in this plugin
/localizegenGenerate strongly-typed localization classes from .resx resource files using Shiny.Extensions.Localization.Generator for .NET applications/shiny-accessorysetupGenerate code using Shiny.BluetoothLE.AccessorySetup - the system accessory pairing sheet for BLE devices (AccessorySetupKit on iOS 18+, CompanionDeviceManager on Android) with no MFi, no location prompt and no general Bluetooth prompt on iOS; picked accessories open as Shiny.BluetoothLE peripherals, and Android adds background presence (device appeared / disappeared) events/shiny-actorsGenerate code using Shiny.Actors — Orleans-style virtual actors without the ceremony, AOT/trim-clean, running anywhere .NET runs including .NET MAUI and Blazor WebAssembly. Covers actor interfaces and source-generated proxies, the ShinyActorBuilder (AddShinyActors), persistent state with ETags, named states and auto-save, event-sourced JournaledActor with snapshots, state and event migrations, typed streams (durable, implicit consumers), timers and persistent reminders (background jobs via Shiny.Jobs, on-time OS notifications via Shiny.Notifications), concurrency control ([Reentrant], [AlwaysInterleave], [ReadOnly], [StatelessWorker]), call filters and request context, OpenTelemetry traces and metrics, remoting over HTTP (Shiny.Net.HttpServer server, RemoteActorSystem client), mDNS discovery of actor servers, Shiny.DocumentDb storage (SQLite, PostgreSQL, IndexedDB...), and the ActorTestHost testing kit./shiny-agesignalsGenerate code using Shiny.AgeSignals to read the user's age range as the app store shares it - Apple Declared Age Range (iOS / macOS 26+) and Google Play Age Signals (Android) - for app store accountability laws (Texas SB 2420, Utah, Louisiana, California AB 1043) and age-gated features/shiny-aiconversationGenerate code for Shiny.AiConversation v3 - session-based AI conversations for .NET over Microsoft.Extensions.AI with persisted, resumable sessions (IAiSessionManager / IAiSession / IAiTurn), streaming replies, the built-in ask_user tool for typed questions and multiple-choice answers, interruption and supersession, usage and context-window pressure tracking, rolling context compaction, silent assistant memory, conversation search, session titles and long-term memory, session interceptors for tools and prompts, pluggable session/memory stores (in-memory or SQLite via Shiny.AiConversation.Stores.SqliteDocDb), and voice conversations via Shiny.AiConversation.Voice (wake word, push-to-talk, follow-up, quiet-word/barge-in interruption, sentence-streamed text-to-speech over Shiny.Speech, acknowledgement modes, sounds, voice selection tools), the MAUI chat UI via Shiny.AiConversation.Maui (AiChatView bound to a session with streaming bubbles, choice chips, push-to-talk and an AiMemoryView), image attachments with retention, and the use_camera tool via Shiny.AiConversation.Maui.Camera, and AG-UI via Shiny.AiConversation.AgUi (a session as an AG-UI event stream for the Shiny AgentView with ask_user questions as interrupts, the render_ui tool for A2UI surfaces, and a remote AG-UI agent as the chat client)/shiny-appdevicebridgeGenerate code using Shiny.AppDeviceBridge, device bridges on your app's own Shiny.Net.HttpServer that also host a web app (Blazor WebAssembly, React, Vue, any static build) inside a .NET MAUI app on Android, iOS, Mac Catalyst, Windows and the maui-labs macOS and Linux heads — served from a loopback HTTP server, updated over the air from a signed release server, GitHub releases or a provider of your own, and given device access through bridges with typed C# and TypeScript clientsOther plugins' skills for the same job