supabase-rls

supabase-rls is a skill for Claude Code from YuDefine/nuxt-supabase-starter. It costs 63 tokens per session (662 once invoked), scanned A, original, MIT.

A set of rules and templates for Supabase Row Level Security, which restricts database rows according to the signed-in user or role. Supabase is a hosted database and backend service based on PostgreSQL.

In plain words
What is it for?
Use it when creating or changing database access policies, enabling Row Level Security, handling user and service roles, securing file storage operations, or checking that insert, update, and delete rules are complete.
Why use it?
It helps prevent users from reading or changing data they should not access and addresses common cases where database operations quietly return no rows or fail.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

Good fit Use it when creating or changing database access policies, enabling Row Level Security, handling user and service roles, securing file storage operations, or checking that insert, update, and delete rules are complete.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yudefine/nuxt-supabase-starter/supabase-rls
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add YuDefine/nuxt-supabase-starter --skill supabase-rls
Clone the repo
git clone --depth 1 https://github.com/YuDefine/nuxt-supabase-starter

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for supabase-rls

README.md
[![agentmods](https://agentmods.dev/badge/skills/yudefine/nuxt-supabase-starter/supabase-rls/github.svg)](https://agentmods.dev/skills/yudefine/nuxt-supabase-starter/supabase-rls)
Your own site
<a href="https://agentmods.dev/skills/yudefine/nuxt-supabase-starter/supabase-rls"><img src="https://agentmods.dev/badge/skills/yudefine/nuxt-supabase-starter/supabase-rls/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for supabase-rls

Your own site · 80×15
<a href="https://agentmods.dev/skills/yudefine/nuxt-supabase-starter/supabase-rls"><img src="https://agentmods.dev/badge/skills/yudefine/nuxt-supabase-starter/supabase-rls.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 662 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00063 $0.00662
Opus 5 $0.00032 $0.00331
Sonnet 5 $0.00013 $0.00132
Haiku 4.5 $0.00006 $0.00066

Measured 10d ago against content hash 2588031fd99f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

supabase-rls scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

template/.claude/skills/supabase-rls/SKILL.md · 62 lines

How it starts

The opening of the file, as written. The whole thing — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Supabase RLS 政策規範

service_role 繞過規則已定義在 CLAUDE.md。本 skill 提供完整 RLS 實作指引。

核心原則

使用 Helper 函式

建議建立 helper 函式取代直接查表:

-- ✅ 使用 helper
your_schema.current_user_role()
your_schema.current_user_id()

-- ❌ 直接查表(效能差)
SELECT role FROM your_schema.user_roles WHERE id = auth.uid()

RLS 開啟原則

ALTER TABLE your_schema.new_table ENABLE ROW LEVEL SECURITY;
ALTER TABLE your_schema.new_table FORCE ROW LEVEL SECURITY;

常見問題

症狀 原因 解法
Toast 成功但資料沒變 缺少 service_role 繞過 加上 (SELECT auth.role()) = 'service_role'
查詢回傳空陣列 RLS 未開放讀取 檢查 SELECT policy
UPDATE 回傳 0 rows 無報錯 UPDATE 需要搭配 SELECT policy 補上對應的 SELECT policy(Postgres RLS 限制)
Storage upsert 靜默失敗 只有 INSERT policy,缺 SELECT/UPDATE Storage upsert 需要 INSERT + SELECT + UPDATE 三個 policy
RLS policy 用 user_metadata user_metadata 使用者可自行修改 改用 app_metadataraw_app_meta_data
刪除 user 後仍能存取 JWT 未失效 先 revoke sessions,縮短 JWT expiry

參考資料

檔案 內容
references/templates.md Policy 模板 + 角色階層

檢查清單

  • 包含 (SELECT auth.role()) = 'service_role' 繞過
  • 使用 helper 函式而非直接查表
  • INSERT/UPDATE/DELETE 都有對應 policy
  • 有 UPDATE policy 的表必須同時有 SELECT policy(否則 UPDATE 靜默失敗)
  • Storage bucket 的 upsert 場景需 INSERT + SELECT + UPDATE 三個 policy
  • Policy 中 NEVER 使用 user_metadata / raw_user_meta_data 做授權判斷
  • pnpm db:lint 無警告

Read the full file on GitHub · 62 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 62 lines · 63 tokens per session scan A 2588031fd99f

Subscribe to this mod's changes

supabase-rls is a skill published in the GitHub repository YuDefine/nuxt-supabase-starter (45 stars, last pushed yesterday), licensed MIT. It adds 63 tokens to every session and 662 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

explorer

Build and modify Studio Explorer surfaces, including notebooks, chats, SQL snippets, query cells, and their shared toolbar patterns.

supabase/supabase · 27 tokens

azure-cosmos-db-py

Build Azure Cosmos DB NoSQL services with Python/FastAPI following production-grade patterns. Use when implementing database client setup with dual auth (DefaultAzureCredential + emulator), service layer classes with CRUD operations, partition key strategies, parameterized queries, or TDD patterns for Cosmos. Triggers…

microsoft/skills · 96 tokens

dotcanvas

Author and edit a Grida .canvas board — a .canvas.json manifest plus document files (references, generated images, notes) placed on an infinite canvas. Use when working on a .canvas bundle or arranging visuals/design work spatially. For a linear deck/presentation, use the slides skill instead.

gridaco/grida · 69 tokens

supabase

Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); client libraries and SSR integrations (supabase-js, @supabase/ssr) in Next.js, React, SvelteKit, Astro, Remix; auth issues (login, logout, sessions, JWT, cookies…

supabase/agent-skills · 185 tokens

svg

Author and edit .svg files in a Grida editor session — live-canvas binding, SVG output style, and parse-error recovery. Use when creating or modifying an SVG document.

gridaco/grida · 39 tokens

gh-issue

Size-audit, write, and split BanyanDB issues that somebody else or an automated TDD workflow can implement. Use whenever the user asks to file or revise an issue, decide whether an issue is too large, make an issue TDD-ready, turn a design into tickets, or split an umbrella into executable leaves. Do not draft or file…

apache/skywalking-banyandb · 91 tokens