Skip to content

Commit 75219a8

Browse files
Add schema for Roo Coder custom modes configuration (SchemaStore#4729)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 0f10ced commit 75219a8

File tree

3 files changed

+177
-0
lines changed

3 files changed

+177
-0
lines changed

src/api/json/catalog.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4894,6 +4894,17 @@
48944894
"fileMatch": ["rockcraft.yaml", "rockcraft.yml"],
48954895
"url": "https://raw.githubusercontent.com/canonical/rockcraft/main/schema/rockcraft.json"
48964896
},
4897+
{
4898+
"name": "Roo Coder Custom Modes",
4899+
"description": "Roo Coder custom mode configuration files",
4900+
"fileMatch": [
4901+
".roomodes",
4902+
"*.roomodes",
4903+
"custom_modes.yaml",
4904+
"custom_modes.yml"
4905+
],
4906+
"url": "https://json.schemastore.org/roomodes.json"
4907+
},
48974908
{
48984909
"name": "runny",
48994910
"description": "runny, a rool for running things",

src/schemas/json/roomodes.json

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://json.schemastore.org/roomodes.json",
4+
"title": "Roo Coder Custom Modes",
5+
"description": "Schema for Roo Coder custom mode configuration files. Roo Coder is an AI-powered coding assistant that can be extended with custom modes to specialize its behavior for specific tasks. See https://docs.roocode.com/features/custom-modes for documentation.",
6+
"type": "object",
7+
"required": ["customModes"],
8+
"additionalProperties": false,
9+
"definitions": {
10+
"permission": {
11+
"title": "Permission",
12+
"description": "Tool access permission for a custom mode",
13+
"oneOf": [
14+
{
15+
"title": "Simple Permission",
16+
"type": "string",
17+
"enum": ["read", "edit", "browser", "command", "mcp"],
18+
"enumDescriptions": [
19+
"read: Read access to files",
20+
"edit: Edit access to all files",
21+
"browser: Web browser access",
22+
"command: Command execution access",
23+
"mcp: Model Context Protocol access"
24+
]
25+
},
26+
{
27+
"title": "Edit Permission with Path Restrictions",
28+
"description": "Edit permission with optional file path restrictions using regex patterns",
29+
"type": "object",
30+
"required": ["type"],
31+
"additionalProperties": false,
32+
"properties": {
33+
"type": {
34+
"const": "edit",
35+
"description": "Must be 'edit' for path-restricted edit permissions"
36+
},
37+
"allowedPaths": {
38+
"type": "array",
39+
"description": "Regex patterns for allowed file paths. If specified, only files matching these patterns can be edited.",
40+
"items": {
41+
"type": "string",
42+
"format": "regex",
43+
"examples": ["^/src/.*\\.js$", "^/docs/.*\\.md$"]
44+
}
45+
},
46+
"disallowedPaths": {
47+
"type": "array",
48+
"description": "Regex patterns for disallowed file paths. Files matching these patterns cannot be edited even if they match allowedPaths.",
49+
"items": {
50+
"type": "string",
51+
"format": "regex",
52+
"examples": [".*\\.env$", ".*/secrets/.*"]
53+
}
54+
}
55+
}
56+
}
57+
]
58+
},
59+
"customMode": {
60+
"title": "Custom Mode",
61+
"description": "Definition of a custom mode in Roo Coder",
62+
"type": "object",
63+
"required": ["slug", "name", "roleDefinition"],
64+
"additionalProperties": false,
65+
"properties": {
66+
"slug": {
67+
"type": "string",
68+
"pattern": "^[a-z0-9-]+$",
69+
"minLength": 1,
70+
"maxLength": 50,
71+
"description": "Unique internal identifier for the mode. Must contain only lowercase letters, numbers, and hyphens.",
72+
"examples": ["code-reviewer", "test-writer", "api-designer"]
73+
},
74+
"name": {
75+
"type": "string",
76+
"minLength": 1,
77+
"maxLength": 100,
78+
"description": "Display name for the mode in the Roo Coder UI. Can include spaces, capitalization, and emojis.",
79+
"examples": ["Code Reviewer", "Test Writer 🧪", "API Design Expert"]
80+
},
81+
"roleDefinition": {
82+
"type": "string",
83+
"minLength": 10,
84+
"description": "Core identity and expertise of the mode. The first sentence becomes the default mode summary.",
85+
"examples": [
86+
"I am a senior code reviewer focused on improving code quality, maintainability, and performance.",
87+
"I am a test automation expert specializing in comprehensive test coverage and best practices."
88+
]
89+
},
90+
"whenToUse": {
91+
"type": "string",
92+
"description": "Guidance for when to use this mode. Used by the Orchestrator mode and for mode switching suggestions.",
93+
"examples": [
94+
"Use this mode when you need a thorough code review with focus on best practices",
95+
"Use this mode when creating or updating test files"
96+
]
97+
},
98+
"customInstructions": {
99+
"type": "string",
100+
"description": "Additional behavioral guidelines for the mode. Supports markdown formatting for structured instructions.",
101+
"examples": [
102+
"## Review Process\n1. Analyze code structure\n2. Check for performance issues\n3. Verify security best practices"
103+
]
104+
},
105+
"groups": {
106+
"type": "array",
107+
"description": "Allowed toolsets and file access permissions for this mode",
108+
"items": {
109+
"$ref": "#/definitions/permission"
110+
},
111+
"examples": [
112+
["read", "edit", "browser"],
113+
["read", { "type": "edit", "allowedPaths": ["^/docs/.*\\.md$"] }]
114+
]
115+
}
116+
}
117+
}
118+
},
119+
"properties": {
120+
"customModes": {
121+
"type": "array",
122+
"description": "Array of custom mode definitions",
123+
"minItems": 1,
124+
"items": {
125+
"$ref": "#/definitions/customMode"
126+
}
127+
}
128+
}
129+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"customModes": [
3+
{
4+
"customInstructions": "## Review Process\n1. Analyze code structure and architecture\n2. Check for performance bottlenecks\n3. Verify security best practices\n4. Assess test coverage\n\n## Focus Areas\n- Code readability and maintainability\n- Error handling and edge cases\n- Performance optimizations\n- Security vulnerabilities\n- Testing strategies",
5+
"groups": ["read", "edit", "browser"],
6+
"name": "Code Reviewer",
7+
"roleDefinition": "I am a senior code reviewer focused on improving code quality, maintainability, and performance.",
8+
"slug": "code-reviewer",
9+
"whenToUse": "Use this mode when you need a thorough code review with focus on best practices and potential improvements."
10+
},
11+
{
12+
"groups": [
13+
"read",
14+
{
15+
"allowedPaths": [
16+
"^.*\\.test\\.(js|ts|jsx|tsx)$",
17+
"^.*\\.spec\\.(js|ts|jsx|tsx)$",
18+
"^test/.*",
19+
"^tests/.*",
20+
"^__tests__/.*"
21+
],
22+
"type": "edit"
23+
},
24+
"command"
25+
],
26+
"name": "Test Writer 🧪",
27+
"roleDefinition": "I am a test automation expert specializing in comprehensive test coverage and best practices.",
28+
"slug": "test-writer",
29+
"whenToUse": "Use this mode when creating or updating test files, setting up test frameworks, or improving test coverage."
30+
},
31+
{
32+
"name": "Minimal Example",
33+
"roleDefinition": "I am a minimal mode demonstrating only required fields.",
34+
"slug": "minimal-example"
35+
}
36+
]
37+
}

0 commit comments

Comments
 (0)