Cette page est affichée en anglais. Une traduction française est en cours.
PromptsMay 7, 2026·2 min de lecture

.clinerules — Project Behavior File for Cline AI Agent

.clinerules is Cline's per-project rules file, read every task. Steers code style, libraries, conventions without retyping context. Roo-compatible.

Cline
Cline · Community
Prêt pour agents

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Stage only · 17/100Stage only
Surface agent
Tout agent MCP/CLI
Type
CLI Tool
Installation
Single
Confiance
Confiance : New
Point d'entrée
Asset
Commande CLI universelle
npx tokrepo install 3136dbec-c3dd-49db-acb4-f52bc7acda00
Introduction

.clinerules is the persistent rules file Cline reads on every task. It steers Cline's coding style, library choices, and project conventions without re-typing context. Best for: teams standardizing how an AI agent writes code in their codebase. Works with: Cline (VS Code), Roo Code (compatible). Setup time: under 1 minute.


Format

Create .clinerules (no extension) in your repo root. Cline reads it as plain text and injects it into every task's system prompt.

# Project: Acme Web

Code Style

  • TypeScript strict mode, no any
  • Functional components only, no class components
  • Prefer async/await over .then() chains

Libraries

  • UI: shadcn/ui + Tailwind (no Material UI, no Bootstrap)
  • HTTP: native fetch (no axios)
  • Forms: React Hook Form + Zod
  • State: Zustand (no Redux)

File Structure

  • Components in src/components/<feature>/
  • Hooks in src/hooks/
  • API routes in src/app/api/

Testing

  • Vitest, not Jest
  • Co-locate *.test.ts next to source
  • Mock at the network layer, not the function layer

Don't

  • Don't add comments unless asked
  • Don't refactor unrelated code in the same PR
  • Don't add new dependencies without confirming

### Per-folder rules

You can also drop `.clinerules` in subdirectories. Cline reads the closest one to the file being edited:

src/ ├── .clinerules # frontend rules ├── components/ └── api/ └── .clinerules # backend-specific overrides


### Plan / Act mode

Cline supports a Plan / Act split  Plan reviews the rules file, asks clarifying questions, and proposes the change before any file is touched. Act executes. The rules file is read in both phases.

---

### FAQ

**Q: Is .clinerules free?**
A: Yes. The Cline VS Code extension itself is free and open-source (Apache-2.0). You bring your own LLM API key (Claude / OpenAI / OpenRouter / etc) and pay for inference.

**Q: Will Roo Code read .clinerules?**
A: Yes  Roo Code is a Cline fork and stays compatible with the .clinerules format. Same file, same behavior.

**Q: How long can the rules file be?**
A: Practically, keep it under ~500 lines. The file goes into every system prompt, so very long rules waste tokens on every task. Split per-folder or move long context into a referenced doc.

---
🙏

Source et remerciements

Built by Cline. Licensed under Apache-2.0.

cline/cline — ⭐ 50,000+

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires