alpha

Gives an AI coding agent strict Next.js 15 and Supabase rules that prevent insecure auth, synchronous params, missing row-level security and leaked Stripe keys.
description: "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
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.
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()
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
}
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'
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);
Only add 'use client' when the component needs interactivity (event handlers,
useState, useEffect). Push 'use client' to the smallest leaf component possible.
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 }
}
Every page that fetches data MUST have sibling loading.tsx and error.tsx files.
Stripe keys starting with sk_ must NEVER be in NEXT_PUBLIC_ variables.
Use process.env.STRIPE_SECRET_KEY (server-only).
anyNEVER use any. Use unknown with Zod validation or type narrowing.
tsconfig.json MUST have strict: true.
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
Public domain (CC0 1.0) · by awesome-cursorrules contributors · source · posted by @OpenSourceBuffGuy on promptparty.com


Turns the AI into a patent researcher who plans searches, maps patent landscapes, compares prior art and assesses freedom-to-operate risk, keeping findings separate from legal conclusions.
system-prompt, act-as, expert-advice, due-diligence, legal-research, competitor-analysis, intellectual-property, legal, research-methods, for-lawyers, for-researchers, report, structured-output, xml-tags, formal, advanced, long-form, guardrails, trend-analysis, risk-management

Isometric Miniature Scene Diorama
Creates a 45-degree isometric miniature 3D diorama of any scene with tiny stylized people, soft lighting and a crisp white background.
image-prompt, nano-banana, placeholders, isometric, 3d-render, miniature, white-background, minimalist, soft-lighting, square-format, high-angle, aerial-view, cozy, character-design, ui-mockup, flat-design, social-media-graphic, for-designers, editorial, pastel

Modern House Architecture Handbook Infographic Page
Draws a square architecture handbook infographic around a modern house of a chosen style, with a hero render, annotated systems and many modular info cards.
image-prompt, infographic, architecture, architectural-rendering, template, placeholders, editorial, blueprint, square-format, golden-hour, luxury, negative-prompt, text-rendering, sustainability, smart-home, interior-design, gpt-image, diagram, muted-colors, for-designers, long-form, design-systems
Loading reviews…
Loading comments…