Repository navigation
feat(antigravity): write directory-scoped rules to nested .agents/rules/ - #3385
Merged
Merged
Conversation
Antigravity reads a .agents/rules/ directory in any subdirectory and loads it for files under that directory. In project scope, a non-root rule with agentsmd.subprojectPath is now written by antigravity-ide and antigravity-cli to <dir>/.agents/rules/ instead of the project-root .agents/rules/, and such folders are imported back with that subprojectPath and both Antigravity targets. The antigravity-plugin target keeps every rule in its own rules/ directory. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TMP9AiZudwa2b154EMY4FS
…ren only Nested rule files are flattened and keep their case in both the IDE and the CLI, so an imported codeStyle.md is written back to the same file instead of a kebab-case duplicate. The nested scan reads only the direct .md children of a rules directory, which is all Antigravity loads. The docs describe derived subprojectPath, the file naming, and import collisions. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TMP9AiZudwa2b154EMY4FS
Regenerate src/generated/docs-content.ts after the conflict. Also drop a duplicated comment and treat a subprojectPath of "." like the project root. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TMP9AiZudwa2b154EMY4FS
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
Covers the "
subprojectPathnesting for the Antigravity rule adapters" item of #2666.Antigravity reads a
.agents/rules/directory in any subdirectory and loads it for files under that directory, just as it doesAGENTS.md/GEMINI.md(rules docs: "You can place anAGENTS.mdorGEMINI.mdfile—or a.agents/rules/directory—in any subdirectory of your project").agentsmd.subprojectPathis written to<subprojectPath>/.agents/rules/<name>.mdinstead of the project-root.agents/rules/.antigravity-ideandantigravity-cliwrite the same file, as they already do for the root directory. The root rule and global rules are never nested..agents/rules/folders in subdirectories are read back throughgetNestedFilePatternsas rules carrying thatagentsmd.subprojectPathandtargets: ["antigravity-ide", "antigravity-cli"]. This follows the Trae precedent (feat(trae): write directory-scoped rules to nested .trae/rules/ #3258), so the next generate neither surprises other tools with new nested files nor folds the rule into their root files. Folders under hidden directories,node_modulesand build outputs are skipped.rulesync gitignorealready ignores**/.agents/rules/, soownedDirPathkeeps the gitignore filter from dropping them.antigravity-plugininherits from the IDE class. It turns nesting off and keeps every rule in its ownrules/directory.antigravity-rule.ts. A new co-locatedantigravity-rule.test.tscovers generate, import, round-trip, the scan patterns and the plugin opt-out for both targets.docs/reference/file-formats.md.Like the other nested outputs, these files sit outside the root
.agents/rules/, sogenerate --deletedoes not remove them.Still open on #2666: sidecars, the plugin root rule trigger, the
unsandboxed/.antigravityignoreitems on hold, and the undocumented "new workflows system".Refs #2666
🤖 Generated with Claude Code
https://claude.ai/code/session_01TMP9AiZudwa2b154EMY4FS