How to Add Rules to Google Antigravity?

1 min

1. How to Add Rules in Google Antigravity?

Just like Cursor, Google Antigravity also supports Global Rules and Project Rules.

Here’s a step-by-step guide on how to add Global Rules (with screenshots):

  1. Click the three-dot icon in the top right corner of the Agent chat window;
  2. Click on “Customizations”;
  3. Click ”+ Global” - this will create a file called GEMINI.md in the .gemini/ folder under your user directory;
  4. Close the “Global Antigravity Rules File” prompt;
  5. Write your rules in plain text directly in the GEMINI.md file, then save it;
  6. After saving, you can see your updated Global Rules in the Rules section;
  7. To verify, type something like “Please check if the rules are applied?” in the Agent chat. Google Antigravity should confirm that the rules have been applied.
How to add and set up Global Rules in Google Antigravity
How to add and set up Global Rules in Google Antigravity

2. What Are the Common Global Rules?

Here are some useful Global Rules you might want to set:

  1. Agent should reply in your preferred language (e.g., Simplified Chinese);
  2. Code comments should be written in your preferred language;
  3. UI text should follow your project’s i18n settings (or use a default language if not specified).

You can easily convert your existing Cursor project rules to Google Antigravity format. For example, I’ve converted my Cursor project rules for Vue 3 frontend development into Google Antigravity project rules.

Download link: https://www.lanxk.com/files/GEMINI-project-rules-for-vue3-en.md

After downloading, rename the file to GEMINI.md and place it in the .gemini/ folder at your project root.