This mastery hub synchronizes the **Official Supabase agentic skills** currently active in the `.ai/skills` system. It provides the definitive technical architecture and standards for Backend-as-a-Service (BaaS) and high-performance Postgres management.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe β weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Supabase Official Mastery?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/idorgham-supabase-official-mastery)
---
type: Skill
subagents: [core-validator, integrity-bot]
agents: [master-guide, swarm-router]
dependencies: [core-orchestration, global-sync]
version: 1.0.0
---
# Supabase Official Integration Mastery
This mastery hub synchronizes the **Official Supabase agentic skills** currently active in the `.ai/skills` system. It provides the definitive technical architecture and standards for Backend-as-a-Service (BaaS) and high-performance Postgres management.
## π οΈ Technical Architecture
| Feature | Sovereign Implementation |
|---------|-----------|
| **PostgreSQL** | Primary database (direct + pooled URLs). |
| **Auth** | User management via `@supabase/ssr` (Next.js App Router). |
| **Storage** | Object storage for user uploads and media. |
| **Realtime** | WebSocket-based DB change subscriptions. |
| **Row Level Security** | Native multi-tenant isolation. |
### Monorepo Integration
```typescript
// packages/shared/src/lib/supabase/server.ts
import { createServerClient } from '@supabase/ssr'
import { cookies } from 'next/headers'
export function createSupabaseServerClient() {
const cookieStore = cookies()
return createServerClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
{
cookies: {
getAll() { return cookieStore.getAll() },
setAll(cookiesToSet) {
cookiesToSet.forEach(({ name, value, options }) =>
cookieStore.set(name, value, options)
)
},
},
}
)
}
```
### RLS (Row Level Security) Standard
```sql
-- Enable RLS and define owner-only policy
ALTER TABLE bookings ENABLE ROW LEVEL SECURITY;
CREATE POLICY "users_own_bookings" ON bookings
FOR ALL USING (auth.uid() = user_id);
```
## π οΈ Synced System Capabilities
The following skills are linked directly to the executable `.ai/skills` directory:
### Database & Platform
- **supabase**: General integration protocols for the Supabase platform ecosystem.
- **supabase-postgres-best-practices**: Advanced standards for indexing, RLS (Row Level Security), and SQL performance within Supabase.
## π Integrated Sub-Skills (Complete List)
*The system maintains 1:1 parity with the following `.ai/skills/official-supabase-*` capability nodes:*
- `official-supabase-supabase`
- `official-supabase-supabase-postgres-best-practices`
## π‘οΈ Common Pitfalls
- **[SM-001]** Directly using `supabase-js` in Server Components instead of `@supabase/ssr` β causes cookie sync issues.
- **[SM-002]** Exposing `SUPABASE_SERVICE_ROLE_KEY` in the frontend β absolute security bypass.
- **[SM-003]** Forgetting to enable RLS β tables remain public until RLS is explicitly enabled.
- **[SM-004]** Not paginating `.select('*')` queries β Supabase does not apply automatic limits.
- **[SM-005]** Leaking Realtime channel subscriptions β memory leaks in client-side React.
- **[SM-006]** Blind `.upsert()` usage β can silently overwrite data without active unique constraints.
## β Success Criteria
- [ ] `database.types.ts` generated from schema and committed.
- [ ] RLS enabled on every user-scoped table.
- [ ] `SUPABASE_SERVICE_ROLE_KEY` restricted to server-side admin logic.
- [ ] `getUser()` used in Server Components for secure identity verification.
- [ ] All Supabase responses validated via Zod schemas.
## π₯ Execution Protocol
To invoke any of these synced skills within a project, use the corresponding slash command mapped in the system router.
---
*Generated by Sovereign Factory Sync Ops*