// Enforces Head Shakers facade layer coding conventions when creating or modifying business logic facades. This skill ensures consistent patterns for transaction handling, error management, cache integration, query coordination, and cross-service orchestration.
| name | facade-layer |
| description | Enforces Head Shakers facade layer coding conventions when creating or modifying business logic facades. This skill ensures consistent patterns for transaction handling, error management, cache integration, query coordination, and cross-service orchestration. |
This skill enforces the Head Shakers facade layer coding conventions automatically during business logic development. It ensures consistent patterns for transaction handling, error management, cache integration, query coordination, and cross-service orchestration with Sentry monitoring.
This skill activates when:
src/lib/facades/.facade.ts)facades/ or class name ends with Facade)references/Facade-Layer-Conventions.mdAsync suffix (e.g., createAsync, updateAsync, deleteAsync, getByIdAsync)const facadeName = '{Domain}Facade' at file top for error contextDatabaseExecutor (dbInstance?: DatabaseExecutor) as last parametercreateProtectedQueryContext, createUserQueryContext, createPublicQueryContext, createAdminQueryContext)buildBaseFilters()createPublicQueryContext() sets isPublic: true, etc.shouldIncludeDeleted: true for admin restore features(dbInstance ?? db).transaction(async (tx) => { ... })tx) to all nested query callsCacheService.bobbleheads.byId(), etc.)CacheRevalidationServiceCacheService.cached() when domain helper existscreateFacadeError(errorContext, error)withFacadeBreadcrumbs() wrapper to add automatic entry/success/error breadcrumbs (recommended)trackFacadeEntry() and trackFacadeSuccess() for manual controltrackFacadeWarning() for non-critical failures that shouldn't fail the operationcaptureFacadeWarning() to capture non-critical exceptions with proper tags and warning level@param for each parameter@returns describing the return valuePromise.all for parallel independent data fetchingAsync suffix on async methodsgetX and getXAsync)CACHE_KEYS.* constantsreferences/Facade-Layer-Conventions.md - Complete facade layer conventions