21 react rules available
Twenty-one Windsurf rules match react, covering forms, Zustand, Storybook, testing, animation, accessibility and performance; 15 are short. Windsurf's rules documentation now redirects to Devin docs, which use .devin/rules/; legacy .windsurfrules files are still imported. The glob-triggered file below is the component baseline those rules build on.
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/react.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: "**/*.tsx,**/*.jsx" --- # React instructions for Windsurf ## Focus for this project - Put shared client state in the store library the project uses (for example a Zustand store) and select only the fields a component needs. - Write a Storybook story for each visual state of a new component if the project has Storybook. - Respect prefers-reduced-motion in animations. ## React conventions - Write function components and custom hooks; call hooks only at the top level of components or other hooks. - Derive values during render instead of copying props into state, and do not use an effect only to transform data for rendering. - Check the react version in package.json: on React 19, function components receive ref as a regular prop and forwardRef is not needed for new components; on React 18 keep forwardRef. - In tests, query by role and accessible name with Testing Library rather than by class names or test IDs. ## Before you finish - Run the type checker (npx tsc --noEmit for TypeScript projects), the lint script and the component tests and report the actual output. If you cannot run them, say so and list the exact commands instead of saying they pass. - Summarize which of the rules above affected the change. - If a legacy .windsurfrules or .windsurf/rules file gives conflicting guidance, point out the conflict instead of silently choosing one.
Create your own Windsurf rules for React and share with the community.
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)
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
You use the Windsurf agent to build components with Storybook stories and tests and want consistent state and accessibility.
Create a Toast component with success and error variants.
A typed Toast with role="status" or role="alert" by variant, stories for both variants, reduced-motion handling, a test and test output.
Content reviewed 2026-11-05. Confirm instruction activation in your installed client before relying on it.
Generate React forms with react-hook-form and Zod: shared schemas, labelled field components, accessible error messages, async validation, submission state and tests.