Skip to content

Fix rule generation by preventing default frontmatter insertion #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rafaelcalleja
Copy link
Contributor

This PR addresses issue #43 where Cursor automatically injects incomplete frontmatter headers when creating .mdc files directly, breaking rule validation.

Key Fix:

  • Enforces 2-step file creation workflow for new rules:
    1. Create rule as .txt file to avoid auto-generated frontmatter
    2. Rename to .mdc after content is properly configured
  • Updates documentation examples to show correct workflow
  • Adds explicit validation against direct .mdc creation

Why This Works:
By starting with .txt, we bypass Cursor's automatic frontmatter insertion, allowing full control over header configuration. The rename operation preserves manually configured frontmatter while activating the rule.

@bmadcode
Copy link
Owner

Great idea - ill test with this tonight. I am debating the utility of this now with the latest updates to cursor though now supporting automatic geneartion of rules with a command. Do you think this is still useful rule @rafaelcalleja ?

@rafaelcalleja
Copy link
Contributor Author

In the new generation of cursor rules, when using a command, it doesn't generate the rule types correctly. The rule needs to be manually configured to complete the setup.

I still believe this rule adds value:

  • Organizational Folders.
  • Checking if a similar rule exists.
  • Automatic configuration of the Rule Type.
  • Being able to define the rule’s structure, for example, by specifying that it should include examples.

I think the new generation of rules lacks all these aspects, but I could be wrong and simply haven't learned how to use them yet.

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