PHP Policy Pattern Generator

•
45
•

Generates robust, composable business rule and authorization policies for PHP 8.4 applications.

The create-policy skill streamlines the implementation of the Policy pattern within PHP 8.4 projects, specifically targeting Domain-Driven Design (DDD) and Clean Architecture environments. It automates the creation of encapsulated, stateless business rules, authorization checks, and complex validation logic by generating interfaces, concrete implementations, and composite policies. By providing a structured way to handle PolicyResult objects with specific denial reasons, it ensures that your application logic remains auditable, testable, and free from side effects, while also generating corresponding unit tests for every component.

主要功能

01Strict adherence to DDD and Clean Architecture patterns
02Automated PHP 8.4 Policy and Interface generation
03Composable business logic using AND/OR result logic
04Automatic unit test generation for all policy components
0545 GitHub stars
06Detailed denial reasons and metadata for auditing

使用场景

01Implementing complex user authorization checks for specific domain resources
02Validating business rules like discount eligibility or order cancellation constraints
03Creating auditable decision-making logic for regulatory compliance