Reference guide for the modern-di Python DI framework.
“编程与软件开发”领域的一个 Skill。已为 Claude Code, Codex, OpenCode 及另外 32 个智能体 准备好命令。
完整描述
Reference guide for the modern-di Python DI framework. Use this skill for ANY question about modern-di — scope hierarchy (Scope.APP/REQUEST/SESSION/ACTION), Group/Factory/CacheSettings declaration, Container resolution (resolve vs resolve_provider, build_child_container), ContextProvider for runtime values, framework integration via ModernDIPlugin or setup_di/FromDI, testing with container.override/reset_override, injecting Request objects into providers, and SQLAlchemy session wiring. Trigger on: modern-di, providers.Factory, CacheSettings, Scope.REQUEST, Scope.APP, build_child_container, ModernDIPlugin, setup_di, modern-di-litestar, modern-di-fastapi, container.override, resolve_provider. Don't skip this skill for questions that seem simple — modern-di has specific idioms (no Singleton class, sync-only resolution, hierarchical scopes) that differ from other DI frameworks.