Skip to content

fix: include global mode rules files in export #5835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

roomote[bot]
Copy link

@roomote roomote bot commented Jul 17, 2025

This PR fixes issue #5834 where global mode exports were not including rules files from the global .roo directory.

Problem

The exportModeWithRules method in CustomModesManager.ts was only checking for rules files in the workspace directory, even for global modes. This meant that when exporting a global mode, any rules files stored in the global ~/.roo/rules-{mode-slug}/ directory were not included in the export.

Solution

Modified the export logic to determine the correct rules directory based on the mode source:

  • Global modes: Check getGlobalRooDirectory()/rules-{slug}/
  • Project modes: Check workspacePath/.roo/rules-{slug}/ (existing behavior)

Changes

  • Updated exportModeWithRules method to use mode source to determine rules directory
  • Fixed relative path calculation to work correctly for both global and project modes
  • Maintains backward compatibility for project modes

Testing

The fix ensures that:

  1. Global modes now include their rules files in exports
  2. Project modes continue to work as before
  3. Exported YAML files contain the correct relative paths for rules files

Fixes #5834


Important

Fixes exportModeWithRules to include global mode rules files from the global .roo directory in exports.

  • Behavior:
    • Fixes exportModeWithRules in CustomModesManager.ts to include rules files from global .roo directory for global modes.
    • Maintains existing behavior for project modes.
  • Logic:
    • Determines rules directory based on mode source: global modes use getGlobalRooDirectory()/rules-{slug}/, project modes use workspacePath/.roo/rules-{slug}/.
    • Corrects relative path calculation for rules files in both global and project modes.
  • Testing:
    • Ensures global modes include rules files in exports.
    • Confirms project modes remain unaffected.
    • Validates exported YAML files have correct relative paths for rules files.

This description was created by Ellipsis for 85bff1c. You can customize this summary. It will automatically update as commits are pushed.

- Fix exportModeWithRules to check correct rules directory based on mode source
- For global modes, check global .roo directory instead of workspace directory
- For project modes, continue checking workspace .roo directory
- Fixes issue where global mode exports were missing rules files

Fixes #5834
@roomote roomote bot requested review from mrubens, cte and jr as code owners July 17, 2025 18:47
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 17, 2025
@dosubot dosubot bot added the bug Something isn't working label Jul 17, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 17, 2025
@daniel-lxs daniel-lxs moved this from Triage to Roomote/renovate BOT in Roo Code Roadmap Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: Roomote/renovate BOT
Development

Successfully merging this pull request may close these issues.

Global mode export does not include rules files from global .roo directory
2 participants