home / skills / jeremylongshore / claude-code-plugins-plus-skills / supabase-reference-architecture
/plugins/saas-packs/supabase-pack/skills/supabase-reference-architecture
This skill helps design and enforce a scalable Supabase reference architecture with a clean project layout, client wrapper, and health checks.
npx playbooks add skill jeremylongshore/claude-code-plugins-plus-skills --skill supabase-reference-architectureReview the files below or copy the command above to add this skill to your agents.
---
name: supabase-reference-architecture
description: |
Implement Supabase reference architecture with best-practice project layout.
Use when designing new Supabase integrations, reviewing project structure,
or establishing architecture standards for Supabase applications.
Trigger with phrases like "supabase architecture", "supabase best practices",
"supabase project structure", "how to organize supabase", "supabase layout".
allowed-tools: Read, Grep
version: 1.0.0
license: MIT
author: Jeremy Longshore <[email protected]>
---
# Supabase Reference Architecture
## Prerequisites
- Understanding of layered architecture
- Supabase SDK knowledge
- TypeScript project setup
- Testing framework configured
## Instructions
### Step 1: Create Directory Structure
Set up the project layout following the reference structure above.
### Step 2: Implement Client Wrapper
Create the singleton client with caching and monitoring.
### Step 3: Add Error Handling
Implement custom error classes for Supabase operations.
### Step 4: Configure Health Checks
Add health check endpoint for Supabase connectivity.
## Output
- Structured project layout
- Client wrapper with caching
- Error boundary implemented
- Health checks configured
## Error Handling
See `{baseDir}/references/errors.md` for comprehensive error handling.
## Examples
See `{baseDir}/references/examples.md` for detailed examples.
## Resources
- [Supabase SDK Documentation](https://supabase.com/docs/sdk)
- [Supabase Best Practices](https://supabase.com/docs/best-practices)
This skill implements a Supabase reference architecture with a best-practice project layout, client wrapper, error handling, and health checks. It helps teams establish consistent patterns for new Supabase integrations and reviews. Use it to bootstrap structured, maintainable Supabase applications quickly.
The skill provides a recommended directory structure and guides on creating a singleton Supabase client that includes caching and monitoring. It defines custom error classes and an error boundary pattern for predictable error handling. It also shows how to expose a health-check endpoint that verifies Supabase connectivity and basic operations.
Do I need TypeScript for this architecture?
TypeScript is recommended for type safety and clearer client contracts, but the patterns can be adapted to plain JavaScript.
What should the health check verify?
Keep it minimal: confirm the client can authenticate and run a simple read (e.g., select 1) or ping a lightweight table.