How to write Windsurf rules
Where Windsurf stores project rules and how to write them so Cascade follows your stack.
Two locations, one set of rules
Current Windsurf projects use `.windsurf/rules`. Older projects use a root `.windsurfrules` file. Pick the location your editor already reads. Do not maintain two different policies.
The content is the same kind of brief you would put in AGENTS.md: stack, commands, layout, and bans. Windsurf will not infer that you use pnpm, Pest, or Cargo unless you say so.
Keep the file specific
Name the test command and the folders new code should land in. If the app is Tauri, say that privileged work is a Rust command and the capability file must be updated. If it is Phaser, say not to allocate inside update. Those lines prevent the expensive mistakes.
Do it in this order
01
Check which file Windsurf is reading
Look for `.windsurf/rules` first, then a root `.windsurfrules`.
02
Generate a stack draft
Start from a Windsurf rule for the framework you use.
03
Point at real commands
Replace the defaults with this repo's scripts.
04
Open a new Cascade session
Existing chats keep the old rules.
Questions
Will Cursor read Windsurf rules?
No. Cursor reads `.cursor/rules` and AGENTS.md. Generate a separate file if both editors are in use.
Should rules mention the model?
No. Describe the repository. The editor already knows which model it is calling.