fix(cli): write Cursor rules as .mdc, the only extension Cursor reads - #133
Open
MajorLift wants to merge 1 commit into
Open
fix(cli): write Cursor rules as .mdc, the only extension Cursor reads#133MajorLift wants to merge 1 commit into
MajorLift wants to merge 1 commit into
Conversation
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
left a comment
Contributor
There was a problem hiding this comment.
Before merge, I would add explicit tests for the legacy managed/unmanaged RULE.md migration paths. With that covered, this looks ready for approval.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
tools/installwrites 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.mdthere is ignored. A fresh--repo metamask-extensioninstall atcce2ee1emits 89.md, 0.mdc. The two other properties I checked match documented modes, so the extension alone explains it.write_cursornow emitsRULE.mdc, deleting the legacyRULE.mdonly when it carries the managed banner, so hand-written rules survive.is_managed_project_skillstill acceptsRULE.md, or--prune-stalewould orphan older trees.Showcase
This branch emits 26
.mdc, 0RULE.md; re-installing over an old tree migrates all 26, leaving a hand-writtenRULE.mdintact. Reverting onlytools/installwhile keeping the newtest/cli.test.mjsexpectation 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.