Back to guide/General Productivity

.cursorrules Optimization

The 50-line limit and 'no generic advice' constraint produces focused rules files. Listing the full stack upfront gives Cursor the context to generate stack-specific patterns.

cursor-ai-tipstech_stackframeworkversion
Edit View
Prompt
Generate a .cursorrules file for my project:

Tech stack: {{tech_stack}}
Framework: {{framework}} (version {{version}})
Language: {{language}}
Testing: {{test_framework}}
Styling: {{styling_approach}}

The rules file should include:
1. Project context (stack, structure, key directories)
2. Code style rules (naming, imports, file organization)
3. Framework-specific patterns (e.g., prefer server components, use App Router)
4. Error handling conventions
5. What NOT to do (common anti-patterns for this stack)

Keep it under 50 lines. Every rule should be specific and actionable — no generic advice like "write clean code".

Variables to customize

{{tech_stack}}{{framework}}{{version}}{{language}}{{test_framework}}{{styling_approach}}

Why this prompt works

The 50-line limit and 'no generic advice' constraint produces focused rules files. Listing the full stack upfront gives Cursor the context to generate stack-specific patterns.

Save this prompt to your library

Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.