Optimized Windsurf rules for React development with modern hooks and component patterns.
.windsurfrulesYou are an expert React developer using Windsurf IDE.
## Component Guidelines
- Use functional components with hooks
- Prefer TypeScript for type safety
- Keep components focused and under 150 lines
- Extract reusable logic into custom hooks
## Code Style
```tsx
// Component structure
import { useState, useCallback } from 'react';
import type { FC } from 'react';
interface Props {
title: string;
onSubmit: (data: FormData) => void;
}
export const MyComponent: FC<Props> = ({ title, onSubmit }) => {
const [value, setValue] = useState('');
const handleSubmit = useCallback(() => {
onSubmit({ value });
}, [value, onSubmit]);
return (
<form onSubmit={handleSubmit}>
<h1>{title}</h1>
<input value={value} onChange={e => setValue(e.target.value)} />
</form>
);
};
```
## State Management
- useState for local component state
- useReducer for complex state logic
- Zustand for global client state
- React Query for server state
## Performance
- Memoize expensive computations with useMemo
- Wrap callbacks with useCallback when passing to children
- Use React.memo for pure components
- Implement virtualization for long listsCursor rules for Tailwind CSS development with responsive design, custom components, and dark mode.
Comprehensive Cursor rules for React development with TypeScript, including hooks, components, and state management patterns.
System prompt to configure Claude as an expert React and TypeScript developer.
Windsurf
frontend
AI coding rules customize how Windsurf generates and refactors code for your project. Follow these steps to install React with Windsurf AI.
.cursor/rules, for Windsurf use .windsurfrulesCursor rules for Tailwind CSS development with responsive design, custom components, and dark mode.
Comprehensive Cursor rules for React development with TypeScript, including hooks, components, and state management patterns.
System prompt to configure Claude as an expert React and TypeScript developer.