Skip to content

Conversation

@upamune
Copy link
Contributor

@upamune upamune commented Apr 5, 2025

Context

We are adding support for .roorules configuration files while maintaining backward compatibility with existing .clinerules. This change is part of our transition to use Roo-specific configuration files, making it clearer which settings belong to the Roo Code ecosystem.

Cline has recently added support for .clinerules/ directory, which prevents the creation of .clinerules files when the directory exists.

Implementation

The implementation involves several key changes:

  1. Added .roorules to the list of supported rule files in loadRuleFiles
  2. Enhanced the mode-specific rule file handling to:
    • First attempt to load from .roorules-{mode}
    • Fall back to .clinerules-{mode} if .roorules is not found
    • Track which file was successfully loaded to ensure correct rule attribution
  3. Updated test cases to cover:
    • Basic .roorules functionality
    • Mode-specific rule loading
    • Directory skipping behavior
    • Multiple rule file combinations

Key technical decisions:

  • Maintained backward compatibility by keeping .clinerules support
  • Prioritized .roorules over .clinerules for future extensibility
  • Used a tracking variable (usedRuleFile) to ensure correct rule source attribution
  • Kept the existing file loading pattern to minimize impact on other functionality

Screenshots

Not applicable for this change as it's a backend configuration enhancement.

How to Test

  1. Create a test directory with the following files:
.roorules
.roorules-test-mode
.clinerules
.clinerules-test-mode
  1. Add different content to each file:
# .roorules
roo rules content

# .roorules-test-mode
roo mode specific rules

# .clinerules
cline rules content

# .clinerules-test-mode
cline mode specific rules
  1. Run the test suite to verify:
npm test
  1. Verify that:
  • .roorules content is loaded before .clinerules
  • Mode-specific rules from .roorules-test-mode are prioritized over .clinerules-test-mode
  • All existing functionality with .clinerules continues to work as before

Get in Touch

I'm available in the Roo Code Discord as serizawa_. Feel free to reach out with any questions or concerns about this implementation.


Important

Add support for .roorules configuration files, prioritizing them over .clinerules, with updated tests for new behavior.

  • Behavior:
    • Add support for .roorules in loadRuleFiles() in custom-instructions.ts, prioritizing over .clinerules.
    • Mode-specific rules attempt to load from .roorules-{mode} first, then .clinerules-{mode}.
    • Use usedRuleFile to track which file was loaded.
  • Tests:
    • Update tests in custom-instructions.test.ts to cover .roorules and mode-specific rule loading.
    • Ensure directory skipping behavior and multiple rule file combinations are tested.
  • Misc:
    • Maintain backward compatibility with .clinerules.

This description was created by Ellipsis for 72498ef. It will automatically update as commits are pushed.

- Add .roorules to the list of supported rule files
- Improve mode-specific rule file handling to prioritize .roorules over .clinerules
- Update file loading logic to track which rule file was successfully loaded
- Add test cases for .roorules functionality

This change maintains backward compatibility with existing .clinerules while
introducing support for the new .roorules format as the preferred configuration
method.
@changeset-bot
Copy link

changeset-bot bot commented Apr 5, 2025

⚠️ No Changeset found

Latest commit: 82112b4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Apr 5, 2025
@mrubens
Copy link
Collaborator

mrubens commented Apr 5, 2025

Thank you so much for starting the process on this! I've been thinking about this a bit too.

  1. Going forward I don't think we should try to pull in rules files from other tools. So, I think we should first look for .roorules and then fall back on .clinerules, and same with .roorules-code and .clinerules-code for instance. We can just remove the logic for cursorrules and windsurfrules.
  2. We should update the copy on the prompts tab to reflect this as well. Maybe something like "Instructions can also be loaded from .roorules in your workspace (.clinerules is deprecated and will stop working soon)."?

@upamune
Copy link
Contributor Author

upamune commented Apr 5, 2025

@mrubens Thank you for your comments!

  1. I understand. Currently RooCode is combining them, but you're saying that if .roorules exists, RooCode should not load .clinerules, correct? 5b1cc0c 03c56c3

  2. Understood. Also, should RooCode replace the .clinerules references in the docs with .roorules and indicate that .clinerules is deprecated? As an example, I changed it to English only. 7964181

upamune and others added 4 commits April 5, 2025 19:28
- Removed .cursorrules and .windsurfrules from the list of rule files in loadRuleFiles function.
- Modified loadRuleFiles function to return content from the first available rule file instead of combining multiple rule files.
- Updated tests to reflect the new behavior of loading only the .roorules file content when available, ensuring clarity in rule file handling.
- Updated prompts in the English locale to reflect the deprecation of .clinerules in favor of .roorules.
- Added notes in the prompts indicating that .clinerules will stop working soon, ensuring users are aware of the upcoming changes.
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 5, 2025
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Apr 5, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Apr 5, 2025
@mrubens
Copy link
Collaborator

mrubens commented Apr 5, 2025

Pushed a few updates!

@mrubens
Copy link
Collaborator

mrubens commented Apr 5, 2025

So the changes in this are:

  • We stop looking for .cursorrules and .windsurfrules
  • We prioritize .roorules over .clinerules, but look for .clinerules as a fallback if .roorules is not found

Seem reasonable to everyone?

Screenshot 2025-04-05 at 2 33 47 PM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 5, 2025
@mrubens mrubens merged commit d6d5670 into RooCodeInc:main Apr 5, 2025
14 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Apr 5, 2025
@upamune
Copy link
Contributor Author

upamune commented Apr 5, 2025

Thank you for your quick code review and code fixes!​​​​​​​​​​​​​​​​

Seem reasonable to everyone?

LGTM :)

@mrubens
Copy link
Collaborator

mrubens commented Apr 5, 2025

I’ve been wanting to do this for so long! Thanks for making it happen.

@Wstnn
Copy link

Wstnn commented Apr 6, 2025

quick question. how are roorules different to the complete system-prompt replacement in combination with roomodes?
Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants