Skip to content

Commit cd92162

Browse files
Add Footgun Prompting feature documentation and sidebar entry (#104)
1 parent bc0e158 commit cd92162

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

docs/features/footgun-prompting.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
sidebar_label: 'Footgun Prompting'
3+
---
4+
5+
# Footgun Prompting: Override System Prompts
6+
7+
Footgun Prompting, AKA Overriding System Prompt, allows advanced users to completely replace the default system prompt for a specific Roo Code mode. This provides granular control over the AI's behavior but bypasses built-in safeguards.
8+
9+
:::info **footgun** *(noun)*
10+
11+
1. *(programming slang, humorous, derogatory)* Any feature likely to lead to the programmer shooting themself in the foot.
12+
13+
> The System Prompt Override is considered a footgun because modifying the core instructions without a deep understanding can lead to unexpected or broken behavior, especially regarding tool usage and response consistency.
14+
15+
:::
16+
17+
## How It Works
18+
19+
1. **Override File:** Create a file named `.roo/system-prompt-{mode-slug}` in your workspace root (e.g., `.roo/system-prompt-code` for the Code mode).
20+
2. **Content:** The content of this file becomes the new system prompt for that specific mode.
21+
3. **Activation:** Roo Code automatically detects this file. When present, it replaces most of the standard system prompt sections.
22+
4. **Preserved Sections:** Only the core `roleDefinition` and any `customInstructions` you've set for the mode are kept alongside your override content. Standard sections like tool descriptions, rules, and capabilities are bypassed.
23+
5. **Construction:** The final prompt sent to the model looks like this:
24+
```
25+
${roleDefinition}
26+
27+
${content_of_your_override_file}
28+
29+
${customInstructions}
30+
```
31+
32+
## Accessing the Feature
33+
34+
You can find the option and instructions within the Roo Code UI:
35+
36+
1. Click the <Codicon name="notebook" /> icon in the Roo Code top menu bar.
37+
2. Expand the **"Advanced: Override System Prompt"** section.
38+
3. Clicking the file path link within the explanation will open or create the correct override file for the currently selected mode in VS Code.
39+
40+
<img src="/img/footgun-prompting/footgun-prompting.png" alt="UI showing the Advanced: Override System Prompt section" width="500" />
41+
42+
43+
## Key Considerations & Warnings
44+
45+
- **Intended Audience:** Best suited for users deeply familiar with Roo Code's prompting system and the implications of modifying core instructions.
46+
- **Impact on Functionality:** Custom prompts override standard instructions, including those for tool usage and response consistency. This can cause unexpected behavior or errors if not managed carefully.
47+
- **Mode-Specific:** Each override file applies only to the mode specified in its filename (`{mode-slug}`).
48+
- **No File, No Override:** If the `.roo/system-prompt-{mode-slug}` file doesn't exist, Roo Code uses the standard system prompt generation process for that mode.
49+
- **Directory Creation:** Roo Code ensures the `.roo` directory exists before attempting to read or create the override file.
50+
51+
Use this feature cautiously. While powerful for customization, incorrect implementation can significantly degrade Roo Code's performance and reliability for the affected mode.

sidebars.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const sidebars: SidebarsConfig = {
3131
'features/custom-instructions',
3232
'features/custom-modes',
3333
'features/enhance-prompt',
34+
'features/footgun-prompting',
3435
'features/model-temperature',
3536
{
3637
type: 'category',
50.1 KB
Loading

0 commit comments

Comments
 (0)