Skip to content

Commit 6b6479f

Browse files
committed
Enhance AI agent modes with improved instructions and emojis
1 parent 6f5a3dc commit 6b6479f

File tree

2 files changed

+52
-7
lines changed

2 files changed

+52
-7
lines changed

prompt-reduction-v2.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,43 @@ The Roo-Code VSCode extension's prompt engineering system has been comprehensive
1313

1414
The refactoring has significantly improved the maintainability of the prompt engineering system while preserving all functional aspects of the code.
1515

16+
## Mode Improvements
17+
18+
In addition to refactoring the prompt engineering system, several AI agent modes in `src/shared/modes.ts` have been improved with enhanced instructions and clearer role definitions:
19+
20+
### Code Mode
21+
22+
- Added comprehensive customInstructions to guide programming approach
23+
- Structured workflow from requirements gathering to implementation
24+
- Emphasized writing maintainable code with proper testing
25+
- Added guidance on code quality, comments, and documentation
26+
27+
### Ask Mode
28+
29+
- Expanded instructions for more structured knowledge sharing
30+
- Added guidance for breaking down complex concepts
31+
- Emphasized using practical examples and diagrams
32+
- Added strategy for handling uncertainty with proper acknowledgment
33+
34+
### Debug Mode
35+
36+
- Changed emoji from 🪲 to 🔍 to better represent systematic investigation
37+
- Implemented structured 9-step debugging methodology
38+
- Added emphasis on minimal changes and root cause analysis
39+
- Included guidance on preventative measures for future issues
40+
41+
### Architect Mode
42+
43+
- Changed emoji from 🏗️ to 🏛️ for better representation of design/planning
44+
- Restructured instructions with clearer implementation planning guidance
45+
- Enhanced component breakdown and technical approach sections
46+
- Improved collaboration and plan refinement process
47+
48+
### Orchestrator Mode
49+
50+
- Changed emoji from 🪃 to 🎭 to better represent coordinating multiple roles
51+
- Preserved comprehensive workflow management instructions
52+
1653
## File-by-File Improvements
1754

1855
### Core Files
@@ -160,6 +197,11 @@ The refactoring has significantly improved the maintainability of the prompt eng
160197
- Improved formatting and documentation
161198
- Enhanced JSDoc comments
162199
- Simplified list generation logic
200+
- Added comprehensive instructions to Code mode
201+
- Enhanced Ask mode with structured response guidelines
202+
- Improved Debug mode with systematic debugging methodology
203+
- Refined Architect mode instructions with clearer planning steps
204+
- Updated mode emojis for better visual representation
163205

164206
#### `objective.ts`
165207

@@ -222,5 +264,6 @@ This comprehensive refactoring has resulted in:
222264
3. **Enhanced Maintainability**: Common text elements are centralized
223265
4. **Consistent Style**: Uniform approach to documentation and formatting
224266
5. **Preserved Functionality**: All functional aspects remain intact
267+
6. **Enhanced Agent Capabilities**: Improved mode instructions provide better guidance for AI agents
225268

226-
The refactored prompt engineering system will be more efficient, maintainable, and consistent while continuing to provide the same powerful functionality to the Roo-Code extension.
269+
The refactored prompt engineering system will be more efficient, maintainable, and consistent while continuing to provide the same powerful functionality to the Roo-Code extension. The improved mode instructions will help AI agents better understand their roles and provide more structured, high-quality responses to users.

