Skip to content

Commit ae39ece

Browse files
docs: enhance custom modes documentation with overriding instructions and use cases (#140)
1 parent 551192b commit ae39ece

File tree

1 file changed

+57
-2
lines changed

1 file changed

+57
-2
lines changed

docs/features/custom-modes.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ Mode configurations are applied in this order:
153153
2. Global mode configurations (from `custom_modes.json`)
154154
3. Default mode configurations
155155

156-
This means that project-specific configurations will override global configurations, which in turn override default configurations.
156+
This means that project-specific configurations will override global configurations, which in turn override default configurations. You can override any default mode (like "code", "debug", etc.) by including a mode with the same slug in either your global or project-specific configuration.
157+
157158
* **Note on Instruction Files:** Within the loading of mode-specific instructions from the filesystem, the directory `.roo/rules-{mode-slug}/` takes precedence over the single file `.roorules-{mode-slug}` found in the workspace root.
158159

159160
## Creating Custom Modes
@@ -236,7 +237,45 @@ Each example shows different aspects of mode configuration:
236237
}
237238
```
238239

240+
## Overriding Default Modes
241+
242+
You can override Roo Code's built-in modes (like "code", "debug", "ask") with customized versions that better suit your workflow. This is done by creating a custom mode with the same slug as a default mode.
243+
244+
### Overriding Modes Globally
245+
246+
To customize a default mode across all your projects:
247+
248+
1. **Open Prompts Tab:** Click the <Codicon name="notebook" /> icon in the Roo Code top menu bar
249+
2. **Access Settings Menu:** Click the <Codicon name="bracket" /> button to the right of the Modes heading
250+
3. **Edit Global Modes:** Select "Edit Global Modes" to edit `custom_modes.json`
251+
4. **Add Your Override:** Create an entry with the same slug as the built-in mode you want to override
252+
253+
```json
254+
{
255+
"customModes": [{
256+
"slug": "code",
257+
"name": "Code",
258+
"roleDefinition": "You are a software engineer with global-specific constraints",
259+
"groups": [
260+
"read",
261+
["edit", { "fileRegex": "\\.(js|ts)$", "description": "JS/TS files only" }]
262+
],
263+
"customInstructions": "Focus on project-specific JS/TS development"
264+
}]
265+
}
266+
```
267+
268+
This example replaces the default "Code" mode with a custom version that can only edit JavaScript and TypeScript files.
269+
239270
### Project-Specific Mode Override
271+
272+
To override a default mode for just one project:
273+
274+
1. **Open Prompts Tab:** Click the <Codicon name="notebook" /> icon in the Roo Code top menu bar
275+
2. **Access Settings Menu:** Click the <Codicon name="bracket" /> button to the right of the Modes heading
276+
3. **Edit Project Modes:** Select "Edit Project Modes" to edit the `.roomodes` file
277+
4. **Add Your Override:** Create an entry with the same slug as the built-in mode you want to override
278+
240279
```json
241280
{
242281
"customModes": [{
@@ -251,7 +290,23 @@ Each example shows different aspects of mode configuration:
251290
}]
252291
}
253292
```
254-
By following these instructions, you can create and manage custom modes to enhance your workflow with Roo-Code.
293+
294+
Project-specific overrides take precedence over global overrides, which in turn override the built-in defaults.
295+
296+
### Common Use Cases for Overriding Default Modes
297+
298+
Common reasons to override built-in modes include:
299+
300+
* **Restricting file access:** Limit a mode to specific file types for safety (e.g., restricting "Code" mode to only edit non-production files)
301+
* **Specializing behavior:** Customize a mode's expertise for your tech stack (e.g., making "Debug" mode focus on your framework)
302+
* **Adding custom instructions:** Integrate project standards or team guidelines directly into modes
303+
* **Changing available tools:** Remove certain tools from modes to prevent unwanted operations
304+
305+
:::tip
306+
When overriding default modes, test your configuration carefully. Small changes to core modes can significantly impact functionality. Consider creating a backup of your original configuration before making substantial changes.
307+
:::
308+
309+
By following these instructions, you can create and manage custom modes to enhance your workflow with Roo Code.
255310

256311
## Understanding Regex in Custom Modes
257312

0 commit comments

Comments
 (0)