Skip to content
Ultracite
Esc
↑↓navigate↵open⌘Jpreview

Antigravity CLI reads AGENTS.md as it goes

Antigravity CLI (agy) reads AGENTS.md at the repository root and in every folder between a file it touches and the root, so Ultracite’s rules need no extra setup. There’s no Ultracite hook for it: the agent runs ultracite fix and ultracite check because the rules say to, and a command(npx ultracite) allow rule lets it do that without asking.

Antigravity CLI by GoogleChecked against Antigravity CLI 1.3.1

# Ultracite Code Standards

This project uses **Ultracite**, a zero-config preset that enforces strict code quality standards through automated formatting and linting.

## Quick Reference

- **Format code**: `npx ultracite fix`
- **Check for issues**: `npx ultracite check`
- **Diagnose setup**: `npx ultracite doctor`

Oxlint + Oxfmt (the underlying engine) provides robust linting and formatting. Most issues are automatically fixable.

…
Ultracite’s rules
Where Antigravity CLI looks for instructions
  1. 1~/.gemini/AGENTS.mdYour rules for every project. ~/.gemini/GEMINI.md and the modular global rules load too.
  2. 2AGENTS.mdUltraciteAt the repository root, where init writes Ultracite’s rules. A GEMINI.md there is read the same way.
  3. 3.agents/rules/*.mdModular rules, each with a trigger in its frontmatter that decides when it loads.
  4. 4src/**/AGENTS.mdWhen the agent reads or edits a file, it loads the rules in each folder between that file and the workspace root.
  5. 5~/.gemini/antigravity-cli/plugins/*/rules/Rules packaged with installed plugins activate automatically.

How Antigravity CLI reads the rules

Antigravity CLI combines every rule it finds, global and per directory, instead of picking one; when instructions conflict, the more specific directory wins. AGENTS.md needs no frontmatter and is always on for its directory.

Per-file limit
24,000 bytes per rule file, after includes; anything past that is cut. Ultracite’s rules are about 5 KB.
Total budget
Global and always-on rules share 20,000 tokens. Over that, the largest files become pointers the agent reads on demand.
Always on
AGENTS.md and GEMINI.md take no frontmatter and stay active for their whole directory.
Includes
@[label](path) inlines another file before the size check; a bare @path only points the agent at it.
Global
~/.gemini/AGENTS.md or GEMINI.md, plus modular rules in ~/.gemini/config/rules/ and ~/.gemini/antigravity-cli/rules/.
Flat folder
Only direct children of .agents/rules/ load. Nested folders need an entry in .agents/rules.json.

Allow ultracite once in your settings

The rules tell the agent to run ultracite fix and ultracite check with its run_command tool, and your permission rules decide whether it asks first. In a headless run (agy -p), a shell command that needs approval is skipped and the run still exits 0, so allow ultracite ahead of time.

{
  "permissions": {
    "allow": ["command(npx ultracite)"]
  }
}
  1. 01The agent writes a file with write_to_file, replace_file_content or multi_replace_file_content.
  2. 02Following AGENTS.md, it calls run_command with npx ultracite fix or npx ultracite check.
  3. 03A command(npx ultracite) allow rule lets it run without a prompt; without one, you’re asked, or a headless run skips it.
  4. 04The agent reads the linter’s output and fixes what’s left.

Worth knowing about Antigravity CLI

  • Hooks run, but can’t report back

    Antigravity CLI runs PostToolUse hooks from .agents/hooks.json, matched against tool names such as write_to_file|replace_file_content|multi_replace_file_content. The documented output is an empty object, so there’s no documented way for a post-edit hook to tell the agent what’s left. Ultracite doesn’t set one up.

  • Modular rules need a trigger

    Files in .agents/rules/ need a trigger in their frontmatter: always_on, model_decision, glob or manual. A missing or misspelled trigger drops the rule silently. Ultracite’s rules apply everywhere, so they stay in AGENTS.md.

  • Headless runs for CI

    agy -p exits 0 when it produces a response and non-zero when it can’t, and --output-format json adds status and error fields for scripts. A denied tool doesn’t fail the run, so a CI job should read the stderr notices too.

  • The Ultracite skill

    Antigravity CLI loads workspace skills from .agents/skills/ and global ones from ~/.gemini/antigravity-cli/skills/. init installs the Ultracite skill into .agents/skills/, so the CLI finds it.

Antigravity CLI questions, answered

Does Antigravity CLI read AGENTS.md?
Yes, with no setup. It reads AGENTS.md or GEMINI.md at the repository root and in subdirectories, plus ~/.gemini/AGENTS.md for every project, and combines them, with the more specific directory winning on conflicts.
Does Antigravity CLI support hooks?
Yes: PreToolUse, PostToolUse, PreInvocation, PostInvocation and Stop, in .agents/hooks.json or ~/.gemini/config/hooks.json, and /hooks lists what’s loaded. Ultracite doesn’t configure them, because a PostToolUse hook has no documented way to hand lint results to the agent.
Why didn’t agy -p run the linter?
In headless mode, a shell command that needs approval is soft-denied: the run carries on, exits 0 and prints a notice to stderr. Add command(npx ultracite) to permissions.allow in ~/.gemini/antigravity-cli/settings.json.
I used Ultracite with Gemini CLI. What changes?
Nothing for the rules: Google’s migration guide says both CLIs read the same GEMINI.md and AGENTS.md, and Antigravity CLI doesn’t need a context.fileName setting to find AGENTS.md. Workspace skills are the exception; move them from .gemini/skills/ to .agents/skills/.
Is Ultracite’s AGENTS.md too big for Antigravity?
No. Antigravity truncates a rule file past 24,000 bytes and gives global and always-on rules a shared 20,000-token budget; Ultracite’s rules are about 5 KB. Past the budget, the largest files turn into pointers the agent reads on demand.

Ship less slop

One command sets up your linter, formatter, editor and agents. Works with Oxlint, Biome and ESLint.