litestar-di
Installation
SKILL.md
Litestar Dependency Injection
Use this skill for Provide, NamedDependency / SkipValidation, dependency
maps, provider factories, request-scoped resources, and Dishka integration.
Code Style Rules
- Mark every name-based injected parameter with
NamedDependency[T]. UseNamedDependency[SkipValidation[T]]only for trusted provider output that must bypass validation. - Wrap providers in
Provide. For synchronous providers, setsync_to_thread=Truefor blocking work orFalsefor trivial non-blocking work; leaving it unspecified emits a warning. - Use Litestar dependency maps for simple and medium apps.
- Use Dishka when the project needs explicit scopes and provider modules.
- Keep provider names stable and descriptive.
- Do not open request-scoped resources at import time.