Skip to content

feat: add overrideSystemPrompt option for custom modes#11794

Draft
roomote[bot] wants to merge 1 commit intomainfrom
feature/override-system-prompt
Draft

feat: add overrideSystemPrompt option for custom modes#11794
roomote[bot] wants to merge 1 commit intomainfrom
feature/override-system-prompt

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Feb 28, 2026

This PR attempts to address Issue #11793.

Summary

Adds an overrideSystemPrompt boolean option to ModeConfig that allows custom modes to use their roleDefinition as the entire system prompt body, skipping all standard built-in sections (CAPABILITIES, TOOL USE, MODES, SKILLS, RULES, SYSTEM INFO, OBJECTIVE, MARKDOWN RULES).

Changes

  1. packages/types/src/mode.ts - Added overrideSystemPrompt: z.boolean().optional() to modeConfigSchema
  2. src/core/prompts/system.ts - When overrideSystemPrompt is true on the resolved mode config, generatePrompt() returns only the roleDefinition + custom instructions (from .roo/rules-*, global settings, and mode-specific instructions)
  3. src/core/prompts/__tests__/system-prompt.spec.ts - Added 4 test cases covering: override active, custom instructions still appended, override false, and override unset

Usage

{
  "customModes": [
    {
      "slug": "my-mode",
      "name": "My Mode",
      "roleDefinition": "[Complete custom system prompt]",
      "overrideSystemPrompt": true,
      "groups": ["read", "edit"]
    }
  ]
}

What still works with override enabled

  • Tool calling (tools are sent natively, not in the system prompt)
  • Custom instructions from .roo/rules-* files and global settings
  • Mode switching and tool group restrictions

What is skipped

  • All built-in prompt sections (CAPABILITIES, TOOL USE, MODES, SKILLS, RULES, SYSTEM INFO, OBJECTIVE, MARKDOWN RULES)

Backward compatibility

  • overrideSystemPrompt defaults to false/undefined, so all existing modes behave exactly as before

Feedback and guidance are welcome.

Interactively review PR in Roo Code Cloud

When overrideSystemPrompt is true on a ModeConfig, the system prompt
uses only the roleDefinition as its body, skipping all standard
sections (CAPABILITIES, TOOL USE, MODES, SKILLS, RULES, SYSTEM INFO,
OBJECTIVE, MARKDOWN RULES). Custom instructions from .roo/rules-*
files and global settings are still appended.

This gives power users full control over the system prompt for
specialized workflows while maintaining backward compatibility --
the flag defaults to false/undefined so existing modes are unaffected.

Closes #11793
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant