diff --git a/.roo/rules-mode-writer/1_mode_creation_workflow.xml b/.roo/rules-mode-writer/1_mode_creation_workflow.xml
index 15a48aa804..532b4e07e7 100644
--- a/.roo/rules-mode-writer/1_mode_creation_workflow.xml
+++ b/.roo/rules-mode-writer/1_mode_creation_workflow.xml
@@ -6,6 +6,31 @@
+ Choose Mode Scope
+
+ Determine whether the mode should be global (available in all projects) or local (specific to current project)
+
+
+ Ask user to choose between global and local scope
+ Store the choice to determine file paths throughout the workflow
+
+
+
+ Should this be a global mode (available in all projects) or a local mode (only for this project)?
+
+ Global mode - available in all projects
+ Local mode - only for this project
+
+
+
+
+ The user's choice here determines where all files will be written:
+ - Global: Uses the system's global settings directory
+ - Local: Uses the current project's .roomodes and .roo/ directories
+
+
+
+
Gather Requirements
Understand what the user wants the mode to accomplish
@@ -29,7 +54,7 @@
-
+
Design Mode Configuration
Create the mode definition with all required fields
@@ -46,7 +71,7 @@
Detailed description of the mode's role and expertise
- Start with "You are Roo Code, a [specialist type]..."
+ Start with "You are Roo, a [specialist type]..."
List specific areas of expertise
Mention key technologies or methodologies
@@ -69,13 +94,36 @@
- Do not include customInstructions in the .roomodes configuration.
+ Do not include customInstructions in the mode configuration.
All detailed instructions should be placed in XML files within
- the .roo/rules-[mode-slug]/ directory instead.
+ the appropriate rules directory instead.
-
+
+ Write Mode Configuration
+
+ Save the mode configuration to the appropriate location based on scope
+
+
+
+ For global modes, write to the system's custom_modes.yaml file
+
+ Use the SYSTEM INFORMATION context to get the Home Directory,
+ then construct the path to the global settings directory.
+ The exact path varies by OS but follows patterns like:
+ - Windows: C:\Users\[username]\AppData\Roaming\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\custom_modes.yaml
+ - macOS/Linux: ~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/custom_modes.yaml
+
+
+
+ For local modes, write to the project's .roomodes file
+ .roomodes
+
+
+
+
+
Implement File Restrictions
Configure appropriate file access permissions
@@ -98,11 +146,21 @@ groups:
-
+
Create XML Instruction Files
- Design structured instruction files in .roo/rules-[mode-slug]/
+ Design structured instruction files in the appropriate rules directory
+
+
+ For global modes, create rules in the global .roo directory
+ [global-settings-dir]/.roo/rules-[mode-slug]/
+
+
+ For local modes, create rules in the project's .roo directory
+ .roo/rules-[mode-slug]/
+
+
Main workflow and step-by-step processes
Guidelines and conventions
@@ -118,7 +176,7 @@ groups:
-
+
Test and Refine
Verify the mode works as intended
@@ -129,14 +187,18 @@ groups:
- Instructions are clear and actionable
- Mode integrates well with Orchestrator
- All examples are accurate and helpful
+ - For global modes: Verify the mode is available in other projects
- Create mode in .roomodes for project-specific modes
- Create mode in global custom_modes.yaml for system-wide modes
- Use list_files to verify .roo folder structure
+ Always ask for scope (global/local) before creating a mode
+ Global modes: Write to system's custom_modes.yaml file
+ Local modes: Write to project's .roomodes file
+ Global rules: Create in [global-settings-dir]/.roo/rules-[slug]/
+ Local rules: Create in project's .roo/rules-[slug]/
+ Use list_files to verify folder structure
Test file regex patterns with search_files
\ No newline at end of file
diff --git a/.roo/rules-mode-writer/7_global_mode_paths.xml b/.roo/rules-mode-writer/7_global_mode_paths.xml
new file mode 100644
index 0000000000..d1986a8af8
--- /dev/null
+++ b/.roo/rules-mode-writer/7_global_mode_paths.xml
@@ -0,0 +1,97 @@
+
+
+ This file provides specific guidance for creating global modes that are available across all projects.
+ Global modes require special handling of file paths that vary by operating system.
+
+
+
+
+ When creating a global mode, you need to construct the correct path to the global settings directory.
+ This path varies by operating system and must be determined from the SYSTEM INFORMATION context.
+
+
+
+
+ Get System Information
+
+ Check the SYSTEM INFORMATION section for:
+ - Operating System (Windows, macOS, Linux)
+ - Home Directory path
+
+
+
+
+ Construct Global Settings Path
+
+
+ C:\Users\[username]\AppData\Roaming\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\
+ C:\Users\VooDoo\AppData\Roaming\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\
+ custom_modes.yaml
+
+
+ ~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/
+ /Users/username/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/
+ custom_modes.yaml
+
+
+ ~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/
+ /home/username/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/
+ custom_modes.yaml
+
+
+
+
+
+ Create Global Rules Directory
+
+ For global modes, the rules directory follows the same pattern but in a .roo subdirectory
+
+ [global-settings-dir]/.roo/rules-[mode-slug]/
+
+ Windows: C:\Users\VooDoo\AppData\Roaming\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\.roo\rules-api-dev\
+ macOS/Linux: ~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/.roo/rules-api-dev/
+
+
+
+
+
+
+ Creating a global mode called "api-dev"
+
+ Read SYSTEM INFORMATION to determine OS and home directory
+ Construct the global custom_modes.yaml path based on OS
+ Read existing custom_modes.yaml content (if it exists)
+ Add the new mode configuration to the customModes array
+ Write the updated content back to custom_modes.yaml
+ Create the global rules directory at [global-settings-dir]/.roo/rules-api-dev/
+ Write XML instruction files to the global rules directory
+
+
+
+
+
+ Always use absolute paths when working with global mode files.
+ The write_to_file tool will automatically create parent directories if they don't exist.
+
+
+ The Mode Writer mode now has permission to write to any .yaml or .xml file,
+ which enables it to write to the global custom_modes.yaml file.
+
+
+ When reading the global custom_modes.yaml file, handle the case where it might not exist yet.
+ The file should be created with an empty customModes array if it doesn't exist.
+
+
+
+
+
+ After creating a global mode, verify it works correctly
+
+
+ - The mode appears in the mode list in the current project
+ - Switch to a different project and verify the mode appears there too
+ - The global rules are loaded correctly from the global .roo directory
+ - The mode's file restrictions work as expected
+
+
+
\ No newline at end of file
diff --git a/.roomodes b/.roomodes
index d98a0fda7d..fb1e913d86 100644
--- a/.roomodes
+++ b/.roomodes
@@ -22,7 +22,7 @@ customModes:
groups:
- read
- - edit
- - fileRegex: (\.roomodes$|\.roo/.*\.xml$|\.yaml$)
+ - fileRegex: (\.roomodes$|.*\.xml$|.*\.yaml$)
description: Mode configuration files and XML instructions
- command
- mcp