What problem does it solve?
This Skill standardizes the facade layer, ensuring all business logic adheres to consistent patterns for transaction management, error handling, caching, and cross-service orchestration, reducing complexity and improving system reliability.
Core Features & Use Cases
- Transaction & Error Management: Enforces mandatory transaction usage for multi-step mutations and consistent error wrapping with
createFacadeError.
- Comprehensive Caching Integration: Mandates the use of domain-specific
CacheService helpers for reads and CacheRevalidationService for invalidating caches after writes.
- Query Delegation & Context-Driven Filtering: Ensures facades delegate all raw queries to query classes and use
QueryContext to automatically apply permission and soft-delete filters.
- Use Case: When implementing a facade method to delete a 'Collection' and all its associated 'Bobbleheads', this Skill ensures the operation is wrapped in a database transaction, delegates deletions to respective query methods, invalidates relevant caches, and logs Sentry breadcrumbs for success and warnings for non-critical cleanup failures.
Quick Start
Create a new facade method to handle the creation of a 'Product' that involves multiple database writes, ensuring it uses a transaction, invalidates relevant caches, and logs Sentry breadcrumbs.