Add YAML-based configuration system for custom modes#2472
Closed
upamune wants to merge 9 commits intoRooCodeInc:mainfrom
Closed
Add YAML-based configuration system for custom modes#2472upamune wants to merge 9 commits intoRooCodeInc:mainfrom
upamune wants to merge 9 commits intoRooCodeInc:mainfrom
Conversation
…ema; bump zod version
- Introduced JSON and YAML fixtures for legacy v1, v2, and mixed syntax modes. - Implemented unit tests for loading modes with v1 tuple-based syntax, v2 object-based syntax, and mixed syntax. - Added compatibility tests to ensure v1 and v2 syntax are treated as equivalent. - Created a debug test to validate the loading of modes from the filesystem. - Enhanced the ModeConfigService to handle different syntax formats seamlessly.
- Removed global state dependencies and environment variable usage in tests. - Consolidated mock setups within individual test cases to enhance readability. - Adjusted expectations to align with the actual behavior of the implementation, ensuring tests reflect the expected outcomes when loading modes. - Added comments for clarity on test intentions and behaviors. - Enhanced debugging capabilities with console logs and spies where necessary.
…for backward compatibility
… fixtures, update v2 syntax fixture for consistency
|
…n .roo/modes directory and update create mode instructions for new format
Collaborator
|
@upamune are you still interested in making a go of this? |
2 tasks
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.
Context
This PR implements a YAML-based configuration system for custom modes, providing a more structured way for users to define custom modes and improving the developer experience.
Design Doc: https://hackmd.io/@upamune/roo-rule-directory
Implementation
The implementation includes:
Zod Schema for Mode Configuration: Added
src/modeSchemas.tsto implement Zod schemas for mode configurations, enabling type-safe configurations.JSON Schema Generation Script: Added
scripts/generate-mode-schema.tsto generate JSON schema from Zod schema, enabling auto-completion and validation when editing YAML files in editors.Mode Configuration Service: Implemented
src/services/ModeConfigService.tsto provide functionality for loading, saving, and managing mode configurations from both global and project-specific locations.Legacy Support: Maintained backward compatibility with existing
.roomodesfile format.Syntax Extensions: Added support for both V1 (tuple-based) and V2 (object-based) syntax, providing more flexible configuration options.
Dependencies: Added
js-yamlandzod-to-json-schemato support YAML file processing and JSON schema generation.Screenshots
.roomodesJSON file.roo/modes/*.yamlfilesHow to Test
.roo/modes/directory and define a custom mode with a YAML file.roomodesfile, verify that those modes are still availableGet in Touch
Discord: @serizawa_