Continue rules examples work best when they encode repo-specific contracts that land in the system message for Agent, Chat, and Edit—not autocomplete or apply. This page shows Markdown files under .continue/rules/, common frontmatter fields, and snippets you can copy, then tighten against your own verify commands. Treat every path and key here as illustrative— Continue releases change discovery and behavior, so re-check docs.continue.dev (customize / deep-dives / rules) on your installed version before treating any example as permanent.

01

Independence note

02

What Continue rules are for (vs prompts & config)

In Continue, rules feed the system message for Agent, Chat, and Edit sessions. They do not inject into autocomplete or apply. That split matters: put durable repo contracts in rules; put this ticket’s goal in the chat brief; keep ephemeral observations out of committed rule files.

  • Rules: package manager, route registry, forbidden deploy paths, test commands, language defaults.
  • Session prompts: this ticket’s objective, acceptance checks, and temporary non-goals.
  • Neither: secrets, production credentials, or one-off customer data.

If you already maintain Cursor- or Windsurf-oriented rules, the engineering intent is similar—different packaging and loaders. Compare side-by-side in cursor rules examples and windsurf rules examples. Multi-file choice notes live in AGENTS.md vs CLAUDE.md vs Cursor rules. For reusable root agent docs many hosts also load, see how to write AGENTS.md.

03

File layout, load order & frontmatter

Project rules usually live at the workspace root under.continue/rules/. Markdown .md is the recommended format; YAML rule files are still supported in many setups. Files load in lexicographic order—prefix with 01-, 02- when sequence matters. You can also declare string rules or uses:references under rules: in config.yaml; prefer the directory when teammates need reviewable, concern-scoped files.

.continue/
  rules/
    01-general.md          # alwaysApply: true — house style
    02-frontend.md         # globs → src/pages/**
    03-no-deploy.md        # forbid wrangler/DNS unless asked
    04-security-review.md  # description / alwaysApply unset — model picks when relevant

Common frontmatter fields (names and defaults can evolve—confirm in current docs):

  • name — required for YAML-style rules; useful label in Markdown too.
  • globs — limit when the rule attaches by path pattern.
  • regex — alternative / additional matching when your version supports it.
  • description — helps the model decide relevance when the rule is not always on.
  • alwaysApply — true / false / omitted behave differently: always inject, never auto-inject, or let the agent decide from description—re-check your docs for the exact triad.

Keep each file short on purpose: dense bullets beat essays, and headroom leaves room for the next constraint you will inevitably add.

04

Copy-ready continue rules examples

Adapt these templates. Replace commands, paths, and non-goals with your repo’s truth. Keep them short enough that a human will maintain them.

Always-apply project conventions

---
name: Project conventions
alwaysApply: true
---

# Project conventions

- Indent with 4 spaces; do not reformat unrelated files.
- Register every indexable page in the site’s route registry (e.g. pages[]).
- Prefer extending an existing page/component pattern over inventing a new layout.
- Run the project’s build command before claiming done.
- Do not deploy, edit hosting config, or change DNS unless the user explicitly asks.

Glob-scoped frontend / docs pages

---
name: Frontend page rules
globs: ["src/pages/**/*.tsx", "public/assets/styles.css"]
description: Frontend and docs page conventions when editing pages or global styles
---

# Frontend page rules

- Mirror ArticleNavigation + article-hero structure from sibling EN how-to pages.
- Unique Title, Description, and a single H1 that contains the target phrase.
- Include Related reading links to sibling guides; keep bidirectional links updated.
- Do not invent new indexed URLs; only add paths listed in the task.

Description-gated database / migrations

---
name: Database work
description: Schema, migrations, and repository query changes
---

# Database work

- Put queries in the existing repository layer; do not invent a second data access style.
- Add a new migration; never rewrite an already-applied migration.
- Include a rollback note for destructive schema changes.
- Do not run production migrations from the agent session.

Safety / no-deploy (always apply)

---
name: No deploy without ask
alwaysApply: true
---

# Deploy and secrets

- Do not run wrangler deploy, change DNS, or edit Cloudflare / payment config unless asked.
- Never commit secrets, tokens, or production credentials into rules or chat history.
- Prefer env stores and documented secret managers over pasting keys into the session.

When tools live outside the editor, pair rules with a clear tool policy in the prompt. For MCP host pitfalls, see the MCP server tutorial and MCP server best practices.

05

Writing patterns that stick

  1. Imperative and testable. “Run pnpm run build” beats “ensure quality.”
  2. Name artifacts. Paths, registry names, and sibling files beat vibes.
  3. State non-goals. Agents over-help; forbid deploy, rebrand, or drive-by refactors.
  4. Match alwaysApply / globs to weight. Always-apply for house style; globs for area conventions; description-only for intermittent domains.
  5. Write a useful description when the rule is not always on—the agent decides from that text first.
  6. Control load order with prefixes (01-, 02-) when general rules must precede specialized ones.
  7. Point at exemplars. “Match GoodAgentPromptPage.tsx” beats reinventing layout.

Rules degrade when they become a wishlist. If Continue still violates a rule after two sessions, either the rule is vague, alwaysApply/ globs are wrong, or a stronger nearby example is missing—fix the example and the frontmatter first.

06

Anti-patterns

  • Novel-length always-apply rules: crowd the system message and get sampled inconsistently.
  • Vague descriptions: the agent cannot decide relevance from “be careful.”
  • Contradictions: “always refactor” next to “never touch unrelated files.”
  • Secrets in rules: rules are often committed; use env stores instead.
  • Copying Cursor / Windsurf rules wholesale without remapping: wrong directory, wrong front matter, wrong done checks.
  • Duplicating the same wall into config.yaml and every .md file: sync cost explodes; pick one canonical layer per concern.
  • Product tutorials inside rules: teach workflows in docs; keep rules as contracts.

Related reading: Cursor rules examples · Windsurf rules examples · Cline rules examples · Kilo code rules examples · Amazon Q rules examples · AGENTS.md vs CLAUDE.md vs Cursor rules · How to write AGENTS.md · How to write CLAUDE.md · Cursor skills examples · Good agent prompts · Cursor agent tips · Agent engineering notes

07

FAQ

Where should I put continue rules examples in a repo?

Most teams use a .continue/rules/ directory at the workspace root with small, focused Markdown files. YAML rule files andconfig.yaml rules: entries also appear in some setups. Exact discovery depends on your Continue version—confirm in current product docs. This site’s examples are unofficial templates, not a product catalog.

Do Continue rules affect autocomplete?

Per Continue’s rules deep-dive, project rules are intended for Agent / Chat / Edit system messages. They are not described as feeding autocomplete or apply. Keep completion-oriented guidance elsewhere if your workflow needs it, and re-verify after upgrades.

How do these relate to Cursor rules, Windsurf rules, or AGENTS.md?

Same job—durable repo contracts—different loaders and file shapes. Cursor teams often use .cursor/rules; see cursor rules examples. Windsurf / Cascade notes: windsurf rules examples. Cline: cline rules examples. Multi-tool teams often keep a root AGENTS.md and thinner IDE-specific rules. Choice notes: AGENTS.md vs CLAUDE.md vs Cursor rules. Do not paste the same wall of text into every layer.

Will these templates work unchanged on every Continue release?

No. Treat them as starting points. Re-verify directory names, frontmatter keys (name, globs, regex,description, alwaysApply), lexicographic load order, and config.yaml rules: shapes after upgrades. Prefer repo-specific commands and paths over marketing phrases that age poorly.