⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Jan 22, 2026

Summary

Add a new systemPrompt property to ModeConfig that 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/persona
  • customInstructions - Mode-specific behavioral instructions

The 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 systemPrompt property to the ModeConfig schema. When provided, it replaces the middle sections of the generated prompt with the custom content.

Final prompt structure when systemPrompt is provided:

roleDefinition + systemPrompt + customInstructions

Instead of:

roleDefinition + MARKDOWN + TOOL USE + MCP SERVERS + CAPABILITIES + MODES + RULES + SYSTEM INFO + OBJECTIVE + customInstructions

Changes

  • packages/types/src/mode.ts - Added systemPrompt to schema with JSDoc
  • src/core/prompts/system.ts - Implemented the override logic
  • src/core/prompts/__tests__/system-prompt.spec.ts - Added 4 new tests

Priority Order

  1. File-based (.roo/system-prompt-{mode}) - highest priority
  2. Config systemPrompt property - second priority
  3. Default generated prompt - fallback

Usage 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

  • All 5104 tests pass
  • 4 new tests added for systemPrompt functionality

Closes EXT-557


Important

Adds systemPrompt to ModeConfig for custom prompt overrides, with priority handling and tests.

  • Behavior:
    • Adds systemPrompt property to ModeConfig schema in mode.ts for custom prompt content.
    • Overrides default prompt sections (e.g., TOOL USE, CAPABILITIES) when systemPrompt is provided.
    • Priority: file-based > config systemPrompt > default prompt.
  • Implementation:
    • system.ts: Implements logic to use systemPrompt from config or file.
    • system-prompt.spec.ts: Adds tests for systemPrompt functionality, including priority handling.
  • Testing:
    • 4 new tests added for systemPrompt in system-prompt.spec.ts.
    • All existing tests pass.

This description was created by Ellipsis for 0c67a83. You can customize this summary. It will automatically update as commits are pushed.

@daniel-lxs daniel-lxs requested review from cte, jr and mrubens as code owners January 22, 2026 21:49
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Enhancement New feature or request labels Jan 22, 2026
@roomote
Copy link
Contributor

roomote bot commented Jan 22, 2026

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The implementation correctly:

  • Adds the systemPrompt property to the ModeConfig schema with proper JSDoc
  • Implements the priority order (file-based > config systemPrompt > default)
  • Includes comprehensive test coverage for all scenarios

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

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

Labels

Enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants