Windsurf rules for React apps styled with Tailwind: pure components and hooks, theme tokens and dark mode, state by kind (server, URL, form, global) and practical performance work.
.devin/rules/windsurf-react-guidelines.md. Downloaded files need to be placed in that repository path.--- trigger: glob globs: "**/*" --- # React application guidelines ## Components - Prefer function components; keep rendering pure (no side effects during render) and put side effects in event handlers or effects that clean up. - Move reusable stateful logic into custom hooks. - Memoize only where profiling shows a benefit, or rely on React Compiler if the project enables it. ## Styling - Use Tailwind CSS utilities with design tokens defined in `@theme` (Tailwind v4), so spacing, colors and fonts come from one scale. - Use the theme's spacing scale instead of arbitrary values (`p-[13px]`) unless matching an external spec. - Support dark mode with `dark:` utilities; use `@custom-variant dark (&:where(.dark, .dark *));` when users can toggle it. - Use CSS variables for runtime theming (brand colors per tenant, user themes) and reference them from `@theme`. ## State management - Server state: React Query (TanStack Query) or the framework's data loading. - Shareable UI state (filters, tabs, pagination): URL search params. - Form state: react-hook-form with schema validation. - Global client state that many distant components share: Zustand. Keep everything else local. ## Performance - Lazy-load routes and heavy components with `lazy` + `Suspense` (or the framework's route splitting). - Serve images in modern formats with explicit `width`/`height`, `loading="lazy"` below the fold and responsive `srcset`/`sizes` (or the framework's image component). - Check bundle size with an analyzer before and after adding dependencies; import only what you use. - Cache server data with explicit stale times and invalidate after mutations; set HTTP cache headers for static assets.
Cursor rules for Tailwind CSS v4: automatic class sorting, mobile-first breakpoints, CVA variants with merging, class-based dark mode via @custom-variant, and CSS-first @theme configuration.
Cursor rules for React with TypeScript: typed function components, React 19 ref-as-prop, hooks discipline, state ownership, error boundaries and measured performance work.
CLAUDE.md rules for React 19 with TypeScript covering typed components, derived state, compiler-aware memoization, useId-based accessibility and review checks.
Windsurf
frontend
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
Content reviewed .
A Windsurf React + Tailwind app stores filters in Zustand (lost on reload), uses arbitrary pixel values throughout, and loads every route in the main bundle.
Apply the Windsurf React guidelines to the products section: src/pages/Products.tsx, src/store/filters.ts and src/styles/app.css.
Filters moved to URL search params, product data through TanStack Query with a stale time, theme tokens in @theme replacing arbitrary values, the products route lazy-loaded, images with dimensions and lazy loading, and the Zustand store kept only for truly global client state.
Windsurf's rules documentation (docs.windsurf.com/windsurf/cascade/memories) now redirects to Devin documentation, which describes rules for the Devin Local agent in Devin Desktop. Current rules live in .devin/rules/*.md with a trigger setting, and the legacy Windsurf files (.windsurf/rules/*.md, .windsurf/global_rules.md and .windsurfrules) are still imported by default. AGENTS.md files are read as always-on rules.
.devin/rules/windsurf-react-guidelines.mdStarting point, not a tested configuration for your repository. Applied when files matching globs are involved (trigger: glob). Review the instructions, adapt the file paths and run your project's existing checks.
--- trigger: glob globs: "**/*" --- # React application guidelines ## Components - Prefer function components; keep rendering pure (no side effects during render) and put side effects in event handlers or effects that clean up. - Move reusable stateful logic into custom hooks. - Memoize only where profiling shows a benefit, or rely on React Compiler if the project enables it. ## Styling - Use Tailwind CSS utilities with design tokens defined in `@theme` (Tailwind v4), so spacing, colors and fonts come from one scale. - Use the theme's spacing scale instead of arbitrary values (`p-[13px]`) unless matching an external spec. - Support dark mode with `dark:` utilities; use `@custom-variant dark (&:where(.dark, .dark *));` when users can toggle it. - Use CSS variables for runtime theming (brand colors per tenant, user themes) and reference them from `@theme`. ## State management - Server state: React Query (TanStack Query) or the framework's data loading. - Shareable UI state (filters, tabs, pagination): URL search params. - Form state: react-hook-form with schema validation. - Global client state that many distant components share: Zustand. Keep everything else local. ## Performance - Lazy-load routes and heavy components with `lazy` + `Suspense` (or the framework's route splitting). - Serve images in modern formats with explicit `width`/`height`, `loading="lazy"` below the fold and responsive `srcset`/`sizes` (or the framework's image component). - Check bundle size with an analyzer before and after adding dependencies; import only what you use. - Cache server data with explicit stale times and invalidate after mutations; set HTTP cache headers for static assets.
Ask for a small change to one matching file. Check the tool's loaded context or instruction view, inspect the diff for the requested convention, and run the relevant build or test. A well-formatted file does not guarantee the model follows every instruction.
The docs recommend keeping rules short and specific. The current docs say AGENTS.md, AGENTS.local.md and AGENT.md are read as always-on rules, including files in subdirectories. Use .devin/rules/ when you need glob, model-decision or manual triggers.
Documentation checked 2026-11-05: Devin docs: Local customizations (redirect target of Windsurf memories docs)Windsurf docs: Cascade memories (redirects)
Cursor rules for Tailwind CSS v4: automatic class sorting, mobile-first breakpoints, CVA variants with merging, class-based dark mode via @custom-variant, and CSS-first @theme configuration.
Cursor rules for React with TypeScript: typed function components, React 19 ref-as-prop, hooks discipline, state ownership, error boundaries and measured performance work.
CLAUDE.md rules for React 19 with TypeScript covering typed components, derived state, compiler-aware memoization, useId-based accessibility and review checks.