CtrlK
BlogDocsLog inGet started
Tessl Logo

g14wxz/rls-policy-optimization

Prevents CPU spikes and full table scans from poorly written RLS policies via index and wrapper enforcement.

100

Quality

100%

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Advisory

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

Quality

Discovery

100%

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

This is an excellent skill description that clearly articulates specific technical actions, provides explicit trigger conditions via a 'Use when...' clause, and occupies a highly distinctive niche. It uses proper third-person voice and avoids vague language, making it easy for Claude to select this skill precisely when needed.

DimensionReasoningScore

Specificity

Lists multiple specific concrete actions: enforcing SELECT-wrapped auth.uid() calls, mandatory B-Tree/GIN indexes on policy-referenced columns, and SECURITY DEFINER encapsulation of deep JOINs. These are highly specific, actionable techniques.

3 / 3

Completeness

Clearly answers both 'what' (optimizes RLS policies via three specific techniques) and 'when' with an explicit 'Use when...' clause listing four trigger scenarios: optimizing RLS performance, fixing policy full table scans, wrapping auth.uid in SELECT, or indexing columns used in RLS policies.

3 / 3

Trigger Term Quality

Includes strong natural keywords users would say: 'RLS', 'RLS policies', 'auth.uid', 'full table scans', 'indexing', 'RLS performance', 'SELECT', 'B-Tree', 'GIN indexes', 'SECURITY DEFINER'. These cover the domain well and match how developers would describe these problems.

3 / 3

Distinctiveness Conflict Risk

Highly distinctive niche focused specifically on RLS policy performance optimization in what appears to be a Supabase/PostgreSQL context. The combination of auth.uid(), RLS policies, and specific index types makes it very unlikely to conflict with other skills.

3 / 3

Total

12

/

12

Passed

Implementation

100%

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

This is a high-quality skill that provides a clear, phased workflow for optimizing RLS policies with concrete SQL examples at every step. It respects Claude's intelligence by avoiding unnecessary explanations of Postgres concepts while providing specific, actionable patterns. The verification report phase with EXPLAIN ANALYZE checks ensures correctness validation.

DimensionReasoningScore

Conciseness

The content is lean and efficient. Every section serves a purpose, there's no explanation of what RLS is or how Postgres policies work—it assumes Claude knows these concepts. The SQL examples are minimal but complete.

3 / 3

Actionability

Fully executable SQL examples are provided for each phase: audit queries, before/after policy rewrites, index creation with naming conventions, and SECURITY DEFINER function templates. Commands like `supabase db push` are specific and copy-paste ready.

3 / 3

Workflow Clarity

The 5-phase workflow is clearly sequenced (Audit → Wrap → Index → Encapsulate → Migrate) with explicit validation in Phase 5 ('HALT if any statement fails') and a comprehensive verification report phase that includes EXPLAIN ANALYZE checks and confirmation of zero bare auth.* calls. The feedback loop is present: re-query, verify index scans, confirm no inline JOINs.

3 / 3

Progressive Disclosure

Content is well-structured with clear phases as sections. The SECURITY DEFINER template is appropriately placed in a collapsible `<details>` block. References to external tiles (supabase-mcp-verification.md, tenant-isolation-rls.md) are one level deep and clearly signaled in pre-conditions.

3 / 3

Total

12

/

12

Passed

Validation

100%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation11 / 11 Passed

Validation for skill structure

No warnings or errors.

Reviewed

Table of Contents