diff --git a/.gitignore b/.gitignore index 87b0a66e..8173ee82 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +.devcontainer \ No newline at end of file diff --git a/docs/advanced-usage/custom-modes.md b/docs/advanced-usage/custom-modes.md index 49f82b5d..34f2a4f6 100644 --- a/docs/advanced-usage/custom-modes.md +++ b/docs/advanced-usage/custom-modes.md @@ -1,6 +1,6 @@ # Custom Modes -Roo Code allows you to create **custom modes** that can be either global (available across all projects) or project-specific (defined within a single project). These modes let you tailor Roo's behavior to specific tasks or workflows by defining: +Roo Code allows you to create **custom modes** to tailor Roo's behavior to specific tasks or workflows. Custom modes can be either **global** (available across all projects) or **project-specific** (defined within a single project). They allow you to define: * **A unique name and slug:** For easy identification. * **A role definition:** A description of the mode's purpose and expertise. @@ -15,7 +15,7 @@ Roo Code allows you to create **custom modes** that can be either global (availa * **Experimentation:** Safely experiment with different prompts and configurations without affecting other modes. * **Team Collaboration:** Share custom modes with your team to standardize workflows. -## Creating a Custom Mode +## Creating Custom Modes You have three options for creating custom modes: @@ -33,36 +33,54 @@ Roo Code will guide you through the process. ### 2. Using the Prompts Tab -1. **Open the Prompts Tab:** Click the icon in the Roo Code top menu bar. +1. **Open the Prompts Tab:** Click the notebook icon in the Roo Code top menu bar. 2. **Click "Create New Mode":** Use the "+" button to add a new mode. 3. **Fill in the Fields:** Enter the mode's name, role definition, custom instructions, and select the allowed tool groups. 4. **Click "Create Mode":** Save your new mode. Note: Adding/editing file type restrictions is not yet supported in the prompts tab UI. -### 3. Manual Configuration (Advanced) +### 3. Manual Configuration -Custom modes can be configured in two locations: +Custom modes can be configured by directly editing JSON files. There are two locations for custom mode configurations: -1. **Global Configuration:** - - Located at `~/Library/Application Support/Cursor/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_custom_modes.json` - - These modes are available across all projects +1. **Global Configuration:** + * Located at `~/Library/Application Support/Cursor/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_custom_modes.json` + * These modes are available across all projects. -2. **Project-Specific Configuration:** - - Located in `.roomodes` file in your project's root directory - - These modes are only available within that specific project - - Project-specific modes take precedence over global modes with the same slug +2. **Project-Specific Configuration:** + * Located in a `.roomodes` file in your project's root directory. + * These modes are only available within that specific project. + * **Project-specific modes take precedence over global modes with the same slug.** This means if you define a mode with the slug "code" in your `.roomodes` file, it will override the global "code" mode when you're working in that project. To edit either configuration: -1. **Open the Prompts Tab:** Click the icon in the Roo Code top menu bar. -2. **Open the Settings File:** Click the in the top right corner of the "Prompts" tab. +1. **Open the Prompts Tab:** Click the notebook icon in the Roo Code top menu bar. +2. **Open the Settings File:** Click the code icon (`<>`) in the top right corner of the "Prompts" tab. (This will allow you to edit either the Global or project-specific configuration file. You can also edit a project-specific configuration, by manually creating/opening the `.roomodes` file in your project's root directory.) 3. **Edit the JSON:** Add or modify mode configurations within the `customModes` array, following the format described below. 4. **Save the File:** Roo Code will automatically detect the changes. ## Custom Mode Configuration (JSON Format) -Both global and project-specific configuration files use the same JSON format. Here's an example: +Both global and project-specific configuration files use the same JSON format. The configuration is a JSON object with a `customModes` key, which contains an array of mode definitions. Each mode definition is a JSON object with the following properties: + +* `slug`: (Required) A unique identifier for the mode (lowercase letters, numbers, and hyphens). Shorter is better. +* `name`: (Required) The display name for the mode. +* `roleDefinition`: (Required) A detailed description of the mode's role and capabilities. +* `groups`: (Required) An array of allowed tool groups. Each group can be specified either as a string (e.g., `"edit"` to allow editing any file) or with file restrictions (e.g., `["edit", { "fileRegex": "\\.md$", "description": "Markdown files only" }]` to only allow editing markdown files). + * Available tool groups are: `"read"`, `"edit"`, `"browser"`, `"command"`, `"mcp"`. + * **Understanding `fileRegex`:** The `fileRegex` property uses a *regular expression* (or *regex*) to define which files the mode is allowed to edit. A regular expression is a sequence of characters that specifies a search pattern. Here's a breakdown of some common regex components used in the examples: + * `\.`: Matches a literal dot (`.`). The backslash is used to "escape" the dot, since a dot has a special meaning in regular expressions (matching any character). + * `(test|spec)`: Matches either "test" or "spec". The parentheses create a *capturing group*, and the pipe (`|`) acts as an "or". + * `(js|ts|jsx|tsx)`: Matches "js", "ts", "jsx", or "tsx". + * `$`: Matches the end of the string. This ensures that the entire filename matches the pattern, not just a part of it. + * For example, `\\.md$` matches any filename that ends with ".md". `\\.(test|spec)\\.(js|ts|jsx|tsx)$` matches filenames like "myComponent.test.js", "utils.spec.ts", etc. + * You can learn more about regular expressions on websites like [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions). +* `customInstructions`: (Optional) Additional instructions for the mode. + +Here are some examples: + +**Example 1: A simple documentation writer mode (could be global or project-specific):** ```json { @@ -76,7 +94,16 @@ Both global and project-specific configuration files use the same JSON format. H "read", ["edit", { "fileRegex": "\\.md$", "description": "Markdown files only" }] ] - }, + } + ] +} +``` + +**Example 2: A test engineer mode (could be global or project-specific):** + +```json +{ + "customModes": [ { "slug": "test-engineer", "name": "Test Engineer", @@ -90,6 +117,65 @@ Both global and project-specific configuration files use the same JSON format. H } ``` +**Example 3: Adding a new mode in a `.roomodes` file (project-specific):** + +```json +{ + "customModes": [ + { + "slug": "data-scientist", + "name": "Data Scientist", + "roleDefinition": "You are Roo, a data scientist with expertise in data analysis, machine learning, and statistical modeling.", + "groups": [ + "read", + "edit", + "command" + ], + "customInstructions": "Focus on data analysis and machine learning tasks." + } + ] +} +``` + +**Example 4: Overriding an existing mode in a `.roomodes` file (project-specific):** + +```json +{ + "customModes": [ + { + "slug": "code" + "name": "Code (Project-Specific)", + "roleDefinition": "You are Roo, a highly skilled software engineer. In this project, you have limited file access.", + "groups": [ + "read", + ["edit", { "fileRegex": "\\.(js|ts)$", "description": "JavaScript and TypeScript files only" }] + ], + "customInstructions": "Focus on JS and TS files in this project." + } + ] +} +``` + +**Example 5: Mode with File Restrictions (can be used in global or .roomodes)** +```json +{ + "customModes": [ + { + "slug": "markdown-editor", + "name": "Markdown Editor", + "roleDefinition": "You are Roo, a markdown editor with expertise in editing and formatting markdown files.", + "groups": [ + "read", + ["edit", { "fileRegex": "\\.md$", "description": "Markdown files only" }], + "browser" + ], + "customInstructions": "Focus on editing and formatting markdown files." + } + ] +} +``` +By following these instructions, you can create and manage custom modes to enhance your workflow with Roo-Code. + ## Community Gallery Ready to explore more? Check out the [Custom Modes Gallery](../community#custom-modes-gallery) to discover and share custom modes created by the community! \ No newline at end of file diff --git a/docs/community.md b/docs/community.md index 0d8831de..738ec617 100644 --- a/docs/community.md +++ b/docs/community.md @@ -39,3 +39,23 @@ A specialized mode for writing and maintaining Jest test suites with TypeScript "customInstructions": "When writing tests:\n- Always use describe/it blocks for clear test organization\n- Include meaningful test descriptions\n- Use beforeEach/afterEach for proper test isolation\n- Implement proper error cases\n- Add JSDoc comments for complex test scenarios\n- Ensure mocks are properly typed\n- Verify both positive and negative test cases" } ``` + +### VibeMode by [@richardwhiteii](https://github.com/richardwhiteii) + +A mode for transforming natural language descriptions into working code, embracing intuitive and flow-based development. + +```json +{ + "slug": "vibemode", + "name": "VibeMode", + "roleDefinition": "You are Roo, a Vibe Coding assistant that transforms natural language descriptions into working code. You embrace the philosophy that coding should be intuitive and flow-based, where developers can 'give in to the vibes' and focus on what they want to build rather than how to build it.\n\nDescription: An AI coding partner focused on natural language programming and vibe-based development with continuous testing\n\nSystem Prompt: You are a Vibe Coding assistant that helps transform natural language descriptions into working code. Focus on understanding intent over technical specifics while ensuring functionality through continuous testing. Embrace experimentation and rapid iteration with built-in validation.\n\nGoals:\n- Transform natural language descriptions into functional code\n- Maintain flow state by handling technical details automatically\n- Suggest improvements while preserving user intent\n- Handle error resolution autonomously when possible\n- Ensure code quality through continuous testing\n- Validate each iteration before proceeding\n\nPrimary Responsibilities:\n\nNatural Language Programming\n- Transform conversational descriptions into functional code\n- Handle technical implementation details automatically\n- Maintain creative flow by managing error resolution autonomously\n- Suggest improvements while preserving user intent\n- Generate appropriate tests for new functionality\n\nWorkflow Optimization\n- Minimize keyboard interaction by supporting voice-to-text input\n- Handle error messages through simple copy-paste resolution\n- Maintain context across development sessions\n- Switch to appropriate specialized modes when needed\n- Run tests automatically after each significant change\n- Provide immediate feedback on test results\n\nTest-Driven Development\n- Create tests before implementing new features\n- Validate changes through automated testing\n- Maintain test coverage throughout development\n- Flag potential issues early in the development cycle\n- Ensure backwards compatibility with existing functionality\n\nPrompt Templates:\n- Initialization: 'I want to create {description}'\n- Refinement: 'Can you modify this to {change}'\n- Error Handling: 'Fix this error: {error}'\n- Iteration: 'Let's improve {aspect}'\n- Test Creation: 'Generate tests for {feature}'\n- Validation: 'Verify the changes to {component}'", + "groups": [ + "read", + "edit", + "browser", + "command", + "mcp" + ], + "customInstructions": "Prioritize working solutions over perfect code. Use error messages as learning opportunities. Maintain a conversational, encouraging tone. Suggest improvements without breaking flow. Document key decisions and assumptions. Focus on understanding intent over technical specifics. Embrace experimentation and rapid iteration. Switch to architect mode when structural changes are needed. Switch to ask mode when research is required. Switch to code mode when precise implementation is needed. Maintain context across mode transitions. Handle errors autonomously when possible. Preserve code context and conversation history. Support voice-to-text input through SuperWhisper integration. Generate and run tests for each new feature. Validate all changes through automated testing. Maintain test coverage throughout development. Provide immediate feedback on test results. Flag potential issues early in development cycle. Ensure backwards compatibility." +} +```