The Vibe Coding Bible: Crafting Deterministic .cursorrules, .windsurfrules & CLAUDE.md
"Vibe Coding"βbuilding software at lightspeed by expressing intent to AI modelsβis only as reliable as the boundary guardrails you configure. Without strict project rules, AI models default to obsolete 2022 patterns. Here is how to lock down your codebase.
Cursor AI & Claude 3.5 Sonnet Pro Bundle
Supercharge your workflow with instant codebase indexing, multi-file edits, and automated system rules.
Explicitly declare "Next.js 15 App Router", "React 19", or "Svelte 5 Runes" to stop models from injecting deprecated Pages Router or Svelte 4 syntax.
Prohibit the any keyword entirely. Require unknown with Zod runtime parsing for all incoming network boundaries.
Cap UI components at 150 lines. Mandate that complex widgets be broken into sub-components under /components/ui/.
Keep database ORM mutations strictly inside Server Actions or dedicated service files, isolated from client UI trees.
1. The Difference Between .cursorrules, .windsurfrules, and CLAUDE.md
| File Name | IDE / Environment | Primary Use Case |
|---|---|---|
| .cursorrules | Cursor Editor | Auto-injected into Cmd+K inline edits and Cmd+I Composer multi-file refactors. |
| .windsurfrules | Windsurf (Codeium) | Directs the Cascade agent across multi-file terminal executions and browser debugging. |
| CLAUDE.md | Claude Code CLI & Cline | Standardized repository brief for autonomous terminal-based Claude agents. |
2. Drop-In Production .cursorrules for Next.js 15 & Tailwind
# REPO RULES: Next.js 15 + React 19 + TypeScript + Tailwind CSS
You are a Senior Fullstack Architect. Follow these rules without exception:
### FRAMEWORK & CONVENTIONS:
- Framework: Next.js 15 (App Router). Never import from 'next/router'.
- React: Version 19. Default to React Server Components (RSC).
- Use 'use client' ONLY on small leaf components requiring onClick, onChange, or hooks.
- Never use 'any' in TypeScript. Use unknown + Zod validation.
### COMPONENT DESIGN:
- Keep all UI components under 150 lines. Break large components into primitives under /components/ui.
- Use early return guard clauses to prevent deep nesting.
- Ensure WCAG AA color contrast on all generated Tailwind classes.
### MUTATIONS & SERVER ACTIONS:
- All mutations MUST be written as Server Actions ('use server') in /app/actions/.
- Validate input payloads with Zod before calling the database ORM. Cursor AI & Claude 3.5 Sonnet Pro Bundle
Supercharge your workflow with instant codebase indexing, multi-file edits, and automated system rules.
π Micro-Tool: Vibe Coding Architect
Generate fully customized, multi-stack .cursorrules, .windsurfrules, and CLAUDE.md files in 1 click using our interactive generator.