What a production-ready Windsurf (now Devin Desktop) rules file covers for frontend, backend, SaaS, DevOps, mobile, AI/ML and security work — with a free example to copy. Brainfile itself is built for Claude Code, not Windsurf.
Free by email: a practical Claude Code tip every Tuesday and Thursday, plus a Sunday recap.
Every developer who installs Windsurf faces the same friction: the default AI behavior is generic, and creating a proper .windsurfrules file from scratch takes longer than the first project milestone. Most devs never write one at all.
Without a strong rules file, the agent in Windsurf (now Devin Desktop, whose local agent Devin Local replaced Cascade) keeps making generic assumptions — suggesting patterns that don't fit your architecture, missing your team's naming conventions, and generating scaffolding you immediately rewrite.
You type the same context into every agent chat: "I use Next.js, TypeScript, Prisma, deployed on Railway..." A good .windsurfrules file encodes this once and persists it across every session. Most developers never write one.
Devin Desktop reads rules from .devin/rules/ (preferred), .windsurf/rules/ and the legacy .windsurfrules file, plus AGENTS.md. Put a rule in the wrong place or with the wrong trigger and it never loads when you expect it to.
Start from a structure written for how the agent actually reads rules instead of a blank file. The example below is free to copy. Fill in your stack, database and deploy target, and your Windsurf session understands who you are, what you're building, and how you write code.
The example uses the documented rule front matter with description, globs, and alwaysApply fields — no guessing, no silent parse failures, no wasted context.
Write it for your specific engineering role. A frontend file should encode component architecture and CSS-in-JS conventions. A SaaS file should cover multi-tenancy patterns and billing edge cases. Generic rules don't change the agent's behavior — role-specific ones do.
The editor changes often: in June 2026 Windsurf became Devin Desktop and Devin Local replaced Cascade (see the Devin Desktop FAQ). Re-check your rules file when it changes, so it never falls behind the editor it's supposed to be controlling. (Brainfile's weekly freshness feed covers Claude Code, not Windsurf.)
Eight engineering roles and the conventions, patterns and guardrails each file should encode. Use them as a checklist when you write yours — specific instructions that change how the agent behaves in your codebase.
Pick the role checklist that fits, write the file with your stack, and the agent starts from how you build.
Use the role list above that matches how you actually work: frontend, backend, SaaS, DevOps, mobile, AI/ML, security, or full-stack.
→Fill in your framework, your database, and your deploy target, then write the conventions, patterns and guardrails your role cares about.
→Save as .windsurfrules in your project root (or .devin/rules/, the location Devin Desktop now prefers). It is read automatically every session. No extra config, no API keys, no restart required.
Brainfile is built for Claude Code, not Windsurf. It ships no .windsurfrules files. If you also use Claude Code, here is what it adds there.
| Category | ✦ Brainfile (Claude Code) | Write your own |
|---|---|---|
| What it ships | CLAUDE.md, .claude/rules/ and brain/ files, plus the Autopilot protocol | The rules file you write for Windsurf |
| Staying current | A weekly freshness feed for Claude Code changes | Manual — you research and update yourself |
| Role setup | 15 role packs on Pro, including Software Developer and DevOps | Your one role |
| Windsurf support | None — Brainfile ships no Windsurf format | Native |
Windsurf, now Devin Desktop, is not just a re-skinned Cursor. Its agent operates differently from Cursor's, and the rules format reflects that. Write Windsurf rules for Windsurf — don't just port a .cursorrules file.
Devin Desktop's directory rules (.devin/rules/, .windsurf/rules/) take front matter with description, globs, and alwaysApply fields before the markdown content. Get the trigger wrong and the rule does not load when you expect it to.
Devin Desktop's agent takes multi-step actions — it's not just autocomplete. Rules for an agent need to say how to sequence tasks, when to ask before acting, and how to handle partial completions.
Brainfile for Claude Code: the Autopilot protocol, 10 pattern files and a weekly freshness feed. Pro adds 15 role packs. Start free — 30 days, no card.
30-day money-back guarantee · Instant access · Cancel anytime
Need a team setup? Enterprise — contact us →
New Windsurf and Devin Desktop rule configurations, agent tips, and AI context updates. Free: a Claude Code tip every Tuesday and Thursday, plus a Sunday recap.
No spam. Unsubscribe anytime.