CognxSafeTrack commited on
Commit ·
f03c513
1
Parent(s): 2392141
docs: Project Constitution Global Enforcement (.cursorrules & README)
Browse files- .cursorrules +23 -0
- README.md +16 -5
.cursorrules
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 🎭 Global AI Instructions (.cursorrules)
|
| 2 |
+
|
| 3 |
+
You are an expert full-stack developer working on the XAMLÉ AI project. You MUST follow these rules regardless of your model type.
|
| 4 |
+
|
| 5 |
+
## 🚀 SESSION STARTUP
|
| 6 |
+
1. **MANDATORY**: Read `.claude/CLAUDE.md` and `tasks/lessons.md` first.
|
| 7 |
+
2. **MANDATORY**: Read `tasks/todo.md` to understand the current state.
|
| 8 |
+
3. If these don't exist, create them before any code changes.
|
| 9 |
+
|
| 10 |
+
## 🛡️ CORE PRINCIPES
|
| 11 |
+
- **Atomic First**: Never send WhatsApp messages before successful Prisma DB updates.
|
| 12 |
+
- **Async-First**: API Webhooks must respond `200 OK` in < 100ms.
|
| 13 |
+
- **Idempotency**: Use Redis locks (300s) for all long-running tasks.
|
| 14 |
+
- **Root Cause Only**: No temporary fixes. If it's a bug, find the root and fix it elegantly.
|
| 15 |
+
|
| 16 |
+
## 🔄 WORKFLOW
|
| 17 |
+
1. **Plan first** in `tasks/todo.md` for any task > 3 steps.
|
| 18 |
+
2. **Verify strictly**: Never mark a task as done without log proof or test validation.
|
| 19 |
+
3. **Auto-Learning**: Update `tasks/lessons.md` after every bug fix using format: `[date] | what went wrong | rule to avoid`.
|
| 20 |
+
|
| 21 |
+
## 🧪 TECHNICAL PRIMER
|
| 22 |
+
Refer to `.claude/primer.md` for the project stack (Gemini, BullMQ, Redis, Prisma).
|
| 23 |
+
Refer to `tasks/hindsight.md` for historical user mandates and philosophy.
|
README.md
CHANGED
|
@@ -8,10 +8,21 @@ pinned: false
|
|
| 8 |
app_port: 7860
|
| 9 |
---
|
| 10 |
|
| 11 |
-
# EdTech Backend
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
This Space hosts the backend for the EdTech platform, including:
|
| 14 |
-
- **Fastify API**: Handles WhatsApp Webhooks
|
| 15 |
-
- **WhatsApp Worker**: Background
|
| 16 |
-
- **Database**:
|
| 17 |
-
- **Queue**:
|
|
|
|
| 8 |
app_port: 7860
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# EdTech Backend (XAMLÉ AI)
|
| 12 |
+
|
| 13 |
+
## 🤖 AI Development Rules (MANDATORY)
|
| 14 |
+
This project uses a specialized memory and rules system for all AI assistants. Any AI model (Claude, Cursor, GPT, Gemini) working on this codebase **MUST** follow:
|
| 15 |
+
- [CLAUDE.md](.claude/CLAUDE.md) : Project Constitution (Core Rules).
|
| 16 |
+
- [primer.md](.claude/primer.md) : Technical Architecture & Business Profile.
|
| 17 |
+
- [lessons.md](tasks/lessons.md) : Technical history of crashes and fixes.
|
| 18 |
+
- [hindsight.md](tasks/hindsight.md) : Historical User Mandates.
|
| 19 |
+
|
| 20 |
+
**Strict Session Flow**: 1. Read Lessons -> 2. Read Todo -> 3. Plan in `tasks/todo.md` -> 4. Execute.
|
| 21 |
+
|
| 22 |
+
---
|
| 23 |
|
| 24 |
This Space hosts the backend for the EdTech platform, including:
|
| 25 |
+
- **Fastify API**: Handles WhatsApp Webhooks (Async-First).
|
| 26 |
+
- **WhatsApp Worker**: Background logic processor (Atomic DB First).
|
| 27 |
+
- **Database**: Azure Neon PostgreSQL.
|
| 28 |
+
- **Queue**: BullMQ with managed Redis.
|