What problem does it solve?
This Skill audits code for strict adherence to the game engine's Dependency Injection (DI) architecture using DryIoc. It ensures all services use constructor injection, identifies and flags static singleton violations, validates service registration patterns, and helps resolve complex issues like circular dependencies, leading to a more maintainable and testable codebase.
Core Features & Use Cases
- Constructor Injection Validation: Verifies that all dependencies are injected via constructors, not properties or service locators.
- Static Singleton Detection: Identifies and flags forbidden static singletons, enforcing the "DI-first" principle.
- Service Lifetime Guidelines: Provides best practices for
Singleton vs. Transient service registration in Program.cs.
- Circular Dependency Resolution: Offers strategies (events, shared dependencies) to break circular dependencies.
- Use Case: When reviewing a new feature module, use this Skill to ensure that all new services are correctly registered in DryIoc, use constructor injection, and do not introduce any static singletons or circular dependencies that could destabilize the application.
Quick Start
Review the AnimationSystem class for proper constructor injection and ensure its dependencies are correctly registered as singletons in Program.cs.