-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cursorrules
161 lines (129 loc) · 5.07 KB
/
.cursorrules
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
IMPORTANT: AFTER EACH USER REQUEST, CREATE AND/OR UPDATE .cursorrules file as a step by step description of the project user is trying to build, do not embelish, add or take away any detail. just translate user request to a nicely formated instructions
# Repository Tool Project Requirements
1. Repository Management
- Clone repositories from URLs with depth=1 (shallow clone)
- Support force flag for overwriting existing repos with new settings
- Handle branch updates during force clone operations
- Skip if repository exists (return existing) when not force cloning
- Create proper directory structure (author/repo_name)
- Validate repository URLs
- Handle cleanup and directory creation
- Support bulk operations for updates
- Validate GitHub URL format
2. Error Handling
- Validate URLs before cloning
- Proper directory permission checks
- Clear error messages for invalid inputs
- Handle Git operation failures
- Handle missing required parameters
- Proper handling of non-existent repositories
- Validate author/repository name format
- Descriptive error messages for URL validation
- Show toast notifications for API errors
- Display user-friendly error messages in UI
- Implement custom error page with clear messaging and home navigation
- Use consistent error styling with application theme
3. Path Management
- Use proper path construction
- Support for nested directory structures
- Handle path existence checks
- Clean up on force operations
- Handle special characters in paths
4. Testing
- Cover edge cases and abnormal scenarios
- Test idempotent operations
- Test force clone behavior
- Test bulk operations
- Test error conditions
- Validate response formats
- Reset test state between test runs
- Test URL validation
5. UI Testing
- Test navigation to home page
- Test Add Repository button click and icon visibility
- Test modal dialog visibility
- Take screenshots for visual regression
- Validate page title
- Test search input with icon functionality
- Test tab icons visibility and alignment
6. Loading States
- Implement full-screen loading spinner
- Support customizable spinner size
- Support minimum height setting
- Allow custom styling through className
- Support optional loading text labels
- Handle responsive container sizing
- Implement smooth loading animations
- Use semi-transparent background (50% opacity) for better content visibility
- Ensure proper TypeScript typing
- Maintain accessibility standards
5. Repository Content Generation
- Efficient file reading with proper encoding handling
- Process files individually to manage memory usage
- Convert paths to relative format for consistency
- Skip invalid or unreadable files
- Proper error handling per file
- Support UTF-8 encoding with fallback
- Generate structured content output
- Handle large repositories efficiently
- Concurrent file processing with thread pool
- Dynamic thread pool sizing based on CPU cores
- Maximum thread limit for resource control
- Process results as they complete
# Repository Tool Database Requirements
1. Database Setup
- Initialize SQLite database with SQLModel
- Create tables for FilterSettings and SummaryCache
- Handle database migrations
- Proper session management
2. Repository Management
- Store filter settings per repository
- Cache repository summaries
- Support CRUD operations
- Handle database connections properly
3. Error Handling
- Validate database operations
- Handle session lifecycle
- Proper error messages for database operations
- Transaction management
4. Data Models
- FilterSettings model for repository filters
- SummaryCache model for caching summaries
- Proper relationship handling
- Data validation
# Repository Tool Testing Requirements
1. Database Tests
- Test CRUD operations for FilterSettings
- Test CRUD operations for SummaryCache
- Test data integrity
- Test edge cases
- Use in-memory database for testing
- Clean up test data
2. Repository Management Tests
- Test repository ID generation
- Test nonexistent repository handling
- Test bulk operations
- Test data validation
3. Error Handling Tests
- Test invalid inputs
- Test missing data scenarios
- Test database operation failures
4. Data Model Tests
- Test FilterSettings serialization
- Test Summary serialization
- Test data model validation
# CI/CD Requirements
1. GitHub Actions
- Test Docker builds for API service
- Test Docker builds for frontend service
- Run on push to main branch
- Run on pull requests to main branch
- Use Ubuntu latest runner
- Fail workflow if any build fails
# Repository Tool API Requirements
1. API Response Format
- Support multiple response formats (text/plain and application/json)
- Handle Accept header for format negotiation
- Return appropriate Content-Type header
- Support consistent response structure across formats
- Proper error handling for unsupported formats