# Cursor Rules for Filmladder MCP
## Type Annotations
- Use type annotations everywhere: all functions, methods, variables, and return types must be annotated
- Use `from __future__ import annotations` at the top of files to enable postponed evaluation
- Prefer `list[T]` over `List[T]` (Python 3.9+ style)
- Use `|` for union types (e.g., `str | None` instead of `Optional[str]`)
## Pydantic Models
- Use Pydantic BaseModel for all data structures
- All model fields must have type annotations
- Use validators where appropriate for data validation
- Use `pydantic-settings` for all configuration management
## Code Style
- Follow PEP 8 conventions
- Use black for formatting (configured in pyproject.toml)
- Use ruff for linting (configured in pyproject.toml)
- Maximum line length: 100 characters
## Error Handling
- Raise typed exceptions where applicable
- Use descriptive error messages
- Handle network errors gracefully
- Handle parsing errors (website structure changes)
## Imports
- Use absolute imports from `src` package
- Group imports: stdlib, third-party, local
- Use `from __future__ import annotations` for forward references