Skip to content

Commit f764ce3

Browse files
Rewrite of Custom Instructions and Custom Modes pages (#48)
1 parent 36da081 commit f764ce3

File tree

2 files changed

+185
-150
lines changed

2 files changed

+185
-150
lines changed
Lines changed: 57 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,83 @@
11
# Custom Instructions
22

3-
Roo Code allows you to customize its behavior using instructions. These instructions are added to the system prompt and influence how Roo Code responds to your requests. You can define:
3+
Roo Code allows you to customize its behavior using custom instructions at both global and workspace levels. These instructions are added to the system prompt and influence how Roo Code responds to your requests. You can define:
44

5-
* **Global Custom Instructions:** Apply to all modes.
6-
* **Mode-Specific Custom Instructions:** Apply only to a specific mode.
7-
* **`.clinerules` Files:** Generic rules that apply across all modes, or create mode-specific rules files like `.clinerules-code`
5+
* **Global Custom Instructions:** Apply across all workspaces
6+
* **Workspace-Level Instructions:**
7+
* **Workspace-Wide:** Apply to all modes in the workspace through `.clinerules` files
8+
* **Mode-Specific:** Apply to specific modes in the workspace through files like `.clinerules-code`
9+
10+
## Preferred Language
11+
12+
You can specify a preferred language for Roo Code to use. When set, this appears at the start of your custom instructions and directs Roo Code to communicate in your chosen language. You can set this in the **Prompts** tab.
813

914
## Global Custom Instructions
1015

11-
These instructions are added to every prompt, regardless of the active mode. They're useful for setting general preferences or providing information that's always relevant.
16+
These instructions apply across all workspaces. They're useful for setting preferences that you want to maintain regardless of which project you're working on.
1217

1318
**How to set them:**
1419

15-
1. Open the Roo Code panel (<Codicon name="rocket" />).
16-
2. Click the "Prompts" button in the top menu bar.
17-
3. Find the "Custom Instructions for All Modes" section.
18-
4. Enter your instructions in the text area.
19-
5. Click "Done" to save your changes.
20+
1. **Open Prompts Tab:** Click the <Codicon name="notebook" /> icon in the Roo Code top menu bar
21+
2. **Find Section:** Find the "Custom Instructions for All Modes" section
22+
3. **Enter Instructions:** Enter your instructions in the text area
23+
4. **Save Changes:** Click "Done" to save your changes
2024

21-
## Mode-Specific Custom Instructions
25+
## Workspace-Level Instructions
2226

23-
These instructions are added only when a specific mode is active. They allow you to fine-tune Roo Code's behavior for different tasks.
27+
These instructions only apply within your current workspace, allowing you to customize Roo Code's behavior for specific projects.
2428

25-
**How to set them:**
29+
### Workspace-Wide Instructions
2630

27-
1. Open the Roo Code panel (<Codicon name="rocket" />).
28-
2. Click the "Prompts" button in the top menu bar.
29-
3. Select the mode you want to customize from the dropdown.
30-
4. Find the "Mode-specific Custom Instructions" section.
31-
5. Enter your instructions in the text area.
32-
6. Click "Done" to save your changes.
31+
Workspace-wide instructions are defined through rule files in your workspace root, primarily using `.clinerules`. Additional support for `.cursorrules` and `.windsurfrules` is available for editor compatibility.
3332

34-
**Note:** Mode-specific instructions are added *after* global custom instructions.
33+
### Mode-Specific Instructions
3534

36-
## `.clinerules` and `.clinerules-[mode]` Files
35+
Mode-specific instructions can be set in two independent ways that can be used simultaneously:
3736

38-
For more advanced customization, you can create `.clinerules` files in your workspace root. These files contain rules that Roo Code will follow.
37+
1. **Using the Prompts Tab:**
38+
* **Open Tab:** Click the <Codicon name="notebook" /> icon in the Roo Code top menu bar
39+
* **Select Mode:** Under the Modes heading, click the button for the mode you want to customize
40+
* **Enter Instructions:** Enter your instructions in the text area under "Mode-specific Custom Instructions (optional)"
41+
* **Save Changes:** Click "Done" to save your changes
3942

40-
* **`.clinerules`:** Contains general rules that apply to all modes.
41-
* **`.clinerules-[mode]`:** Contains rules specific to a particular mode (e.g., `.clinerules-code`, `.clinerules-architect`).
43+
2. **Using Rule Files:** Create a `.clinerules-[mode]` file in your workspace root (e.g., `.clinerules-code`)
4244

43-
**Format:**
45+
When both tab instructions and rule files are set for a mode, both sets of instructions will be included in the system prompt.
4446

45-
Each line in a `.clinerules` file represents a single rule. You can use plain English to describe the rules.
47+
### How Instructions are Combined
4648

47-
## Preferred Language
49+
Instructions are placed in the system prompt in this exact format:
50+
51+
```
52+
====
53+
USER'S CUSTOM INSTRUCTIONS
54+
The following additional instructions are provided by the user, and should be followed to the best of your ability without interfering with the TOOL USE guidelines.
55+
[Language Preference (if set)]
56+
[Global Instructions]
57+
[Mode-specific Instructions]
58+
59+
Rules:
60+
[.clinerules-{mode} rules]
61+
[.clinerules rules]
62+
[.cursorrules rules]
63+
[.windsurfrules rules]
64+
```
65+
66+
### About Rule Files
4867

49-
You can also specify a preferred language for Roo Code to use. This will instruct Roo Code to communicate with you in that language. You can set this in the **Prompts** tab.
68+
* **File Location:** All rule files must be placed in the workspace root directory
69+
* **Empty Files:** Empty or missing rule files are silently skipped
70+
* **Source Headers:** Each rule file's contents are included with a header indicating its source
71+
* **Rule Interaction:** Mode-specific rules complement global rules rather than replacing them
5072

5173
## Examples of Custom Instructions
5274

53-
* "Always use spaces for indentation, with a width of 4 spaces."
54-
* "Use camelCase for variable names."
55-
* "Write unit tests for all new functions."
56-
* "Explain your reasoning before providing code."
57-
* "Focus on code readability and maintainability."
58-
* "Prioritize using the most common library in the community"
59-
* "When adding new features to websites, ensure they are responsive and accessible."
75+
* "Always use spaces for indentation, with a width of 4 spaces"
76+
* "Use camelCase for variable names"
77+
* "Write unit tests for all new functions"
78+
* "Explain your reasoning before providing code"
79+
* "Focus on code readability and maintainability"
80+
* "Prioritize using the most common library in the community"
81+
* "When adding new features to websites, ensure they are responsive and accessible"
6082

6183
By using custom instructions, you can tailor Roo Code's behavior to match your coding style, project requirements, and personal preferences.

0 commit comments

Comments
 (0)