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.
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.
Cursor has never read the rules this installer emits.
tools/installwrites them to.cursor/rules/mms-<skill>/RULE.md. Cursor's docs state that project rules must use.mdc, and that a plain.mdfile there is ignored by the rules system because it carries no frontmatter that system can read. A fresh--repo metamask-extensioninstall atcce2ee1emits 89.mdand 0.mdc.Nothing else about the emission is wrong.
description+alwaysApply: falseis Cursor's apply-intelligently mode, and nested directories under.cursor/rulesare documented as supported. The extension alone accounts for it.What changed
write_cursoremitsRULE.mdc.is_managed_project_skillstill acceptsRULE.md, because dropping it would make--prune-stalestop recognising every tree an older installer wrote and orphan it.write_cursordeletes that legacy file once the.mdcis written — but only when it carries the managed banner, so a hand-written rule of the same name is left alone.Evidence
Reverting only
tools/installand keeping the updated expectation turns the suite red, so the test discriminates rather than passing either way:A fresh extension install on this branch emits 26
.mdc, 0RULE.md.Migration, run against a tree the old installer had already written:
bash -n tools/installis clean.What this does not establish
The claim that the surface is inert rests on Cursor's documented behaviour. I have not run Cursor against an installed tree and observed a rule load or fail to load, so that remains a prediction rather than an observation. It is cheap to check for anyone with Cursor open, and it is the reason the defect survived this long — nothing in CI can see it.
Out of scope
globsis still never emitted (0 occurrences in the repo), so Cursor's apply-to-specific-files mode stays unavailable. That is the only native conditional-attachment mechanism any of the three surfaces offers, but whether to adopt it depends on an unresolved question — whether an auto-attached rule whose globs do not match still contributes its description to context. If it does,globsgates the rule body only. Tracked in AIENG-142 rather than decided here.Measured at
cce2ee1. Sites:tools/installL267, L268, L412;test/cli.test.mjsL136.