The Three Ways to Talk to AI in Cursor
Cursor offers three interaction modes:
- Chat (Cmd/Ctrl + L) — Ask questions, get explanations, plan features
- Inline Edit (Cmd/Ctrl + K) — Select code and ask for changes
- Composer (Cmd/Ctrl + I) — Multi-file editing and generation
Writing Effective Prompts
The quality of AI output depends heavily on how you ask. Good prompts are specific, contextual, and constrained.
Weak Prompts
- 'Make this better'
- 'Add a login page'
- 'Fix the bug'
- 'Style this nicely'
Strong Prompts
- 'Refactor this function to use async/await instead of callbacks'
- 'Create a login page with email/password fields, using our existing Button component'
- 'The form submits twice when clicked. Find and fix the duplicate submission'
- 'Add Tailwind classes for a minimal, clean look matching our existing pages'
Setting Up Cursor Rules
Cursor Rules are persistent instructions that the AI follows for every request. They save you from repeating context.
User Rules apply to all your projects. Project Rules (in .cursor/rules) apply to a specific codebase.
Common rules to set:
- Preferred technologies (e.g., 'Use TypeScript and Tailwind CSS')
- Coding style (e.g., 'Use functional components, avoid classes')
- Project context (e.g., 'This is a Next.js 14 app with App Router')
- Output preferences (e.g., 'Keep explanations brief and code-focused')
Prompting Strategies
Advanced techniques:
- Chain of thought — Ask AI to explain its reasoning before coding
- Incremental building — Make small changes, test, then continue
- Reference existing code — Point to patterns already in your codebase
- Constrain scope — Limit changes to specific files or functions