rls-performance

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

A guide for finding and fixing slow database queries when row-level security rules and limited connection pools affect an API.

In plain words
What is it for?
It is for diagnosing slow endpoints, PostgreSQL query plans, row-level security performance, and exhausted database connections.
Why use it?
It helps identify full-table scans, inefficient filters, and connection-pool timeouts using measurements that reflect real user access.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit It is for diagnosing slow endpoints, PostgreSQL query plans, row-level security performance, and exhausted database connections.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yudefine/nuxt-supabase-starter/rls-performance
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 rls-performance
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 rls-performance

README.md
[![agentmods](https://agentmods.dev/badge/skills/yudefine/nuxt-supabase-starter/rls-performance/github.svg)](https://agentmods.dev/skills/yudefine/nuxt-supabase-starter/rls-performance)
Your own site
<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.

agentmods 80×15 button for rls-performance

Your own site · 80×15
<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>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 668 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.00058 $0.00668
Opus 5.5 $0.00023 $0.00267
Sonnet 5.5 $0.00012 $0.00134
Haiku 4.5 $0.00006 $0.00067

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

Security

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 2d 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/rls-performance/SKILL.md · 27 lines

What it actually says

RLS Performance Playbook

RLS 效能問題的診斷操作手冊:新增 policy join 或改 policy WHERE、新增含 pagination/filter 的 endpoint、PGRST003、pool 耗盡、特定頁面變慢。量測模板、plan 判讀、index、延遲基準在 db-schema/<variant>/query-optimization.md 與 rls-policy.md,連線池預算與 PGRST003 處置在 db-runtime/<variant>/database.md;本 skill 只串起診斷流程並補規約沒有的判讀訊號。

SOP

Phase 1 -- 收斂症狀

  1. READ 讀取症狀描述與 log.error:是否有 PGRST003(pool 耗盡,REST 504)、哪個頁面或 endpoint 變慢、最近是否新增或修改 policy join/WHERE、是否新增含分頁的 endpoint。

Phase 2 -- 量測與判讀

  1. DELEGATE 在目標主機量測:慢 query 依 query-optimization.md § 效能測量(pg_stat_statements)找出 total/mean 最高者,再依 § EXPLAIN ANALYZE 模板以目標角色(set local role,superuser 會 bypass RLS)跑 EXPLAIN ANALYZE;self-hosted 連線問題依 db-runtime database.md § Connection Pool Runbook 的 pg_stat_activity 查詢按 usename/state 分組。
  2. THINK 讀取 rules/連線池與RLS診斷判準.md,搭配 query-optimization.md § 讀 plan 的重點,判定是 policy 寫法、缺 index、N+1 還是 pool 問題。

Phase 3 -- 修正與驗證

  1. WRITE 依判定修正:改 policy 寫法(rls-policy.md § RLS 效能)、加 index(query-optimization.md § Index 設計原則)、N+1 改 select(*, related(*)) embed 或 RPC,或縮小交易批次(db-runtime database.md § Transaction 與批次寫入安全)。pool 問題照 Runbook 處置,NEVER 對 pool timeout 盲目 retry。
  2. DELEGATE 以相同角色重跑 EXPLAIN ANALYZE,比較修正前後與有/無 policy 的 Execution Time 與 Seq Scan,依已載入規則判定是否仍超標;仍超標就回 Phase 2。
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. 2d ago Changed · -150 lines fb765d0f460e
  2. 19d ago Changed · -1 lines 25cd21e97d20
  3. 1mo ago Changed · -24 lines 1d17469ce7c5
  4. 1mo ago Changed · +1 lines e6b3c83dd9ac
  5. 1mo ago Changed · -2 lines a55c202f53cc
  6. 1mo ago Changed · +2 lines 920dcd835364
  7. 1mo ago First seen · 201 lines · 58 tokens per session scan A e436b8b24352

Subscribe to this mod's changes

rls-performance is a skill published in the GitHub repository YuDefine/nuxt-supabase-starter (44 stars, last pushed yesterday), licensed MIT. It adds 58 tokens to every session and 668 once invoked, about $0.0002 per session on Opus 5.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.

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

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".

Mathews-Tom/armory · 78 tokens

nw-database-technology-selection

Database comparison catalogs, RDBMS vs NoSQL selection criteria, CAP/ACID/BASE theory, OLTP vs OLAP, and technology-specific characteristics.

nWave-ai/nWave · 38 tokens

sql-explain

Explains a PostgreSQL EXPLAIN ANALYZE plan and points at the slowest node. Use when the user pastes a query plan; not for rewriting schemas.

Goldziher/ai-rulez · 39 tokens

srtd-cli

This skill should be used when the user mentions "srtd", "sql templates", "migrations-templates", "live reload sql", "supabase functions", when working with files in supabase/migrations-templates/, when .buildlog.json or srtd.config.json is detected, or when writing Postgres functions/views/triggers for Supabase.

t1mmen/srtd · 75 tokens

optimize-a-query

Diagnose and fix a slow Postgres query in the builders-stack — read its EXPLAIN plan, find the missing index or the ORM N+1, and confirm the fix. Use when a page or endpoint is slow, a query times out, or pgstatstatements shows a hot query. Pairs with design-a-schema for the index itself.

lonormaly/builders-stack · 77 tokens