-
Notifications
You must be signed in to change notification settings - Fork 9
Refactor Cursor rules to Markdown #14
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
Conversation
Summary of ChangesHello @ivangrynenko, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the internal structure of all rule definition files within the repository. The primary goal is to standardize the format of these rules by migrating them from an older, custom XML-like syntax to a more modern and readable Markdown-based structure. This change improves the clarity of rule definitions, making them easier to understand and contribute to. Additionally, it updates the documentation for authoring new rules and outlines the migration process for existing ones, ensuring consistency and future-proofing the rule management system. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| globs: *.py | ||
| alwaysApply: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote glob patterns to produce valid YAML front matter
The new front matter uses globs: *.py (and similar wildcards across the rules). In YAML, values beginning with * or ! are parsed as anchors/tags, so this line fails to parse (Psych::SyntaxError: did not find expected alphabetic or numeric character while scanning an alias). If the rules loader reads the front matter as YAML, every rule file now raises a syntax error and none of the guidance will load. Wrap each glob pattern in quotes or express them as a YAML list to make the metadata valid.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request is a significant and valuable refactoring of the .mdc rule files, migrating them from a legacy XML-style format to a much more readable and maintainable Markdown-based structure. The new format, documented in cursor-rules.mdc, is a great improvement. While the conversion is well-executed overall, I've identified several files where the globs front matter property is either missing or inconsistent with the rule's intended scope as described in the Trigger Conditions. These inconsistencies could lead to rules not being applied to the correct files. I've provided specific suggestions to align the globs with the intended file patterns. Additionally, this refactoring commendably corrects several long-standing errors in the JavaScript rules that were incorrectly targeting Python files.
.cursor/rules/cursor-rules.mdc
Outdated
| ## Required Checks / Recommendations / Positive Signals | ||
| - Use headings that suit the rule's enforcement style. | ||
| - Keep bullets short, actionable, and framework-agnostic. | ||
| - Include validation or positive examples when useful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `*.theme` | ||
|
|
||
| ## Trigger Conditions | ||
| - Files matching pattern `\.(php|inc|module|install|theme|yml)$` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Trigger Conditions pattern yml is less specific than the *.info.yml glob used for file matching. To improve clarity and consistency, the trigger condition should also use the more specific info.yml pattern, which is correct for Drupal module info files.
- Files matching pattern `\.(php|inc|module|install|theme|info\.yml)$`
Summary
Testing