Guide Cursor's AI by telling it not only what you want, but also what *rules* or *limitations* to follow. This leads to more precise and useful results.
Directly state constraints within your prompt using clear language. This works for both Chat (Cmd+L) and Inline Generation (Cmd+K).
Examples:
Example Prompt (Cmd+K):
Create a React functional component for a button. Use Tailwind CSS for styling and ensure it accepts an 'onClick' prop. Do not use default HTML button styles.
Beyond immediate prompt instructions, Cursor offers powerful ways to define more permanent, reusable constraints using Cursor Rules. These are ideal for ensuring consistency across your entire project, such as enforcing coding standards, preferred libraries, or architectural patterns.
There are two main ways to implement these:
Think of these rules as a way to give the AI a comprehensive "style guide" or "project constitution." You can instruct it to always use specific design patterns, avoid certain anti-patterns, or prefer particular technologies.
We will dive deep into creating, managing, and mastering both Project Rules and the legacy .cursorrules in a dedicated step later in this learning path, specifically in the section on "Mastering Cursor Rules." For now, it's important to know that these mechanisms exist for more robust and persistent AI guidance.
Clearly state limitations, requirements, or standards directly in your prompts for immediate tasks. For establishing broader, project-wide consistency and encoding deeper project knowledge, Cursor provides powerful Rule systems (Project Rules and legacy .cursorrules), which you'll learn to master in a subsequent section.