Skip to content

fix(antigravity): trigger frontmatter for CLI project rules, skill disable-slash-command/metadata passthrough - #3276

Merged
dyoshikawa merged 5 commits into
mainfrom
resolve-issue-2666-antigravity-followups
Oct 2, 2026
Merged

dyoshikawa merged 5 commits into
mainfrom
resolve-issue-2666-antigravity-followups

Conversation

@dyoshikawa

@dyoshikawa dyoshikawa commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Refs #2666

Resolves the sub-gaps of #2666 that map cleanly onto existing rulesync features. The rest of the issue is explained below and stays open.

Changes

rules (antigravity-cli, project): non-root rules now carry trigger frontmatter

Antigravity's rules docs say: "Every .md file inside rules/ must start with YAML frontmatter declaring a valid trigger". A file without one is one that "Antigravity silently discards". The CLI tab lists .agents/rules/*.md as a CLI surface. Until now AntigravityCliRule wrote project non-root rules as bare markdown, so every non-root rule was dropped for CLI-only users. When both Antigravity targets were enabled, the IDE's triggers were also overwritten, depending on target order.

  • Project non-root rules now go through the same trigger strategies as the IDE adapter, and as the CLI's own global ~/.gemini/config/rules/ files already do. A plain rule becomes always_on, and specific globs become glob.
  • antigravity-ide and antigravity-cli now write byte-identical files to the shared .agents/rules/ tree. A test checks this.
  • Import maps the frontmatter back to canonical globs / antigravity. A legacy file with no frontmatter, written by an older rulesync, still imports as an always-applied rule.
  • Root files (AGENTS.md, ~/.gemini/GEMINI.md) stay plain, because the docs exempt them from frontmatter.
  • Because the CLI now loads those trigger-tagged files itself, the antigravity-cli project root AGENTS.md no longer carries a rule reference block (ruleDiscoveryMode: "auto", as for antigravity-ide). Both targets therefore write the same project AGENTS.md too, and a rules-processor test checks this.

skills (antigravity-ide / antigravity-cli / antigravity-plugin): disable-slash-command and metadata

Before this change, AntigravitySharedSkill wrote and imported only name / description. Two flags were affected:

  • CLI 1.1.12 added disable-slash-command: true, which hides a skill from the / menu but leaves it model-invocable.
  • CLI 1.1.20 renders metadata.icon.

Neither could be authored, and both were lost on import (CLI CHANGELOG).

  • The new antigravity-ide / antigravity-cli sections on the rulesync skill frontmatter carry disable-slash-command and metadata. antigravity-plugin reads the antigravity-ide section, following the existing plugin convention in docs/guide/plugin-packaging.md.
  • Design choice (the issue left this open): the existing root-level user-invocable: false is reused as the shared default and maps to disable-slash-command: true. That root key already has the same meaning ("hide from the / menu, keep model access") for many tools, and Devin already maps it onto its own native field. A section's disable-slash-command overrides it. Root metadata is the default, and a section metadata replaces it outright, as resolveMetadata does for other tools.
  • Both targets write the shared project .agents/skills/ tree, so there each reads the antigravity-ide section and then the antigravity-cli section merged (the CLI wins). The output then never depends on generation order. This is the same rule the Antigravity MCP and subagent features use for their shared files. In the global trees, each target reads only its own section.
  • On import, every SKILL.md key beyond name / description is kept under the target's section, so generate → import → generate gives the same output.

Small cleanup

The AntigravitySubagentFrontmatterSchema docstring still described the per-kind inheritMcp key as current. CLI 1.1.14 replaced it with inheritCustomizations. The docstring now says so and lists the other release-note-only passthrough keys.

Docs: docs/reference/supported-tools.md (CLI rules no longer "plain markdown") and the skill frontmatter sample in docs/reference/file-formats.md.

Not implemented here, and why

  • Sidecars (sidecar.json): rulesync has no matching feature dimension. Sidecars are global-only or plugin-only (~/.gemini/config/sidecars/<id>/, with no workspace location), and they only run once the user enables them per ID in the shared ~/.gemini/config/config.json. Adding a new feature dimension is a product decision and is out of scope for a follow-up fix.
  • plugin.json for antigravity-plugin: this is intentionally not emitted. docs/guide/plugin-packaging.md states the cross-target policy: "Rulesync manages the selected component files but does not create or modify plugin metadata … Keep the required upstream manifest in the plugin directory", and it lists Antigravity's plugin.json. None of the *-plugin targets (Claude Code, AugmentCode, ZCode, Vibe, Devin) writes its manifest.
  • Plugin rules.json: this item is obsolete. The rules docs now describe rules.json as an optional aggregator, and they say plugin rules under plugins/<name>/rules/ are activated automatically.
  • .geminiignore → .antigravityignore: this is not switched. The only primary source is one CLI 1.1.16 changelog line that names .antigravityignore. No docs page names either file, and nothing shows that .geminiignore is no longer read; upstream issue ci(deps): bump actions/setup-node from 4 to 5 in the all-actions group #309 expects both to be honored. Renaming the output would orphan existing .geminiignore files on that evidence.
  • unsandboxed(...) deprecation warning: this is not added. /docs/permissions still lists unsandboxed as a supported action in its Windows section and in its "CLI fine-grained permissions" table, so a warning would contradict the current docs.
  • Workflows → skills (workflows retire on 2026-11-01): this one is verified and maps to an existing feature (the commands-on-skills precedent in command-skill-ownership.ts). It changes the commands output of every Antigravity user and the global paths, so it needs its own PR.
  • subprojectPath nesting, the trigger on the plugin's rules/AGENTS.md, antigravity-ide global non-root rules: these are follow-ups. The plugin AGENTS.md item is rated low confidence in the issue itself. The IDE global rules need IDE↔CLI coordination on the shared ~/.gemini/config/rules/.

Tests

  • antigravity-cli-rule.test.ts: trigger frontmatter on project non-root rules, always_on default, byte equality with the IDE output, glob round trip, frontmatter-less legacy import, invalid frontmatter rejection.
  • antigravity-cli-skill.test.ts / antigravity-ide-skill.test.ts: root user-invocable mapping, section override, metadata, section isolation between targets, import → regenerate round trip.
  • pnpm cicheck passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y4MwhqMc6s4ct5MzMReGJj

…ss skill flags through

- antigravity-cli: project non-root rules in .agents/rules/ now carry trigger frontmatter, since Antigravity silently discards a rules/*.md file without a valid trigger. The CLI and IDE now write identical files to the shared tree.

- antigravity-ide / antigravity-cli / antigravity-plugin skills: emit disable-slash-command (from the root user-invocable: false or the target section) and metadata (root or section), and keep extra SKILL.md keys under the target section on import.

- Refresh the stale inheritMcp note on the Antigravity subagent schema.

Refs #2666

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_01Y4MwhqMc6s4ct5MzMReGJj
…IDE and CLI

The antigravity-cli project root no longer carries a rule reference block, since the CLI loads trigger-tagged .agents/rules files itself, matching antigravity-ide. Both targets now merge the antigravity-ide and antigravity-cli skill sections (CLI wins) on the shared project .agents/skills tree so generation order never changes SKILL.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_01Y4MwhqMc6s4ct5MzMReGJj
@dyoshikawa
dyoshikawa merged commit 4657e6e into main Oct 2, 2026
9 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-2666-antigravity-followups branch October 2, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant