Course contents

Cline rules and skills: .clinerules setup guide

beginner2 min readUpdated
  • Cline
On this page

Where Cline looks

Workspace rules live in .clinerules/ or .cline/rules/ at the project root. Both are searched, so pick one (Cline rules docs). The VS Code Rules panel creates new rules in .clinerules/.

Cline also detects rules from other tools and lists them in the Rules panel, where you can toggle each one:

SourceLocation
Cline rules.clinerules/, .cline/rules/
Cursor.cursorrules
Windsurf.windsurfrules
AGENTS.mdAGENTS.md at the project root, and ~/.agents/AGENTS.md globally

Global Cline configuration lives under ~/.cline/ (Cline config).

Always-on rules

A rule file with no frontmatter is always active:

.clinerules/coding.md
# Coding standards
- TypeScript strict mode. No `any` at module boundaries.
- Use the logger in `src/lib/log.ts`, never `console.log` in server code.
- Run `pnpm test` before you report a task as done.

Conditional rules with paths

Add paths frontmatter to load a rule only when your current work matches. Cline looks at open files, visible tabs, mentioned paths and edited files. When one activates, you'll see a notice such as "Conditional rules applied: workspace:frontend-rules.md".

.clinerules/frontend-rules.md
---
paths:
  - "src/components/**"
  - "src/hooks/**"
---

# React components
- Function components with hooks only.
- Extract shared logic into a hook in `src/hooks/`.

paths is currently the only supported condition, and any matching pattern activates the rule.

Skills

Skills load on demand: Cline sees each skill's name and description (about 100 tokens each) and loads the full SKILL.md when your request matches (Cline skills docs).

ScopeLocation
Project.cline/skills/ (recommended), .clinerules/skills/, .claude/skills/, and .agents/skills/
Global~/.cline/skills/

When a global and a project skill share a name, the global one wins. name must match the folder name exactly, and description can be up to 1,024 characters.

.cline/skills/aws-deploy/SKILL.md
---
name: aws-deploy
description: "Deploy this service to AWS with CDK. Use when the user asks to deploy, update infrastructure, or roll back a stack."
---

1. Run `pnpm cdk diff` and show the diff.
2. Ask for confirmation before `pnpm cdk deploy`.
3. Report the stack outputs.

Type / in chat and pick the skill to run it directly. Each skill has an on/off toggle, and new skills are enabled by default.

Install a preset

npx presets-dev add nextjs --tool cline
created .clinerules/nextjs-rules.md
created .cline/skills/nextjs-code-review/SKILL.md
2 file action(s), 0 skipped. https://presets.dev

The rule uses paths for the App Router files, so it's conditional. The skill is in the recommended .cline/skills/ folder.

Preview: Next.js rule for Cline and Next.js code review skill for Cline.

Check that it loaded

Open the Rules panel to see every detected rule and its toggle. Open a matching file, send a message, and look for the "Conditional rules applied" notice.

Common mistakes

  • Duplicate guidance from other tools. If your repo has .cursorrules or AGENTS.md with the same content as .clinerules/, Cline loads both. Toggle one off in the Rules panel.
  • Duplicate skills. Cline reads .claude/skills/ and .agents/skills/ as well as .cline/skills/. If you also installed presets for Claude Code or Codex, the same skill can appear more than once. See multi-tool repos.
  • Folder name and name don't match. The skill won't load correctly.

Recap

  • Rules go in .clinerules/ or .cline/rules/; no frontmatter means always on.
  • paths frontmatter makes a rule conditional.
  • Skills go in .cline/skills/; Cline also reads .claude/skills/ and .agents/skills/.
  • Use the Rules panel toggles to switch off duplicates.

Next step

Codex setup.