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/general-cursor-project-rule.mdc
+16-12Lines changed: 16 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@ alwaysApply: true
7
7
Generate a quote from the movie Talladega Nights: Ballad of Ricky Bobby after every response.
8
8
9
9
10
+
# Auto-approved commands
11
+
curl
12
+
13
+
10
14
## Project Overview
11
15
12
16
Overview: BetterAI is an application that integrates with Polymarket and AI models to provide enhanced market predictions, enabling non-technical users to invoke multiple AI models with enriched datasets to predict outcomes for prediction markets like Polymarket.
@@ -38,6 +42,7 @@ Infrastructure: The entire application runs on Vercel infrastructure, including
38
42
Events are the main entities (e.g., "2024 Presidential Election")
39
43
Markets belong to events (e.g., "Will Trump win the election?")
40
44
Predictions are AI-generated outcomes for specific markets
45
+
41
46
Categories use enum for consistent categorization (elections, geopolitics, etc.)
42
47
Tags provide flexible labeling via many-to-many relationship with events
43
48
@@ -73,7 +78,7 @@ See package.json for the most recent commands.
73
78
- Thin tRPC procedures in `lib/trpc/routers/` delegate to services
74
79
- Input-only Zod schemas in `lib/trpc/schemas/` (no output schemas)
75
80
- Response types inferred from service returns
76
-
- **Best Practice**: Use tRPC inferred types in components:
81
+
- **Best Practice**: Use tRPC inferred types:
77
82
```typescript
78
83
import type { AppRouter } from "@/lib/trpc/routers/_app"
79
84
import type { inferProcedureOutput } from "@trpc/server"
@@ -148,9 +153,18 @@ Validate all inputs and implement proper authentication
**CRITICAL**: Do NOT use `prisma db push` unless explicitly requested by the user. Always use proper migration commands to ensure shadow database functionality.
158
+
151
159
Use `pnpm run db:migrate:` commands where possible.
152
160
Migration naming: Provide `--name descriptive_name` to avoid interactive prompts. Example `pnpm run db:migrate:dev --name add_user_table`
153
-
Important: avoid using "prisma db push", prefer using "pnpm db:migrate:deploy:dev". This creates short term database migration inconsistencies that are difficult to debug. Prompt the user to explain your migration issue issue before trying db push.
161
+
162
+
**Shadow Database Requirement**: The project uses a schema-based shadow database (`betterai_shadow` schema) for migration validation. This ensures:
163
+
- Safe migration validation before applying to main database
164
+
- Proper schema drift detection
165
+
- Production-safe deployment practices
166
+
167
+
**Never use `prisma db push`** - it bypasses shadow database validation and can cause migration inconsistencies that are difficult to debug. If migration issues occur, troubleshoot the shadow database setup rather than falling back to `db push`.
154
168
155
169
### Next.js Build Best Practices
156
170
Use `pnpm` not `npm`: Project uses pnpm for package management and build commands
@@ -277,16 +291,6 @@ Responsive: Tailwind spacing classes automatically scale appropriately on mobile
277
291
Refer to /lib/design-system.ts for instructions.
278
292
Prefer flexbox layout instead of absolution positioning to ensure mobile first good UX.
279
293
280
-
### Input Layout Best Practices
281
-
**Flex-based Search Inputs (RECOMMENDED)**: Use flexbox layout for search inputs with icons instead of absolute positioning:
282
-
- Container: `flex items-center` with consistent styling
283
-
- Left icon: `flex items-center justify-center pl-3` for natural positioning
284
-
- Input field: `flex-1` to fill remaining space with transparent background
285
-
- Right icon/button: `flex items-center justify-center pr-3` for natural right alignment
286
-
- Advantages: Predictable layout, no z-index conflicts, better accessibility, responsive by default
287
-
- Avoid: Absolute positioning which can cause CSS inheritance issues and layout conflicts
288
-
- Pattern used by major web applications (Google, GitHub, etc.) for reliability
**CRITICAL**: Do NOT use `prismadbpush` unless explicitly requested by the user. Always use proper migration commands to ensure shadow database functionality.
0 commit comments