#Share Today I'm sharing a new feature, .cursor/rules, that you might not use often, but is incredibly useful. This feature provides fine-grained control over files. Simply put, MDC Rules tell Cursor how to filter, sort, and use this information when faced with a large amount of context, making LLM's answers more accurate and consistent with expectations. Some usage scenarios: 1. Refine rules, such as applying different rules to ts (logic), tsx (components), and css (UI). 2. Assign different rules to different projects in a Monorepo. 👇 Here are some specific practices:
2. In the new configuration, .cursor/rules is now available under the Rules tab. Global rules are submitted to LLM as cursor context in all conversations. .cursor/rules are submitted on demand based on file matching rules. Previously, using global .cursorrules is no longer recommended. Created rule files have the suffix .mdc and can be found in the project root directory.
3. Advanced usage: mdc files can also inherit the rules in .cursor/rules and can reference other files through @, which creates an opportunity for us to inherit mdc files.
4. The Gospel of Monorepo A single .cursorrules is not enough for a monorepo. .cursor/rules can create different rules for different projects
5. There is a post in the forum that mentions some hidden points - MDC can be in any format, but YAML may be the best form - through trial and error, the author found that organizing rules with numbers works best, for example: Core Rules: 001-099 Integration Rules: 100-199 Pattern/Role Rules: 200-299 Examples: Core Rules: “001-Core-Security.mdc” “015-Core-Logging.mdc” Integration Rules: “100-API-Integration.mdc” “110-CLI-Handler.mdc” Pattern/Role Rules: “200-File-Pattern-Rule.mdc” “210-Data-Validation.mdc”
6. cursor.directory The function of converting .cursorrules to mdc has been launched