Home / Guides / Windsurf rules

Windsurf rules that keep Cascade on track

Windsurf's Cascade agent follows workspace rules stored as Markdown files in .windsurf/rules/. Like Cursor rules, the trick is lots of small, scoped files rather than one big one.

How Windsurf rules load

Keep each file well under Windsurf's per-rule size limit, and mirror the core rules in AGENTS.md so other tools get them too. If you are porting a Cursor pack into .windsurf/rules/, where to buy Cursor rules compares free GitHub lists with paid packs.

Free rule: Supabase row-level security

This is the rule that saves the most money in a Next.js + Supabase app. It's written as a Cursor .mdc file; for Windsurf, drop the front matter, save it as .windsurf/rules/database-rls.md and set activation to Glob supabase/**.

.windsurf/rules/database-rls.md
- For each newly created table, enable row level security and define its policies in the same migration.
- Policies use (select auth.uid()) for performance; separate policies per command (select/insert/update/delete).
- Add indexes on every column used in a policy or foreign key.
- Never disable RLS to 'make it work'. If a query fails, fix the policy and explain it.
- Regenerate types after schema changes.

The original file is free on GitHub: nextjs-supabase-rls.mdc.

Want the whole drawer?

The Vibe Starter Rules Pack ($19) has 8 scoped rules (auth, Stripe webhooks, env, tests, UI), AGENTS.md, CLAUDE.md and 12 prompts. The rules are plain Markdown, so they port to Windsurf.

Not ready for a full pack? Start with One-File Agent Rules ($9), one universal AGENTS.md for any stack, or download the free Starter AGENTS.md (no email needed).

14-day refund, no questions.

FREE · 1 FILE · WORKS IN EVERY AGENT

Get the free Starter AGENTS.md

A 40-line rules file that makes Cursor, Claude Code, Codex and Windsurf plan first, keep diffs small and run your tests before saying "done". We email it to you instantly, plus one follow-up and a short note when a new pack ships. Unsubscribe anytime. Privacy