agentleFS
ryne2010ryne2010/build-lynx-apps/skills/supabase-postgres-best-practices/SKILL.md

supabase-postgres-best-practices

Skill1 starsChanged 6 months agoMITView on GitHub

Optional service-domain guidance for Postgres and Supabase data layers used by Lynx.js apps. Use when writing, reviewing, or optimizing queries, schema designs, indexes, RLS policies, connection behavior, or database configuration; do not use as UI implementation guidance.

81 other projects use a version of this, 78 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use supabase, building-native-ui and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • OpenAISkill

    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, getSession, getUser, getClaims, RLS); Supabase CLI or MCP server; schema changes, migrations, security audits, Postgres extensions (pg_graphql, pg_cron, pg_vector).

    Also in 28 projects that use this

  • OpenAISkill

    building-native-ui

    Complete guide for building beautiful apps with Expo Router. Covers fundamentals, styling, components, navigation, animations, patterns, and native tabs.

    Also in 3 projects that use this

  • VercelSkill

    vercel-react-view-transitions

    Guide for implementing smooth, native-feeling animations using React's View Transition API (`<ViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter/exit of components, animate list reorder, implement directional (forward/back) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.

    Also in 4 projects that use this

  • DatabricksSkill

    shadcn

    Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI. Provides project context, component docs, and usage examples. Applies when working with shadcn/ui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for "shadcn init", "create an app with --preset", or "switch to --preset".

    Also in 10 projects that use this

  • studio-lgtmSkill

    make-interfaces-feel-better

    Apply design engineering best practices to polish UI components - use when reviewing or improving interfaces, animations, typography, or interaction details.

    Also in 3 projects that use this

  • VercelSkill

    ai-elements

    Build AI chat interfaces using ai-elements components — conversations, messages, tool displays, prompt inputs, and more. Use when the user wants to build a chatbot, AI assistant UI, or any AI-powered chat interface.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

8 rules. 1 is common, 6 are distinctive, and 1 is very specific to this project.

  • 1

    Common

    Most of the 80 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill for database and backend/service-layer decisions in Lynx apps.

    line 15
  2. Distinctive:

    When Supabase or Postgres powers a Lynx app surface, keep database and auth boundaries explicit:

    line 20
  3. Distinctive:

    Never put Supabase service-role keys, database passwords, JWT signing secrets, or privileged admin credentials in a Lynx bundle.

    line 22
  4. Distinctive:

    If a Lynx client uses a Supabase anon key, require Row-Level Security policies and verify that the anon role can access only intended …

    line 23
  5. Distinctive:

    Keep schema changes, migrations, privileged writes, cron jobs, and server-side aggregation on trusted backend or database surfaces.

    line 24
  6. Distinctive:

    Treat network/offline behavior as host-dependent.

    line 25
  7. Distinctive:

    Place generated clients and environment loading according to the consuming app's conventions, and avoid leaking private environment …

    line 26
  8. Common:

    Read individual rule files for detailed explanations and SQL examples:

    line 55

“Common” is measured: kept by at least 6 in 10 of the 80 edited versions of this file we could read. “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 Postgres Best Practices

Use this skill for database and backend/service-layer decisions in Lynx apps. Keep UI composition in lynx-app-builder and lynx-ui-guidance.

Lynx host/client safety

When Supabase or Postgres powers a Lynx app surface, keep database and auth boundaries explicit:

  • Never put Supabase service-role keys, database passwords, JWT signing secrets, or privileged admin credentials in a Lynx bundle.
  • If a Lynx client uses a Supabase anon key, require Row-Level Security policies and verify that the anon role can access only intended rows/actions.
  • Keep schema changes, migrations, privileged writes, cron jobs, and server-side aggregation on trusted backend or database surfaces.
  • Treat network/offline behavior as host-dependent; record the target host service/network assumptions before promising sync, caching, or background behavior.
  • Place generated clients and environment loading according to the consuming app's conventions, and avoid leaking private environment variables into bundled code.
  • Route UI composition back to lynx-app-builder, official/global ReactLynx guidance, and lynx-ui-guidance; this skill owns data, policy, query, and performance guidance only.
  • Cite current Supabase/Postgres docs for security, auth, and RLS claims.

When to Apply

Reference these guidelines when:

  • Writing SQL queries or designing schemas
  • Implementing indexes or query optimization
  • Reviewing database performance issues
  • Configuring connection pooling or scaling
  • Optimizing for Postgres-specific features
  • Working with Row-Level Security (RLS)

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Query PerformanceCRITICALquery-
2Connection ManagementCRITICALconn-
3Security & RLSCRITICALsecurity-
4Schema DesignHIGHschema-
5Concurrency & LockingMEDIUM-HIGHlock-
6Data Access PatternsMEDIUMdata-
7Monitoring & DiagnosticsLOW-MEDIUMmonitor-
8Advanced FeaturesLOWadvanced-

How to Use

Read individual rule files for detailed explanations and SQL examples:

references/query-missing-indexes.md
references/schema-partial-indexes.md
references/_sections.md

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect SQL example with explanation
  • Correct SQL example with explanation
  • Optional EXPLAIN output or metrics
  • Additional context and references
  • Supabase-specific notes when applicable

References

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.