Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Dec 3, 2025

Summary

The system prompt sections no longer change based on which tools are available. All tool-specific instructions are now in the tool descriptions themselves. This simplifies the codebase and makes tool behavior self-contained.

Changes

Tool Descriptions Updated (XML & Native)

  • codebase_search: Added CRITICAL usage instructions about using it first for code exploration
  • write_to_file: Added guidance about preferring other editing tools, complete file content requirements, project creation best practices
  • search_files: Added regex pattern crafting guidance, context analysis tips
  • browser_action: Added web development usage guidance, non-development task handling

System Prompt Sections Simplified

  • rules.ts: Removed getEditingInstructions(), all editing tool conditionals, browser_action conditionals. Function signature simplified from 8 params to 3.
  • capabilities.ts: Removed all tool availability conditionals, diffStrategy, mode-specific logic. Function signature simplified from 9 params to 2.
  • tool-use-guidelines.ts: Removed codeIndexManager parameter and conditional guidelines. Function signature simplified.
  • objective.ts: Removed all parameters and conditional codebase_search instruction. Function now takes no parameters.
  • system.ts: Updated calls to match new simplified signatures

Tests Updated

  • Deleted mode-aware-sections.spec.ts (was testing removed behavior)
  • Updated sections.spec.ts for new signatures
  • Updated snapshot files

Benefits

  • Tool instructions are self-contained in their descriptions
  • System prompt is simpler and more predictable
  • Reduced coupling between prompt sections and tool availability
  • Easier to add/modify tool instructions without affecting system prompt

Testing

All 4456 tests pass (339 test files)


Important

Refactor system prompt to decouple tool-specific instructions, simplifying the codebase and enhancing predictability.

  • Behavior:
    • System prompt no longer changes based on available tools; tool-specific instructions are now in tool descriptions.
    • codebase_search must be used first for unexplored code areas.
  • Code Changes:
    • Removed tool availability conditionals from rules.ts, capabilities.ts, tool-use-guidelines.ts, and objective.ts.
    • Simplified function signatures in rules.ts, capabilities.ts, tool-use-guidelines.ts, and objective.ts.
    • Updated sections.spec.ts and objective.spec.ts to reflect changes.
  • Testing:
    • Deleted mode-aware-sections.spec.ts as it tested removed behavior.
    • Updated sections.spec.ts for new function signatures.
    • All tests pass (4456 tests across 339 files).

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

@roomote
Copy link
Contributor

roomote bot commented Dec 3, 2025

Rooviewer Clock   See task on Roo Cloud

Re-reviewed the latest commits. The previously flagged issue has been resolved. No new issues found.

  • Remove unused diffStrategy parameter from getRulesSection() in rules.ts
Previous reviews

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

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 3, 2025
Copy link
Collaborator

@hannesrudolph hannesrudolph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is a well-structured refactor that achieves its stated goal of decoupling tool-specific instructions from system prompt sections. The changes reduce coupling and make the codebase simpler and more maintainable. Found one cleanup issue noted below.

Note: The PR has merge conflicts that need to be resolved before merging.

@daniel-lxs daniel-lxs marked this pull request as ready for review December 5, 2025 01:37
@daniel-lxs daniel-lxs requested review from cte, jr and mrubens as code owners December 5, 2025 01:37
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Dec 5, 2025
@roomote
Copy link
Contributor

roomote bot commented Dec 5, 2025

Rooviewer Clock   See task on Roo Cloud

Review completed. Found 1 minor cleanup issue.

This refactoring successfully decouples tool-specific instructions from the system prompt by moving them into the tool descriptions themselves. The changes simplify the codebase while maintaining the same functionality.

  • Remove unused diffStrategy parameter from getRulesSection() in rules.ts

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

The system prompt sections no longer change based on which tools are available.
All tool-specific instructions are now in the tool descriptions themselves.

- codebase_search: Added CRITICAL usage instructions about using it first
- write_to_file: Added guidance about preferring other editing tools
- search_files: Added regex pattern crafting guidance
- browser_action: Added web development usage guidance

- rules.ts: Removed getEditingInstructions(), all tool conditionals
- capabilities.ts: Removed all tool availability conditionals
- tool-use-guidelines.ts: Removed codeIndexManager conditional guidelines
- objective.ts: Removed all parameters and conditional instructions
- system.ts: Updated calls to match new simplified signatures

- Deleted mode-aware-sections.spec.ts (tests for removed behavior)
- Updated sections.spec.ts for new signatures
- Updated snapshot files
@daniel-lxs daniel-lxs force-pushed the decouple-tools-from-system-prompt branch from 66d632a to 3f5c534 Compare December 5, 2025 16:13
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Dec 5, 2025
@hannesrudolph hannesrudolph added PR - Needs Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Dec 5, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 5, 2025
@mrubens mrubens merged commit dd92453 into main Dec 5, 2025
20 of 23 checks passed
@mrubens mrubens deleted the decouple-tools-from-system-prompt branch December 5, 2025 21:26
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Dec 5, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer PR - Needs Review size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants