Using the new Project Rules for Monorepos

Hey guys!

My team is building a big monorepo with many folders, a lot of technologies and different coding languages. We weren’t sure how to integrate this properly with .cursorrules files (As we basically wanted a different nested file for each folder).

Now that we have the Project Rule feature, would you just make a rule file for each folder and provide it a glob for that folder? Would that be the best approach to handle monorepos?

Thanks in advance!

1 Like

This really depends on your project specifically!

The Composer is able to pick it’s own rules (as long as the globs match) based on the description you give it - you can consider the description more like a statement for the AI to know when to use that rule.

You might use one per folder, or there may be times you want the same rules for a few folders, but I think experimentation (and help from others who have already done so) will be the best route forward here!

1 Like

I’ve experimented with adding @ghuntley’s Cursor Rules Location rule as mentioned in this blogpost but it never ended up creating valid rules files for me.

After a while I ended up creating a prompt that asks Cursor to draft rules files for me. It does so by first analyzing the codebase and identifying top level systems and then asks which of them you want to create rules files for. You can then (and should) edit them to your liking.

It’s not perfect but it did well in some projects I’ve tried.

2 Likes