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.
npx skills add YuDefine/nuxt-supabase-starter --skill rls-performancegit clone --depth 1 https://github.com/YuDefine/nuxt-supabase-starterWrote 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.
[](https://agentmods.dev/skills/yudefine/nuxt-supabase-starter/rls-performance)<a href="https://agentmods.dev/skills/yudefine/nuxt-supabase-starter/rls-performance"><img src="https://agentmods.dev/badge/skills/yudefine/nuxt-supabase-starter/rls-performance/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.
<a href="https://agentmods.dev/skills/yudefine/nuxt-supabase-starter/rls-performance"><img src="https://agentmods.dev/badge/skills/yudefine/nuxt-supabase-starter/rls-performance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00058 | $0.02730 |
| Opus 5 | $0.00029 | $0.01365 |
| Sonnet 5 | $0.00012 | $0.00546 |
| Haiku 4.5 | $0.00006 | $0.00273 |
Grade A, and why
rls-performance 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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 203 lines — stays where its author put it; the contents beside it link to each section on GitHub.
RLS Performance Playbook
大型專案常累積大量 RLS policy 與 SECURITY DEFINER function,加上 self-hosted LXC 的 connection pool 限制,任何 N+1 或 full scan 都會被放大。本 skill 是遇到效能問題時的操作手冊。
決策原則(「MUST 做 / NEVER 做」)仍在 db-runtime/<variant>/database.md 與 db-schema/<variant>/database-design.md 規約(依 consumer 的 module variant 投影,三端都送達),本檔提供實際診斷與優化工具。
何時開啟本 skill
- 新增涉及 policy join 的表
- 修改既有 RLS policy 的 WHERE 條件
- 新增 server API endpoint 含 pagination / filter
- 遇到
PGRST003(504 timeout)或 pool 耗盡 - 使用者抱怨特定頁面 / endpoint 變慢
- 需要稽核 production 效能或清理無用 index
- 排查 LXC 連線問題 / Tunnel 斷線
核心原則:policy 改動前先量,改動後驗證,不要憑感覺優化。
EXPLAIN ANALYZE — 正確的 RLS 測量方式
關鍵陷阱:superuser 跑 EXPLAIN 會 bypass RLS,測出來的 plan 跟 production 完全不同。一定要 set local role 模擬目標角色。
-- 1. 模擬目標 role(不是 postgres superuser!)
set local role authenticated;
set local request.jwt.claims to '{"sub": "<user_uuid>", "role": "authenticated"}';
-- 2. 跑實際 query
explain (analyze, buffers, verbose, format text)
select ... from <schema>.<table> where ...;
-- 3. 還原
reset role;
讀 plan 重點
| Plan 片段 | 意義 | 處理 |
|---|---|---|
Seq Scan on xxx |
全表掃描 | 檢查 WHERE 欄位是否有 index |
Rows Removed by Filter: > 1000 |
Index 取太多又濾掉 | Composite index 或 partial index |
Subquery Scan ... InitPlan |
(SELECT auth.uid()) 有快取 |
✅ 正確模式 |
Filter: (auth.uid() = user_id) |
沒快取 | 改 subselect (SELECT auth.uid()) |
Nested Loop + 高 rows |
Policy 內 per-row JOIN | 改 subselect 預先算 ID set |
Planning Time > Execution Time |
Plan cache 沒命中 | 通常是 schema cache 過期或 prepared statement 問題 |
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.
- yesterday Changed · +2 lines 920dcd835364
- 5d ago First seen · 201 lines · 58 tokens per session scan A e436b8b24352
rls-performance is a skill published in the GitHub repository YuDefine/nuxt-supabase-starter (45 stars, last pushed yesterday), licensed MIT. It adds 58 tokens to every session and 2,730 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-09-03.
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
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-postgres-best-practices
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the…
sql-optimizer
Analyzes SQL queries for missing indexes, N+1 patterns, suboptimal joins, and full table scans. Interprets EXPLAIN, detects anti-patterns, rewrites queries. Triggers on: "optimize this query", "slow query", "add indexes", "explain plan", "N+1 query", "why is this query slow".
nw-database-technology-selection
Database comparison catalogs, RDBMS vs NoSQL selection criteria, CAP/ACID/BASE theory, OLTP vs OLAP, and technology-specific characteristics.
ecto-constraint-debug
Debug Ecto constraint violations - trace triggers, check migrations, find duplicate data. Use when seeing uniqueconstraint, foreignkeyconstraint, or checkconstraint errors.