Cursor & Prompting
Tips and techniques for effective AI-assisted development using Cursor IDE.
Cursor is an AI-powered code editor that can significantly speed up your development. It understands your codebase and can help with everything from writing boilerplate to debugging complex issues.
While you can use any IDE you prefer, Cursor is highly recommended for Olive Code projects. The AI assistance helps you move faster and produce higher-quality code.
- Download Cursor
Get Cursor from cursor.sh. It's available for macOS, Windows, and Linux.
- Open Your Project
Open the cloned repository folder in Cursor. It will index the codebase for context-aware assistance.
- Start Chatting
Use
Cmd/Ctrl + Kfor inline edits orCmd/Ctrl + Lfor the chat panel.
Getting good results from AI depends on how you communicate. Here are key principles:
Vague prompts lead to vague results. Be explicit about what you want.
| ❌ Vague | ✅ Specific |
|---|---|
| "Add a button" | "Add a blue submit button with rounded corners that calls handleSubmit when clicked" |
| "Fix this bug" | "The form submits even when validation fails. Add a check to prevent submission if there are errors" |
| "Make it look better" | "Add proper spacing between elements and use the project's color scheme" |
Include relevant information about the existing code, patterns, and requirements:
- Reference files – Use @filename to include file context in your prompt
- Explain patterns – "Following the same pattern as the existing auth components..."
- Share constraints – "This needs to work without JavaScript disabled"
Don't expect perfection on the first try. Refine the output through conversation:
- "Good, but also add error handling for network failures"
- "Make it responsive for mobile screens"
- "Extract this into a reusable component"
- Review All Generated Code – AI can make mistakes. Always read and understand the code before committing.
- Test Thoroughly – Don't assume generated code works. Test every feature manually.
- Understand, Don't Copy-Paste – If you don't understand the code, ask Cursor to explain it.
- Use Existing Patterns – Point Cursor to existing code as examples of the patterns you want to follow.
- Break Down Complex Tasks – For large features, work through them step by step rather than asking for everything at once.
Cursor excels at these tasks:
| Task | Example Prompt |
|---|---|
| Boilerplate | "Create a React component for a product card with image, title, price, and add to cart button" |
| Refactoring | "Extract the form validation logic into a custom hook" |
| Bug Fixing | "The date picker shows the wrong month when first opened. Help me debug this." |
| Understanding Code | "Explain what this useEffect hook is doing and when it runs" |
| API Integration | "Add a function to fetch products from the Firestore products collection" |
For more advanced features and tips, check the official Cursor documentation.