facade-layer

Standardize facade layers with transactions, error handling, caching, and query delegation.

2|Updated Aug 20, 2025
One-click install
npx skills add https://github.com/JasonPaff/head-shakers --skill facade-layer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: facade-layer
Source: https://github.com/JasonPaff/head-shakers/tree/main/.claude/skills/facade-layer
Command: npx skills add https://github.com/JasonPaff/head-shakers --skill facade-layer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

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.