dependency-inversion-principle

Installation
SKILL.md

Dependency Inversion Principle (DIP)

Overview

High-level modules should not depend on low-level modules. Both should depend on abstractions.

Classes should depend on interfaces, not concrete implementations. Dependencies should be injected, not instantiated internally.

When to Use

  • Creating any class that uses external services
  • Class uses database, email, file system, APIs
  • Writing new ConcreteClass() inside another class
  • Told "don't overcomplicate with DI"

The Iron Rule

NEVER instantiate dependencies inside a class. Always inject them.
Related skills
Installs
26
GitHub Stars
10
First Seen
Jan 22, 2026