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
Copy file name to clipboardExpand all lines: docs/advanced-usage/custom-instructions.md
+28-15Lines changed: 28 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,50 +1,57 @@
1
1
# Custom Instructions
2
2
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:
3
+
Custom Instructions allow you to personalize how Roo behaves, providing specific guidance that shapes responses, coding style, and decision-making processes.
4
4
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`
5
+
## What Are Custom Instructions?
9
6
10
-
## Preferred Language
7
+
Custom Instructions define specific behaviors, preferences, and constraints beyond Roo's basic role definition. Examples include coding style, documentation standards, testing requirements, and workflow guidelines.
8
+
:::info Rules Files
9
+
Custom Instructions are simply .rules files. They use the common convention of `.clinerules`, `.cursorrules`, and `.windsurfrules` files, which can be placed in your workspace root for version control or configured through the UI.
10
+
:::
11
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.
12
+
## Setting Custom Instructions
13
13
14
-
## Global Custom Instructions
14
+
###Global Custom Instructions
15
15
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.
16
+
These instructions apply across all workspaces and maintain your preferences regardless of which project you're working on.
17
17
18
18
**How to set them:**
19
19
20
+
<imgsrc="/img/custom-instructions/custom-instructions.png"alt="Roo Code Prompts tab showing global custom instructions interface"width="600" />
20
21
1.**Open Prompts Tab:** Click the <Codiconname="notebook" /> icon in the Roo Code top menu bar
21
22
2.**Find Section:** Find the "Custom Instructions for All Modes" section
22
23
3.**Enter Instructions:** Enter your instructions in the text area
23
24
4.**Save Changes:** Click "Done" to save your changes
24
25
25
-
## Workspace-Level Instructions
26
+
###Workspace-Level Instructions
26
27
27
28
These instructions only apply within your current workspace, allowing you to customize Roo Code's behavior for specific projects.
28
29
29
-
### Workspace-Wide Instructions
30
+
####Workspace-Wide Instructions
30
31
31
32
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.
32
33
33
-
### Mode-Specific Instructions
34
+
####Mode-Specific Instructions
34
35
35
36
Mode-specific instructions can be set in two independent ways that can be used simultaneously:
***Open Tab:** Click the <Codiconname="notebook" /> icon in the Roo Code top menu bar
39
42
***Select Mode:** Under the Modes heading, click the button for the mode you want to customize
40
43
***Enter Instructions:** Enter your instructions in the text area under "Mode-specific Custom Instructions (optional)"
41
44
***Save Changes:** Click "Done" to save your changes
42
45
46
+
:::info Global Mode Rules
47
+
If the mode itself is global (not workspace-specific), any custom instructions you set for it will also apply globally for that mode across all workspaces.
48
+
:::
49
+
43
50
2.**Using Rule Files:** Create a `.clinerules-[mode]` file in your workspace root (e.g., `.clinerules-code`)
44
51
45
52
When both tab instructions and rule files are set for a mode, both sets of instructions will be included in the system prompt.
46
53
47
-
###How Instructions are Combined
54
+
## How Instructions are Combined
48
55
49
56
Instructions are placed in the system prompt in this exact format:
50
57
@@ -63,7 +70,7 @@ Rules:
63
70
[.windsurfrules rules]
64
71
```
65
72
66
-
### About Rule Files
73
+
##Rules about .rules files
67
74
68
75
***File Location:** All rule files must be placed in the workspace root directory
69
76
***Empty Files:** Empty or missing rule files are silently skipped
@@ -80,4 +87,10 @@ Rules:
80
87
* "Prioritize using the most common library in the community"
81
88
* "When adding new features to websites, ensure they are responsive and accessible"
82
89
83
-
By using custom instructions, you can tailor Roo Code's behavior to match your coding style, project requirements, and personal preferences.
90
+
:::tip Pro Tip: File-Based Team Standards
91
+
When working in team environments, placing `.clinerules` files under version control allows you to standardize Roo's behavior across your entire development team. This ensures consistent code style, documentation practices, and development workflows for everyone on the project.
92
+
:::
93
+
94
+
## Combining with Custom Modes
95
+
96
+
For advanced customization, combine with [Custom Modes](custom-modes) to create specialized environments with specific tool access, file restrictions, and tailored instructions.
0 commit comments