Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Dec 26, 2025

Add an optional "mode" field to slash command front matter that will automatically switch to the specified mode if it exists when the command is executed.

Changes Made

Usage Example

Create a slash command with the mode field in frontmatter:

---
description: Debug the application
mode: debug
---

# Debug Command

Start debugging the application with proper breakpoints.

When this command is executed via run_slash_command, it will automatically switch to debug mode before presenting the command content.

Testing

All tests are passing:

  • ✅ Frontmatter parsing tests (16 tests passed)
  • ✅ RunSlashCommandTool tests (13 tests passed)

View task on Roo Code Cloud


Important

Add optional mode field to slash command front matter for automatic mode switching in commands.ts and RunSlashCommandTool.ts, with updated tests.

  • Behavior:
    • Add optional mode field to Command interface in commands.ts.
    • Update tryLoadCommand and scanCommandDirectory in commands.ts to parse mode from frontmatter.
    • Modify RunSlashCommandTool in RunSlashCommandTool.ts to switch mode if specified.
  • Testing:
    • Add tests for mode field parsing in frontmatter-commands.spec.ts.
    • Add tests for mode switching in runSlashCommandTool.spec.ts.
    • Update existing tests to include mode field.

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

- Add mode field to Command interface
- Update command parsing to extract mode from frontmatter
- Modify RunSlashCommandTool to automatically switch mode when specified
- Add comprehensive tests for mode field parsing and switching
- Update existing tests to include mode field
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 26, 2025
@roomote
Copy link
Contributor Author

roomote bot commented Dec 26, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The implementation cleanly adds an optional mode field to slash command frontmatter that automatically switches to the specified mode when a command is executed. Key observations:

  • Mode parsing follows consistent patterns with existing frontmatter fields
  • Mode validation uses getModeBySlug to check existence before switching
  • Graceful degradation when mode doesn't exist (command still executes)
  • Comprehensive test coverage for both tool-based and manual slash commands
  • All existing tests updated to handle the new return type

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

@mrubens mrubens marked this pull request as ready for review December 26, 2025 18:28
@mrubens mrubens requested review from cte, jr and mrubens as code owners December 26, 2025 18:28
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Enhancement New feature or request labels Dec 26, 2025
@roomote
Copy link
Contributor Author

roomote bot commented Dec 26, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The implementation cleanly adds an optional mode field to slash command frontmatter that automatically switches to the specified mode when a command is executed. Key observations:

  • Mode parsing follows consistent patterns with existing frontmatter fields (description, argumentHint)
  • Mode validation uses getModeBySlug to check existence before switching
  • Graceful degradation when mode doesn't exist (command still executes)
  • Return type changes to ParseMentionsResult and ProcessUserContentMentionsResult properly handled at all call sites
  • Comprehensive test coverage for both tool-based (RunSlashCommandTool) and manual slash commands (parseMentions)
  • All existing tests updated to handle the new return type structure

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

@mrubens mrubens merged commit 13370a2 into main Dec 27, 2025
23 checks passed
@mrubens mrubens deleted the feature/add-mode-field-to-slash-commands branch December 27, 2025 01:17
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Dec 27, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants