vibe-stack
AGENTS.md8 starsChanged 8 months agoMITView on GitHub
This file provides project context and instructions for AI coding agents (Cursor, Claude, Copilot, Windsurf, Cline) working within this codebase. Vibe Stack is a production-ready Next.js 15 + Supabase boilerplate designed for AI-assisted development. It includes 22 .mdc architecture rule files that constrain AI models to generate secure, modern, production-grade code.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository31 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .cursor/rules/ai-collaboration.mdcCursor rule
- .cursor/rules/api-design.mdcCursor rule
- .cursor/rules/api-validation.mdcCursor rule
- .cursor/rules/caching-revalidation.mdcCursor rule
- .cursor/rules/context-management.mdcCursor rule
- .cursor/rules/database-design.mdcCursor rule
- .cursor/rules/env-management.mdcCursor rule
- .cursor/rules/error-handling.mdcCursor rule
- .cursor/rules/file-naming.mdcCursor rule
- .cursor/rules/file-uploads.mdcCursor rule
- .cursor/rules/git-conventions.mdcCursor rule
- .cursor/rules/hydration-safety.mdcCursor rule
- .cursor/rules/middleware-auth.mdcCursor rule
- .cursor/rules/nextjs15-params.mdcCursor rule
- .cursor/rules/performance.mdcCursor rule
- .cursor/rules/project-context.mdcCursor rule
- .cursor/rules/react19-patterns.mdcCursor rule
- .cursor/rules/security.mdcCursor rule
- .cursor/rules/server-actions.mdcCursor rule
- .cursor/rules/server-vs-client-components.mdcCursor rule
- .cursor/rules/shadcn-patterns.mdcCursor rule
- .cursor/rules/stripe-payments.mdcCursor rule
- .cursor/rules/stripe-webhooks.mdcCursor rule
- .cursor/rules/supabase-auth-security.mdcCursor rule
- .cursor/rules/supabase-rls.mdcCursor rule
- .cursor/rules/supabase-ssr-only.mdcCursor rule
- .cursor/rules/testing.mdcCursor rule
- .cursor/rules/typescript-strict.mdcCursor rule
- .cursor/rules/verify-before-use.mdcCursor rule
- llms.txtllms.txt
The file
We split this AGENTS.md into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 68
All mutations use Server Actions with this pattern:
- Distinctive: line 113
When adding new features, the AI should read and follow all applicable rules automatically.
- Distinctive: line 125
When adding new features:
- Distinctive: line 126
Follow the 3-stage agentic loop: Plan → Implement (in batches) → Verify
- Very specific: line 127
Check applicable .mdc rules before writing code
- Distinctive: line 128
Use Server Components by default
- Distinctive: line 130
Add RLS policies for any new tables
- Very specific: line 131
Use conventional commits (feat:, fix:, docs:)
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md — AI Coding Agent Instructions
This file provides project context and instructions for AI coding agents (Cursor, Claude, Copilot, Windsurf, Cline) working within this codebase.
Project Overview
Vibe Stack is a production-ready Next.js 15 + Supabase boilerplate designed for AI-assisted development. It includes 22 .mdc architecture rule files that constrain AI models to generate secure, modern, production-grade code.
Tech Stack
- Framework: Next.js 15 (App Router, Server Components, Server Actions)
- Runtime: React 19
- Database & Auth: Supabase (PostgreSQL, Auth with SSR, Row Level Security)
- Payments: Stripe (Checkout Sessions, Webhooks, Customer Portal)
- Email: Resend (transactional email with HTML templates)
- Validation: Zod (runtime validation at every boundary)
- Styling: Tailwind CSS + shadcn/ui
- Language: TypeScript (strict mode, no
any)
Architecture Principles
- Server Components by default — Only use
'use client'when hooks or event handlers are required getUser()overgetSession()— Server-side auth MUST usegetUser()for JWT verification@supabase/ssronly — Never import from the deprecated@supabase/auth-helpers-nextjs- Zod at every boundary — All user input validated before processing
- RLS on every table — Row Level Security is mandatory, never optional
Directory Structure
src/
├── app/ # Next.js App Router pages and layouts
│ ├── (auth)/ # Auth route group (login, signup)
│ │ ├── actions.ts # Auth server actions with Zod validation
│ │ ├── login/page.tsx # Login page (Server Component)
│ │ └── signup/page.tsx # Signup page (Server Component)
│ ├── auth/confirm/ # PKCE email verification callback
│ ├── dashboard/ # Protected pages (requires auth)
│ ├── api/webhooks/ # External webhook handlers (Stripe)
│ ├── layout.tsx # Root layout (fonts, metadata, dark mode)
│ ├── page.tsx # Landing page
│ ├── loading.tsx # Global loading state
│ ├── error.tsx # Global error boundary
│ └── not-found.tsx # Custom 404
├── lib/ # Business logic & integrations
│ ├── supabase/ # Server + Client factories + middleware helper
│ ├── stripe/ # Checkout session + customer portal helpers
│ ├── email/ # Resend email templates (welcome, password reset)
│ ├── env.ts # Type-safe environment variable access
│ └── utils.ts # cn() helper and general utilities
├── types/ # Shared TypeScript types
│ └── index.ts # ActionResponse<T>, UserProfile, PaginatedResponse
└── middleware.ts # Session refresh entry point
.cursor/
├── rules/ # 22 .mdc architecture rules (auto-loaded by Cursor)
└── mcp.json # 4 MCP server configurations
docs/
├── VIBE-CODING.md # The 3-stage agentic loop framework
├── ARCHITECTURE.md # 8 Architecture Decision Records
└── MCP-SETUP.md # MCP server setup guide
n8n-workflows/ # 3 importable n8n automation templatesKey Patterns
Server Actions
All mutations use Server Actions with this pattern:
'use server'
import { z } from 'zod'
import { createClient } from '@/lib/supabase/server'
const schema = z.object({ /* fields */ })
export async function myAction(formData: FormData): Promise<ActionResponse<T>> {
const parsed = schema.safeParse(Object.fromEntries(formData))
if (!parsed.success) return { error: 'Validation failed' }
const supabase = await createClient()
const { data: { user } } = await supabase.auth.getUser()
if (!user) return { error: 'Not authenticated' }
// ... business logic
return { data: result }
}Auth Check Pattern
// ALWAYS use this pattern in Server Components and Server Actions
const supabase = await createClient()
const { data: { user }, error } = await supabase.auth.getUser()
if (error || !user) redirect('/login')Environment Variables
NEXT_PUBLIC_*— Safe to expose to client (Supabase URL, app URL)- Everything else — Server-only (Stripe secret, Supabase service role, Resend key)
- Access via
src/lib/env.tsfor type safety
Rules System
The .cursor/rules/ directory contains 22 .mdc files that auto-activate based on file globs. These rules override AI training data defaults to prevent:
- Insecure auth patterns (
getSession()→getUser()) - Deprecated package imports
- Next.js 15 breaking changes (async params)
- Missing RLS policies
- Client-side Stripe usage
- Hydration mismatches
- N+1 query patterns
When adding new features, the AI should read and follow all applicable rules automatically.
MCP Integrations
4 MCP servers are pre-configured in .cursor/mcp.json:
- GitHub MCP — Read repos, PRs, issues, commits
- Supabase MCP — Inspect database schema and RLS policies (read-only)
- Filesystem MCP — Navigate project structure
- Browser MCP — Take screenshots and test the running app
Contributing
When adding new features:
- Follow the 3-stage agentic loop: Plan → Implement (in batches) → Verify
- Check applicable
.mdcrules before writing code - Use Server Components by default
- Validate all input with Zod
- Add RLS policies for any new tables
- Use conventional commits (
feat:,fix:,docs:)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

