-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.cursorrules
More file actions
75 lines (57 loc) · 2.1 KB
/
.cursorrules
File metadata and controls
75 lines (57 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Cursor Rules for BudSimulator
## Project Context
You are working on BudSimulator, an advanced AI model simulation and benchmarking platform. The project has multiple components:
- GenZ framework for LLM performance modeling
- FastAPI backend with REST APIs
- React frontend for UI
- Streamlit dashboard for analysis
## Key Principles
1. **Preserve Existing Functionality**: Never break existing features when making changes
2. **Test-Driven**: Write or update tests for any new functionality
3. **Type Safety**: Use type hints in Python code
4. **Clear Documentation**: Document complex logic inline
## Code Guidelines
### Python (Backend)
- Follow PEP 8 style guide
- Use descriptive variable names
- Prefer explicit over implicit
- Handle exceptions gracefully
- Add docstrings to functions and classes
### JavaScript/TypeScript (Frontend)
- Use functional components with hooks
- Implement proper error boundaries
- Follow React best practices
- Keep components small and focused
### API Design
- Use RESTful conventions
- Include proper status codes
- Validate input data
- Return consistent response formats
## Common Patterns
### Database Operations
```python
# Always use unique_id for usecases, not numeric id
usecase = db.query(Usecase).filter(Usecase.unique_id == unique_id).first()
```
### Model Definition
```python
# Models should inherit from appropriate base classes
# Include proper parallelism configurations
```
### Frontend API Calls
```typescript
// Always handle loading and error states
// Use proper TypeScript types for API responses
```
## File Structure
- Keep related functionality together
- Follow existing naming conventions
- Place tests near the code they test
- Use appropriate directories for different concerns
## Current Focus
The current branch addresses usecase ID handling. Ensure all references use `unique_id` (string) not `id` (numeric).
## Remember
- The codebase is actively used - maintain backward compatibility
- Performance matters - consider computational efficiency
- User experience is important - provide clear feedback
- Documentation helps future development - keep it updated