-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.cursorrules
More file actions
116 lines (87 loc) · 3.74 KB
/
Copy path.cursorrules
File metadata and controls
116 lines (87 loc) · 3.74 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
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
# RevampIT Project Rules for Cursor AI
## 🎯 Project Overview
RevampIT is a Swiss non-profit enabling free exchange of technology, promoting open-source hardware and software.
**See SSOT files for details:**
- **Mission**: `docs/MISSION_STATEMENT.md`
- **Project Context**: `docs/SHARED_CONTEXT.md` (tech stack, location, database, file structure)
- **Commands**: `docs/COMMANDS.md` (all npm scripts)
---
## ⚡ Quick Commands
```bash
npm run d # Start everything (databases + dev server)
npm run dev # Frontend only (port 3000)
npm run services:up # Start Docker services
npm run services:down # Stop Docker services
npm run setup-admins # Create admin users
npm run lint # Check code quality
npm run build # Test production build
npm run typecheck # TypeScript check (IMPORTANT: run before commits)
```
**Full command reference**: See `docs/COMMANDS.md`
---
## 🛡️ Critical Rules (MUST FOLLOW)
### File Deletion Protection
**⚠️ NEVER delete without explicit user approval:**
- Migration files: `cms-api/src/migrations/*`, `scripts/db/migrations/*`
- `.env*` files
- Core configuration files
- Documentation files
### Code Quality Standards
**ALWAYS:**
- ✅ Use `import { logger } from '@/lib/logger'` (NEVER `console.log`)
- ✅ Use constants from `src/config/` (TABLE_NAMES, URLs, error messages)
- ✅ Use TypeScript strict mode (no `any` without justification)
- ✅ Search codebase before creating new files (prevent duplicates)
- ✅ Follow existing patterns from similar files
**NEVER:**
- ❌ `console.log` statements (see `docs/CODE_AUDIT.md` for current count)
- ❌ Hardcoded table names (use `TABLE_NAMES` from `src/config/database.ts`)
- ❌ Hardcoded URLs (use `src/config/urls.ts`)
- ❌ Duplicate functionality
### AI Slop Prevention
**Before creating ANY new file:**
1. Search with semantic search: `@codebase "similar functionality"`
2. Check with grep: `grep -r "ComponentName"`
3. Verify naming conventions in target directory
4. Ensure no duplicates exist
---
## 📋 Detailed Topic-Specific Rules
For detailed, modular rules, see:
- `.cursor/rules/code-quality.mdc` - Code standards and patterns
- `.cursor/rules/database.mdc` - Database access patterns
- `.cursor/rules/deployment.mdc` - Deployment workflow
- `.cursor/rules/swiss-context.mdc` - Swiss-specific requirements
---
## 📚 Key Documentation
**Read BEFORE starting any task:**
1. `docs/development/DEV_GUIDE.md` - Core principles (DRY, SSOT)
2. `docs/BEST_PRACTICES.md` - AI slop prevention
3. `DEVELOPMENT_GUIDELINES.md` - File protection rules
**Project Context:**
- `docs/SHARED_CONTEXT.md` - Tech stack, database, file structure, access points
- `docs/COMMANDS.md` - All npm scripts
- `docs/CODE_AUDIT.md` - Current issues to fix
**For specific features:**
- `docs/UNIFIED_AUTH.md` - Authentication system
- `docs/SHARED_CONTEXT.md` - Shop and platform status
- `docs/guides/ARCHITECTURE.md` - System architecture
---
## 🧪 Testing Changes
```bash
# After making changes:
npm run typecheck # TypeScript validation (CRITICAL: run before commits)
npm run build # Check TypeScript compilation
npm run lint # Check code quality
npm run test # Run tests (if applicable)
npm run d # Start and test manually
```
---
## 🚨 Known Issues
See `docs/CODE_AUDIT.md` for current issues:
- console.log statements → replace with `logger`
- Hardcoded table names → use `TABLE_NAMES`
- Hardcoded URLs → use `src/config/urls.ts`
- Missing auth checks
- Performance issues
---
**Remember**: This is a Swiss non-profit focused on sustainability and inclusion. Write clean, maintainable code that future volunteers can understand and extend. Quality matters, but so does making technology accessible to everyone.