lib-dependency-injector

Enforces dependency_injector imports through FlextContainer and FlextRuntime bridge APIs.

Updated May 20, 2025
One-click install
npx skills add https://github.com/flext-sh/flext --skill lib-dependency-injector
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lib-dependency-injector
Source: https://github.com/flext-sh/flext/tree/main/.claude/skills/lib-dependency-injector
Command: npx skills add https://github.com/flext-sh/flext --skill lib-dependency-injector

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces strict boundaries for the use of the dependency-injector library within the FLEXT ecosystem, preventing direct imports in application code and ensuring a clean, maintainable dependency injection architecture.

Core Features & Use Cases

  • Enforces DI Boundaries: Prevents direct dependency-injector imports outside of core bridge modules.
  • Promotes Framework Agnosticism: Ensures application code interacts with DI through the FlextContainer and FlextRuntime APIs.
  • Use Case: When developing a new FLEXT service, this Skill will flag any attempt to import dependency_injector directly, guiding the developer to use the provided bridge interfaces instead.

Quick Start

Ensure all new DI wiring adheres to the FlextContainer and FlextRuntime bridge patterns.

Frequently Asked Questions about lib-dependency-injector

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why should I use a dependency injection container bridge instead of direct library imports?

A dependency injection container bridge prevents direct library imports in application code, enforcing strict architectural boundaries. This promotes framework agnosticism by ensuring services interact only through public APIs, keeping your dependency injection architecture clean and maintainable.

How do I wire dependencies in a FLEXT service without importing the injector library?

Wire dependencies by using the FlextContainer and FlextRuntime bridge APIs. All new dependency injection wiring, provider registration, and scoped test container modifications must route through these bridge interfaces instead of direct library imports.

Can I use direct dependency-injector imports outside of the flext-core project?

No, direct dependency-injector imports are limited to the flext-core scope for defining public contracts. Other FLEXT projects must consume the provided bridge APIs to maintain framework agnosticism and strict architectural boundaries.

What happens if I import dependency_injector directly in my application code?

Importing dependency_injector directly in application code will be flagged. The Skill enforces DI boundaries by guiding you to remove the direct import and use the provided FlextContainer and FlextRuntime bridge interfaces instead.

Does this dependency injection bridge support scoped test container modifications?

Yes, the bridge supports scoped test container modifications. It triggers on dependency injection wiring and provider registration, ensuring that test containers adhere to the same bridge API boundaries as production runtime code.