Tips for Building Apps with CursorAI

My Favorite Tips for Building Apps with CursorAI

I just finished building a complete Ruby on Rails app with CursorAI, and I wanted to share some tips that made the process so much faster. Here are a few things I learned along the way that will help you get the most out of Cursor.

1. Keep a Changelog with .cursorrules

It’s a good idea to have Cursor maintain a changelog for you. This helps you keep track of what’s been done and prevents the AI from getting stuck in a loop trying the same failed solutions over and over. If Cursor knows what you’ve already tried, it won’t waste time suggesting the same things again.

2. Write Tests for Everything

CursorAI is surprisingly good at writing unit tests. Whenever you add a new feature, ask Cursor to write a spec for it. This not only prevents you from breaking things later on but also gives the AI more context about your app, leading to better suggestions.

3. Manage Your Features with a TODO.md

If you have a list of features to implement, have Cursor add them to a TODO.md file. You can even ask it to generate unique branch names for each feature, which saves you the hassle of coming up with them yourself.

4. Use @/ to Specify Directories

To keep your context window from getting too large, use @/ in your prompts to tell Cursor which directories to focus on. This helps the AI reason about your code more effectively without getting bogged down in irrelevant files.

5. Don’t Forget to Use @Web

If you run into a problem, there’s a good chance someone else has already discussed it online. Use @Web in your prompts to have Cursor search the web for recent discussions and solutions that can help you out.

6. When in Doubt, Read the Code

This might seem obvious, but sometimes Cursor overlooks simple things. I’ve found that taking a moment to read the code myself can help me spot issues like using Rails credentials when I should be using a dotenv file.

7. Commit Your Code Often—Seriously

I learned this the hard way. In my first week with Cursor, I lost about three hours of uncommitted work when my computer went to sleep. When I woke it up, all the changed files were gone. This doesn’t seem to happen with committed code, so commit your work as soon as you can.

8. Let Ctrl+K Be Your Friend

Having Cursor generate commands for you is a huge time-saver. I use Ctrl+K all the time to generate commit messages. It saves me from having to stop and think, which I love.

9. Bootstrap New Projects with a Shell Script

When you’re starting a new project, ask Cursor to write a shell script to generate the project and all its boilerplate. It’s much faster than doing it manually. Or, you know, you could just use Composer.