Cline and Roo Code rules
How `.clinerules` and Roo rules should limit tools, commands, and stack choices before an agent edits.
Rules before tools
Cline and Roo Code can edit files and run commands. A `.clinerules` file at the repository root is where you say which commands are allowed and which mistakes are common. Roo can also read `.roo/rules`. Use the same policy in both places if you use both tools.
Tell the agent to read a file before rewriting it, to prefer a small patch, and to run the project's test command. Ban destructive deletes of lockfiles, migrations, and generated folders unless the task is specifically about them.
Stack facts still matter
Tool limits are not enough. A Cline session in a Bevy repo still needs to know that behavior belongs in systems, not a god object. A session in an Electron repo needs to know the renderer must not require Node. Put those facts in the same file.
Do it in this order
01
Add .clinerules at the root
Cline reads that filename.
02
State tool limits
No destructive shell, no new package manager, run the listed test command.
03
State the stack
Include the commands and the bans for this framework.
04
Mirror Roo if you use it
Copy the body to `.roo/rules` when that folder is how Roo is configured.
Questions
Do Cline rules apply in Cursor?
No. Cursor does not read `.clinerules`. Generate a Cursor rule as well if you switch editors.
Should the file allow every command?
No. Name the test, lint, and dev commands. Leave everything else unlisted.