nextjs15-supabase-cursorrules-prompt-file
27 architecture rules preventing AI hallucinations: insecure auth (getSession vs getUser), synchronous params, deprecated imports, missing RLS, and Stripe key exposure. Built for Cursor Agent and Claude Code.
Install / Use
npx skills add PatrickJS/awesome-cursorrulesInstalls into whichever agent you are using.
Other
Other agent config
Quality Score
Category
SecuritySupported Platforms
Our assessment of nextjs15-supabase-cursorrules-prompt-file
nextjs15-supabase-cursorrules-prompt-file scores 91/100 on our quality scale, 401st of 1,099 Security skills we index (top 37%).
Its Other is 4.5 KB long, well organised into 12 sections with 5 code examples: a solid amount of guidance for an agent.
With 41,108 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 5 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
- Our last check on 2026-10-17 found the source still online.
- It is released under the CC0-1.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 98/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-24. Automated pattern scan on 2026-09-24. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
nextjs15-supabase-cursorrules-prompt-file compared with similar skills
All 4 of these similar skills score higher than nextjs15-supabase-cursorrules-prompt-file; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| nextjs15-supabase-cursorrules-prompt-file (this skill)by PatrickJS | 91 | 41.1k | 5mo ago | Other |
| claude-memby thedotmack | 100 | 113.5k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 109.2k | today | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 78.9k | today | CLAUDE.md |
| rufloby ruvnet | 100 | 81.0k | today | MCP Server |
Frequently asked questions
- How do I install nextjs15-supabase-cursorrules-prompt-file?
- Run
npx skills add PatrickJS/awesome-cursorrules. The install tabs above show the steps for each supported agent. - Which AI agents does nextjs15-supabase-cursorrules-prompt-file work with?
- It is written for Cursor and Zed, as a Other file. Other agents that read the same format can often use it too.
- Is nextjs15-supabase-cursorrules-prompt-file safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is CC0-1.0-licensed and scores 98/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is nextjs15-supabase-cursorrules-prompt-file still maintained?
- The repository was last updated about 5 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
Skill content
View source on GitHubdescription: "27 architecture rules preventing AI hallucinations: insecure auth (getSession vs getUser), synchronous params, deprecated imports, missing RLS, and Stripe key exposure. Built for Cursor Agent and Claude Code." globs: */ alwaysApply: false
Next.js 15 + Supabase Architecture Rules
You are an expert Next.js 15 developer working with Supabase, TypeScript (strict), and shadcn/ui. Follow ALL rules below unconditionally. If you are tempted to deviate, re-read the rule.
Tech Stack
- Framework: Next.js 15 (App Router) with React 19
- Language: TypeScript (strict mode)
- Styling: Tailwind CSS + shadcn/ui
- Database: Supabase (PostgreSQL + RLS)
- Auth: Supabase SSR (cookie-based, @supabase/ssr)
- Validation: Zod
- Payments: Stripe (server-side only)
RULE 1: NEVER use getSession() on the server
SECURITY CRITICAL. getSession() reads the JWT from cookies WITHOUT verifying it. A forged cookie passes silently. ALWAYS use getUser() for server-side auth.
// ✅ CORRECT — verified with Supabase auth server
const supabase = await createClient()
const { data: { user } } = await supabase.auth.getUser()
if (!user) redirect('/login')
// ❌ WRONG — reads JWT without verification, session can be forged
const { data: { session } } = await supabase.auth.getSession()
RULE 2: NEVER access params synchronously in Next.js 15
In Next.js 15, params and searchParams are Promises. Synchronous access compiles but crashes at runtime.
// ✅ CORRECT
export default async function Page({ params }: { params: Promise<{ id: string }> }) {
const { id } = await params
}
// ❌ WRONG — runtime crash
export default function Page({ params }: { params: { id: string } }) {
const { id } = params // TypeError at runtime
}
RULE 3: NEVER import from @supabase/auth-helpers-nextjs
This package is deprecated. It does NOT work with Next.js 15 App Router cookies. ALWAYS use @supabase/ssr with manual cookie handling.
// ✅ CORRECT
import { createServerClient } from '@supabase/ssr'
// ❌ WRONG — deprecated, broken with App Router
import { createServerComponentClient } from '@supabase/auth-helpers-nextjs'
RULE 4: All database tables MUST have RLS enabled
Every Supabase table must have Row Level Security enabled. Without RLS, any user with the anon key can read ALL data from the table.
-- ✅ Always add after CREATE TABLE:
ALTER TABLE public.my_table ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Users can only read their own data"
ON public.my_table FOR SELECT
USING (auth.uid() = user_id);
RULE 5: Default to Server Components
Only add 'use client' when the component needs interactivity (event handlers, useState, useEffect). Push 'use client' to the smallest leaf component possible.
RULE 6: All mutations via Server Actions
All data mutations happen through Server Actions, never client-side fetch(). Always validate with Zod, authenticate with getUser(), and return ActionResponse<T>.
'use server'
import { z } from 'zod'
type ActionResponse<T = void> =
| { success: true; data: T }
| { success: false; error: string }
const Schema = z.object({ title: z.string().min(1).max(200) })
export async function createItem(input: unknown): Promise<ActionResponse> {
const supabase = await createClient()
const { data: { user } } = await supabase.auth.getUser()
if (!user) return { success: false, error: 'Unauthorized' }
const result = Schema.safeParse(input)
if (!result.success) return { success: false, error: 'Invalid input' }
const { error } = await supabase.from('items').insert({ ...result.data, user_id: user.id })
if (error) return { success: false, error: 'Failed to create item' }
revalidatePath('/items')
return { success: true, data: undefined }
}
RULE 7: Error boundaries for every data-fetching page
Every page that fetches data MUST have sibling loading.tsx and error.tsx files.
RULE 8: NEVER expose Stripe secret keys
Stripe keys starting with sk_ must NEVER be in NEXT_PUBLIC_ variables.
Use process.env.STRIPE_SECRET_KEY (server-only).
RULE 9: TypeScript strict mode, no any
NEVER use any. Use unknown with Zod validation or type narrowing.
tsconfig.json MUST have strict: true.
RULE 10: Middleware is for session REFRESH only
NEVER put auth enforcement in Next.js middleware. Middleware runs on Edge Runtime and cannot verify Supabase JWTs. Auth enforcement belongs in layouts/pages with getUser().
Full rule set (27 rules) available at: https://github.com/vibestackdev/vibe-stack Quick install: npx vibe-stack-rules init
Related Skills
claude-mem
113.5kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
109.2kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
78.9kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ruflo
81.0k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
