Bug Report: Cmd+K Shorthand Commands Not Working with Project Rules (.mdc Files)
Issue Description
Shorthand commands defined in project rules (Project Folder.cursor\rules*.mdc files) are not being recognized when used directly in the Cmd+K prompt, even when the rules have alwaysApply: true
set. The same commands work properly when explicitly referenced using the @Rules selector.
Steps to Reproduce
- Create a project rule file (.mdc) with shorthand commands
- Set
alwaysApply: true
in the file’s frontmatter - Place the file in the
.cursor/rules/
directory - Select code in the editor
- Press Cmd+K
- Type a shorthand command (e.g.,
!cp
) - Observe that the command isn’t processed correctly
Expected Behavior
When typing a shorthand command in Cmd+K, the IDE should recognize and process it according to the logic defined in the project rules, especially when the rule has alwaysApply: true
.
Actual Behavior
The IDE scans the code but doesn’t apply the command. In my case, a comment is expected to be added to the code selected in the code window.
Workarounds Discovered
- Working method #1: Select code → @Rules → select rule file → type shorthand command
- Working method #2: Add just the shorthand command descriptions to global rules in Settings
Environment Details
- Cursor IDE version: 0.48.8
- VSCode version: 1.96.2
- OS: Windows 11 Pro, current
- Project type: JavaScript/TypeScript, Litegrahp.js build
Additional Information
- The commands work perfectly when the same content is added to global rules in Settings → Rules for AI
- The rules file itself works correctly when explicitly referenced using @Rules
- Works in the main agent chat window
- This suggests a disconnect between how project rules are processed in Cmd+K vs. when explicitly referenced with @Rules