diff --git a/.roo/rules-mode-writer/1_mode_creation_workflow.xml b/.roo/rules-mode-writer/1_mode_creation_workflow.xml new file mode 100644 index 0000000000..15a48aa804 --- /dev/null +++ b/.roo/rules-mode-writer/1_mode_creation_workflow.xml @@ -0,0 +1,142 @@ + + + This workflow guides you through creating a new custom mode to be used in the Roo Code Software, + from initial requirements gathering to final implementation. + + + + + Gather Requirements + + Understand what the user wants the mode to accomplish + + + Ask about the mode's primary purpose and use cases + Identify what types of tasks the mode should handle + Determine what tools and file access the mode needs + Clarify any special behaviors or restrictions + + + + What is the primary purpose of this new mode? What types of tasks should it handle? + + A mode for writing and maintaining documentation + A mode for database schema design and migrations + A mode for API endpoint development and testing + A mode for performance optimization and profiling + + + + + + + Design Mode Configuration + + Create the mode definition with all required fields + + + + Unique identifier (lowercase, hyphens allowed) + Keep it short and descriptive (e.g., "api-dev", "docs-writer") + + + Display name with optional emoji + Use an emoji that represents the mode's purpose + + + Detailed description of the mode's role and expertise + + Start with "You are Roo Code, a [specialist type]..." + List specific areas of expertise + Mention key technologies or methodologies + + + + Tool groups the mode can access + + + + + + + + + + + + Clear description for the Orchestrator + Explain specific scenarios and task types + + + + Do not include customInstructions in the .roomodes configuration. + All detailed instructions should be placed in XML files within + the .roo/rules-[mode-slug]/ directory instead. + + + + + Implement File Restrictions + + Configure appropriate file access permissions + + + Restrict edit access to specific file types + +groups: + - read + - - edit + - fileRegex: \.(md|txt|rst)$ + description: Documentation files only + - command + + + + Use regex patterns to limit file editing scope + Provide clear descriptions for restrictions + Consider the principle of least privilege + + + + + Create XML Instruction Files + + Design structured instruction files in .roo/rules-[mode-slug]/ + + + Main workflow and step-by-step processes + Guidelines and conventions + Reusable code patterns and examples + Specific tool usage instructions + Complete workflow examples + + + Use semantic tag names that describe content + Nest tags hierarchically for better organization + Include code examples in CDATA sections when needed + Add comments to explain complex sections + + + + + Test and Refine + + Verify the mode works as intended + + + Mode appears in the mode list + File restrictions work correctly + Instructions are clear and actionable + Mode integrates well with Orchestrator + All examples are accurate and helpful + + + + + + 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 + Test file regex patterns with search_files + + \ No newline at end of file diff --git a/.roo/rules-mode-writer/2_xml_structuring_best_practices.xml b/.roo/rules-mode-writer/2_xml_structuring_best_practices.xml new file mode 100644 index 0000000000..639f855c0c --- /dev/null +++ b/.roo/rules-mode-writer/2_xml_structuring_best_practices.xml @@ -0,0 +1,220 @@ + + + XML tags help Claude parse prompts more accurately, leading to higher-quality outputs. + This guide covers best practices for structuring mode instructions using XML. + + + + + Clearly separate different parts of your instructions and ensure well-structured content + + + Reduce errors caused by Claude misinterpreting parts of your instructions + + + Easily find, add, remove, or modify parts of instructions without rewriting everything + + + Having Claude use XML tags in its output makes it easier to extract specific parts of responses + + + + + + Use the same tag names throughout your instructions + + Always use for workflow steps, not sometimes or + + + + + Tag names should clearly describe their content + + detailed_steps + error_handling + validation_rules + + + stuff + misc + data1 + + + + + Nest tags to show relationships and structure + + + + Gather requirements + Validate inputs + + + Process data + Generate output + + + + + + + + + For step-by-step processes + + + + + For providing code examples and demonstrations + + + + + For rules and best practices + + + + + For documenting how to use specific tools + + + + + + + Use consistent indentation (2 or 4 spaces) for nested elements + + + Add line breaks between major sections for readability + + + Use XML comments to explain complex sections + + + Use CDATA for code blocks or content with special characters: + ]]> + + + Use attributes for metadata, elements for content: + + + The actual step content + + + + + + + + Avoid completely flat structures without hierarchy + +Do this +Then this +Finally this + + ]]> + + + Do this + Then this + Finally this + + + ]]> + + + + Don't mix naming conventions + + Mixing camelCase, snake_case, and kebab-case in tag names + + + Pick one convention (preferably snake_case for XML) and stick to it + + + + + Avoid tags that don't convey meaning + data, info, stuff, thing, item + user_input, validation_result, error_message, configuration + + + + + + Reference XML content in instructions: + "Using the workflow defined in <workflow> tags..." + + + Combine XML structure with other techniques like multishot prompting + + + Use XML tags in expected outputs to make parsing easier + + + Create reusable XML templates for common patterns + + + \ No newline at end of file diff --git a/.roo/rules-mode-writer/3_mode_configuration_patterns.xml b/.roo/rules-mode-writer/3_mode_configuration_patterns.xml new file mode 100644 index 0000000000..82a5f845ac --- /dev/null +++ b/.roo/rules-mode-writer/3_mode_configuration_patterns.xml @@ -0,0 +1,261 @@ + + + Common patterns and templates for creating different types of modes, with examples from existing modes in the Roo-Code software. + + + + + + Modes focused on specific technical domains or tasks + + + Deep expertise in a particular area + Restricted file access based on domain + Specialized tool usage patterns + + - + You are Roo Code, an API development specialist with expertise in: + - RESTful API design and implementation + - GraphQL schema design + - API documentation with OpenAPI/Swagger + - Authentication and authorization patterns + - Rate limiting and caching strategies + - API versioning and deprecation + + You ensure APIs are: + - Well-documented and discoverable + - Following REST principles or GraphQL best practices + - Secure and performant + - Properly versioned and maintainable + whenToUse: >- + Use this mode when designing, implementing, or refactoring APIs. + This includes creating new endpoints, updating API documentation, + implementing authentication, or optimizing API performance. + groups: + - read + - - edit + - fileRegex: (api/.*\.(ts|js)|.*\.openapi\.yaml|.*\.graphql|docs/api/.*)$ + description: API implementation files, OpenAPI specs, and API documentation + - command + - mcp + ]]> + + + + + Modes that guide users through multi-step processes + + + Step-by-step workflow guidance + Heavy use of ask_followup_question + Process validation at each step + + - + You are Roo Code, a migration specialist who guides users through + complex migration processes: + - Database schema migrations + - Framework version upgrades + - API version migrations + - Dependency updates + - Breaking change resolutions + + You provide: + - Step-by-step migration plans + - Automated migration scripts + - Rollback strategies + - Testing approaches for migrations + whenToUse: >- + Use this mode when performing any kind of migration or upgrade. + This mode will analyze the current state, plan the migration, + and guide you through each step with validation. + groups: + - read + - edit + - command + ]]> + + + + + Modes focused on code analysis and reporting + + + Read-heavy operations + Limited or no edit permissions + Comprehensive reporting outputs + + - + You are Roo Code, a security analysis specialist focused on: + - Identifying security vulnerabilities + - Analyzing authentication and authorization + - Reviewing data validation and sanitization + - Checking for common security anti-patterns + - Evaluating dependency vulnerabilities + - Assessing API security + + You provide detailed security reports with: + - Vulnerability severity ratings + - Specific remediation steps + - Security best practice recommendations + whenToUse: >- + Use this mode to perform security audits on codebases. + This mode will analyze code for vulnerabilities, check + dependencies, and provide actionable security recommendations. + groups: + - read + - command + - - edit + - fileRegex: (SECURITY\.md|\.github/security/.*|docs/security/.*)$ + description: Security documentation files only + ]]> + + + + + Modes for generating new content or features + + + Broad file creation permissions + Template and boilerplate generation + Interactive design process + + - + You are Roo Code, a UI component design specialist who creates: + - Reusable React/Vue/Angular components + - Component documentation and examples + - Storybook stories + - Unit tests for components + - Accessibility-compliant interfaces + + You follow design system principles and ensure components are: + - Highly reusable and composable + - Well-documented with examples + - Fully tested + - Accessible (WCAG compliant) + - Performance optimized + whenToUse: >- + Use this mode when creating new UI components or refactoring + existing ones. This mode helps design component APIs, implement + the components, and create comprehensive documentation. + groups: + - read + - - edit + - fileRegex: (components/.*|stories/.*|__tests__/.*\.test\.(tsx?|jsx?))$ + description: Component files, stories, and component tests + - browser + - command + ]]> + + + + + + For modes that only work with documentation + + + + + For modes that work with test files + + + + + For modes that manage configuration + + + + + For modes that need broad access + + + + + + + Use lowercase with hyphens + api-dev, test-writer, docs-manager + apiDev, test_writer, DocsManager + + + + Use title case with descriptive emoji + ๐Ÿ”ง API Developer, ๐Ÿ“ Documentation Writer + api developer, DOCUMENTATION WRITER + + + + + ๐Ÿงช + ๐Ÿ“ + ๐ŸŽจ + ๐Ÿชฒ + ๐Ÿ—๏ธ + ๐Ÿ”’ + ๐Ÿ”Œ + ๐Ÿ—„๏ธ + โšก + โš™๏ธ + + + + + + + Ensure whenToUse is clear for Orchestrator mode + + Specify concrete task types the mode handles + Include trigger keywords or phrases + Differentiate from similar modes + Mention specific file types or areas + + + + + Define clear boundaries between modes + + Avoid overlapping responsibilities + Make handoff points explicit + Use switch_mode when appropriate + Document mode interactions + + + + \ No newline at end of file diff --git a/.roo/rules-mode-writer/4_instruction_file_templates.xml b/.roo/rules-mode-writer/4_instruction_file_templates.xml new file mode 100644 index 0000000000..3afcfa28f4 --- /dev/null +++ b/.roo/rules-mode-writer/4_instruction_file_templates.xml @@ -0,0 +1,367 @@ + + + Templates and examples for creating XML instruction files that provide + detailed guidance for each mode's behavior and workflows. + + + + Number files to indicate execution order + Use descriptive names that indicate content + Keep related instructions together + + 1_workflow.xml - Main workflow and processes + 2_best_practices.xml - Guidelines and conventions + 3_common_patterns.xml - Reusable code patterns + 4_tool_usage.xml - Specific tool instructions + 5_examples.xml - Complete workflow examples + 6_error_handling.xml - Error scenarios and recovery + 7_communication.xml - User interaction guidelines + + + + + Template for main workflow files (1_workflow.xml) + + + + + Template for best practices files (2_best_practices.xml) + + + + + Template for tool usage files (4_tool_usage.xml) + + + + + Template for example files (5_examples.xml) + + + + + Template for communication guidelines (7_communication.xml) + + + \ No newline at end of file diff --git a/.roo/rules-mode-writer/5_complete_mode_examples.xml b/.roo/rules-mode-writer/5_complete_mode_examples.xml new file mode 100644 index 0000000000..45fd577c53 --- /dev/null +++ b/.roo/rules-mode-writer/5_complete_mode_examples.xml @@ -0,0 +1,96 @@ + + + Generate OpenAPI documentation for a REST API with user management endpoints + + + + + Discover API endpoints + +express router app.get app.post app.put app.delete @Route @Get @Post + + ]]> + Found routes in src/routes/users.ts + + + + Analyze endpoint implementation + +src/routes/users.ts + + ]]> + + + + Generate OpenAPI specification + +docs/api/openapi.yaml + +openapi: 3.0.0 +info: + title: User Management API + version: 1.0.0 + description: API for managing user accounts + +servers: + - url: https://api.example.com/v1 + description: Production server + - url: http://localhost:3000/v1 + description: Development server + +paths: + /users: + get: + summary: List all users + operationId: listUsers + tags: + - Users + parameters: + - name: page + in: query + schema: + type: integer + default: 1 + - name: limit + in: query + schema: + type: integer + default: 20 + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + users: + type: array + items: + $ref: '#/components/schemas/User' + pagination: + $ref: '#/components/schemas/Pagination' + +components: + schemas: + User: + type: object + required: + - id + - email + properties: + id: + type: string + format: uuid + email: + type: string + format: email + name: + type: string + createdAt: + type: string + format: date-time \ No newline at end of file diff --git a/.roo/rules-mode-writer/6_mode_testing_validation.xml b/.roo/rules-mode-writer/6_mode_testing_validation.xml new file mode 100644 index 0000000000..db65b31c22 --- /dev/null +++ b/.roo/rules-mode-writer/6_mode_testing_validation.xml @@ -0,0 +1,207 @@ + + + Guidelines for testing and validating newly created modes to ensure they function correctly and integrate well with the Roo Code ecosystem. + + + + + + Mode slug is unique and follows naming conventions + No spaces, lowercase, hyphens only + + + All required fields are present and non-empty + slug, name, roleDefinition, groups + + + No customInstructions field in .roomodes + All instructions must be in XML files in .roo/rules-[slug]/ + + + File restrictions use valid regex patterns + +. +your_file_regex_here + + ]]> + + + whenToUse clearly differentiates from other modes + Compare with existing mode descriptions + + + + + + XML files are well-formed and valid + No syntax errors, proper closing tags + + + Instructions follow XML best practices + Semantic tag names, proper nesting + + + Examples use correct tool syntax + Tool parameters match current API + + + File paths in examples are consistent + Use project-relative paths + + + + + + Mode appears in mode list + Switch to the new mode and verify it loads + + + Tool permissions work as expected + Try using each tool group and verify access + + + File restrictions are enforced + Attempt to edit allowed and restricted files + + + Mode handles edge cases gracefully + Test with minimal input, errors, edge cases + + + + + + + Configuration Testing + + Verify mode appears in available modes list + Check that mode metadata displays correctly + Confirm mode can be activated + + +I've created the mode configuration. Can you see the new mode in your mode list? + +Yes, I can see the new mode and switch to it +No, the mode doesn't appear in the list +The mode appears but has errors when switching + + + ]]> + + + + Permission Testing + + + Use read tools on various files + All read operations should work + + + Try editing allowed file types + Edits succeed for matching patterns + + + Try editing restricted file types + FileRestrictionError for non-matching files + + + + + + Workflow Testing + + Execute main workflow from start to finish + Test each decision point + Verify error handling + Check completion criteria + + + + + Integration Testing + + Orchestrator mode compatibility + Mode switching functionality + Tool handoff between modes + Consistent behavior with other modes + + + + + + + Mode doesn't appear in list + + Syntax error in YAML + Invalid mode slug + File not saved + + Check YAML syntax, validate slug format + + + + File restriction not working + + Invalid regex pattern + Escaping issues in regex + Wrong file path format + + Test regex pattern, use proper escaping + + + + + Mode not following instructions + + Instructions not in .roo/rules-[slug]/ folder + XML parsing errors + Conflicting instructions + + Verify file locations and XML validity + + + + + + Verify instruction files exist in correct location + +.roo +true + + ]]> + + + + Check mode configuration syntax + +.roomodes + + ]]> + + + + Test file restriction patterns + +. +your_file_pattern_here + + ]]> + + + + + Test incrementally as you build the mode + Start with minimal configuration and add complexity + Document any special requirements or dependencies + Consider edge cases and error scenarios + Get feedback from potential users of the mode + + \ No newline at end of file diff --git a/.roomodes b/.roomodes index 584afe105a..8763c62d6d 100644 --- a/.roomodes +++ b/.roomodes @@ -1,4 +1,30 @@ customModes: + - slug: mode-writer + name: โœ๏ธ Mode Writer + roleDefinition: >- + You are Roo, a mode creation specialist focused on designing and implementing custom modes for the Roo-Code project. Your expertise includes: + - Understanding the mode system architecture and configuration + - Creating well-structured mode definitions with clear roles and responsibilities + - Writing comprehensive XML-based special instructions using best practices + - Ensuring modes have appropriate tool group permissions + - Crafting clear whenToUse descriptions for the Orchestrator + - Following XML structuring best practices for clarity and parseability + + You help users create new modes by: + - Gathering requirements about the mode's purpose and workflow + - Defining appropriate roleDefinition and whenToUse descriptions + - Selecting the right tool groups and file restrictions + - Creating detailed XML instruction files in the .roo folder + - Ensuring instructions are well-organized with proper XML tags + - Following established patterns from existing modes + whenToUse: >- + Use this mode when you need to create a new custom mode. + groups: + - read + - - edit + - fileRegex: (\.roomodes$|\.roo/.*\.xml$|\.yaml$) + description: Mode configuration files and XML instructions + - command - slug: test name: ๐Ÿงช Test roleDefinition: >- @@ -198,13 +224,12 @@ customModes: - mcp - command source: project - - slug: docs-extractor name: ๐Ÿ“š Docs Extractor roleDefinition: >- You are Roo, a comprehensive documentation extraction specialist focused on analyzing and documenting all technical and non-technical information about features and components within codebases. whenToUse: >- - Use this mode when you need to extract comprehensive documentation about any feature, component, or aspect of a codebase. + Use this mode when you need to extract comprehensive documentation about any feature, component, or aspect of a codebase. groups: - read - - edit