You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Roo Code allows you to create **custom modes**that can be either global (available across all projects) or project-specific (defined within a single project). These modes let you tailor Roo's behavior to specific tasks or workflows by defining:
3
+
Roo Code allows you to create **custom modes**to tailor Roo's behavior to specific tasks or workflows. Custom modes can be either **global** (available across all projects) or **project-specific** (defined within a single project). They allow you to define:
4
4
5
5
***A unique name and slug:** For easy identification.
6
6
***A role definition:** A description of the mode's purpose and expertise.
@@ -15,7 +15,7 @@ Roo Code allows you to create **custom modes** that can be either global (availa
15
15
***Experimentation:** Safely experiment with different prompts and configurations without affecting other modes.
16
16
***Team Collaboration:** Share custom modes with your team to standardize workflows.
17
17
18
-
## Creating a Custom Mode
18
+
## Creating Custom Modes
19
19
20
20
You have three options for creating custom modes:
21
21
@@ -40,29 +40,47 @@ Roo Code will guide you through the process.
40
40
41
41
Note: Adding/editing file type restrictions is not yet supported in the prompts tab UI.
42
42
43
-
### 3. Manual Configuration (Advanced)
43
+
### 3. Manual Configuration
44
44
45
-
Custom modes can be configured in two locations:
45
+
Custom modes can be configured by directly editing JSON files. There are two locations for custom mode configurations:
46
46
47
-
1.**Global Configuration:**
48
-
- Located at `~/Library/Application Support/Cursor/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_custom_modes.json`
49
-
-These modes are available across all projects
47
+
1.**Global Configuration:**
48
+
* Located at `~/Library/Application Support/Cursor/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_custom_modes.json`
49
+
*These modes are available across all projects.
50
50
51
-
2.**Project-Specific Configuration:**
52
-
-Located in `.roomodes` file in your project's root directory
53
-
-These modes are only available within that specific project
54
-
-Project-specific modes take precedence over global modes with the same slug
51
+
2.**Project-Specific Configuration:**
52
+
*Located in a `.roomodes` file in your project's root directory.
53
+
*These modes are only available within that specific project.
54
+
***Project-specific modes take precedence over global modes with the same slug.** This means if you define a mode with the slug "code" in your `.roomodes` file, it will override the global "code" mode when you're working in that project.
55
55
56
56
To edit either configuration:
57
57
58
58
1.**Open the Prompts Tab:** Click the notebook icon in the Roo Code top menu bar.
59
-
2.**Open the Settings File:** Click the code icon (`<>`) in the top right corner of the "Prompts" tab.
59
+
2.**Open the Settings File:** Click the code icon (`<>`) in the top right corner of the "Prompts" tab. (This will open the global configuration file. To edit a project-specific configuration, you'll need to manually open the `.roomodes` file in your project's root directory.)
60
60
3.**Edit the JSON:** Add or modify mode configurations within the `customModes` array, following the format described below.
61
61
4.**Save the File:** Roo Code will automatically detect the changes.
62
62
63
63
## Custom Mode Configuration (JSON Format)
64
64
65
-
Both global and project-specific configuration files use the same JSON format. Here's an example:
65
+
Both global and project-specific configuration files use the same JSON format. The configuration is a JSON object with a `customModes` key, which contains an array of mode definitions. Each mode definition is a JSON object with the following properties:
66
+
67
+
*`slug`: (Required) A unique identifier for the mode (lowercase letters, numbers, and hyphens). Shorter is better.
68
+
*`name`: (Required) The display name for the mode.
69
+
*`roleDefinition`: (Required) A detailed description of the mode's role and capabilities.
70
+
*`groups`: (Required) An array of allowed tool groups. Each group can be specified either as a string (e.g., `"edit"` to allow editing any file) or with file restrictions (e.g., `["edit", { "fileRegex": "\\.md$", "description": "Markdown files only" }]` to only allow editing markdown files).
71
+
* Available tool groups are: `"read"`, `"edit"`, `"browser"`, `"command"`, `"mcp"`.
72
+
***Understanding `fileRegex`:** The `fileRegex` property uses a *regular expression* (or *regex*) to define which files the mode is allowed to edit. A regular expression is a sequence of characters that specifies a search pattern. Here's a breakdown of some common regex components used in the examples:
73
+
*`\.`: Matches a literal dot (`.`). The backslash is used to "escape" the dot, since a dot has a special meaning in regular expressions (matching any character).
74
+
*`(test|spec)`: Matches either "test" or "spec". The parentheses create a *capturing group*, and the pipe (`|`) acts as an "or".
75
+
*`(js|ts|jsx|tsx)`: Matches "js", "ts", "jsx", or "tsx".
76
+
*`$`: Matches the end of the string. This ensures that the entire filename matches the pattern, not just a part of it.
77
+
* For example, `\\.md$` matches any filename that ends with ".md". `\\.(test|spec)\\.(js|ts|jsx|tsx)$` matches filenames like "myComponent.test.js", "utils.spec.ts", etc.
78
+
* You can learn more about regular expressions on websites like [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions).
79
+
*`customInstructions`: (Optional) Additional instructions for the mode.
80
+
81
+
Here are some examples:
82
+
83
+
**Example 1: A simple documentation writer mode (could be global or project-specific):**
66
84
67
85
```json
68
86
{
@@ -76,7 +94,16 @@ Both global and project-specific configuration files use the same JSON format. H
"customInstructions": "Focus on editing and formatting markdown files."
173
+
}
174
+
]
175
+
}
176
+
```
177
+
By following these instructions, you can create and manage custom modes to enhance your workflow with Roo-Code.
178
+
93
179
## Community Gallery
94
180
95
181
Ready to explore more? Check out the [Custom Modes Gallery](../community#custom-modes-gallery) to discover and share custom modes created by the community!
0 commit comments