rm-guide-di
CommunityEnforce safe DI practices in Blazor apps
Software Engineering#dotnet#dependency-injection#blazor#constructor-injection#service-registration#ioptions
Authormichaelvolz
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Uncontrolled dependency injection patterns in Blazor can lead to runtime failures, singleton leaks, and hard-to-test code, so this guidance keeps constructors, components, and services aligned with predictable DI behavior.
Core Features & Use Cases
- Constructor injection focus: Emphasizes required constructor parameters and discourages instantiating dependencies inside methods when DI can provide them.
- Blazor component guidance: Reinforces using [Inject] with required for UI components and avoids service locator anti-patterns that hide dependencies.
- Configuration handling: Recommends IOptions<T> for configuration-bound services instead of passing IConfiguration throughout business logic.
- Use case: When adding a new service, handler, or component that relies on shared app services, follow these guidelines to register the service properly and wire dependencies cleanly.
Quick Start
Ask the assistant to review a Blazor component or service constructor and ensure it uses required constructor injection, required [Inject] properties, and IOptions for configuration instead of manual instantiation.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: rm-guide-di Download link: https://github.com/michaelvolz/redmuffin.Blazor.StaticWeb/archive/main.zip#rm-guide-di Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.