7.4 KiB
7.4 KiB
Mode Patterns Summary Guide
Quick Reference: Common Elements Across All Modes
1. Universal Structure Template
# [Mode Name] Mode (Enhanced/Custom)
## Mode Slug
`mode-slug`
## Role Definition (System Prompt Core)
You are Roo, [specific role description in 1-2 sentences]
## Custom Instructions
### [Numbered sections with mode-specific content]
## Tool Access (`groups`)
[List of tool groups and file regex patterns]
## `whenToUse`
[Clear description of when this mode should be activated]
## Notes & Research
[Optional section for implementation notes]
2. Core Protocol Sections (Present in Most Modes)
Section 0: Universal Protocols
- 0.0: Advanced Reasoning and Alignment Protocols (6 subsections)
- 0.1: Guiding Principles & Directives (3 subsections)
- 0.2: Core Development Principles (3 MOST PRIORITY items)
Common Workflow Elements
- Mermaid flowchart showing mode-specific workflow
- Memory Bank consultation as CRITICAL FIRST STEP
- Iterative development approach
- Tool prioritization guidelines
- Task completion protocols
3. Memory Bank Files Referenced
projectbrief.md
- Project scope and requirementsproductContext.md
- Problem definition and UX goalssystemPatterns.md
- Architecture and design patternstechContext.md
- Technology stack and constraintsactiveContext.md
- Current focus and decisionsprogress.md
- Project-wide progress trackingcurrentTask.md
- Current task implementation plan.clinerules
/.roo/rules/
- Project-specific patterns
4. Standard Tool Prioritization
File Reading Hierarchy:
search_files
- For targeted content searcheslist_code_definition_names
- For structural overviewread_file
(with line ranges) - For specific sections
File Editing Hierarchy:
apply_diff
- For targeted changesinsert_content
- For adding new blockssearch_and_replace
- For multiple replacementswrite_to_file
- Last resort for new files
Information Gathering Flow: Context7 MCP → Brave Search → Playwright MCP → Ask user
Mode-Specific Patterns
Information & Explanation Modes
Ask Mode
- Tool Access:
["read", "browser", "mcp"]
(no edit) - Key Features:
- Focuses on clear explanations with diagrams
- Uses Mermaid syntax for visualizations
- Cites sources when using external information
- Cannot modify files
Deep Research Mode
- Tool Access:
["read", "edit", "browser", "mcp", "command"]
- Key Features:
- Structured research output format
- Heavy MCP tool usage (Context7, Playwright, Brave)
- Creates
Research_Summary_[Topic].md
files - 9-section research document structure
Deep Thinker Mode
- Tool Access:
["read", "edit", "mcp", "browser"]
- Key Features:
- Primary tool:
sequentialthinking
MCP - Manages depth vs overthinking balance
- Creates
deep_analysis_[topic].md
files - Focuses on analysis, not solutions
- Primary tool:
Development Modes
Code Mode
- Tool Access:
["read", "edit", "browser", "command", "mcp"]
- Key Features:
- Full access to all tools
- Standard coding workflow with Memory Bank
- Complete, runnable code requirement
- Iterative development approach
Debug Mode
- Tool Access:
["read", "edit", "browser", "command", "mcp"]
- Key Features:
- Systematic hypothesis-testing approach
- Analyze stdout, stderr, exit codes
- Maximum 3 retry attempts
- Root cause analysis focus
Specialized Language Modes
Haskell God Mode
- File Regex:
(\\.hs|\\.lhs|\\.cabal)$
- Key Features:
- Large-scale repository optimization
- Surgical file reading with line ranges
- Skip extensive import sections
- Heavy use of search tools
ReScript Master Mode
- File Regex:
(\\.res|\\.resi)$
- Key Features:
- Monorepo awareness (17,000+ files)
- Prioritize existing components
- Semantic search for patterns
- Limited reading of reference files
Quality & Planning Modes
Code Reviewer Mode
- File Regex:
review\.md|.*_review\.md|projectbrief\.md|...
- Key Features:
- Uses
review.md
for iterative analysis - 12-point comprehensive checklist (A-L)
- Holistic review after initial pass
- Constructive feedback structure
- Uses
QA Tester Mode
- File Regex: Complex pattern for test files
- Key Features:
- Test strategy development
- Bug report structure
- Regression testing focus
- Updates
qa_memory_log.md
Enhanced Planning Mode
- Tool Access:
["read", "edit", "browser", "command", "mcp"]
- Key Features:
- Chain of Thought + Tree of Thought
- Failure context analysis (CARE framework)
- Deep research integration
- Creates detailed implementation plans
Coordination Mode
Orchestrator Mode
- File Regex:
(\\.roomodes|custom_modes\\.json)$
- Key Features:
- Can modify mode configurations
- Delegates via
new_task
tool - Monitors subtask progress
- Synthesizes results from multiple modes
Key Differentiators by Mode Type
Read-Only Modes
- Ask Mode: Information and explanations only
Full Access Modes
- Code, Debug, Enhanced Planning: Complete tool access
Restricted Edit Modes
- Code Reviewer: Can edit review files and memory bank
- QA Tester: Can edit test files and QA logs
- Orchestrator: Can only edit mode configuration files
Specialized Modes
- Haskell God: Optimized for large repos
- ReScript Master: Monorepo-specific strategies
- Deep Thinker: Analysis without implementation
- Deep Research: Structured research methodology
Anti-Reward Hacking Patterns
Each mode has specific anti-reward hacking instructions:
- Code: No placeholders, complete runnable code
- Debug: No superficial fixes, systematic analysis
- Code Reviewer: No glossing over issues, thorough review
- QA Tester: No superficial tests, comprehensive coverage
- Orchestrator: No poorly defined subtasks, genuine progress
- Deep Thinker: No shallow analysis, genuine depth
- Haskell/ReScript: No generic solutions, repo-specific code
Common Workflow Patterns
Standard Development Flow
Memory Bank → Understand → Plan → Implement → Test → Update Docs → Complete
Research/Analysis Flow
Memory Bank → Clarify Scope → Gather Info → Analyze → Synthesize → Document → Complete
Review/QA Flow
Memory Bank → Understand Context → Plan Strategy → Execute → Document Findings → Complete
Orchestration Flow
Memory Bank → Decompose → Delegate → Monitor → Synthesize → Update Progress → Complete
Recommendations for Mode Selection
- For Questions/Explanations: Ask Mode
- For Implementation: Code Mode
- For Bug Fixing: Debug Mode
- For Complex Planning: Enhanced Planning Mode
- For Research: Deep Research Mode
- For Analysis: Deep Thinker Mode
- For Code Quality: Code Reviewer Mode
- For Testing: QA Tester Mode
- For Multi-Step Projects: Orchestrator Mode
- For Haskell Projects: Haskell God Mode
- For ReScript Projects: ReScript Master Mode
Key Improvements Needed
- Reduce Repetition: Extract universal protocols to shared files
- Standardize Structure: Consistent section numbering
- Modernize Patterns: Add few-shot examples, better CoT
- Simplify Access: Clearer tool group definitions
- Enhance Clarity: Reduce word count by 50%
- Improve Modularity: Separate concerns into focused files