Windsurf AI Rules: Files, Examples, and Scope

Windsurf (now Devin Desktop) uses project-level rule files to shape how the coding assistant behaves. Here is how to write and scope those rules with concrete examples.

Updated 6 min read

Windsurf, now renamed Devin Desktop, reads rule files you place in your project to shape how the coding assistant behaves in that codebase. Rules tell the assistant which patterns to follow, which to avoid, and what context it needs before making changes. A rule file is one of the most direct ways to make an AI coding assistant consistently useful for your specific project.

Storing your approved project rules in a portable place matters when you use more than one assistant. fenbs keeps your Decisions and rules in a shared record that Claude Code, Cursor, and other connected tools read at the start of each session, so the same rules apply everywhere.

What rule files do in Windsurf and Devin Desktop

Rule files inject standing instructions into every session in that project. The assistant reads them before starting work, so the rules apply without you having to repeat them each time. Rules can cover code style, architecture choices, forbidden patterns, testing requirements, and any project-specific context the assistant needs to do useful work.

Windsurf was renamed to Devin Desktop. If you were using Windsurf rule files, the same files continue to work in Devin Desktop. Check Devin Desktop's documentation (opens in a new tab) for the current file name, location, and syntax, as these can change between versions.

Where rule files live

Project-level rules go in a file in your project root. The file name and format may change with application versions; check the current documentation. Global rules that apply across all projects go in a settings location within the application. Project rules take precedence over global rules when both cover the same topic.

Committing the rule file to your repository means every team member who opens the project in Devin Desktop gets the same rules automatically. This is the best practice for team projects: the rules are version-controlled alongside the code they govern.

Writing rules that hold

A rule that the assistant ignores is usually one of three things: too abstract, too long, or in conflict with another rule. Concrete rules with specific examples are followed more consistently than general principles.

Structure each rule as: what to do or not do, and an example if the case is not obvious. Keep the full rule file to a length you can read and maintain. Rules near the end of a long file receive less attention than rules at the top.

Example rules that work well

Here are concrete rule examples across common categories. Adapt them to your project:

Example Windsurf and Devin Desktop rule patterns
CategoryRule example
TestingEvery new function must have at least one unit test in the corresponding test file. Do not add a function without adding a test.
Error handlingDo not use bare catch blocks. Every catch must log the error and either rethrow or handle it explicitly.
NamingUse camelCase for variables and functions, PascalCase for classes and types. Do not use single-letter variable names except in short loops.
DependenciesDo not add new npm dependencies without asking. Prefer the existing utility library in /src/utils before introducing a new package.
CommentsAdd a comment only when the code does not explain itself. Do not add comments that restate what the code does in plain English.
ArchitectureAll API calls go through /src/services. Do not call fetch or axios directly from a component.
SecurityDo not log user data, tokens, or personally identifying information. Check for this in every new logging statement.
How fenbs helps

Keep project rules where every assistant reads them

In fenbs, record each architectural and code rule as a Decisions and rules entry. Claude Code, Cursor, and any other connected assistant reads those rules at the start of a session via MCP. When a rule changes, update it once in fenbs and every connected tool gets the update. Create a free account and record your first project rule today.

Create a free account

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

Scoping rules to a project or workspace

Some rules apply to every project you work on; others apply only to one codebase. Put project-specific rules in the project rule file and commit it to the repository. Put global rules that apply to all your projects in the global settings of the application.

Avoid putting rules in the global settings that only make sense for one project. A rule about a specific framework or library from one project applied globally will produce confusing suggestions in unrelated projects.

Keeping rules consistent across assistants

If you use Devin Desktop for some tasks and Claude Code or Cursor for others, the same project rules should apply in all three. Duplicating rule files across tools creates a maintenance problem: when a rule changes, you have to update it in every place.

Storing your project rules as Decisions and rules in fenbs solves this. Any assistant connected to fenbs reads the current rules at session start, regardless of which app it runs in. For setup, see /integrations. For a broader look at rule files in coding assistants, see cursor rules for AI projects.

How to do this with fenbs

  1. Create a free account and add a project for the codebase these rules govern.
  2. Add each rule as a Decisions and rules entry in fenbs: what the rule is, why it exists, and who decided it.
  3. Commit the rule file to the repository so every team member gets the rules automatically in Devin Desktop.
  4. Connect Claude Code, Cursor, or other tools at /integrations to read the same rules via MCP.
  5. When a rule changes, update the Decisions and rules entry in fenbs and the rule file in the repository at the same time.

For related reading, see what is an AI brain for the broader concept behind shared project rules, or how to use AI at work for practical patterns across tools.

Questions people ask.

Where is the Windsurf rule file located?

The file name and location have changed as the application moved from Windsurf to Devin Desktop. Check the current documentation at devin.ai for the exact path and format in the version you are running.

Do Windsurf rules apply to all AI models in the editor?

Rule files inject instructions into the session for the AI assistant in that editor. They do not apply outside the editor or to other AI apps you use separately.

Should I commit rule files to the repository?

Yes, for team projects. Committing the rule file version-controls it with the code and gives every team member who opens the project in Devin Desktop the same rules automatically.

How long should a rule file be?

As short as possible while covering the cases that matter. A rule file you can read in two minutes is more likely to be maintained than one that takes ten. Start with the five most important rules and add more only when testing shows you need them.

What if the assistant ignores a rule?

Add a concrete example that shows the correct behavior. Abstract rules are ignored more often than rules with examples. If a rule is still ignored, check whether another rule contradicts it.

More in Prompts and skills for AI work

All Prompts and skills for AI work articles

Start with one thing.

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

There is nothing to set up first. Write one line and you’ve started.