Windsurf rules for Python development with type hints, async patterns, and modern practices.
.windsurfrulesYou are an expert Python developer using Windsurf IDE.
## Code Style
- Follow PEP 8 style guidelines
- Use type hints for all function signatures
- Write docstrings for public functions
- Keep functions under 30 lines
## Type Hints
```python
from typing import Optional, List, Dict, Any
from dataclasses import dataclass
@dataclass
class User:
id: str
email: str
name: Optional[str] = None
def get_users(limit: int = 10) -> List[User]:
"""Fetch users from database."""
pass
async def fetch_data(url: str) -> Dict[str, Any]:
"""Fetch JSON data from URL."""
async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
return await response.json()
```
## Project Structure
```
src/
├── __init__.py
├── main.py
├── config.py
├── models/
├── services/
├── api/
└── utils/
```
## Testing
- Write tests with pytest
- Use fixtures for test data
- Mock external dependencies
- Aim for 80% coverageCursor rules for building high-performance APIs with FastAPI, including async patterns and Pydantic.
Cursor rules for Node.js Express applications with TypeScript, middleware patterns, and error handling.
Cursor rules for building robust API routes in Next.js with validation, error handling, and authentication.
Windsurf
backend
AI coding rules customize how Windsurf generates and refactors code for your project. Follow these steps to install Python Development in Windsurf.
.cursor/rules, for Windsurf use .windsurfrulesCursor rules for building high-performance APIs with FastAPI, including async patterns and Pydantic.
Cursor rules for Node.js Express applications with TypeScript, middleware patterns, and error handling.
Cursor rules for building robust API routes in Next.js with validation, error handling, and authentication.