You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/rules/common.mdc
+16-7Lines changed: 16 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -3,16 +3,19 @@ description:
3
3
globs:
4
4
alwaysApply: true
5
5
---
6
-
You are an expert full-stack developer proficient in TypeScript, React, Next.js, Apollo GraphQL, and PostgreSQL with drizzle ORM.
6
+
# Common
7
+
8
+
You are an expert full-stack developer proficient in TypeScript, React, Next.js, and PostgreSQL with drizzle ORM.
7
9
Your task is to produce the most optimized and maintainable Next.js version 15+ code, following best practices and adhering to the principles of clean code and robust architecture.
8
10
11
+
## Code Style and Structure
9
12
10
-
### Code Style and Structure
11
13
- Write concise, technical TypeScript code with accurate examples.
12
14
- Use functional and declarative programming patterns; avoid classes.
13
15
- Favor iteration and modularization over code duplication.
14
16
15
17
### Optimization and Best Practices
18
+
16
19
- Minimize the use of `'use client'`, `useEffect`, and `setState`; favor React Server Components (RSC) and Next.js SSR features.
17
20
- Use 'use client' only when necessary for interactivity, such as:
18
21
- Rich text editors (Tiptap, Slate)
@@ -24,36 +27,42 @@ Your task is to produce the most optimized and maintainable Next.js version 15+
24
27
- Optimize images: use WebP format, include size data, implement lazy loading.
25
28
26
29
### Error Handling and Validation
30
+
27
31
- Prioritize error handling and edge cases:
28
-
- Use early returns for error conditions.
29
-
- Implement guard clauses to handle preconditions and invalid states early.
30
-
- Use custom error types for consistent error handling.
32
+
- Use early returns for error conditions.
33
+
- Implement guard clauses to handle preconditions and invalid states early.
34
+
- Use custom error types for consistent error handling.
31
35
32
36
### UI and Styling
37
+
33
38
- Do not use any UI frameworks or library.
34
39
- Implement consistent design and responsive patterns across platforms.
35
40
36
41
### State Management and Data Fetching
42
+
37
43
- Do not use any State Management
38
-
- Use Apollo for Data Fetching
39
44
40
45
### Security and Performance
46
+
41
47
- Implement proper error handling, user input validation, and secure coding practices.
42
48
- Follow performance optimization techniques, such as reducing load times and improving rendering efficiency.
43
49
44
50
### Testing and Documentation
51
+
45
52
- Write unit tests for components using Jest and React Testing Library.
46
53
- Provide clear and concise comments for complex logic.
47
54
48
55
### Methodology
56
+
49
57
1. **System 2 Thinking**: Approach the problem with analytical rigor. Break down the requirements into smaller, manageable parts and thoroughly consider each step before implementation.
50
58
2. **Tree of Thoughts**: Evaluate multiple possible solutions and their consequences. Use a structured approach to explore different paths and select the optimal one.
51
59
3. **Iterative Refinement**: Before finalizing the code, consider improvements, edge cases, and optimizations. Iterate through potential enhancements to ensure the final solution is robust. Finally check the TS types.
52
60
4. Suggest a variant first let me take a look at the suggestion.
53
61
54
62
**Process**:
63
+
55
64
1. **Deep Dive Analysis**: Begin by conducting a thorough analysis of the task at hand, considering the technical requirements and constraints.
56
65
2. **Planning**: Develop a clear plan that outlines the architectural structure and flow of the solution, using <PLANNING> tags if necessary.
57
66
3. **Implementation**: Implement the solution step-by-step, ensuring that each part adheres to the specified best practices.
58
67
4. **Review and Optimize**: Perform a review of the code, looking for areas of potential optimization and improvement.
59
-
5. **Finalization**: Finalize the code by ensuring it meets all requirements, is secure, and is performant.
68
+
5. **Finalization**: Finalize the code by ensuring it meets all requirements, is secure, and is performant.
Сайт русскоязыного сообщества поддержки пациентов с болезнью Рандю-Ослера-Вебера.
1
+
# About the Project
3
2
3
+
A website for the Russian-speaking community supporting patients with [Osler–Weber–Rendu](https://en.wikipedia.org/wiki/Hereditary_hemorrhagic_telangiectasia) disease.
4
4
5
-
### Технологии
6
-
-[Next.js 15](https://nextjs.org/) - React фреймворк для создания веб-приложений
7
-
-[React 19](https://react.dev/) - JavaScript библиотека для создания пользовательских интерфейсов
0 commit comments