decoupling-with-di

Installation
SKILL.md

Decoupling with DI

When to use

  • Wiring services and repositories
  • Removing direct imports of concrete classes
  • Breaking circular dependencies
  • Switching DI containers

Core rules

  1. Domain/application declare ports (interfaces), infrastructure implements them
  2. Classes receive collaborators via constructor injection
  3. No direct imports of concrete classes across layers
  4. Use DI container (tsyringe, inversify, or NestJS built-in)
  5. Layer dependency: infrastructure → application → domain

Reference shape (TypeScript)

Installs
2
GitHub Stars
1
First Seen
Aug 22, 2026
decoupling-with-di — j4flmao/agent_skills_nodejs_nestjs