This directory contains tools and output for converting CLI-format custom modes to VS Code-compatible format.
The Roo Code custom modes exist in two versions:
- CLI Version: Designed for command-line Roo Code
- VS Code Version: Designed for the Roo Code VS Code extension
This conversion tool transforms CLI modes into VS Code-compatible format.
vs-code/
├── convert_modes.py # Conversion script
├── converted_modes/ # Output directory
│ ├── custom_modes.yaml # VS Code-compatible mode definitions (186 modes)
│ ├── .roo/ # Rules directory
│ │ ├── rules-{slug}/ # One directory per mode
│ │ │ └── 1_instructions.xml
│ │ └── ... (186 mode directories)
│ └── README.md # Detailed usage guide
└── README.md # This file
cd Custom-Modes-Roo-Code/vs-code
python3 convert_modes.py listThis displays all available modes organized alphabetically.
# Search with wildcards
python3 convert_modes.py search code*
python3 convert_modes.py search *python* *architect*
# Search multiple patterns
python3 convert_modes.py search golang* rust* *developer*Convert all modes (merges with existing):
python3 convert_modes.py convert allConvert specific modes (adds or updates):
python3 convert_modes.py convert code-skeptic architect python-proCustom output directory:
python3 convert_modes.py convert all --output my_custom_modesPurge the output directory:
python3 convert_modes.py purgeCopy to remote environment (WSL/SSH):
python3 convert_modes.py copy remoteCopy to local environment:
python3 convert_modes.py copy localUsage: python3 convert_modes.py {list|search|convert|purge|copy} [args...] [options]
Commands:
list List all available modes
search Search for modes by pattern (supports wildcards)
convert Convert modes to VS Code format (merges with existing)
purge Empty the output directory
copy Copy converted modes to VS Code settings
Arguments:
For search: One or more search patterns (supports * wildcard)
For convert: Mode slugs to convert (use "all" for all modes)
For copy: Destination: 'remote' or 'local'
Options:
--source PATH Source custom_modes.yaml file (default: ../custom_modes.yaml)
--output DIR Output directory (default: converted_modes)
--help Show help message
Examples:
# List and search
python3 convert_modes.py list
python3 convert_modes.py search code* *python*
# Convert (merges with existing output)
python3 convert_modes.py convert all
python3 convert_modes.py convert code-skeptic architect
python3 convert_modes.py convert python-pro --output my_modes
# Manage output
python3 convert_modes.py purge
# Copy to VS Code
python3 convert_modes.py copy remote
python3 convert_modes.py copy local
Smart Merge (Default): The convert command now intelligently merges modes:
- Updates existing modes with new data
- Adds new modes that don't exist
- Preserves existing modes not being converted
Example output:
Conversion complete!
Output directory: 'converted_modes'
Total modes in output: 15
Updated: 3 mode(s)
Added: 2 new mode(s)
Kept: 10 existing mode(s)
This means you can:
- Convert a few modes initially
- Add more modes later without losing the first ones
- Update specific modes without affecting others
- Run
convert allmultiple times safely
After conversion, use the copy command to install:
Remote Environment (WSL/SSH):
python3 convert_modes.py copy remoteLocal Environment:
python3 convert_modes.py copy localManual Installation (if needed):
Remote (WSL/SSH):
cp converted_modes/custom_modes.yaml ~/.vscode-server/data/User/globalStorage/rooveterinaryinc.roo-cline/settings/
cp -r converted_modes/.roo ~/.vscode-server/data/User/globalStorage/rooveterinaryinc.roo-cline/settings/Local Linux:
cp converted_modes/custom_modes.yaml ~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/
cp -r converted_modes/.roo ~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/Local macOS:
cp converted_modes/custom_modes.yaml ~/Library/Application\ Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/
cp -r converted_modes/.roo ~/Library/Application\ Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/Local Windows:
copy converted_modes\custom_modes.yaml %APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\
xcopy /E /I converted_modes\.roo %APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\.rooThe convert_modes.py script:
- Lists all available modes organized alphabetically
- Searches for modes using wildcard patterns (* matches any characters)
- Converts modes from CLI to VS Code format with smart merging
- Merges new conversions with existing output (updates/adds/preserves)
- Purges output directory when needed
- Copies converted modes to VS Code settings (remote or local)
- Parses the CLI
custom_modes.yamlformat - Extracts mode metadata (slug, name, roleDefinition, groups)
- Creates VS Code-compatible YAML structure
- Generates XML instruction files from
customInstructions - Handles long filenames (truncates to 50 characters)
- Provides default
whenToUsetext if not specified
CLI Format:
customModes:
- slug: code-skeptic
name: 🧐 Code Skeptic
roleDefinition: You are a SKEPTICAL...
customInstructions: "You will: 1. NEVER ACCEPT..."
groups: [read, edit, browser, command, mcp]VS Code Format:
customModes:
- slug: code-skeptic
name: 🧐 Code Skeptic
roleDefinition: You are a SKEPTICAL...
whenToUse: Use when you need to act as a 🧐 Code Skeptic...
groups: [read, edit, browser, command, mcp]The customInstructions content is extracted to:
.roo/rules-code-skeptic/1_instructions.xml
What the script CAN do:
- ✅ List all available modes
- ✅ Search modes with wildcard patterns
- ✅ Convert mode metadata to VS Code format
- ✅ Smart merge: update existing, add new, preserve others
- ✅ Create proper directory structure
- ✅ Generate basic XML instruction files
- ✅ Purge output directory
- ✅ Copy to VS Code settings (remote/local)
- ✅ Handle all modes automatically
What the script CANNOT do:
- ❌ Create semantic XML structure (like
<workflow>,<step>,<actions>) - ❌ Split instructions into multiple logical XML files
- ❌ Infer meaningful structure from plain text
The CLI modes contain unstructured text instructions. Hand-crafted VS Code modes use rich, semantic XML. The conversion preserves the content but cannot automatically create semantic structure.
The script converts from ../custom_modes.yaml (the consolidated CLI file).
Note: The repository also contains individual YAML files in ../agents/ organized by category. These files have the same customInstructions content but include additional metadata:
categoryandsubcategoryfieldsversionandlastUpdatedtimestamps
The consolidated file was chosen for simplicity since the instruction content is identical.
- Converts modes incrementally without losing existing work
- Updates existing modes with new data
- Adds new modes without affecting others
- Preserves modes not being converted
- Wildcard pattern matching (* matches any characters)
- Search by slug or name
- Multiple patterns in single search
- Case-insensitive matching
- Copy to remote environment (WSL/SSH)
- Copy to local environment (native VS Code)
- Auto-detects correct paths for each platform
- Supports Windows, macOS, and Linux
The converted modes work immediately in VS Code with basic functionality.
Pros:
- Immediate availability of 186 modes
- No additional work required
Cons:
- Less structured than hand-crafted modes
- Plain text instructions vs. semantic XML
For frequently-used modes, manually restructure the XML:
- Read the plain text in
1_instructions.xml - Identify logical sections (workflow, best practices, examples)
- Create separate XML files with semantic structure
- Use meaningful tags like
<workflow>,<step>,<checklist>
Example Enhancement:
# Before (auto-converted)
rules-code-skeptic/
└── 1_instructions.xml # All content in one file
# After (manually enhanced)
rules-code-skeptic/
├── 1_workflow.xml # Structured workflow steps
├── 2_quality_gates.xml # Quality checklist
├── 3_verification.xml # Verification procedures
└── 4_examples.xml # Concrete examples- Use converted modes immediately
- Gradually enhance your most-used modes
- Share enhanced versions with the community
"File name too long" error:
- Already fixed in current version (filenames truncated to 50 chars)
"AttributeError: 'list' object has no attribute 'strip'":
- Already fixed in current version (proper list indexing)
Modes not appearing in VS Code:
- Verify files are in correct location (
~/.roo/or./.roo/) - Restart VS Code or reload Roo Code extension
- Check file permissions
Modes appear but don't work correctly:
- Verify XML files are present in
.roo/rules-{slug}/directories - Check for syntax errors in
custom_modes.yaml - Review VS Code console for errors
If you enhance any modes with better XML structure:
- Document your improvements
- Consider sharing with the community
- Create templates for similar modes
- Python 3.6+
- PyYAML library (
pip install pyyaml)
- Parse CLI YAML file
- Extract mode metadata
- Create VS Code YAML structure
- Generate XML files from
customInstructions - Handle filename length limits
- Provide default
whenToUseif missing
- Mode directories:
rules-{slug} - XML files:
{number}_{sanitized_title}.xml - Sanitization: lowercase, alphanumeric + underscores, max 50 chars
- v2.0 (2025-01-04): Enhanced conversion script
- Added search command with wildcard support
- Smart merge: updates/adds/preserves modes
- Added purge command
- Added copy command with remote/local support
- Fixed customModes key (was incorrectly "modes")
- Multiple pattern search support
- v1.0 (2025-01-04): Initial conversion script
- Converts modes from CLI to VS Code format
- Handles filename length limits
- Generates basic XML structure
For issues or questions:
- Check the detailed README in
converted_modes/README.md - Review Roo Code documentation
- Consult the community forums
Last Updated: 2025-01-04 Script Version: 2.0 Source: Custom-Modes-Roo-Code/custom_modes.yaml (CLI format) Target: VS Code Roo Code Extension
# Workflow example
python3 convert_modes.py list # See all modes
python3 convert_modes.py search *python* # Find Python modes
python3 convert_modes.py convert python-pro # Convert one mode
python3 convert_modes.py convert all # Convert all (merges)
python3 convert_modes.py copy remote # Install to VS Code