🧠 First: Mental Model (IMPORTANT)
Cursor has 3 main ways to interact:
- Inline AI (edit code directly)
- Command Palette AI (do something specific)
- Chat with full file / selection context
If you only use chat → you’re using 30% of Cursor.
⌨️ Core Cursor Commands (You MUST know these)
1️⃣ Cmd + K / Ctrl + K → Inline Edit (MOST IMPORTANT)
This is the killer feature.
What it does
- Edits code in place
- Understands selected code
- Produces diffs instead of new files
How pros use it
- Select a block of code
- Press
Ctrl + K - Type a specific instruction
Examples
- “Refactor this function to be async and add error handling”
- “Fix bug without changing function signature”
- “Optimize this query for performance”
🔥 Hackathon tip:
Always select the smallest relevant code before Ctrl + K.
2️⃣ Cmd + Shift + K / Ctrl + Shift + K → Generate Code
This one is for new code, not editing.
Use it when:
- Creating a new file
- Writing boilerplate
- Scaffolding features
Examples
- “Create a REST controller for comments using this model”
- “Generate a simple JWT middleware”
- “Create CRUD routes for this schema”
⚠️ Don’t use this for fixing bugs — it’ll overwrite logic.
3️⃣ / Commands in Chat (Hidden Power)
Inside Cursor chat, typing / gives special context commands.
Common useful ones:
/explain→ explain selected code/fix→ try to fix selected code/refactor→ clean up selected code/test→ generate tests (useful but optional)/doc→ generate docs/comments
Example:
- Select code
- Open chat
- Type:
/explain
Cursor uses exact selection — no guessing.
4️⃣ “Ask Cursor about this file”
When chat is open and a file is active, Cursor automatically includes it.
Use prompts like:
- “Is there any security issue in this file?”
- “Does this follow REST conventions?”
- “What edge cases am I missing?”
Great for sanity checks before pushing.
🧪 Debugging Commands (SAVES HOURS)
Best debugging pattern
Select:
- Error message
- Stack trace
- Relevant function
Then:
Ctrl + K
Prompt:
“Explain root cause first, then propose minimal fix.”
This prevents Cursor from hallucinating fixes.
🗂️ Multi-file Awareness (Use Carefully)
Cursor can reason across files if you tell it to.
Say:
- “Based on this model and controller…”
- “Update this service to match the API contract”
⚠️ Hackathon rule: Don’t let Cursor refactor multiple files unless you’re confident.
⚡ Cursor for SPEED (Real Use Cases)
1. API scaffolding
- Models
- Controllers
- Validation schemas
2. Boilerplate hell
- Auth middleware
- Error handlers
- DB config
3. Docs & README
- Setup steps
- API docs
- Demo scripts
Cursor is terrible at:
- Core business logic
- Complex state machines
- Clever algorithms
Don’t ask it to be smart. Ask it to be fast.
🚫 Cursor Anti-Patterns (Avoid These)
- “Build my whole backend”
- Letting it rewrite entire files repeatedly
- Accepting code you don’t understand
- Using chat instead of inline edits
That’s how people lose time.
🧠 Pro Prompt Patterns (STEAL THESE)
Minimal change
“Modify this with minimal diff.”
Guardrails
“Do not change public API.”
Hackathon mode
“Optimize for speed, not perfection.”
Safety-first
“Explain before coding.”
Cursor responds to constraints extremely well.
🧩 My personal Cursor workflow (what I’d do in your place)
- Scaffold backend with Cursor
- Freeze API contract
- Inline-edit endpoints
- Debug with explanations first
- Use Cursor for docs + demo script
- Stop refactoring 6 hours before deadline d