api-layer

Installation
SKILL.md

API Layer Patterns

Boundary Zone: external/

All raw Supabase access and Supabase-generated types live only in a feature's external/ directory (or shared/external/). This is lint-enforced:

  • getSupabaseClient may be imported only inside */external/**. hooks, components, and utils must call a feature's external/ fetch*/read* functions — which return domain types — never the raw client.
  • @/shared/external/database.types (generated schema types) may be imported only inside external/. UI code deals in domain types, not row/DTO shapes.

external/ is the one place a raw row shape or a boundary cast may exist; everything outside it is structurally confined to domain types. The client is typed (createClient<Database>), so .from(...).select(...) results are inferred from the schema — parse and map at the boundary instead of casting.

Canonical References

Installs
31
GitHub Stars
9
First Seen
Feb 3, 2026