Prompt Coding Limited info

Roo Code: Improve Selected Code (Readability, Performance, Practices, Edge Cases)

The "Improve" code action template from Roo Code: it asks for improvements in readability and maintainability, performance, best practices and patterns, and error handling and edge cases, with the improved code and an explanation for each change.

  • 🤖 Any chat LLM
  • 🗂️ Coding

Prompt by Roo Code, Inc. (RooCodeInc/Roo-Code) · Original source (opens in a new tab)

Roo Code: Improve Selected Code (Readability, Performance, Practices, Edge Cases) — prompt preview

The prompt

prompt
Improve the following code from file path ${filePath}:${startLine}-${endLine}
${userInput}

```
${selectedText}
```

Please suggest improvements for:
1. Code readability and maintainability
2. Performance optimization
3. Best practices and patterns
4. Error handling and edge cases

Provide the improved code along with explanations for each enhancement.

What it is

The "Improve" code action template from Roo Code: it asks for improvements in readability and maintainability, performance, best practices and patterns, and error handling and edge cases, with the improved code and an explanation for each change. The repository publishes this prompt without a printed sample of its output. The prompt text comes from the Roo-Code repository (Apache License 2.0, Copyright 2025 Roo Code, Inc.). Licence: https://github.com/RooCodeInc/Roo-Code/blob/main/LICENSE. Original author: Roo Code, Inc. (RooCodeInc/Roo-Code). Changes by FoxaMind: JavaScript template-literal quotes removed, escaped backticks and \${ unescaped; ${...} placeholders keep the source syntax.

Who it's for

  • Developers refactoring a function or block
  • People building editor code actions

قالب إجراء "حسّن" في Roo Code: يطلب تحسينات في سهولة القراءة والصيانة، الأداء، أفضل الممارسات والأنماط، ومعالجة الأخطاء والحالات الطرفية، مع الكود المحسّن وشرح لكل تعديل.

Tips

  • ${filePath}, ${startLine}, ${endLine}, ${selectedText} and ${userInput} are filled by the extension.
  • The prompt asks for the improved code together with an explanation for each enhancement.