Skip to content

Commit ecba14e

Browse files
committed
feat(mode-writer): Add global vs. local mode creation choice
This commit enhances the 'Mode Writer' mode by introducing a new workflow that allows users to choose between creating a global or a local mode. - Updates `1_mode_creation_workflow.xml` to include a new initial step for selecting the mode's scope (global/local) and adjusts subsequent steps to handle file paths and directory creation accordingly. - Modifies `.roomodes` to update the `whenToUse` description and broaden the `fileRegex` to allow editing of global configuration files.
1 parent de13d8a commit ecba14e

File tree

2 files changed

+47
-8
lines changed

2 files changed

+47
-8
lines changed

.roo/rules-mode-writer/1_mode_creation_workflow.xml

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,25 @@
66

77
<detailed_steps>
88
<step number="1">
9+
<title>Choose Mode Scope</title>
10+
<description>
11+
Determine whether the mode should be available globally or only within the current project.
12+
</description>
13+
<actions>
14+
<action>Ask the user to select the mode's scope.</action>
15+
</actions>
16+
<example>
17+
<ask_followup_question>
18+
<question>Should this be a global mode (available in all projects) or a local mode (only for this project)?</question>
19+
<follow_up>
20+
<suggest>Create a global mode</suggest>
21+
<suggest>Create a local mode</suggest>
22+
</follow_up>
23+
</ask_followup_question>
24+
</example>
25+
</step>
26+
27+
<step number="2">
928
<title>Gather Requirements</title>
1029
<description>
1130
Understand what the user wants the mode to accomplish
@@ -29,7 +48,28 @@
2948
</example>
3049
</step>
3150

32-
<step number="2">
51+
<step number="3">
52+
<title>Define Final File Paths and Create Directories</title>
53+
<description>
54+
Based on the selected scope, define the absolute paths for the mode's configuration and rule files, and create the necessary directories directly in the final location.
55+
</description>
56+
<actions>
57+
<action>
58+
If "global" is selected, construct the full path using the 'Home Directory' from the SYSTEM INFORMATION section. The base path is `[Home Directory]/AppData/Roaming/Code/User/globalStorage/rooveterinaryinc.roo-cline/`. The mode configuration file is `[base path]/settings/custom_modes.yaml` and the rules directory is `[base path]/.roo/rules-[mode-slug]/`.
59+
</action>
60+
<action>
61+
If "local" is selected, the mode configuration file is `.roomodes` and the rules directory is `.roo/rules-[mode-slug]/` relative to the workspace root.
62+
</action>
63+
<action>
64+
Create the `rules-[mode-slug]` directory directly in the final destination path (local or global).
65+
</action>
66+
</actions>
67+
<important_note>
68+
Always use the full, absolute path when creating directories and writing files for global modes.
69+
</important_note>
70+
</step>
71+
72+
<step number="4">
3373
<title>Design Mode Configuration</title>
3474
<description>
3575
Create the mode definition with all required fields
@@ -75,7 +115,7 @@
75115
</important_note>
76116
</step>
77117

78-
<step number="3">
118+
<step number="5">
79119
<title>Implement File Restrictions</title>
80120
<description>
81121
Configure appropriate file access permissions
@@ -98,10 +138,10 @@ groups:
98138
</guidelines>
99139
</step>
100140

101-
<step number="4">
141+
<step number="6">
102142
<title>Create XML Instruction Files</title>
103143
<description>
104-
Design structured instruction files in .roo/rules-[mode-slug]/
144+
Design structured instruction files and write them directly to the full path determined in the previous step (e.g., `C:\Users\...\rules-[mode-slug]/` for global, or `./.roo/rules-[mode-slug]/` for local). Do not create files locally and move them.
105145
</description>
106146
<file_structure>
107147
<file name="1_workflow.xml">Main workflow and step-by-step processes</file>
@@ -118,7 +158,7 @@ groups:
118158
</xml_best_practices>
119159
</step>
120160

121-
<step number="5">
161+
<step number="7">
122162
<title>Test and Refine</title>
123163
<description>
124164
Verify the mode works as intended

.roomodes

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ customModes:
1717
- Creating detailed XML instruction files in the .roo folder
1818
- Ensuring instructions are well-organized with proper XML tags
1919
- Following established patterns from existing modes
20-
whenToUse: Use this mode when you need to create a new custom mode.
21-
description: Create and implement custom modes.
20+
whenToUse: Use this mode when you need to create a new custom mode. It will guide you through the process of creating a new mode, including choosing whether to create it globally (available in all projects) or locally (for the current project only).
2221
groups:
2322
- read
2423
- - edit
25-
- fileRegex: (\.roomodes$|\.roo/.*\.xml$|\.yaml$)
24+
- fileRegex: (\.roomodes$|.*\.xml$|.*\.yaml$)
2625
description: Mode configuration files and XML instructions
2726
- command
2827
- mcp

0 commit comments

Comments
 (0)