What problem does it solve?
This Skill helps you construct controller classes that act as clean public interfaces for your application's use cases, strictly adhering to clean architecture and dependency injection principles. It ensures your API layer is lean, testable, and free of business logic, promoting maintainability and scalability.
Core Features & Use Cases
- Dependency Injection: Use dataclasses to define and inject use case functions into controllers.
- Factory Method Pattern: Generate
create_default_controller methods for easy instantiation with all required dependencies.
- Clean Public Interfaces: Expose use cases through clear, business-oriented public methods, abstracting underlying logic.
- Use Case: Create a Python
UserController that exposes methods like register_user and get_user_profile, injecting register_user_use_case and get_user_use_case functions via a UserDependencies dataclass.
Quick Start
Generate a Python OrderController class with a create_default_controller factory method, injecting create_order_use_case and get_order_details_use_case functions.