-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add YAML-based configuration system for custom modes #2472
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
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
|
@upamune are you still interested in making a go of this? |
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_