ROOMODES(5)ROOMODES(5)

NAME

.roomodes — instruction file for Roo Code

SYNOPSIS

./.roomodes

METADATA

FORMATJson
FILENAME.roomodes
CASE SENSITIVEYes
TOOLRoo Code
ENCODINGUTF-8
GIT COMMITTEDYes
MAX SIZE10KB
SINCERoo Code (formerly Roo-Cline) 2025

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

├──Custom Modes ArrayREQUIRED
A `customModes` array where each entry defines a mode with `slug`, `name`, `roleDefinition` (system prompt), `groups` (tool permissions), and optional `customInstructions`.
└──Tool GroupsREQUIRED
Each mode specifies allowed tool groups: `read`, `edit`, `browser`, `command`, `mcp`. Groups can be simple strings or arrays with file glob restrictions like `['edit', { fileRegex: '\\.test\\.ts$' }]`.

ANNOTATED EXAMPLE

.roomodes
json
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

Gotchas
✗WRONG Using YAML format for .roomodes
✓RIGHT .roomodes is JSON (or auto-detected YAML) — JSON is the primary format

While Roo Code can auto-detect YAML, the canonical format is JSON. Most documentation and examples use JSON. Stick with JSON for maximum compatibility.

✗WRONG Confusing .roomodes with .roo/rules/
✓RIGHT .roomodes defines persona modes; .roo/rules/ defines instruction rules loaded within modes

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.

✗WRONG Forgetting to set tool group permissions for a custom mode
✓RIGHT Every custom mode needs explicit `groups` — modes have no tool access by default

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.

USED BY

SIMILAR FILES

.roo/rules/*.mdRoo Code Rules
.clinerules/Cline Rules & Memory Bank
.cursor/rules/*.mdcCursor Rules (MDC Format)

COMPARISONS

agentconfig.ing2026-03-16ROOMODES(5)