-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat: add correct JSON schema for .roomodes configuration files #11791
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cfc8a55
feat: add correct JSON schema for .roomodes configuration files
roomote d399085
fix: add browser tool group and rulesFiles property to roomodes schema
roomote 70db387
fix: make content optional in RuleFile schema definition
roomote 3fd2ca4
refactor: dynamically generate roomodes JSON schema from Zod types
roomote 8725668
refactor: move schema tests and ajv dep to packages/types, extract sh…
roomote File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "$id": "https://github.com/RooCodeInc/Roo-Code/blob/main/schemas/roomodes.json", | ||
| "title": "Roo Code Custom Modes", | ||
| "description": "Schema for .roomodes configuration files used by Roo Code to define custom modes.", | ||
| "type": "object", | ||
| "required": ["customModes"], | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "customModes": { | ||
| "type": "array", | ||
| "description": "List of custom mode definitions.", | ||
| "items": { | ||
| "$ref": "#/definitions/CustomMode" | ||
| } | ||
| } | ||
| }, | ||
| "definitions": { | ||
| "ToolGroup": { | ||
| "type": "string", | ||
| "enum": ["read", "edit", "browser", "command", "mcp", "modes"], | ||
| "description": "A tool group name that grants the mode access to a set of tools. Note: 'browser' is deprecated but still accepted for backward compatibility." | ||
| }, | ||
| "GroupOptions": { | ||
| "type": "object", | ||
| "description": "Options that restrict a tool group's file access.", | ||
| "properties": { | ||
| "fileRegex": { | ||
| "type": "string", | ||
| "description": "A regular expression pattern to restrict which files the tool group can access." | ||
| }, | ||
| "description": { | ||
| "type": "string", | ||
| "description": "A human-readable description of the file restriction." | ||
| } | ||
| }, | ||
| "additionalProperties": false | ||
| }, | ||
| "GroupEntryTuple": { | ||
| "type": "array", | ||
| "description": "A tuple of [toolGroupName, options] for tool groups with file restrictions.", | ||
| "items": [{ "$ref": "#/definitions/ToolGroup" }, { "$ref": "#/definitions/GroupOptions" }], | ||
| "additionalItems": false, | ||
| "minItems": 2, | ||
| "maxItems": 2 | ||
| }, | ||
| "GroupEntry": { | ||
| "description": "A tool group permission entry. Either a simple tool group name string, or a [toolGroupName, options] tuple for groups with file restrictions.", | ||
| "oneOf": [{ "$ref": "#/definitions/ToolGroup" }, { "$ref": "#/definitions/GroupEntryTuple" }] | ||
| }, | ||
| "RuleFile": { | ||
| "type": "object", | ||
| "description": "A rules file associated with a mode, used during import/export.", | ||
| "required": ["relativePath", "content"], | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "relativePath": { | ||
| "type": "string", | ||
| "description": "The relative file path for the rules file." | ||
| }, | ||
| "content": { | ||
| "type": "string", | ||
| "description": "The text content of the rules file." | ||
| } | ||
| } | ||
| }, | ||
| "CustomMode": { | ||
| "type": "object", | ||
| "description": "A custom mode definition.", | ||
| "required": ["slug", "name", "roleDefinition", "groups"], | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "slug": { | ||
| "type": "string", | ||
| "pattern": "^[a-zA-Z0-9-]+$", | ||
| "description": "A unique identifier for the mode, containing only letters, numbers, and dashes." | ||
| }, | ||
| "name": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "description": "The display name of the mode." | ||
| }, | ||
| "roleDefinition": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "description": "The system prompt that defines the mode's role and behavior." | ||
| }, | ||
| "whenToUse": { | ||
| "type": "string", | ||
| "description": "A description of when this mode should be used, shown in the mode selection UI." | ||
| }, | ||
| "description": { | ||
| "type": "string", | ||
| "description": "A short description of the mode." | ||
| }, | ||
| "customInstructions": { | ||
| "type": "string", | ||
| "description": "Additional instructions appended to the system prompt." | ||
| }, | ||
| "groups": { | ||
| "type": "array", | ||
| "description": "The tool groups this mode has access to.", | ||
| "items": { | ||
| "$ref": "#/definitions/GroupEntry" | ||
| } | ||
| }, | ||
| "source": { | ||
| "type": "string", | ||
| "enum": ["global", "project"], | ||
| "description": "Where this mode was defined. Automatically set by Roo Code." | ||
| }, | ||
| "rulesFiles": { | ||
| "type": "array", | ||
| "description": "Rules files associated with this mode, used during import/export.", | ||
| "items": { | ||
| "$ref": "#/definitions/RuleFile" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roomote Is content supposed to be required?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made
contentoptional in theRuleFileschema definition -- onlyrelativePathremains required. All 25 tests pass.View commit | Revert commit