-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
App Version
Development version (n/a)
API Provider
Not Applicable / Other
Model Used
N/A
馃攣 Steps to Reproduce
- Create a global custom mode or use an existing global mode
- Add rules files to the global
.roo/rules-{mode-slug}/
directory (located in~/.roo/rules-{mode-slug}/
) - In VSCode, open the Prompts view and select the global mode
- Click the "Export Mode" button
- Save the exported YAML file and examine its contents
馃挜 Outcome Summary
Expected: The exported YAML file should contain the rules files from the global ~/.roo/rules-{mode-slug}/
directory
Actual: The exported YAML file does not include any rules files, even though they exist in the global directory
馃搫 Relevant Logs or Errors
No error messages are shown - the export completes successfully but without the rules files.
Technical Analysis
Based on my investigation:
Root Cause
The issue is in src/core/config/CustomModesManager.ts
in the exportModeWithRules
method. The code only looks for rules files in the project's workspace directory, not in the global rules directory:
// Line 691: Get workspace path
const workspacePath = getWorkspacePath()
if (!workspacePath) {
return { success: false, error: "No workspace found" }
}
// Line 697: Check for .roo/rules-{slug}/ directory
const modeRulesDir = path.join(workspacePath, ".roo", `rules-${slug}`)
This means that for global modes, the export function is looking in the wrong location for rules files.
Expected Behavior
For global modes (where mode.source === "global"
), the code should check for rules files in the global .roo
directory using getGlobalRooDirectory()
instead of the workspace path.
Related Code
- The import functionality correctly handles both global and project rules directories (see lines 872-878 in the same file)
- The
getGlobalRooDirectory()
function is already imported and available (line 12)
Proposed Fix: The export function should determine the correct rules directory based on the mode's source:
- For project modes: Use
path.join(workspacePath, ".roo",
rules-${slug})
- For global modes: Use
path.join(getGlobalRooDirectory(),
rules-${slug})
This would ensure that global mode rules files are correctly included in the export.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status