feat: add systemPrompt property to ModeConfig for custom system prompt override #10903
+205
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add a new
systemPromptproperty toModeConfigthat allows custom modes to override the default system prompt sections (CAPABILITIES, OBJECTIVE, TOOL USE, etc.) with custom content.Problem
Currently, custom modes can only customize:
roleDefinition- The mode's identity/personacustomInstructions- Mode-specific behavioral instructionsThe middle sections of the system prompt are hardcoded and cannot be disabled or replaced except by creating a file at
.roo/system-prompt-{mode-slug}. Users want the ability to define a minimal/custom system prompt directly in their mode configuration without creating external files. This is useful for creating specialized modes (e.g., MCP-only modes) where the default "code assistant" framing is unnecessary.Solution
Added a new optional
systemPromptproperty to theModeConfigschema. When provided, it replaces the middle sections of the generated prompt with the custom content.Final prompt structure when
systemPromptis provided:Instead of:
Changes
packages/types/src/mode.ts- AddedsystemPromptto schema with JSDocsrc/core/prompts/system.ts- Implemented the override logicsrc/core/prompts/__tests__/system-prompt.spec.ts- Added 4 new testsPriority Order
.roo/system-prompt-{mode}) - highest prioritysystemPromptproperty - second priorityUsage Example
{ "slug": "mcp-only", "name": "MCP Only Mode", "roleDefinition": "You are an MCP assistant.", "groups": ["mcp"], "systemPrompt": "Use MCP tools to accomplish tasks. You have access to connected MCP servers.", "customInstructions": "Focus on efficiency." }Testing
Closes EXT-557
Important
Adds
systemPrompttoModeConfigfor custom prompt overrides, with priority handling and tests.systemPromptproperty toModeConfigschema inmode.tsfor custom prompt content.systemPromptis provided.systemPrompt> default prompt.system.ts: Implements logic to usesystemPromptfrom config or file.system-prompt.spec.ts: Adds tests forsystemPromptfunctionality, including priority handling.systemPromptinsystem-prompt.spec.ts.This description was created by
for 0c67a83. You can customize this summary. It will automatically update as commits are pushed.