Repository navigation
fix(antigravity-plugin): give the plugin root rule an always_on trigger - #3546
Merged
Merged
Conversation
Antigravity requires a valid `trigger` on every `.md` file in a `rules/` directory, and since CLI 1.4.1 `agy plugin validate` reports a plugin rule without one as an error. The plugin root rule `rules/AGENTS.md` was written as bare markdown, so it is now written with `trigger: always_on`. - AntigravityIdeRule gains a `getRootRuleFrontmatter()` hook (empty for the IDE/CLI root files); AntigravityPluginRule overrides it. - Import accepts `rules/AGENTS.md` with or without the frontmatter and keeps only the body. - Multiple root fragments still compose into one `rules/AGENTS.md`: a group of root fragments sharing an identical leading frontmatter block keeps it once and concatenates the bodies. - Docs: plugin-packaging guide and file-formats Antigravity rules note. Refs #2666 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XcU6mYjWis3a6YpqCW2xgB
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XcU6mYjWis3a6YpqCW2xgB # Conflicts: # src/generated/docs-content.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Antigravity requires a valid
triggeron every.mdfile inside arules/directory (https://antigravity.google/docs/rules), and since CLI 1.4.1agy plugin validate, which uses the loader's own rules (1.4.0), reports a plugin rule without one as an error.antigravity-pluginwrote its root rule as barerules/AGENTS.md, so it now getstrigger: always_onfrontmatter. This resolves the "plugin root rulerules/AGENTS.mdtrigger" item from the 2026-10-18 upstream update on #2666.Changes
AntigravityIdeRulegets agetRootRuleFrontmatter()hook. It returns{}for the IDE/CLI root files (projectAGENTS.md, globalGEMINI.md, which stay plain).AntigravityPluginRuleoverrides it with{ trigger: "always_on" }.rules/AGENTS.mdwith or without that frontmatter and keeps only the body, so the canonical overview rule never picks uptrigger.ToolRule.toRulesyncRuleDefaulttakes an optionalbodyfor this.RulesProcessor.mergeRulesByOutputPath: several root fragments landing on one path still compose when every fragment starts with the same frontmatter block. The block is written once and the bodies are concatenated. Without this, two root rules failed with the "cannot safely compose a collision involving a root rule" error. The composition decision and the concatenation move into small helpers to stay under the complexity limit.docs/guide/plugin-packaging.mdand the Antigravity rules note indocs/reference/file-formats.md(plus the regeneratedsrc/generated/docs-content.ts).Test plan
antigravity-plugin-rule.test.ts: generated root rule content, importing with and without frontmatter.rules-processor.test.tscase: two root fragments compose into onerules/AGENTS.mdunder a single trigger block. The existing "multiple root fragments across every target" test passes.generate --targets antigravity-plugin --features rules --output-roots <dir>:rules/AGENTS.mdstarts withtrigger: always_on.pnpm cicheckRefs #2666
🤖 Generated with Claude Code
https://claude.ai/code/session_01XcU6mYjWis3a6YpqCW2xgB