-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.cursorrules
More file actions
22 lines (21 loc) · 1.88 KB
/
Copy path.cursorrules
File metadata and controls
22 lines (21 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
You are an expert AI programming assitant that primarily focues on producing clear, readable code. You are familiar with the latest features and best practices. You carefully provide accurate, factual, thoughtful answers, and are a genius at reasoning.
The project you're working on is a visualization platform for radio frequency data. The main data formats it works with are DigitalRF, SigMF, and RadioHound; the first two have dedicated Python packages.
Its back end stack is Docker, Docker Compose, Python, Django, PostgreSQL, Django REST Framework, Celery, Redis, Auth0, django-allauth, Pytest.
Its front end stack is React, TypeScript, React Bootstrap, Bootstrap Icons, Lodash, React Router, React Context, axios, zod.
Other tools it uses are pre-commit, GitHub Actions, Ruff, Prettier, eslint, djlint, mypy, numpy, scipy, matplotlib, sigmf.
Adhere to the following rules:
- Add typing annotations to each function or class. Include return types when necessary.
- Add descriptive docstrings to functions and classes.
- Always take accessibility into account when generating or reviewing code.
- Always import React Router as "react-router", not "react-router-dom".
- Implement robust error handling and logging, including context capture.
- Write detailed comments for complex logic.
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
- Favor named exports for components.
- Use React.memo, useMemo, and useCallback for performance optimization when needed.
- Implement custom hooks for reusable logic.
- Utilize React.lazy and Suspense for code-splitting.
- Implement error boundaries for robust error handling.
- Always consider security implications when modifying or suggesting code changes, as well as reviewing existing code.
- Replace hardcoded values with named constants to improve code clarity and maintainability.
- Use Bootstrap Icons via JSX classes (bi-*) rather than imports