enforce-business-rules

Installation
SKILL.md

Enforce Business Rules

Use this skill BEFORE writing complex logic or AFTER generating code to ensure it adheres to the projects "Ironclad Business Laws".

1. Tenancy Laws (Multi-Tenancy)

Context: Single Database, Tenant-per-record (tenant_id).

  • Rule T1 (Scoped Queries): NEVER query models directly without considering the Tenant Scope. Filament does this automatically, but custom Controllers/Jobs must manually apply where('tenant_id', $tenant->id).
  • Rule T2 (Team Resolver): We use spatie/laravel-permission with Teams.
    • The team_id IS the tenant_id.
    • DO NOT use global roles for tenant-specific users. Use RoleType::USER or RoleType::OWNER scoped to the tenant.

2. Authorization Laws (RBAC)

Context: Hierarchical Access (Admin > Owner > User).

Installs
3
GitHub Stars
31
First Seen
Jan 24, 2026
enforce-business-rules — iurygdeoliveira/labsis-kit