/shiny:shiny-difrom shiny
Generates and configures Shiny DI for .NET with attribute-driven service registration, source generators, keyed services, categories, and multi-interface support.
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.
None: SKILL.md is the whole skill.
You are an expert in Shiny Extensions Dependency Injection, a .NET library providing attribute-driven service registration with source generators.
Invoke this skill when the user wants to:
[Singleton], [Scoped], or [Transient] attributes with source generationDocumentation: https://shinylib.net/extensions/di/
Repository: https://github.com/shinyorg/Shiny.Extensions
Package: Shiny.Extensions.DependencyInjection
Namespace: Shiny
Mark classes with attributes for automatic DI registration via source generation:
[Singleton] // Singleton lifetime
public class MyService : IMyService { }
[Scoped] // Scoped lifetime
public class MyRepository : IRepository { }
[Transient] // Transient lifetime
public class MyFactory : IFactory { }
All registration attributes support these properties:
| Property | Type | Description |
|---|---|---|
AsSelf | bool | Register as the class itself rather than its interface |
Type | Type | Register against a specific interface (when class implements multiple) |
KeyedName | string? | Register as a keyed service |
Category | string? | Category for conditional registration |
TryAdd | bool | Use TryAdd semantics (won't replace existing registrations) |
// Register as the class itself
[Singleton(AsSelf = true)]
public class AppState { }
// Register against a specific interface
[Singleton(Type = typeof(ISpecificInterface))]
public class MultiInterfaceService : ISpecificInterface, IOtherInterface { }
// Keyed service
[Singleton(KeyedName = "primary")]
public class PrimaryCache : ICache { }
// Category-based conditional registration
[Singleton(Category = "premium")]
public class PremiumFeature : IFeature { }
// TryAdd semantics
[Singleton(TryAdd = true)]
public class DefaultLogger : ILogger { }
// Register all source-generated services
// AddGeneratedServices is generated into the project's root namespace
builder.Services.AddGeneratedServices();
// Register with specific categories only
builder.Services.AddGeneratedServices("premium", "analytics");
The extension method name and namespace can be customized via MSBuild properties:
<PropertyGroup>
<ShinyDIExtensionMethodName>AddMyServices</ShinyDIExtensionMethodName>
<ShinyDIExtensionNamespace>My.Custom.Namespace</ShinyDIExtensionNamespace>
</PropertyGroup>
// Register a singleton against all implemented interfaces
services.AddSingletonAsImplementedInterfaces<MyService>();
services.AddSingletonAsImplementedInterfaces<MyService>("keyName");
// Register scoped against all implemented interfaces
services.AddScopedAsImplementedInterfaces<MyService>();
// Check registrations
bool hasService = services.HasService<IMyService>();
bool hasImpl = services.HasImplementation<MyService>();
// Lazy resolution
Lazy<IMyService> lazy = services.GetLazyService<IMyService>(required: true);
Every [Service]/[Singleton]/[Scoped]/[Transient] attributed class is emitted in factory form — the source generator expands the constructor at compile time so registrations are AOT-clean and chain-friendly. Constructor selection mirrors ActivatorUtilities: [ActivatorUtilitiesConstructor] wins, otherwise the longest constructor is chosen. [FromKeyedServices("k")] and IServiceProvider parameters are handled. Optional parameters — those with an explicit default (e.g. IFoo? foo = null) or a nullable reference annotation — are resolved via GetService/GetKeyedService (no throw when unregistered) and fall back to the declared default, mirroring ActivatorUtilities. Multi-interface classes get explicit forwarders (no AddSingletonAsImplementedInterfaces reflection).
[Singleton]
public class MyService(IDep dep) : IMyService { }
// Generated:
// services.AddSingleton<IMyService>(sp => new MyService(sp.GetRequiredService<IDep>()));
Chain a callback onto the most recently registered factory-based service. Fires once per factory invocation (singleton → once; scoped → per-scope; transient → every resolve). Fully AOT-clean — wraps the factory, no reflection. Type-based and pre-built instance registrations are rejected (but generator-emitted registrations are always factory form, so this just works).
// With IServiceProvider
services
.AddSingleton<IFoo>(sp => new Foo())
.OnResolved<IFoo>((foo, sp) => foo.Configure(sp.GetRequiredService<IOptions>()));
// Without IServiceProvider (Action<TService> overload)
services
.AddSingleton<IFoo>(sp => new Foo())
.OnResolved<IFoo>(foo => foo.Initialize());
Mark a partial property [Bind] on a partial class. The generator emits the property body that reads/writes a Shiny key/value store via the static Shiny.Stores accessor (requires Shiny.Extensions.Stores). No INotifyPropertyChanged, no reflection, AOT-clean.
[Singleton]
public partial class AppSettings
{
[Bind] // default store
public partial string Theme { get; set; }
[Bind("secure")] // secure store
public partial string Token { get; set; }
[Bind(Key = "ui_density")] // override storage key (defaults to property name)
public partial int Density { get; set; }
}
[Singleton], [Scoped], [Transient]) over manual registrationCategory for optional features that may not always be registeredKeyedName when multiple implementations of the same interface existAddGeneratedServices() (generated into the project's root namespace) to activate source-generated registrations[Singleton]/[Scoped]/[Transient] attributes over manual services.Add*() callsKeyedName to disambiguateWhat SKILL.md sets; muted values are Claude Code's defaults
57 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 clients2 plugins ship this exact skill · first indexed Aug 16, 2026
npx claudepluginhub shinyorg/skills --plugin shinyOther plugins' skills for the same job