Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/supabase-reference-architecture

@0d57af8
Run it yourself

Implement enterprise Supabase reference architectures — monorepo layout, multi-tenant RLS, microservices with cross-project access, framework integration, edge functions, caching, queue patterns, and audit logging. Use when designing a new Supabase project from scratch, reviewing project structure for production readiness, planning multi-tenant isolation, or establishing team architecture standards. Trigger with phrases like "supabase architecture", "supabase project structure", "supabase monorepo", "supabase multi-tenant", "supabase reference design", "how to organize supabase at scale".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/supabase-reference-architecture

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referenceserrors.md

≈616 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Error Handling Reference

Common Errors

Error Cause Solution
Missing SUPABASE_URL or SUPABASE_ANON_KEY Environment variables not set Check .env file and ensure variables are loaded
new row violates row-level security policy RLS blocks the operation Check role grants, verified identity, and the trusted membership row
Empty tenant result Membership or matching rows absent Inspect trusted membership provisioning; do not manufacture a JWT claim
relation "public.audit_log" does not exist Audit migration not applied Run supabase db push or supabase db reset
permission denied for function claim_next_job Missing execute grant Run grant execute on function claim_next_job to authenticated
Cross-project profile lookup failed Wrong service_role key for the target project Verify MAIN_SUPABASE_SERVICE_ROLE_KEY matches the main project
TypeError: Cannot read properties of null Client singleton not initialized Ensure env vars are available before first getSupabaseClient() call
cron.schedule: permission denied pg_cron extension not enabled Enable via dashboard: Database > Extensions > pg_cron

RLS Debugging Checklist

  1. Check RLS is enabled on tenants, tenant_members, and projects.
  2. Confirm authenticated has SELECT only and anon and PUBLIC have no table grants in this read-only example; audit other policies and PUBLIC grants.
  3. Verify identity with the request-scoped user client; user-editable metadata is not authorization.
  4. Test two ordinary users with disjoint memberships, a nonmember, and unauthenticated requests. Confirm membership writes are denied and the self-membership policy does not recurse.
  5. Run scoped project reads through the Data API as the user; owner/admin SQL sessions can bypass RLS and are not isolation evidence. Application writes need separately reviewed policies.

See RLS authorization and helper semantics.

Cross-Project Access Troubleshooting

  • 401 Unauthorized: The service_role key is wrong or belongs to a different project
  • Network timeout: Cross-region calls add latency; consider caching or co-locating projects
  • Rate limited: Supabase enforces per-project rate limits; distribute load across projects
  • Type mismatch: Regenerate types for both projects after schema changes

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides comprehensive architectural patterns and documentation for enterprise Supabase deployments, focusing on security, scalability, and best practices.

  • Socket2mo

    2 alerts: gptSecurity, gptAnomaly

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
What it can do
Reads files Edits files Runs commands
version
1.55.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
compatibility
Designed for Claude Code
All 8 allowed tools
ReadWriteEditBash(npm:*)Bash(npx:*)Bash(supabase:*)GrepGlob
Other metadata
tags
[
  "saas",
  "supabase",
  "architecture",
  "patterns",
  "multi-tenant",
  "monorepo"
]

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/supabase-reference-architecture