Cursor Rules are instructions passed to large language models (LLMs) by Cursor, allowing developers to codify foundational decisions in their codebase and tailor suggestions or completions to match their team's coding style and best practices. These rules can be attached at various points in the codebase based on file paths or patterns, providing granular control over cursor's behavior. Each rule includes a description of when it should be applied, allowing for matching entire directories or specific file types using glob patterns, as well as referencing other files via @file directives. Automatic attachment enables rules to be applied when opening or modifying files that match certain rules. The .cursor/rules directory is used to store these rules, with the option to create new rules through the Cursor command palette or migrate from an older .cursorrules file structure. Global rules can also be set up in Cursor's global settings for projects that require consistent application across multiple repositories. Additionally, developers can share their best practice rules through community-driven sites and follow tips such as keeping rules granular, version controlling them, and iterating and refining them to address recurring challenges or style preferences.