Factory Function Composition
Standardizes code architecture using factory patterns to achieve clean dependency injection and modular service composition.
This skill provides a standardized framework for implementing factory function patterns in TypeScript, ensuring a strict separation between client, service, and method-level configurations. By enforcing a universal signature for dependencies and options, it eliminates common anti-patterns like hidden client creation or mixed configuration blobs. This approach facilitates highly testable, modular, and maintainable codebases by ensuring that each layer of your application owns its specific configuration and dependencies.
主な機能
01Identifies and refactors anti-patterns like hidden resource creation within functions
02Promotes clean dependency injection for easier unit testing with mocks
03Enforces a universal two-argument factory signature for consistent API design
043,817 GitHub stars
05Supports scalable patterns for services requiring multiple external dependencies
06Separates client, service, and method configuration layers to prevent configuration leakage
ユースケース
01Refactoring legacy functions that mix business logic with client initialization
02Structuring backend services for high testability via dependency injection
03Designing modular API client libraries with clear separation of concerns