agentleFS
samsam007bsamsam007b/claude-code-standards-kit/skills/supabase-review/SKILL.md

supabase-review

Skill2 starsChanged 8 months agoMITView on GitHub

Supabase security audit: checks RLS on all tables, correct auth.uid(), indexes on FK columns, no select('*'), secured Edge Functions. Sources: NIST SP 800-63B, OWASP.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before every PR touching the DB or migrations

    line 12

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/supabase-review: Supabase Security & Quality Audit

When to use

  • Before every PR touching the DB or migrations
  • Full audit of the Supabase schema
  • Review of a new table or RPC
  • Verification of auth and RLS for a feature

Absolute rules (blocking)

RLS

  • Every table has RLS enabled: ALTER TABLE x ENABLE ROW LEVEL SECURITY
  • (select auth.uid()) in USING/WITH CHECK, NEVER bare auth.uid() (-40% performance on large queries)
  • Separate policy for SELECT / INSERT / UPDATE / DELETE
  • Publicly readable tables: explicit USING (true) policy + never public writes

Auth (NIST SP 800-63B)

  • Sessions invalidated server-side on logout (not just client-side)
  • MFA available for sensitive actions
  • JWT tokens not persisted in localStorage (HttpOnly cookie preferred)
  • Refresh token rotation enabled

SQL migrations

  • Idempotent: IF NOT EXISTS everywhere
  • Rollback possible (no DROP without an alternative CREATE)
  • RPCs with p_ prefix on all parameters
  • Financial RPCs: p_idempotency_key UUID DEFAULT NULL mandatory
  • Indexes on all FK columns (CREATE INDEX IF NOT EXISTS)

App-side queries

  • Never select('*'): use explicit field selectors
  • No supabase.from() in UI components: go through services
  • createServerSupabaseClient() in each server method (not in the constructor)

Edge Functions

  • Auth verified on the first line via supabase.auth.getUser()
  • Rate limiting on public functions
  • Secrets in Supabase env vars, never hardcoded

Output format

## Supabase Review: [scope]

### 🔴 Blocking (fix before merge)
- [problem] → [fix]

### 🟡 Important (fix this week)
- [problem] → [fix]

### 🟢 Suggestions
- [improvement]

### Corrective SQL
[migrations/RPCs to apply]

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.