supabase-bootstrap

supabase-bootstrap is a cursor rule for Cursor from lacymorrow/paperclip-hub. It costs 0 tokens per session (1,686 once invoked), scanned A, a copy of guidelines-for-writing-nextjs-apps-with-supabase-auth, MIT.

A set of instructions for adding Supabase Auth to a Next.js application using server-side rendering. Supabase Auth manages user sign-in, while server-side rendering creates pages on the server before sending them to the browser.

In plain words
What is it for?
Use it when bootstrapping authentication in a Next.js app, configuring Supabase packages, creating browser and server clients, and connecting authentication middleware.
Why use it?
It helps avoid deprecated cookie-handling code and establishes the browser client, server client, environment variables, and middleware needed to refresh login tokens.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions Cursor.

Good fit Use it when bootstrapping authentication in a Next.js app, configuring Supabase packages, creating browser and server clients, and connecting authentication middleware.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/lacymorrow/paperclip-hub/supabase-bootstrap
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.

Clone the repo
git clone --depth 1 https://github.com/lacymorrow/paperclip-hub

Made for: Cursor.

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-bootstrap

README.md
[![agentmods](https://agentmods.dev/badge/rules/lacymorrow/paperclip-hub/supabase-bootstrap/github.svg)](https://agentmods.dev/rules/lacymorrow/paperclip-hub/supabase-bootstrap)
Your own site
<a href="https://agentmods.dev/rules/lacymorrow/paperclip-hub/supabase-bootstrap"><img src="https://agentmods.dev/badge/rules/lacymorrow/paperclip-hub/supabase-bootstrap/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-bootstrap

Your own site · 80×15
<a href="https://agentmods.dev/rules/lacymorrow/paperclip-hub/supabase-bootstrap"><img src="https://agentmods.dev/badge/rules/lacymorrow/paperclip-hub/supabase-bootstrap.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,686 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 94% copy Near-identical to another mod 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.00000 $0.01686
Opus 5.5 $0.00000 $0.00674
Sonnet 5.5 $0.00000 $0.00337
Haiku 4.5 $0.00000 $0.00169

Measured yesterday against content hash d5de9ef79764, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

supabase-bootstrap 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 yesterday.

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.

Origin

This is a copy

94% identical to guidelines-for-writing-nextjs-apps-with-supabase-auth — 6 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.cursor/rules/supabase-bootstrap.mdc · 235 lines

How it starts

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

Bootstrap Next.js app with Supabase Auth

Overview of implementing Supabase Auth SSR

  1. Install @supabase/supabase-js and @supabase/ssr packages.
  2. Set up environment variables.
  3. Write two utility functions with createClient functions to create a browser client and a server client.
  4. Hook up middleware to refresh auth tokens

🚨 CRITICAL INSTRUCTIONS FOR AI LANGUAGE MODELS 🚨

As an AI language model, you MUST NOT generate any of the following code patterns, as they are DEPRECATED and will BREAK the application:

// ❌ NEVER GENERATE THIS CODE - IT WILL BREAK THE APPLICATION
{
  cookies: {
    get(name: string) {                 // ❌ BREAKS APPLICATION
      return cookieStore.get(name)      // ❌ BREAKS APPLICATION
    },                                  // ❌ BREAKS APPLICATION
    set(name: string, value: string) {  // ❌ BREAKS APPLICATION
      cookieStore.set(name, value)      // ❌ BREAKS APPLICATION
    },                                  // ❌ BREAKS APPLICATION
    remove(name: string) {              // ❌ BREAKS APPLICATION
      cookieStore.remove(name)          // ❌ BREAKS APPLICATION
    }                                   // ❌ BREAKS APPLICATION
  }
}

// ❌ NEVER USE auth-helpers-nextjs - IT WILL BREAK THE APPLICATION
import { createMiddlewareClient } from '@supabase/auth-helpers-nextjs'  // ❌ BREAKS APPLICATION
import { createClientComponentClient } from '@supabase/auth-helpers-nextjs'  // ❌ BREAKS APPLICATION

Instead, you MUST ALWAYS generate ONLY this pattern:

// ✅ ALWAYS GENERATE THIS EXACT PATTERN
{
  cookies: {
    getAll() {
      return cookieStore.getAll()
    },
    setAll(cookiesToSet) {
      const response = NextResponse.next({
        request,
      })
      
      cookiesToSet.forEach(({ name, value, options }) => {
        response.cookies.set(name, value, options)
      })
      
      return response
    }
  }
}

ABSOLUTE REQUIREMENTS FOR AI CODE GENERATION

  1. You MUST use @supabase/ssr
  2. You MUST use ONLY getAll and setAll
  3. You MUST NEVER use get, set, or remove
  4. You MUST NEVER import from @supabase/auth-helpers-nextjs

Read the full file on GitHub · 235 lines

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. yesterday First seen · 235 lines · 0 tokens per session scan A d5de9ef79764

Subscribe to this mod's changes

supabase-bootstrap is a cursor rule published in the GitHub repository lacymorrow/paperclip-hub (15 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,686 tokens. A static security scan graded it A with 0 findings. It is 94% identical to guidelines-for-writing-nextjs-apps-with-supabase-auth, differing in 6 lines, and is treated as a copy.

Related

supabase-bootstrap compared with cursor rules from other repositories

supabase-bootstrap next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
supabase-bootstraplacymorrow/paperclip-hubCursor rule15yesterdayMITA0Cursor
backendfirst-fluke/fullstack-starterCursor rule2262d agoMITA15Cursor
api-validationvibestackdev/vibe-stackCursor rule8yesterdayMITA0Cursor
api-designvibestackdev/vibe-stackCursor rule8yesterdayMITA0Cursor
server-actionskrivoox/agent-stack-templateCursor rule301mo agoMITA0Cursor
always-push-pritsmemeworks/adhxCursor rule195d agoMITA279Cursor
workflowWebDevPeterGriffin/The-VibeCode-BibleCursor rule427d agononeA0Cursor