Rules documentation confusion

Where does the bug appear (feature/product)?

Somewhere else…

Describe the Bug

Examples on web page not rendering sensibly

Steps to Reproduce

Go to Rules | Cursor Docs and read the examples.

Expected Behavior

To describe the RULE.md files, I would expect you to be showing examples of markdown…but you’re showing rendered text.

And a template name which is probably the name of the asset being rendered, but seems like it shouldn’t be rendered.

aka I can’t follow the documentation and I’m not sure it’s my fault.

As an aside, at some point, you should probably link to or pay someone to write a description of what frontmatter is, and which tags are supported - if it is a limited set.

“It’s important to note that Frontmatter is parsed as YAML blocks, so the indentation is important”

Ah.

Every day, we stray further from the light of god.

Screenshots / Screen Recordings

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.3.34
VSCode Version: 1.105.1
Commit: 643ba67cd252e2888e296dd0cf34a0c5d7625b90
Date: 2026-01-10T21:17:10.428Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 25.2.0

And tbh, got some weird stuff going on with stopping agents.

For AI issues: which model did you use?

N/A

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. I get the confusion. The docs show the final result after the rules are applied, not the source code of the RULE.md file.

What you need to copy: you need to create the folder structure and the RULE.md file yourself, following the format described.

Example for Express/React:

  1. Create the folder .cursor/rules/templates/
  2. Inside it, create a RULE.md file with this content:
---
description: "Templates for Express services and React components"
alwaysApply: false
---

This rule provides a template for Express services:

Use this template when creating Express service:
-  Follow RESTful principles
-  Include error handling middleware
-  Set up proper logging

@express-service-template.ts

This rule defines React component structure:

React components should follow this layout:
-  Props interface at top
-  Component as named export
-  Styles at bottom

@component-template.tsx
  1. Create the template files next to RULE.md (express-service-template.ts and component-template.tsx) with whatever code you want.

The docs show the final rule content that the AI will see, not the source files. I agree it’s confusing, I’ll pass the feedback to the team.

Re: frontmatter, it’s the YAML block at the top of the markdown file between ---. Supported fields are description, alwaysApply, globs. This is a standard format, not specific to Cursor.

Oddly ‘RULE.md’ has been removed from the documentation, despite RULE.md being the only name that works.

It uses an example of:

.cursor/rules/
  react-patterns.mdc       # Rule with frontmatter (description, globs)
  api-guidelines.md        # Simple markdown rule
  frontend/                # Organize rules in folders
    components.md

Which does not work, it ignores those .md files. The only thing that seems to work is:

.cursor/rules/
  react-patterns.mdc       # Rule with frontmatter (description, globs)
  rulename/                # Organize rules in folders
    RULE.md

I believe there was a note about .mdc files being legacy/deprecated, which has been removed also. I guess that is a good thing as the create-rule skill insists on creating rules with .mdc extension.

But that is also a shame, as the .mdc style rules don’t work in sub-directories like this:

componenta/
  .cursor/rules/
     myrule.mdc
componentb/
  .cursor/rules/
     myotherrule.mdc

However this does appear to work:

componenta/
  .cursor/rules/rulenamea/
     RULE.md
componentb/
  .cursor/rules/rulenameb/
     RULE.md

But RULE.md may or may not support frontmatter, depending on which way Cursor decides to go tomorrow. It’s also anyone’s guess whether this multi .cursor folder support is intended behaviour or a bug as the documentation is inconsistent and the rules behaviour is constantly changing.

Can we get some kind of confirmation about what is meant to be supported in the long run? We can’t build projects only to find we have to re-write all our rules from a collection of .mdc files to a single RULE.md.. and then later find out multiple .cursor/rules directory support gets removed.

We have an enterprise licence to ensure the software works as specified and will remain supported but this is proving quite difficult without correct documentation or adherance to the doc.

2 Likes

Dean, thanks for the clarification.

If we’re wishing for things, I think I might need a way to debug rules, or at least sanity check the agent is getting them.

My dev environment is partly PHP running inside a docker container. I wrote two simple rules to point the agent to where the tests live, and how they should be run.

”If you are writing any code, or running any scripts, read the document @docs/development-environment.md.

If you are doing any coding, read the document @docs/testing.md to learn how to run the tests.”

I haven’t seen an agent read those documents yet, unless I mention them in chat.

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.