Context-powered prompts
1. Context-powered prompts
Welcome back! In this video, we’ll learn how to make our prompts smarter and more context-aware.2. @ References
Instead of just giving Cursor instructions, we’ll know how to reference files, folders, and documentation — so that our responses are grounded in real project data. For this, we’ll be using `@` references in Cursor, which we can add as part of any of our prompts.3. @ References
Let’s take our portfolio app as an example and see how to improve it with context-powered prompts. When we type `@` in the input box of the Cursor Agent, a dropdown appears with all available context options. From here, we can reference: Specific files or folders in the project, A particular code block we want the AI to edit or improve, Documentation or rule files for guidance, Even the web itself, for fetching the latest information.4. @ References
Referencing helps Cursor stay grounded in real project data. Without it, the Cursor Agent might hallucinate — meaning it could generate inaccurate or unrelated responses. By anchoring prompts to files, folders, and docs, we give the model verified context to work with, reducing confusion and improving accuracy.5. @ References
Let’s start by referencing documentation to help improve our project. We type @Docs, then select "Add new doc". Now, we paste the official Tailwind CSS documentation URL. Once confirmed, Cursor will index the docs — meaning it processes and understands their content. We’ll explore indexing more in depth later. Now, we can directly use these docs in our prompts. For example, we can ask: “@Tailwind CSS Use the latest utility classes for styling the app.” When we send this request, Cursor searches the documentation for the most up-to-date syntax and applies it to our code. That’s how we can ground our prompts in external context — ensuring accuracy and consistency.6. More @ References
Similarly, we can use other @ references like: @file — to point to a specific file @folder — to provide an overview of a folder’s contents @code — to highlight a particular code snippet @cursor rules — to follow predefined coding conventions @past chats — to recall previous discussions or decisions All of these make our prompts more precise and context-aware.7. Slash Commands
Now that we understand @ references, let’s shift gears and look at slash commands — another powerful way to manage context quickly. These give us quick control over what the AI sees and remembers, so we can reset, refine, or expand context with just one keystroke.8. Slash Commands
Typing / in the chat opens several command options: /Reset Context resets context to the default state; /Generate Cursor Rules creates rule files for consistent AI behavior; /Disable Iterate on Lints stops automatic lint fixes; /Add Open Files to Context adds all open editor tabs; /Add Active Files to Context adds only visible files in view. These shortcuts help manage what the AI can see and respond to, keeping our context relevant — and we can even create our own personalized slash commands.9. Let's practice!
That’s how we can use `@` references and `/commands` to create context-powered prompts. By grounding our instructions and managing what the AI assistant can see, we help Cursor truly understand our project — so it can work alongside us as an informed coding partner. Let’s practice!Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.