mde-supabase

Guides Supabase database, RLS, auth, Edge Functions, Realtime, and Storage work in the mdeai.co repository.

1|Updated Sep 15, 2026
One-click install
npx skills add https://github.com/amoai-tech/mdeai --skill mde-supabase-amoai-tech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mde-supabase
Source: https://github.com/amoai-tech/mdeai/tree/main/.claude/skills/mde-supabase
Command: npx skills add https://github.com/amoai-tech/mdeai --skill mde-supabase-amoai-tech

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Supabase work on the mdeai.co codebase spans schema migrations, RLS policies, Deno Edge Functions, Realtime channels, Storage buckets, and auth gotchas, and mistakes in any of these silently create security holes or broken sign-ins. This Skill consolidates all Supabase guidance into one entry point with routing to topic files and repo-specific rules. ## Core Features & Use Cases - Security-first RLS and auth rules: Enforces patterns like (SELECT auth.uid()), app_metadata over user_metadata, paired SELECT/UPDATE policies, and service-role key isolation. - Edge Function lifecycle reference: Covers Deno.serve patterns, verify_jwt configuration, secrets, webhooks, deployment, testing, and platform limits, plus a canonical inventory of the repo's 16 functions. - Topic routing: Directs to dedicated files for Postgres performance, Realtime broadcast triggers, Storage RLS, and Better Auth practices. - Use Case: When adding a new Edge Function or writing an RLS policy for a sponsor-schema table, load this Skill to get the correct schema routing (svc.schema('sponsor')), migration workflow, and security checklist before writing code. ## Quick Start Ask the assistant to write an RLS policy or deploy a Supabase Edge Function for the mdeai.co repo and it will load the matching topic files automatically.

Frequently Asked Questions about mde-supabase

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a secure RLS policy in Supabase?

Use `(SELECT auth.uid())` instead of `auth.uid()` so the value is cached per query rather than per row, and always pair UPDATE policies with SELECT policies since updates silently return zero rows without one. Index every column referenced in the policy.

How do I deploy a Supabase Edge Function with Deno?

Write the handler with the built-in `Deno.serve` (not the deprecated std serve import), add a `[functions.<name>]` block to `supabase/config.toml`, then run `supabase functions deploy <name>`. Set `verify_jwt = false` for webhooks and public endpoints.

Should I use user_metadata or app_metadata for authorization in Supabase?

Use `app_metadata` for authorization because `user_metadata` is editable by the user through the JS client and is unsafe for access decisions. Move authorization claims into `raw_app_meta_data` via a server-side trigger on `auth.users`.

Why does my Supabase UPDATE return zero rows without an error?

Postgres RLS requires a SELECT policy before an UPDATE can match rows, since the update first selects the row. Without a matching SELECT policy the update silently affects zero rows, so audit `pg_policies` to confirm each mutating policy has a paired SELECT.

When should I use broadcast instead of postgres_changes in Supabase Realtime?

Always use broadcast via database triggers for new features because `postgres_changes` is single-threaded and does not scale under load. Combine it with private channels, `realtime.messages` RLS policies, and scoped topic names like `event:123:tickets`.

When should this Skill not be used?

Do not use it for Auth0, Clerk, or Firebase Auth as the primary auth system, for raw Postgres or Neon without Supabase client, RLS, or Edge Functions in scope, or for Vercel-only environment questions with no Supabase secrets angle.