RooPrompts/docs/mode-patterns-summary.md
2025-06-04 14:04:37 +05:30

241 lines
No EOL
7.4 KiB
Markdown

# Mode Patterns Summary Guide
## Quick Reference: Common Elements Across All Modes
### 1. Universal Structure Template
```markdown
# [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 requirements
- `productContext.md` - Problem definition and UX goals
- `systemPatterns.md` - Architecture and design patterns
- `techContext.md` - Technology stack and constraints
- `activeContext.md` - Current focus and decisions
- `progress.md` - Project-wide progress tracking
- `currentTask.md` - Current task implementation plan
- `.clinerules` / `.roo/rules/` - Project-specific patterns
### 4. Standard Tool Prioritization
**File Reading Hierarchy:**
1. `search_files` - For targeted content searches
2. `list_code_definition_names` - For structural overview
3. `read_file` (with line ranges) - For specific sections
**File Editing Hierarchy:**
1. `apply_diff` - For targeted changes
2. `insert_content` - For adding new blocks
3. `search_and_replace` - For multiple replacements
4. `write_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
### 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
#### 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
1. **For Questions/Explanations**: Ask Mode
2. **For Implementation**: Code Mode
3. **For Bug Fixing**: Debug Mode
4. **For Complex Planning**: Enhanced Planning Mode
5. **For Research**: Deep Research Mode
6. **For Analysis**: Deep Thinker Mode
7. **For Code Quality**: Code Reviewer Mode
8. **For Testing**: QA Tester Mode
9. **For Multi-Step Projects**: Orchestrator Mode
10. **For Haskell Projects**: Haskell God Mode
11. **For ReScript Projects**: ReScript Master Mode
## Key Improvements Needed
1. **Reduce Repetition**: Extract universal protocols to shared files
2. **Standardize Structure**: Consistent section numbering
3. **Modernize Patterns**: Add few-shot examples, better CoT
4. **Simplify Access**: Clearer tool group definitions
5. **Enhance Clarity**: Reduce word count by 50%
6. **Improve Modularity**: Separate concerns into focused files