Agent Rules & AGENTS.md
Antigravity natively discovers and adheres to instructions and constraints defined in standard Markdown rules files.
The Standard: AGENTS.md
Section titled โThe Standard: AGENTS.mdโWhile GEMINI.md is a vendor-specific format, AGENTS.md has emerged as the open, multi-tool industry standard supported across modern AI development environments (Cursor, Codex, Antigravity).
Antigravity treats both file names as first-class citizens.
Project-Level Rules (Automatic Discovery)
Section titled โProject-Level Rules (Automatic Discovery)โPlace an AGENTS.md file at the root of your project:
my-project/โโโ .git/โโโ AGENTS.md <-- Automatically discovered and loadedโโโ src/As you navigate or edit code, the agent walks up from the current working directory to the repository root and loads any AGENTS.md or GEMINI.md files it finds. They apply hierarchically to that directory and all subdirectories.
Global Rules (Machine-Wide)
Section titled โGlobal Rules (Machine-Wide)โGlobal rules default to ~/.gemini/GEMINI.md. To standardize on AGENTS.md across your entire system, you have two approaches:
Option A: Markdown Include Syntax
Section titled โOption A: Markdown Include SyntaxโInside ~/.gemini/GEMINI.md, link to your central rules file:
@[Global Agent Rules](/home/samob/.config/AGENTS.md)(Antigravity automatically resolves and expands @[label](path) includes up to the rules budget).
Option B: Symbolic Link (Cleanest)
Section titled โOption B: Symbolic Link (Cleanest)โReplace the default file with a symlink pointing to your standard configuration:
ln -sf ~/.config/AGENTS.md ~/.gemini/GEMINI.mdWhenever you start a new conversation or launch agy, your global rules are loaded immediately.