What problem does it solve?
This Skill solves the common Django pain point of tangled, hard-to-test code where business logic is mixed into views, model methods, or scattered across the codebase, making changes risky and tests slow and dependent on the database.
Core Features & Use Cases
- Structured Service Layer: Enforces plain Python service classes that hold all business logic, with dependencies injected via constructor for full testability.
- Centralized Dependency Injection: Uses the svcs registry to wire services and repositories once at startup, so they can be resolved anywhere — views, Celery tasks, management commands, and tests.
- Strict Separation of Concerns: Services never import Django ORM or models, all database access is delegated to repositories, and all layer boundaries use typed Pydantic DTOs to keep changes local.
- Use Case: Refactor a fat Django view that handles order creation, inventory checks, and payment processing into a dedicated OrderService, inject the required OrderRepository and ProductRepository, register it in the svcs registry, and write fast, database-free unit tests for the business logic.
Quick Start
Use the dj-services skill to refactor the order creation logic from your Django view into a dedicated OrderService class with injected repository dependencies, registered in the project's svcs registry.