输入你的请求
了解如何使用自然语言与 Roo Code 有效沟通。输入请求、示例以及避免常见陷阱的最佳实践。 keywords: Roo Code 请求,自然语言 AI,输入命令,AI 沟通,请求示例,最佳实践
输入你的请求
Roo Code 旨在理解自然语言。你无需使用任何特殊命令或语法即可与其通信。只需像与人类开发人员交谈一样,用简单的英语输入你的请求即可。
有效的请求策略
清楚地说明你希望 Roo Code 做什么。避免使用模糊或含糊的语言。
| 策略 | 实施 |
|---|---|
| 具体 | 使用 "Fix the bug in calculateTotal that returns incorrect results" 取代 "Fix the code" |
| 提供上下文 | 使用 @上下文提示 来引用文件和代码 |
| 分解任务 | 将复杂的任务分解为更小、更易于管理的步骤 |
| 包含示例 | 当你需要特定的格式或样式时,提供示例代码 |
示例请求
create a new file named `utils.py` and add a function called `add` that takes two numbers as arguments and returns their sum
in the file @src/components/Button.tsx, change the color of the button to blue
find all instances of the variable `oldValue` in @/src/App.js and replace them with `newValue`
run the command `npm install` in the terminal
explain the function `calculateTotal` in @/src/utils.ts
@problems address all detected problems
要避免的常见陷阱
| 不要 | 要 |
|---|---|
| 模糊不清的请求 | 具体说明需要做什么 |
| 假设上下文 | 明确引用文件和函数 |
| 过多的技术术语 | 使用清晰、直截了当的语言 |
| 多个不相关的任务 | 一次提交一个重点突出的请求 |
| 未经确认就继续 | 检查代码以确保其完整 |