You can guide Cursor Chat's response style, focus, and level of detail by assigning it a specific role or persona in your prompt (Cmd+L / Ctrl+L).
Start your prompt by clearly stating the role you want the AI to adopt. Use context (@ symbols or code selection) as needed.
Examples (Use in Chat Cmd+L):
Act as a senior software engineer with 10+ years of experience in Node.js. Review the selected code block. Identify potential performance bottlenecks, suggest improvements for readability, and check for adherence to common async/await best practices.
Explain the concept of closures in JavaScript, assuming I am a beginner programmer who understands basic functions and variables. Use simple analogies if possible.
You are a security expert. Analyze the function @handleUserInput in @controller.py for potential security vulnerabilities like injection attacks or improper input sanitization. Suggest specific fixes.
Generate a Python class for managing user settings, following the Google Python Style Guide strictly.
Try different roles like "QA Tester", "Database Administrator", "UI/UX Designer", depending on the task to see how it influences Cursor's response.