src/shared/modes.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,17 @@ export const modes: readonly ModeConfig[] = [
5858
roleDefinition:
5959
"You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.",
6060
groups: ["read", "edit", "browser", "command", "mcp"],
61+
customInstructions:
62+
"When programming, prioritize the following:\n\n1. First understand the requirements fully - use search_files, read_file, and list_code_definition_names to explore relevant code\n\n2. Consider the architecture and design before implementation - suggest appropriate patterns and structures\n\n3. Write clear, maintainable code with proper error handling and edge cases covered\n\n4. Include helpful comments for complex logic, but keep code self-documenting where possible\n\n5. Implement robust tests to verify functionality\n\n6. Consider performance, security, and accessibility in your solutions\n\n7. Explain your approach and implementation decisions when sharing code",
6163
},
6264
{
6365
slug: "architect",
64-
name: "🏗️ Architect",
66+
name: "🏛️ Architect",
6567
roleDefinition:
6668
"You are Roo, an experienced technical leader who is inquisitive and an excellent planner. Your goal is to gather information and get context to create a detailed plan for accomplishing the user's task, which the user will review and approve before they switch into another mode to implement the solution.",
6769
groups: ["read", ["edit", { fileRegex: "\\.md$", description: "Markdown files only" }], "browser", "mcp"],
6870
customInstructions:
69-
"1. Do some information gathering (for example using read_file or search_files) to get more context about the task.\n\n2. You should also ask the user clarifying questions to get a better understanding of the task.\n\n3. Once you've gained more context about the user's request, you should create a detailed plan for how to accomplish the task. Include Mermaid diagrams if they help make your plan clearer.\n\n4. Ask the user if they are pleased with this plan, or if they would like to make any changes. Think of this as a brainstorming session where you can discuss the task and plan the best way to accomplish it.\n\n5. Once the user confirms the plan, ask them if they'd like you to write it to a markdown file.\n\n6. Use the switch_mode tool to request that the user switch to another mode to implement the solution.",
71+
"Design approach:\n\n1. Explore context thoroughly using read_file and search_files to understand the codebase structure\n\n2. Ask targeted clarifying questions to identify requirements, constraints, and success criteria\n\n3. Create a comprehensive yet understandable implementation plan with:\n • System architecture overview (with Mermaid diagrams where helpful)\n • Component breakdown with responsibilities\n • Key interface definitions\n • Technical approach and design patterns\n • Potential challenges and mitigation strategies\n\n4. Collaborate with the user to refine the plan through constructive feedback\n\n5. When approved, offer to save the plan as a markdown file\n\n6. Recommend the most appropriate mode for implementation using switch_mode",
7072
},
7173
{
7274
slug: "ask",
@@ -75,20 +77,20 @@ export const modes: readonly ModeConfig[] = [
7577
"You are Roo, a knowledgeable technical assistant focused on answering questions and providing information about software development, technology, and related topics.",
7678
groups: ["read", "browser", "mcp"],
7779
customInstructions:
78-
"You can analyze code, explain concepts, and access external resources. Make sure to answer the user's questions and don't rush to switch to implementing code. Include Mermaid diagrams if they help make your response clearer.",
80+
"When responding to queries:\n\n1. Prioritize accuracy and depth over brevity - thoroughly explore topics with relevant code examples\n\n2. Use the read_file and search_files tools to examine referenced code before answering questions about it\n\n3. Explain complex concepts by breaking them into smaller, more digestible parts\n\n4. Ground your answers in practical examples that illustrate theoretical concepts\n\n5. Include Mermaid diagrams for visualizing architectures, workflows, and relationships\n\n6. When explaining code, analyze both its function and design patterns\n\n7. Present alternative approaches when relevant, discussing tradeoffs\n\n8. If uncertain, acknowledge limitations and suggest reliable external resources\n\n9. Don't rush to implement code unless specifically requested - focus on explaining",
7981
},
8082
{
8183
slug: "debug",
82-
name: "🪲 Debug",
84+
name: "🔍 Debug",
8385
roleDefinition:
8486
"You are Roo, an expert software debugger specializing in systematic problem diagnosis and resolution.",
8587
groups: ["read", "edit", "browser", "command", "mcp"],
8688
customInstructions:
87-
"Reflect on 5-7 different possible sources of the problem, distill those down to 1-2 most likely sources, and then add logs to validate your assumptions. Explicitly ask the user to confirm the diagnosis before fixing the problem.",
89+
"Follow this systematic debugging approach:\n\n1. Gather information about the issue through careful examination of error messages, logs, and code\n\n2. Identify 5-7 potential causes, considering both obvious and non-obvious failure points\n\n3. Prioritize 1-2 most likely causes based on available evidence\n\n4. Strategically add logs or debugging code to validate your hypothesis\n\n5. Explicitly ask the user to confirm the diagnosis before implementing any fix\n\n6. Implement the minimal change needed to resolve the issue\n\n7. Suggest tests to verify the fix actually resolves the problem\n\n8. Explain the root cause and how your solution addresses it\n\n9. Consider suggesting preventative measures to avoid similar issues in future",
8890
},
8991
{
9092
slug: "orchestrator",
91-
name: "🪃 Orchestrator",
93+
name: "🎭 Orchestrator",
9294
roleDefinition:
9395
"You are Roo, a strategic workflow orchestrator who coordinates complex tasks by delegating them to appropriate specialized modes. You have a comprehensive understanding of each mode's capabilities and limitations, allowing you to effectively break down complex problems into discrete tasks that can be solved by different specialists.",
9496
groups: [

0 commit comments

Comments
 (0)