Skip to content

Commit db39505

Browse files
authored
Merge pull request #1877 from dyoshikawa/resolve-scrap-issue-1820-antigravity-cli-agentsmd
feat(antigravity-cli): emit root rules as AGENTS.md instead of GEMINI.md
2 parents abc25ce + 55a5d91 commit db39505

12 files changed

Lines changed: 57 additions & 22 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ The tables below show whether each tool supports a given feature (✅ = supporte
118118
### Deprecation notes
119119

120120
- **Gemini CLI (`geminicli`)** — Google is retiring Gemini CLI on **June 18, 2026**, when it stops serving requests for Google AI Pro/Ultra and free Gemini Code Assist for individuals (Enterprise plans are unaffected). The successor is the **Antigravity CLI (`antigravity-cli`)**. `geminicli` is **not** removed from rulesync — Enterprise access continues and existing `GEMINI.md`/`.gemini/` repositories still rely on it — but new projects should prefer `antigravity-cli`. See the [Gemini CLI → Antigravity CLI migration guide](https://dyoshikawa.github.io/rulesync/guide/geminicli-to-antigravity-cli).
121-
- **Google Antigravity (`antigravity`)** — Antigravity 2.0 splits into two products with separate global config trees: the desktop **`antigravity-ide`** and the **`antigravity-cli`** (`agy`). The legacy `antigravity` target is now a **deprecated alias for `antigravity-ide`** that keeps its original `.agent/` (singular) paths for backward compatibility. Migrate to `antigravity-ide` (desktop IDE) or `antigravity-cli` (CLI). For project-scope rules, `antigravity-ide` emits the root rule as a plain cross-tool **`AGENTS.md`** at the project root (read by the IDE since v1.20.3, with `GEMINI.md` taking precedence on conflict) and non-root rules under `.agents/rules/`.
121+
- **Google Antigravity (`antigravity`)** — Antigravity 2.0 splits into two products with separate global config trees: the desktop **`antigravity-ide`** and the **`antigravity-cli`** (`agy`). The legacy `antigravity` target is now a **deprecated alias for `antigravity-ide`** that keeps its original `.agent/` (singular) paths for backward compatibility. Migrate to `antigravity-ide` (desktop IDE) or `antigravity-cli` (CLI). For project-scope rules, **both `antigravity-ide` and `antigravity-cli`** emit the root rule as a plain cross-tool **`AGENTS.md`** at the project root (the Gemini-lineage discovery order is `AGENTS.md`, `CONTEXT.md`, `GEMINI.md`; the IDE has read `AGENTS.md` since v1.20.3) and non-root rules under `.agents/rules/`.
122122

123123
Some features accept per-feature options (e.g., Claude Code's `ignore` feature supports `fileMode: "local"` to write to `settings.local.json` instead of `settings.json`). See [Configuration > Per-feature options](https://dyoshikawa.github.io/rulesync/guide/configuration#per-feature-options) for details.
124124

docs/guide/geminicli-to-antigravity-cli.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ transition.
3131

3232
| Feature | `geminicli` | `antigravity-cli` |
3333
| ----------- | -------------------------------------- | ------------------------------------------------------------------------------------------- |
34-
| rules | root `GEMINI.md` + `.gemini/memories/` | root `GEMINI.md` + `.agents/rules/`; global `~/.gemini/GEMINI.md` |
34+
| rules | root `GEMINI.md` + `.gemini/memories/` | root `AGENTS.md` + `.agents/rules/`; global `~/.gemini/GEMINI.md` |
3535
| skills | `.gemini/skills/` | `.agents/skills/`; global `~/.gemini/antigravity-cli/skills/` |
3636
| mcp | `.gemini/settings.json` (`mcpServers`) | `.agents/mcp_config.json`; global `~/.gemini/config/mcp_config.json` (shared config dir) |
3737
| hooks | `.gemini/` (Gemini hook shape) | `.agents/hooks.json`; global `~/.gemini/config/hooks.json` (Claude-Code-like matcher shape) |
@@ -41,6 +41,13 @@ transition.
4141

4242
### Notable differences
4343

44+
- **Root rules file**: `antigravity-cli` emits the project root rule as the
45+
cross-tool **`AGENTS.md`** (matching `antigravity-ide`), not `GEMINI.md`. The
46+
CLI reads both, with the Gemini-lineage discovery order `AGENTS.md`,
47+
`CONTEXT.md`, `GEMINI.md`. If you previously generated `antigravity-cli` output
48+
and have a generated root `GEMINI.md`, rulesync no longer manages it — delete
49+
the stale `GEMINI.md` manually after regenerating. Global scope is unchanged
50+
(`~/.gemini/GEMINI.md`).
4451
- **MCP**: Antigravity uses `serverUrl` (not `url`) for HTTP servers and honors
4552
a `disabledTools` array. Rulesync emits the Antigravity-compatible shape
4653
automatically.

docs/reference/supported-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ Rulesync supports both **generation** and **import** for All of the major AI cod
4545
## Deprecation notes
4646

4747
- **Gemini CLI (`geminicli`)** — Google is retiring Gemini CLI on **June 18, 2026**, when it stops serving requests for Google AI Pro/Ultra and free Gemini Code Assist for individuals (Enterprise plans are unaffected). The successor is the **Antigravity CLI (`antigravity-cli`)**. `geminicli` is **not** removed from rulesync — Enterprise access continues and existing `GEMINI.md`/`.gemini/` repositories still rely on it — but new projects should prefer `antigravity-cli`. See the [Gemini CLI → Antigravity CLI migration guide](../guide/geminicli-to-antigravity-cli.md).
48-
- **Google Antigravity (`antigravity`)** — Antigravity 2.0 splits into two products: the desktop **`antigravity-ide`** and the **`antigravity-cli`** (`agy`). The legacy `antigravity` target is now a **deprecated alias for `antigravity-ide`** that keeps its original `.agent/` (singular) paths for backward compatibility. Migrate to `antigravity-ide` (desktop IDE) or `antigravity-cli` (CLI). As of Antigravity 2.0 the IDE reads its global MCP config and skills from the shared `~/.gemini/config/` tree — `~/.gemini/config/mcp_config.json` and `~/.gemini/config/skills/`, matching the current [MCP](https://antigravity.google/docs/mcp) and [Skills](https://antigravity.google/docs/skills) docs. The `antigravity-cli` global MCP config also lives in the shared `~/.gemini/config/mcp_config.json`, while the CLI keeps its own global skills tree at `~/.gemini/antigravity-cli/skills/`. Both targets also intentionally **share** the global rule file `~/.gemini/GEMINI.md` and the global hooks file `~/.gemini/config/hooks.json` — enabling both targets in `--global` mode writes those shared files once. For project-scope rules, `antigravity-ide` emits the root rule as a plain cross-tool **`AGENTS.md`** at the project root (read by the Antigravity IDE since v1.20.3 in addition to `GEMINI.md`, which takes precedence on conflict) and non-root rules under `.agents/rules/` with trigger frontmatter.
48+
- **Google Antigravity (`antigravity`)** — Antigravity 2.0 splits into two products: the desktop **`antigravity-ide`** and the **`antigravity-cli`** (`agy`). The legacy `antigravity` target is now a **deprecated alias for `antigravity-ide`** that keeps its original `.agent/` (singular) paths for backward compatibility. Migrate to `antigravity-ide` (desktop IDE) or `antigravity-cli` (CLI). As of Antigravity 2.0 the IDE reads its global MCP config and skills from the shared `~/.gemini/config/` tree — `~/.gemini/config/mcp_config.json` and `~/.gemini/config/skills/`, matching the current [MCP](https://antigravity.google/docs/mcp) and [Skills](https://antigravity.google/docs/skills) docs. The `antigravity-cli` global MCP config also lives in the shared `~/.gemini/config/mcp_config.json`, while the CLI keeps its own global skills tree at `~/.gemini/antigravity-cli/skills/`. Both targets also intentionally **share** the global rule file `~/.gemini/GEMINI.md` and the global hooks file `~/.gemini/config/hooks.json` — enabling both targets in `--global` mode writes those shared files once. For project-scope rules, **both `antigravity-ide` and `antigravity-cli`** emit the root rule as a plain cross-tool **`AGENTS.md`** at the project root (the Gemini-lineage discovery order is `AGENTS.md`, `CONTEXT.md`, `GEMINI.md`; the IDE has read `AGENTS.md` since v1.20.3) and non-root rules under `.agents/rules/` (the IDE adds trigger frontmatter to non-root rules; the CLI keeps them as plain markdown).

skills/rulesync/geminicli-to-antigravity-cli.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ transition.
3131

3232
| Feature | `geminicli` | `antigravity-cli` |
3333
| ----------- | -------------------------------------- | ------------------------------------------------------------------------------------------- |
34-
| rules | root `GEMINI.md` + `.gemini/memories/` | root `GEMINI.md` + `.agents/rules/`; global `~/.gemini/GEMINI.md` |
34+
| rules | root `GEMINI.md` + `.gemini/memories/` | root `AGENTS.md` + `.agents/rules/`; global `~/.gemini/GEMINI.md` |
3535
| skills | `.gemini/skills/` | `.agents/skills/`; global `~/.gemini/antigravity-cli/skills/` |
3636
| mcp | `.gemini/settings.json` (`mcpServers`) | `.agents/mcp_config.json`; global `~/.gemini/config/mcp_config.json` (shared config dir) |
3737
| hooks | `.gemini/` (Gemini hook shape) | `.agents/hooks.json`; global `~/.gemini/config/hooks.json` (Claude-Code-like matcher shape) |
@@ -41,6 +41,13 @@ transition.
4141

4242
### Notable differences
4343

44+
- **Root rules file**: `antigravity-cli` emits the project root rule as the
45+
cross-tool **`AGENTS.md`** (matching `antigravity-ide`), not `GEMINI.md`. The
46+
CLI reads both, with the Gemini-lineage discovery order `AGENTS.md`,
47+
`CONTEXT.md`, `GEMINI.md`. If you previously generated `antigravity-cli` output
48+
and have a generated root `GEMINI.md`, rulesync no longer manages it — delete
49+
the stale `GEMINI.md` manually after regenerating. Global scope is unchanged
50+
(`~/.gemini/GEMINI.md`).
4451
- **MCP**: Antigravity uses `serverUrl` (not `url`) for HTTP servers and honors
4552
a `disabledTools` array. Rulesync emits the Antigravity-compatible shape
4653
automatically.

skills/rulesync/supported-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ Rulesync supports both **generation** and **import** for All of the major AI cod
4545
## Deprecation notes
4646

4747
- **Gemini CLI (`geminicli`)** — Google is retiring Gemini CLI on **June 18, 2026**, when it stops serving requests for Google AI Pro/Ultra and free Gemini Code Assist for individuals (Enterprise plans are unaffected). The successor is the **Antigravity CLI (`antigravity-cli`)**. `geminicli` is **not** removed from rulesync — Enterprise access continues and existing `GEMINI.md`/`.gemini/` repositories still rely on it — but new projects should prefer `antigravity-cli`. See the [Gemini CLI → Antigravity CLI migration guide](../guide/geminicli-to-antigravity-cli.md).
48-
- **Google Antigravity (`antigravity`)** — Antigravity 2.0 splits into two products: the desktop **`antigravity-ide`** and the **`antigravity-cli`** (`agy`). The legacy `antigravity` target is now a **deprecated alias for `antigravity-ide`** that keeps its original `.agent/` (singular) paths for backward compatibility. Migrate to `antigravity-ide` (desktop IDE) or `antigravity-cli` (CLI). As of Antigravity 2.0 the IDE reads its global MCP config and skills from the shared `~/.gemini/config/` tree — `~/.gemini/config/mcp_config.json` and `~/.gemini/config/skills/`, matching the current [MCP](https://antigravity.google/docs/mcp) and [Skills](https://antigravity.google/docs/skills) docs. The `antigravity-cli` global MCP config also lives in the shared `~/.gemini/config/mcp_config.json`, while the CLI keeps its own global skills tree at `~/.gemini/antigravity-cli/skills/`. Both targets also intentionally **share** the global rule file `~/.gemini/GEMINI.md` and the global hooks file `~/.gemini/config/hooks.json` — enabling both targets in `--global` mode writes those shared files once. For project-scope rules, `antigravity-ide` emits the root rule as a plain cross-tool **`AGENTS.md`** at the project root (read by the Antigravity IDE since v1.20.3 in addition to `GEMINI.md`, which takes precedence on conflict) and non-root rules under `.agents/rules/` with trigger frontmatter.
48+
- **Google Antigravity (`antigravity`)** — Antigravity 2.0 splits into two products: the desktop **`antigravity-ide`** and the **`antigravity-cli`** (`agy`). The legacy `antigravity` target is now a **deprecated alias for `antigravity-ide`** that keeps its original `.agent/` (singular) paths for backward compatibility. Migrate to `antigravity-ide` (desktop IDE) or `antigravity-cli` (CLI). As of Antigravity 2.0 the IDE reads its global MCP config and skills from the shared `~/.gemini/config/` tree — `~/.gemini/config/mcp_config.json` and `~/.gemini/config/skills/`, matching the current [MCP](https://antigravity.google/docs/mcp) and [Skills](https://antigravity.google/docs/skills) docs. The `antigravity-cli` global MCP config also lives in the shared `~/.gemini/config/mcp_config.json`, while the CLI keeps its own global skills tree at `~/.gemini/antigravity-cli/skills/`. Both targets also intentionally **share** the global rule file `~/.gemini/GEMINI.md` and the global hooks file `~/.gemini/config/hooks.json` — enabling both targets in `--global` mode writes those shared files once. For project-scope rules, **both `antigravity-ide` and `antigravity-cli`** emit the root rule as a plain cross-tool **`AGENTS.md`** at the project root (the Gemini-lineage discovery order is `AGENTS.md`, `CONTEXT.md`, `GEMINI.md`; the IDE has read `AGENTS.md` since v1.20.3) and non-root rules under `.agents/rules/` (the IDE adds trigger frontmatter to non-root rules; the CLI keeps them as plain markdown).

src/cli/commands/gitignore-entries.test.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,18 @@ describe("filterGitignoreEntries", () => {
128128
// non-root rules under .agents/rules/.
129129
expect(result).toContain("**/AGENTS.md");
130130
expect(result).toContain("**/.agents/rules/");
131-
// The CLI-only GEMINI.md must NOT be included for the IDE target.
131+
// GEMINI.md (a geminicli-only entry) must NOT be included for this target.
132+
expect(result).not.toContain("**/GEMINI.md");
133+
});
134+
135+
it("should include the root AGENTS.md and .agents/rules entries for antigravity-cli", () => {
136+
const result = filterGitignoreEntries({ logger, targets: ["antigravity-cli"] });
137+
138+
// antigravity-cli now emits the project root rule as AGENTS.md (matching
139+
// antigravity-ide), not GEMINI.md, plus non-root rules under .agents/rules/.
140+
expect(result).toContain("**/AGENTS.md");
141+
expect(result).toContain("**/.agents/rules/");
142+
// The project root is no longer GEMINI.md (that is a geminicli-only entry).
132143
expect(result).not.toContain("**/GEMINI.md");
133144
});
134145

src/cli/commands/gitignore-entries.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const GITIGNORE_ENTRY_REGISTRY: ReadonlyArray<GitignoreEntryTag> = [
5252

5353
// AGENTS.md
5454
{
55-
target: ["agentsmd", "amp", "antigravity-ide", "pi", "vibe", "warp"],
55+
target: ["agentsmd", "amp", "antigravity-cli", "antigravity-ide", "pi", "vibe", "warp"],
5656
feature: "rules",
5757
entry: "**/AGENTS.md",
5858
},
@@ -68,16 +68,15 @@ export const GITIGNORE_ENTRY_REGISTRY: ReadonlyArray<GitignoreEntryTag> = [
6868
{ target: "amp", feature: "skills", entry: "**/.agents/skills/" },
6969

7070
// Antigravity (IDE + CLI, Antigravity 2.0)
71-
// Both targets share the `.agents/` project tree; the IDE additionally writes
72-
// a root `AGENTS.md` (handled by the shared AGENTS.md entry above) and the CLI
73-
// a root `GEMINI.md`. Global-scope paths (under the home directory) are
71+
// Both targets share the `.agents/` project tree and both write a root
72+
// `AGENTS.md` (handled by the shared AGENTS.md entry above). Global-scope
73+
// paths (under the home directory, e.g. `~/.gemini/GEMINI.md`) are
7474
// intentionally not gitignored.
7575
{
7676
target: ["antigravity-ide", "antigravity-cli"],
7777
feature: "rules",
7878
entry: "**/.agents/rules/",
7979
},
80-
{ target: "antigravity-cli", feature: "rules", entry: "**/GEMINI.md" },
8180
{ target: "antigravity-cli", feature: "ignore", entry: "**/.geminiignore" },
8281
{
8382
target: "antigravity-ide",

src/constants/antigravity-cli-paths.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,12 @@ export {
1515

1616
export const ANTIGRAVITY_AGENTS_DIR = ANTIGRAVITY_DIR;
1717

18-
export const ANTIGRAVITY_RULE_FILE_NAME = "GEMINI.md";
18+
// Project-root rules file. The CLI reads the cross-tool `AGENTS.md` standard at
19+
// the workspace root (Gemini-lineage discovery order is `AGENTS.md`,
20+
// `CONTEXT.md`, `GEMINI.md`), so rulesync emits `AGENTS.md` to align with the
21+
// standard and the `antigravity-ide` target.
22+
export const ANTIGRAVITY_RULE_FILE_NAME = "AGENTS.md";
23+
24+
// Global (user-scope) rules file lives in `~/.gemini/` and stays `GEMINI.md`,
25+
// matching the `antigravity-ide` global file and the shared Gemini home config.
26+
export const ANTIGRAVITY_GLOBAL_RULE_FILE_NAME = "GEMINI.md";

src/e2e/e2e-rules.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe("E2E: rules", () => {
2727
{ target: "copilot", outputPath: join(".github", "copilot-instructions.md") },
2828
{ target: "opencode", outputPath: "AGENTS.md" },
2929
{ target: "geminicli", outputPath: "GEMINI.md" },
30-
{ target: "antigravity-cli", outputPath: "GEMINI.md" },
30+
{ target: "antigravity-cli", outputPath: "AGENTS.md" },
3131
{ target: "antigravity-ide", outputPath: "AGENTS.md" },
3232
{ target: "goose", outputPath: ".goosehints" },
3333
{ target: "copilotcli", outputPath: join(".github", "copilot-instructions.md") },
@@ -285,7 +285,7 @@ describe("E2E: rules (import)", () => {
285285
},
286286
{
287287
target: "antigravity-cli",
288-
sourcePath: "GEMINI.md",
288+
sourcePath: "AGENTS.md",
289289
importedFileName: "overview.md",
290290
},
291291
{

src/features/rules/antigravity-cli-rule.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ describe("AntigravityCliRule", () => {
3535
});
3636

3737
describe("getSettablePaths", () => {
38-
it("should return root GEMINI.md and nonRoot .agents/rules for project scope", () => {
38+
it("should return root AGENTS.md and nonRoot .agents/rules for project scope", () => {
3939
const paths = AntigravityCliRule.getSettablePaths();
4040

4141
expect(paths.root.relativeDirPath).toBe(".");
42-
expect(paths.root.relativeFilePath).toBe("GEMINI.md");
42+
expect(paths.root.relativeFilePath).toBe("AGENTS.md");
4343
const nonRoot = (paths as { nonRoot: { relativeDirPath: string } }).nonRoot;
4444
expect(nonRoot.relativeDirPath).toBe(join(".agents", "rules"));
4545
});
@@ -53,7 +53,7 @@ describe("AntigravityCliRule", () => {
5353
});
5454

5555
describe("fromRulesyncRule", () => {
56-
it("should place a root rule in root GEMINI.md", () => {
56+
it("should place a root rule in root AGENTS.md", () => {
5757
const rulesyncRule = new RulesyncRule({
5858
relativeDirPath: RULESYNC_RELATIVE_DIR_PATH,
5959
relativeFilePath: "overview.md",
@@ -69,7 +69,7 @@ describe("AntigravityCliRule", () => {
6969

7070
expect(cliRule).toBeInstanceOf(AntigravityCliRule);
7171
expect(cliRule.getRelativeDirPath()).toBe(".");
72-
expect(cliRule.getRelativeFilePath()).toBe("GEMINI.md");
72+
expect(cliRule.getRelativeFilePath()).toBe("AGENTS.md");
7373
expect(cliRule.isRoot()).toBe(true);
7474
expect(cliRule.getFileContent().trim()).toBe("# Root Memory\n\nPlain body.");
7575
});

0 commit comments

Comments
 (0)