supabase-clients

supabase-clients is a skill for Claude Code from rungchan2/frontend-skills. It costs 144 tokens per session (1,114 once invoked), scanned A, original, Apache-2.0.

A setup for connecting a Next.js application to Supabase, a hosted database and authentication service, in different parts of the app.

In plain words
What is it for?
It helps create the Supabase clients and middleware needed for browser components, server code, background jobs, webhooks, session refreshes, and protected routes.
Why use it?
It keeps browser, server, administrator, and session-handling code separate. This helps prevent broken sessions, blocked database access, and accidental exposure of an administrator key.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md.

Part of the project-packages plugin — 8 skills shipped together

Good fit It helps create the Supabase clients and middleware needed for browser components, server code, background jobs, webhooks, session refreshes, and protected routes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rungchan2/frontend-skills/supabase-clients
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add rungchan2/frontend-skills --skill supabase-clients
Clone the repo
git clone --depth 1 https://github.com/rungchan2/frontend-skills

Made for: Claude Code.

Or install project-packages, the plugin that ships this one along with the rest of its 8 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for supabase-clients

README.md
[![agentmods](https://agentmods.dev/badge/skills/rungchan2/frontend-skills/supabase-clients/github.svg)](https://agentmods.dev/skills/rungchan2/frontend-skills/supabase-clients)
Your own site
<a href="https://agentmods.dev/skills/rungchan2/frontend-skills/supabase-clients"><img src="https://agentmods.dev/badge/skills/rungchan2/frontend-skills/supabase-clients/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for supabase-clients

Your own site · 80×15
<a href="https://agentmods.dev/skills/rungchan2/frontend-skills/supabase-clients"><img src="https://agentmods.dev/badge/skills/rungchan2/frontend-skills/supabase-clients.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 144 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,114 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00144 $0.01114
Opus 5 $0.00072 $0.00557
Sonnet 5 $0.00029 $0.00223
Haiku 4.5 $0.00014 $0.00111

Measured 11d ago against content hash 6c7d9aad1dc2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

supabase-clients scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (assets/client.ts, assets/middleware.ts, assets/root-middleware.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/project-packages/skills/supabase-clients/SKILL.md · 93 lines

How it starts

The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Supabase 클라이언트 4종 세트

@supabase/ssr 기반 Next.js 프로젝트의 표준 클라이언트 분리.

왜 이 분리가 필요한가

환경 사용할 클라이언트 이유
'use client' 컴포넌트 / hooks client.tscreateClient() 브라우저 cookie에서 세션 읽기
Server Component / Route Handler / Server Action server.tscreateClient() Next 서버 cookies API 사용
Cron / Webhook / 관리자 작업 service-role.tscreateServiceRoleClient() RLS 우회 필요
모든 요청 진입점 (세션 갱신) middleware.tsupdateSession() 세션 자동 갱신 + 보호 라우트

잘못된 클라이언트를 사용하면 세션이 안 잡히거나, RLS가 막거나, 브라우저에 service key가 노출되는 보안 사고로 이어진다.

워크플로우

1. 패키지 설치

pnpm add @supabase/ssr @supabase/supabase-js

2. 위치 결정

프로젝트 구조 베이스 경로
src/ 구조 src/lib/supabase/
루트 직접 lib/supabase/

루트 middleware는 항상 프로젝트 루트의 middleware.ts.

3. 파일 생성

assets/ 안의 5개 파일을 다음과 같이 배치:

asset 대상 위치
client.ts lib/supabase/client.ts
server.ts lib/supabase/server.ts
service-role.ts lib/supabase/service-role.ts
middleware.ts lib/supabase/middleware.ts
root-middleware.ts middleware.ts (프로젝트 루트)

⚠️ Database 제네릭 타입은 @/types/database.types에서 import. 이 파일이 없으면 supabase:initial-setting 스킬로 먼저 생성하거나, 임시로 import 라인을 주석 처리하고 나중에 채운다.

4. 환경변수 점검

.env.local에 다음이 있어야 한다:

NEXT_PUBLIC_SUPABASE_URL=https://...supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ...
SUPABASE_SERVICE_ROLE_KEY=eyJ...    # 서버 전용. NEXT_PUBLIC_ 절대 금지.

없으면 사용자에게 안내하고 추가하도록 함.

5. 보호 라우트 커스터마이즈

assets/middleware.ts의 보호 정책은 /auth, /error 외 모든 경로 인증 필요가 기본값. 프로젝트마다 공개 페이지(/, /pricing 등)가 있을 수 있으니 사용자에게:

"현재 기본은 /auth, /error를 제외한 모든 경로에서 로그인을 요구합니다. 공개 페이지가 있다면 알려주세요 — 미들웨어에 화이트리스트로 추가하겠습니다."

6. CLAUDE.md 사용 규칙 (선택)

## Supabase 클라이언트 사용 규칙

- `'use client'` / hooks / store: `import { createClient } from "@/lib/supabase/client"`
- Server Component / Route Handler / Server Action: `import { createClient } from "@/lib/supabase/server"` (await 호출)
- Cron / webhook / 관리자 백그라운드 작업: `createServiceRoleClient()` (RLS 우회. 일반 요청 흐름 금지)
- 새 보호 라우트가 추가되면 `lib/supabase/middleware.ts`의 화이트리스트 검토

Read the full file on GitHub · 93 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 93 lines · 144 tokens per session scan A 6c7d9aad1dc2

Subscribe to this mod's changes

supabase-clients is a skill published in the GitHub repository rungchan2/frontend-skills (2 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 144 tokens to every session and 1,114 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

event-store-design

Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.

wshobson/agents · 33 tokens

convex-explain-app

Explain an existing Convex app — data model + relationships, public vs internal functions, auth/ownership model, components, a request→data flow — read from the schema and function surface. Read-only.

openclaw/clawhub · 47 tokens

platform-custom-field-generate

Use this skill when users need to create, generate, or validate Salesforce Custom Field metadata. Trigger when users mention custom fields, field types, Roll-up Summary fields, Master-Detail relationships, Lookup relationships, formula fields, picklists, dependent (controlling) picklists, referencing a value set from…

forcedotcom/sf-skills · 194 tokens

durable-objects

Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.

fcakyon/claude-codex-settings · 22 tokens

field-service-sobject-create-configure

Headless 360 REST API deployment step for creating sObject records. Handles describe-based field discovery, required-field derivation, entity-relationship ordering, and composite graph transactions. Use this skill when a designer skill (or a user directly) needs to create sObject records after design confirmation…

forcedotcom/sf-skills · 74 tokens

nornicdb-grpc

Drive NornicDB over gRPC — the Qdrant-compatible surface (Collections, Points, Snapshots) plus the additive NornicSearch service. Use when ingesting via Qdrant SDKs, migrating from Qdrant, or running hybrid text+vector search from a non-Bolt client. Covers connection, RPC catalog, collection→database mapping…

orneryd/NornicDB · 98 tokens