Antigravity
Where rules, skills, plugins, and MCP must live to be loaded
One lookup table for the folders Antigravity reads for rules, skills, custom agents, plugins, hooks, and MCP, plus what to check when a correctly placed file still doesn't load.
Antigravity does not crawl your whole repository looking for rules. It reads a handful of agreed locations, and a file in the wrong place usually fails silently. This page is a lookup map. After reading it you can decide where a rule, a skill, an MCP configuration, a plugin, or a hook belongs, and you can work through the checks in order when a correctly placed file still isn’t loaded.
This page covers where things go and how they are discovered, not how to write their contents. The examples here were not run; they were only checked against the official pages for directory structure and field names. Where the official pages don’t settle a behavior (for example, whether mcp_config.json is also picked up from the repository root when you start in a subfolder), the page says so and defers to the official page.
Two scopes
Section titled “Two scopes”The official Customization discovery page says Antigravity reads customizations from two scopes:
| Scope | Location | Good for |
|---|---|---|
| Workspace | The .agents/ folder in your project, plus AGENTS.md and GEMINI.md |
Rules and workflows shared with the team and committed with the repository |
| Personal | ~/.gemini/config/ in your home directory, plus ~/.gemini/AGENTS.md and ~/.gemini/GEMINI.md |
Preferences that belong to you and apply to every project |
Personal customizations apply in both the Antigravity App and the Antigravity CLI. Both scopes use the same layout: each path in the table below can live under .agents/ or under ~/.gemini/config/.
The official page adds that Antigravity also recognizes folders named .agent/, _agents/, and _agent/, but recommends .agents/ for new projects.
Directory and file lookup table
Section titled “Directory and file lookup table”Paths below are relative to .agents/ or ~/.gemini/config/.
| Customization | Path | CLI vs. App |
|---|---|---|
| Rules | rules/*.md, AGENTS.md, GEMINI.md |
Both read them; rules with the manual trigger load through an @ mention in the App, and the CLI doesn’t support rule mentions |
| Skills | skills/<name>/SKILL.md |
The CLI also reads ~/.gemini/antigravity-cli/skills/ and ~/.gemini/skills/; the App doesn’t |
| Custom agents | agents/<name>.md or agents/<name>/agent.md |
Both read them |
| Plugins | plugins/<plugin-folder>/ |
Both read them; plugins installed in the App also show up in the CLI’s installed list |
| Hooks | hooks.json |
Both read them; hooks written in the CLI’s settings.json are not loaded |
| MCP servers | mcp_config.json |
Both read them; the CLI’s global file is ~/.gemini/config/mcp_config.json and its workspace file is <workspace>/.agents/mcp_config.json |
A few details that are easy to miss:
AGENTS.mdandGEMINI.mdcan sit in the workspace folder itself or inside.agents/. The personal scope also accepts~/.gemini/config/AGENTS.mdand~/.gemini/config/GEMINI.md.- A plugin folder needs a
plugin.json, either in the folder or in its.antigravity-plugin/or.gemini-plugin/subfolder. A plugin can bundle its own skills, rules, custom agents, hooks, and MCP servers, which load while the plugin is enabled. A plugin’s skills are named<plugin>:<skill>, so they never collide with your own. - Every
.mdfile inrules/must start with YAML frontmatter that declares a validtrigger(always_on,model_decision,glob, ormanual). A missing frontmatter block, or a camelCase value such asalwaysOn, causes the rule to be silently discarded.AGENTS.mdandGEMINI.mduse no frontmatter and are always active. - A skill’s
SKILL.mdalso needs frontmatter, and itsdescriptionis required.
Look upward, never downward
Section titled “Look upward, never downward”What counts as the “workspace folder” depends on the surface:
- App: each folder you add to a project.
- CLI: the folder where you start
agy, plus any folder you add with--add-diror/add-dir.
Antigravity checks the workspace folder and each parent folder up to the repository root (for example, the folder that contains .git). At each level it reads AGENTS.md, GEMINI.md, and the .agents/ folder. If you start the CLI in services/api/, it loads services/api/.agents/ and the .agents/ folder at the repository root.
Two boundaries apply:
- The search stops at the repository root. If the workspace folder isn’t in a repository, only the workspace folder is checked.
- It does not search the subfolders below the workspace folder. If you open the repository root,
src/routes/AGENTS.mdis not loaded, even while the agent reads and edits files in that folder.
In practice: put a rule at the repository root if it should apply everywhere, and start the client in a subfolder if the rule should apply only to that sub-project. Don’t expect the agent to discover a rule by walking into a subfolder.
The one-level depth trap and discovery manifests
Section titled “The one-level depth trap and discovery manifests”Antigravity scans each customization folder one level deep. A skill folder must sit directly inside skills/, and a rule file directly inside rules/. Custom agents follow the same rule: agents/<name>.md and agents/<name>/agent.md load, and deeper ones don’t.
skills/├── add-endpoint/SKILL.md loaded└── database/ └── migrate-schema/SKILL.md skipped: nested one level too deeprules/├── api-conventions.md loaded└── security/ └── api-keys.md skipped: nested one level too deepThere are two fixes: move the item up one level, or name it in a discovery manifest. A manifest is a JSON file that lists customizations stored outside the standard folders or nested deeper than the scan reaches. Manifests add to the standard folders; they don’t replace them.
| Manifest file | Covers |
|---|---|
skills.json |
Skills |
rules.json |
Rules |
agents.json |
Custom agents |
plugins.json |
Plugins |
A manifest can live in one project’s .agents/ folder, or in ~/.gemini/config/ for all your projects. Antigravity reads the manifests in every .agents/ folder between the workspace folder and the repository root. The top-level fields are entries, inherits, and exclude; each item in entries and inherits has path (required), include_only, and exclude.
{ "entries": [ { "path": ".agents/skills", "include_only": ["database/migrate-schema"] } ]}Rules from the official page to keep in mind when writing a manifest:
- In a project manifest, a relative
pathstarts at the folder that contains.agents/; if it isn’t found there, Antigravity tries the repository root. In a personal manifest, relative paths inentriesstart at~/.gemini/config/. ~is not expanded, so write paths in your home directory as absolute paths.include_onlyandexcludematch by name or relative path (for exampleload-test,api-keys.md, ordatabase/migrate-schema). Wildcards are not supported;load-*does not matchload-test.- A rule listed in
rules.jsonkeeps its own frontmatter, so itstriggerstill applies. - The official page also describes a
.gemini/config.jsonfile at the repository root whosepersonal_customization_dirsetting lets each person load customizations from their own folder inside the repository; see the official page for details.
When names collide: rules don’t replace each other, and every rule found is loaded. For two skills or two custom agents with the same name, only one is kept, in this priority order: your personal folder inside the repository (if the repository sets one up), the workspace, your personal ~/.gemini/config/, and built-in items. The CLI is the exception: skills in ~/.gemini/antigravity-cli/skills/ and ~/.gemini/skills/ take priority over all of these, and a manifest exclude list can’t hide them.
How GEMINI.md, AGENTS.md, and .agents/rules/ relate
Section titled “How GEMINI.md, AGENTS.md, and .agents/rules/ relate”All three are “rules” and are loaded the same way. The official Rules page says rules are cumulative: Antigravity combines everything it finds into the prompt rather than replacing one with another. They differ in format and in how they are triggered:
| Location | Frontmatter | Trigger | Good for |
|---|---|---|---|
AGENTS.md, GEMINI.md |
Not used | Always active (always_on) |
Repository-wide invariants, acceptance commands, stop conditions |
.agents/rules/*.md |
Required, with a valid trigger |
One of always_on, model_decision, glob, manual |
Per-module details that should load conditionally |
The Rules page lists these discovery locations: <dir>/AGENTS.md or <dir>/GEMINI.md, <dir>/.agents/AGENTS.md or <dir>/.agents/GEMINI.md, and <dir>/.agents/rules/*.md, where <dir> is the workspace folder and each of its parent folders.
For choosing between them, the official Rules page suggests putting always-active content that needs no frontmatter directly in AGENTS.md. The page describes GEMINI.md the same way as AGENTS.md (no frontmatter, always active), so a project that already uses GEMINI.md, or a repository migrated from Gemini CLI, doesn’t need to rename it. Don’t write the same constraint into both AGENTS.md and GEMINI.md: both are loaded, and you will update one and forget the other. For content and examples, see GEMINI.md project context.
Two more limits apply; take the exact numbers from the official Rules page. A single rule file over the size limit is truncated, and all active global rules share one token budget, so when the total is exceeded the largest rule files are demoted to a “path plus description” pointer that the agent reads on demand.
What the CLI and the App read differently
Section titled “What the CLI and the App read differently”| Item | CLI | App |
|---|---|---|
| Workspace folders | The folder where you start agy, plus folders from --add-dir and /add-dir |
Each folder added to the project |
| Personal skills | Reads ~/.gemini/config/skills/, and also ~/.gemini/antigravity-cli/skills/ and ~/.gemini/skills/ |
Reads only ~/.gemini/config/skills/ |
| A personal skill usable in both | Put it in ~/.gemini/config/skills/ |
Put it in ~/.gemini/config/skills/ |
| Checking what loaded | /skills, /agents, /hooks, /mcp, /plugin |
The Customizations section in project Settings, or Customizations > Installed in the sidebar |
| Rules list | The official pages list no command for it; check the start folder and file paths | Filter by type in the interfaces above |
manual rules |
Rule mentions aren’t supported | Load with an @ mention |
This is the usual reason a repository works in the App but is missing something in the CLI, or the other way around. Reads in the Antigravity IDE and editor extensions differ slightly from the above; follow the official pages.
Minimal example: a deliberately too-deep project
Section titled “Minimal example: a deliberately too-deep project”The synthetic project demo-notes has a .git at its root. The goal is to make three things load. You may change only .agents/ and the rule files at the project root.
Initial layout (all three items are misplaced):
demo-notes/├── .git/├── AGENTS.md├── .agents/│ ├── rules/│ │ ├── style.md│ │ └── docs/│ │ └── citations.md│ └── skills/│ └── docs/│ └── check-links/│ └── SKILL.md└── notes/ └── drafts/ └── GEMINI.mdAssume rules/style.md and citations.md both have valid frontmatter. After starting agy in demo-notes/, the official rules predict this result:
| File | Loaded | Why |
|---|---|---|
AGENTS.md |
Yes | It’s in the workspace folder itself |
.agents/rules/style.md |
Yes | It sits directly inside rules/ |
.agents/rules/docs/citations.md |
No | Nested one level too deep |
.agents/skills/docs/check-links/ |
No | Nested one level too deep |
notes/drafts/GEMINI.md |
No | It’s below the workspace folder, and Antigravity doesn’t search downward |
This is an expected failure that checks your understanding of discovery. Ask the agent to restate the rules it sees (without modifying files), then run /skills; check-links should not appear.
The fixes use a different approach for each of the three:
-
Move the rule up one level: move
citations.mdto.agents/rules/citations.md. -
Name the skill in a manifest and leave the folders where they are. Create
.agents/skills.json:{"entries": [{ "path": ".agents/skills", "include_only": ["docs/check-links"] }]} -
A
GEMINI.mdin a subfolder is not discovered automatically: merge its content into a rule at the repository root. If it only matters while drafting, use.agents/rules/drafts.mdwithtrigger: model_decisionand a one-linedescription, so the agent reads it on demand when a task matches.
Verify again after fixing: rules are reread before each turn. In the CLI, run /skills reload or start a new conversation, then run /skills to confirm check-links appears and check the path it shows.
Verification and failure recovery
Section titled “Verification and failure recovery”When changes take effect. The official page says Antigravity rereads rules and skills before each turn, so a new or edited file applies to your next message without a restart. In the CLI, the /skills list and the slash commands update only after /skills reload or a new conversation. The App refreshes its lists when you open Settings or the Customizations page.
If something doesn’t load, check in this order (taken from the official checklist):
- Location: the file is in one of the folders listed above, in the workspace folder or a parent folder, without crossing the repository root.
- Depth: the item sits one level inside its folder, or a manifest names it.
- File name: skills use
SKILL.md; rules and custom agents end in.md; MCP configs usemcp_config.json; each plugin has aplugin.json. - Frontmatter:
SKILL.mdand every file inrules/has frontmatter, and each rule’striggeris valid. - Manifest: the JSON is valid, paths are absolute or relative to the right folder, no
excludematches the item, and no wildcard is used. - Name conflicts: no other skill or custom agent with the same name has higher priority, especially in the CLI’s two dedicated skill folders.
How to verify. In the CLI, use /skills, /agents, /hooks, /mcp, and /plugin to check each category. In the App, look in the Customizations section of Settings, and hover over a Global badge under Installed to see where an item came from. Rules have no CLI list command, so ask the agent to restate one distinctive, low-risk rule and tell you which file it came from.
MCP and hooks. What this page can confirm is their file names and scope locations. How mcp_config.json is resolved between the repository root and a subfolder you started in isn’t spelled out: the official MCP page only names <workspace>/.agents/mcp_config.json, so follow the official page and use /mcp to see whether the server actually appears. For whether hooks need a restart after editing, see Run automatic checks before and after tool calls with hooks.
Safety boundary. The .agents/ folder, hooks.json, and mcp_config.json in a project are shared with the repository, and the scripts and servers they name run as you. After cloning an unfamiliar repository, review these files before starting an agent in it. Don’t put secrets in mcp_config.json or rule files; use YOUR_API_KEY in examples.
Next steps
Section titled “Next steps”- Write project rules: GEMINI.md project context.
- Turn repeatable workflows into skills and slash commands: Custom CLI commands.
- Connect external tools and run a revocation test: MCP and plugins.
- Run checks before and after tool calls: Run automatic checks before and after tool calls with hooks.
- Move old Gemini CLI folders over: Migrate from Gemini CLI to Antigravity CLI.
- Compare the CLI, App, and IDE entry points: Choosing an Antigravity surface.