Skip to content

fix(cli): write Cursor rules as .mdc, the only extension Cursor reads - #133

Open
MajorLift wants to merge 1 commit into
mainfrom
jongsun/fix/cursor-rules-mdc-extension
Open

fix(cli): write Cursor rules as .mdc, the only extension Cursor reads#133
MajorLift wants to merge 1 commit into
mainfrom
jongsun/fix/cursor-rules-mdc-extension

Conversation

@MajorLift

@MajorLift MajorLift commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Overview

tools/install writes Cursor rules to .cursor/rules/mms-<skill>/RULE.md. On Cursor's documented behavior, it has never read them — project rules must be .mdc; a plain .md there is ignored. A fresh --repo metamask-extension install at cce2ee1 emits 89 .md, 0 .mdc. The two other properties I checked match documented modes, so the extension alone explains it.

write_cursor now emits RULE.mdc, deleting the legacy RULE.md only when it carries the managed banner, so hand-written rules survive. is_managed_project_skill still accepts RULE.md, or --prune-stale would orphan older trees.

Showcase

This branch emits 26 .mdc, 0 RULE.md; re-installing over an old tree migrates all 26, leaving a hand-written RULE.md intact. Reverting only tools/install while keeping the new test/cli.test.mjs expectation turns the suite red (64 pass, 1 fail) — the test discriminates.

Not established: I have not run Cursor against an installed tree, so inertness is a prediction from the docs, not an observation.

Cursor ignores a plain `.md` in `.cursor/rules` because it carries no
frontmatter the rules system can read, so every rule the installer has
emitted has been inert on arrival.

`is_managed_project_skill` still accepts `RULE.md`, or `--prune-stale`
would stop recognising every tree an older installer wrote and orphan
it. `write_cursor` removes that file once it has written the `.mdc`,
but only when it carries the managed banner, so a hand-written rule of
the same name survives.

@NicolasMassart NicolasMassart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before merge, I would add explicit tests for the legacy managed/unmanaged RULE.md migration paths. With that covered, this looks ready for approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants