home / skills / busirocket / agents-skills / busirocket-supabase-boundaries
/skills/busirocket-supabase-boundaries
This skill helps enforce strict Supabase boundaries by centralizing access in services and avoiding direct calls from components.
npx playbooks add skill busirocket/agents-skills --skill busirocket-supabase-boundariesReview the files below or copy the command above to add this skill to your agents.
---
name: busirocket-supabase-boundaries
description:
Supabase access patterns and service boundaries. Use only when working with
Supabase projects. Centralize Supabase access in services/ and never call
Supabase directly from components/hooks/utils/route handlers.
disable-model-invocation: true
metadata:
author: cristiandeluxe
version: "1.0.0"
---
# Supabase Boundaries
Service boundary patterns for Supabase projects.
## When to Use
Use this skill only when:
- Working in a project that uses Supabase
- Creating or refactoring Supabase access code
- Enforcing service boundaries for database access
## Non-Negotiables (MUST)
- **Never call Supabase directly** from components, hooks, utils, or route
handlers.
- **Centralize access** in dedicated Supabase service wrappers (e.g.
`services/supabase/*`).
- Keep wrappers small, focused, and typed.
- Never import `@supabase/supabase-js` outside a single Supabase client module
(e.g. `lib/supabase.ts`) or your Supabase service wrappers.
## Rules
### Supabase Access
- `supabase-access-rule` - Isolate Supabase access in service wrappers
- `supabase-services-usage` - Route handlers, hooks, utils, and components must
NOT call Supabase directly
## How to Use
Read individual rule files for detailed explanations and code examples:
```
rules/supabase-access-rule.md
rules/supabase-services-usage.md
```
Each rule file contains:
- Brief explanation of why it matters
- Code examples (correct and incorrect patterns)
- Additional context and best practices
This skill defines service boundary patterns for projects that use Supabase. It enforces centralized Supabase access in small, typed service wrappers and prevents direct Supabase calls from UI, hooks, utilities, or route handlers. The goal is safer, easier-to-test, and more maintainable data access across TypeScript, React, Next.js, Rust, and Tauri codebases.
The skill inspects code for direct imports or calls to the Supabase client outside designated service modules and flags violations. It requires a single client module and dedicated services/supabase/* wrappers that expose focused, typed functions. Each rule includes clear examples of correct and incorrect patterns and recommends where to place the Supabase client and service wrappers.
Why avoid importing the Supabase client everywhere?
Scattered imports make it hard to change authentication, add logging, mock data for tests, and enforce access policies. A single client and service layer centralize these concerns.
What belongs in a service wrapper versus a component?
Data fetching, permission checks, and transformations belong in service wrappers. Components should only call wrapper functions and render results.