简介
Roo Code 的 Modes 是带作用域的 agent 人格 —— Architect(只规划不动文件)/ Code(改代码)/ Ask(只读问答)/ Debug(根因调查)。每个模式有独立的系统 prompt 和工具白名单,所以你不会遇到「架构师顺手改文件」或「调试员加新依赖」。适合需要清晰分离规划和执行的团队。兼容 Roo Code(VS Code)和 Cursor(通过 .roomodes 配置)。装机时间 30 秒。
4 个默认模式
| 模式 | 干什么 | 允许的工具 |
|---|---|---|
| Architect | 读代码、规划改动、写设计文档 | 只读 + 创建设计文档 |
| Code | 按规划改代码 | 读 + 写 + 执行 |
| Ask | 回答关于代码库的问题 | 只读 |
| Debug | 系统化调查 bug | 读 + 选择性执行(不改文件) |
切换:Cmd+Shift+P → Roo Code: Switch Mode 或聊天面板里的下拉菜单。
自定义模式
在仓库里建 .roomodes 加项目专属模式:
customModes:
- slug: security-auditor
name: Security Auditor
roleDefinition: |
You are a security auditor. Read code, identify OWASP Top 10
vulnerabilities, and produce a severity-classified report.
Never modify files.
groups:
- read
- mcp
customInstructions: |
Output findings as a markdown table: severity | file:line | issue | fix.
Cite the OWASP category for each finding.
- slug: pr-reviewer
name: PR Reviewer
roleDefinition: |
You are a senior reviewer. Read git diff, flag bugs and style issues,
suggest improvements. Never modify files.
groups:
- read
customInstructions: |
Use git CLI to read the diff. Output a markdown review comment.Boomerang 任务委派
模式之间通过 Boomerang 协作 —— Architect 规划完,用 new_task 工具 委派 给 Code。Code 跑完之后把结果 "回旋" 给 Architect 做验证。一个用户 prompt 驱动多模式工作流。
FAQ
Q: Roo Code 免费吗? A: 免费。Roo Code Apache-2.0 开源。你用自己的 LLM API key(Claude / OpenAI / Bedrock / OpenRouter 等),按推理量付费。
Q: 跟 Cline 区别在哪? A: Roo Code 是 2025 年从 Cline fork 出来的,加了 Modes、Boomerang 任务委派、自定义模式定义。Cline 还停在单模式模型。两边都兼容 .clinerules / .roomodes 格式。
Q: Cursor 能用 modes 吗? A: Roo Code 是独立的 VS Code 扩展。Cursor 有自己的 Custom Modes 特性(v0.45+),用不同的配置格式。这份资产里的 .roomodes 文件是 Roo 专用。