NAME
.roomodes — instruction file for Roo Code
SYNOPSIS
./.roomodes
METADATA
DESCRIPTION
`.roomodes` is the custom modes definition file for Roo Code (formerly Roo-Cline), a VS Code AI coding extension forked from Cline. It defines persona-based AI modes, each with a unique role definition (system prompt), tool permissions, and optional file access restrictions.
Each mode in the `customModes` array specifies which tool groups it can use: `read`, `edit`, `browser`, `command`, and `mcp`. Tool groups can include file regex restrictions to limit which files a mode can modify, enabling least-privilege patterns like a 'Frontend Dev' mode that can only edit component files.
Roo Code ships with built-in modes (Code, Architect, Ask, Debug, Orchestrator) and .roomodes lets teams define project-specific modes. The file works alongside `.roo/rules/` which provides instruction rules loaded within modes.
STRUCTURE
ANNOTATED EXAMPLE
1{
2 "customModes": [
3 {
4 "slug": "frontend-dev",
5 "name": "Frontend Developer",
6 "roleDefinition": "You are a senior frontend engineer specializing in React and TypeScript. Focus on component architecture, accessibility, and performance.",
7 "groups": [
8 "read",
9 ["edit", { "fileRegex": "src/components/.*\\.tsx?$" }],
10 "browser",
11 "command"
12 ],
13 "customInstructions": "Always use Tailwind CSS. Prefer server components."
14 },
15 {
16 "slug": "reviewer",
17 "name": "Code Reviewer",
18 "roleDefinition": "You are a thorough code reviewer. Analyze code for bugs, security issues, and style violations. Never edit files directly.",
19 "groups": [
20 "read",
21 "browser"
22 ]
23 },
24 {
25 "slug": "db-admin",
26 "name": "Database Admin",
27 "roleDefinition": "You manage database schemas, migrations, and queries. Only modify files in the db/ and migrations/ directories.",
28 "groups": [
29 "read",
30 ["edit", { "fileRegex": "(db|migrations)/.*" }],
31 "command"
32 ]
33 }
34 ]
35}
COMMON MISTAKES
While Roo Code can auto-detect YAML, the canonical format is JSON. Most documentation and examples use JSON. Stick with JSON for maximum compatibility.
These serve different purposes: .roomodes creates custom AI personas with specific tool permissions and role definitions. .roo/rules/ contains instruction files that can be loaded conditionally within any mode.
Custom modes start with no tool permissions. You must explicitly grant access to tool groups (read, edit, browser, command, mcp). Without groups, the mode can only chat — it cannot read files, edit code, or run commands.