Global Rules Do Not Open in the Dedicated Rule Editor

When opening global rule markdown files located in ~/.gemini/config/rules/, Antigravity IDE falls back to the default Monaco raw Markdown text editor rather than routing the file through the dedicated Rule Editor (antigravity.ruleEditor) webview. In contrast, workspace rules inside <workspace>/.agents/rules/ correctly open in the custom GUI Rule Editor.


Steps to Reproduce

  1. Create or open any rule markdown file located in ~/.gemini/config/rules/ (e.g., ~/.gemini/config/rules/python-standards.md).
  2. Observe that the file opens in the default Monaco raw Markdown editor.
  3. Right-click the tab or press Ctrl+Shift+P → View: Reopen Editor With….
  4. Observe that “Rule Editor” is missing from the list of available custom editors.
  5. Open any workspace-level rule (e.g., <project-root>/.agents/rules/my-rule.md) and observe that it automatically opens in the custom Rule Editor with dedicated GUI fields (Activation Mode, Glob Pattern / Description, and Content).

Observed Behavior

  • Global Rules Fallback: Global rule files (~/.gemini/config/rules/*.md) open strictly as raw Markdown text files.
  • Asymmetrical Custom Editor Registration: The custom Rule Editor webview is completely inaccessible for global rules, even via the “Reopen Editor With…” picker.

Expected Behavior

  • Files matching ~/.gemini/config/rules/**/*.md and ~/.gemini/rules/**/*.md should automatically open in the GUI Rule Editor, matching the behavior of workspace rules.
  • “Rule Editor” should be registered as an available custom editor for all rule directories recognized by the Antigravity engine.

Root Cause Analysis (Code References)

Inspection of the built-in Antigravity extension manifest:
resources/app/extensions/antigravity/package.json

Under contributes.customEditors:

"customEditors": [
  {
    "viewType": "antigravity.workflowEditor",
    "displayName": "Workflow Editor",
    "selector": [
      { "filenamePattern": "**/.agent/workflows/**/*.md" },
      { "filenamePattern": "**/_agent/workflows/**/*.md" },
      { "filenamePattern": "**/.agents/workflows/**/*.md" },
      { "filenamePattern": "**/_agents/workflows/**/*.md" },
      { "filenamePattern": "**/.gemini/jetski*/global_workflows/*.md" },
      { "filenamePattern": "**/.gemini/antigravity*/global_workflows/*.md" }
    ],
    "priority": "default"
  },
  {
    "viewType": "antigravity.ruleEditor",
    "displayName": "Rule Editor",
    "selector": [
      { "filenamePattern": "**/.agent/rules/**/*.md" },
      { "filenamePattern": "**/_agent/rules/**/*.md" },
      { "filenamePattern": "**/.agents/rules/**/*.md" },
      { "filenamePattern": "**/_agents/rules/**/*.md" }
    ],
    "priority": "default"
  }
]
  1. Omission in antigravity.ruleEditor: While antigravity.workflowEditor registers global paths (**/.gemini/.../global_workflows/*.md), antigravity.ruleEditor only accounts for workspace folder permutations (.agent, _agent, .agents, _agents).
  2. Missing Global Path Selectors: Global rule directories (**/.gemini/config/rules/**/*.md and **/.gemini/rules/**/*.md) were omitted from the selector array.

Suggested Fix

Update contributes.customEditors for antigravity.ruleEditor in package.json to include the global rule directories:

{
  "viewType": "antigravity.ruleEditor",
  "displayName": "Rule Editor",
  "selector": [
    { "filenamePattern": "**/.agent/rules/**/*.md" },
    { "filenamePattern": "**/_agent/rules/**/*.md" },
    { "filenamePattern": "**/.agents/rules/**/*.md" },
    { "filenamePattern": "**/_agents/rules/**/*.md" },
    { "filenamePattern": "**/.gemini/config/rules/**/*.md" },
    { "filenamePattern": "**/.gemini/rules/**/*.md" }
  ],
  "priority": "default"
}

Verified User Workaround

Injecting editor associations into the user settings.json resolves the issue immediately:

"workbench.editorAssociations": {
    "**/.gemini/config/rules/**/*.md": "antigravity.ruleEditor",
    "**/.gemini/rules/**/*.md": "antigravity.ruleEditor"
}

Related Issue (Bonus)

“Copy path” button in User Settings > Customizations fails silently on Windows:

  • Location: Settings panel under both “Skills” and “Rules” cards.
  • Symptom: Clicking the copy icon triggers the “Copied” tooltip state, but nothing is written to the system clipboard.
  • Cause: Embedded Electron webview calling navigator.clipboard.writeText() without active focus or IPC delegation, and virtual rule items (user_global) passing unresolved identifiers rather than file paths.

Environment

  • IDE: Antigravity IDE 2.0.3+
  • OS: Windows 11 (High-DPI)

Hi @Rafal_Jot,

Thanks for the thorough report. We were able to reproduce it and your analysis is spot on: the Rule Editor is only registered for workspace rule folders, while the Workflow Editor also covers the global folders. We’ve confirmed this as a bug and escalated it to the engineering team.

Until it’s fixed, the workaround you found works well. For anyone else hitting this, add the following to your user settings.json:

"workbench.editorAssociations": {
  "**/.gemini/config/rules/**/*.md": "antigravity.ruleEditor"
}

For future issues, you can also send reports straight to the team from inside Antigravity using Provide Feedback, which can include your logs automatically.