-
Notifications
You must be signed in to change notification settings - Fork 74
02_Mode_Selection_Guide
This guide provides structured information and principles to assist all users and AI modes (especially coordinators like session-manager, roo-dispatch, and roo-commander) in selecting the most appropriate specialist mode for a given task. Effective delegation is key to efficient project execution within the Roo Commander framework.
This guide enhances the original standard (.ruru/docs/standards/mode_selection_guide.md) by incorporating hierarchy concepts and explaining both automatic selection by coordinators and manual selection by users.
When deciding which mode should handle a task, consider these principles:
-
Specificity First: Always prefer a specialist mode whose core purpose and
tagsdirectly match the task's domain and technology over a generalist mode (e.g., useframework-reactfor React component implementation overlead-frontendorutil-senior-dev). -
Match Keywords & Context: Use the task description's keywords, required technologies, and the project's Stack Profile (
.ruru/context/stack_profile.json, if available) to find modes with matchingtagsor capabilities described in their summary/documentation. -
Consider Hierarchy & Task Level: Align the task's nature with the mode classifications (see
01_Mode_Roles_Hierarchy.md).-
Strategic/Planning: Directors (
manager-*,core-architect). -
Domain Oversight/Coordination: Leads (
lead-*). -
Implementation/Execution: Workers/Specialists (
dev-*,framework-*,spec-*,util-*). -
Support/Automation: Agents (
agent-*). Delegate "down" the hierarchy where appropriate.
-
Strategic/Planning: Directors (
-
Review Capabilities: If unsure between similar modes, consult their specific capabilities listed in the Mode Directory Reference (
03_Mode_Directory_Reference.md) or their individual.mode.mddocumentation. -
Use MDTM Appropriately: For complex, stateful, or high-risk tasks requiring detailed tracking, initiate the MDTM workflow (see
.roo/rules/04-mdtm-workflow-initiation.md) and specify theassigned_tomode in the task file's TOML. For simpler tasks, directnew_taskdelegation is sufficient. - Provide Clear Context: The clearer your task description and context, the better the automatic selection (by coordinators) or your manual selection will be.
-
When in Doubt, Ask/Default: If unsure which specialist to delegate to, ask a higher-level coordinator (
roo-commander) or delegate to the relevant Lead mode to handle the breakdown and further delegation.
Coordinating modes like roo-commander and roo-dispatch use a systematic process when automatically selecting a specialist for a delegated task:
- Analyze Task Input: Parse the task description, identifying keywords, required actions (e.g., "implement", "test", "refactor", "document", "configure"), and specific technologies mentioned (e.g., "React", "PostgreSQL", "Terraform", "FastAPI").
-
Consult Stack Profile: Check the project's Stack Profile (
.ruru/context/stack_profile.json) for preferred technologies and team familiarity, which can influence mode selection. -
Filter Available Modes: Review the list of available modes (from
.roomodesor internal knowledge). -
Match Metadata: Compare task requirements against mode metadata:
-
tags: Look for direct matches between task keywords/technologies and mode tags. -
summary/roleDefinition: Analyze for alignment between the task goal and the mode's core purpose. -
domain/sub_domain: Filter modes based on the task's domain (e.g., "backend", "frontend", "devops"). -
classification: Ensure the mode's role (e.g., "worker", "agent") is appropriate for the task type (implementation vs. support).
-
- Prioritize Specificity: Give preference to modes with highly specific matching tags or sub-domains over more generalist modes.
- Consider Hierarchy: Generally avoid delegating implementation tasks directly to Leads if appropriate Workers/Specialists exist.
- Select & Log: Choose the best-matching mode. Log the chosen mode and the rationale for the selection in the coordination log (e.g., the Commander's MDTM task file).
-
Fallback: If no suitable specialist is found, select the most relevant Lead or a capable generalist (like
util-senior-dev) and provide clear instructions, or escalate back to the user/requestor for guidance.
While coordinators aim for optimal automatic delegation, users have several ways to influence or directly control mode selection:
-
Influencing Automatic Selection:
-
Clear Prompts: Provide specific, unambiguous task descriptions to the coordinator (
session-manager,roo-commander). - Use Keywords: Include relevant technology names, action verbs, and domain keywords in your request.
- Reference Artifacts: Point to specific requirements documents, designs, or existing code files that provide context.
-
Clear Prompts: Provide specific, unambiguous task descriptions to the coordinator (
-
Direct Mode Interaction (Bypassing Coordinators):
- Mode Switcher: Use the mode selection dropdown in the Roo Code UI to activate a specific mode directly.
-
Chat Mention: Address a mode directly in chat using
@<mode-slug>(e.g.,@dev-react Please implement this component...). Note: The mode still operates under the coordination framework if initiated by Commander/Dispatch.
-
Specifying Assignee in MDTM:
- When creating or updating an MDTM task file (
.ruru/projects/[proj]/tasks/TASK-ID.md), you can manually set theassigned_tofield in the TOML frontmatter to the desired mode slug. Themanager-projectorroo-commanderwill then delegate to that specified mode when the task becomes active.
- When creating or updating an MDTM task file (
Caution: When you directly select a mode or specify an assignee, you take on more responsibility for ensuring that mode is the correct choice for the task's complexity and requirements. Coordinators provide a layer of analysis that is bypassed with direct selection.
(Note: The detailed information for each specific mode, including Core Purpose, Key Capabilities, and Hierarchy/Collaboration details, is intended to be automatically generated and maintained by a build script (e.g., build_mode_selection_guide_data.js) parsing individual .mode.md files. Manual updates to the detailed list below this point should generally be avoided.)
- Core Purpose: Highest-level coordinator for software development projects, managing goals, delegation, and project state.
- Key Capabilities: Implementation
-
Hierarchy & Collaboration:
-
Typical Delegators:
user -
Typical Reports To:
user -
Frequent Collaborators:
prime-coordinator,lead-*,manager-*,core-architect
-
Typical Delegators:
(... Auto-generated details for all other modes would follow here ...)
The general principles and explanations in Sections 1-4 are maintained manually. The detailed mode information in Section 5 should be kept up-to-date automatically by running the relevant build script (e.g., build_mode_selection_guide_data.js or build_roomodes.js if it also handles this) whenever modes are added, removed, or significantly changed.