Using Cursor Rules

Using Cursor Rules

The current state of AI is mixed. It has completely changed my development workflow to be much faster at getting letters and characters into my IDE. But at least for now, those characters are not very good, and it takes a lot of time and effort fighting with AI to write better code or having to manually edit yourself.

I foresee this being an ongoing problem us, engineers, will have to deal with for years to come.

The most important tip is to not get too trigger happy with the tools. Be cautious and intentional with the code you are writing, and AI becomes a super power. This is more of an internal patience you need to develop, but there are some technical ways to make developing with AI better.

Cursor Rules is one of the tools to reign in your AI agent.

About Cursor

Cursor is an AI IDE that was forked from Visual Studio Code. It has quickly become a very popular way to write code using AI.

What are Cursor Rules

When you send a chat message within your Cursor IDE, you are sending a lot more than just the chat message to the AI. In fact, the reason Cursor has been so successful is due to the context they send to the AI.

Context Gathering

Context is just like the definition sounds. It gives the AI more information so it can understand what is going on, and give better results. For example, if you are asking it to make updates to a specific document, Cursor sends the contents of that document to the AI so it can create a better response.

With Cursor Rules, you get to define extra context for your chat messages. These are treated as rules the AI should follow when giving you a response.

Using Cursor Rules

Cursor rules live in a .cursor/rules/ folder within the root of the repo. These rules are structured within an .mdc file, which is a Markdown file with specific frontmatter that Cursor created. Within this markdown file you can add any rules or instructions you want the AI to follow.

.cursor
rules
architecture.mdc
conventions.mdc
test.mdc

We have a list of the most useful rules we’ve found that follow all guide the AI to follow all the standards that the Flutter Kit follows. It should make AI much better at giving you good results that work with the MVVM Architecture.