Controller Builder
CommunityBuild clean, testable API controllers.
Software Engineering#python#clean architecture#API design#dependency injection#controller#use case#factory method
Authorjzallen
Version1.0.0
Installs0
System Documentation
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_controllermethods 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
UserControllerthat exposes methods likeregister_userandget_user_profile, injectingregister_user_use_caseandget_user_use_casefunctions via aUserDependenciesdataclass.
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.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: Controller Builder Download link: https://github.com/jzallen/fred_simulations/archive/main.zip#controller-builder Please download this .zip file, extract it, and install it in the .claude/skills/ directory.