This guide explains how to use the structured prompting files (core.md
, refresh.md
, request.md
) to optimize your interactions with Cursor AI, leading to more reliable, safe, and effective coding assistance.
-
core.md
(Foundational Rules)- Purpose: Establishes the fundamental operating principles, safety protocols, tool usage guidelines, and validation requirements for Cursor AI. It ensures consistent and cautious behavior across all interactions.
- Usage: This file's content should be persistently active during your Cursor sessions.
-
refresh.md
(Diagnose & Resolve Persistent Issues)- Purpose: A specialized prompt template used when a previous attempt to fix a bug or issue failed, or when a problem is recurring. It guides the AI through a rigorous diagnostic and resolution process.
- Usage: Used situationally by pasting its modified content into the Cursor AI chat.
-
request.md
(Implement Features/Modifications)- Purpose: A specialized prompt template used when asking the AI to implement a new feature, refactor code, or make specific modifications. It guides the AI through planning, validation, implementation, and verification steps.
- Usage: Used situationally by pasting its modified content into the Cursor AI chat.
The rules in core.md
need to be loaded by Cursor AI so they apply to all your interactions. You have two main options:
Option A: .cursorrules
File (Recommended for Project-Specific Rules)
- Create a file named
.cursorrules
in the root directory of your workspace/project. - Copy the entire content of the
core.md
file. - Paste the copied content into the
.cursorrules
file. - Save the
.cursorrules
file.- Note: Cursor will automatically detect and use these rules for interactions within this specific workspace. Project rules typically override global User Rules.
Option B: User Rules Setting (Global Rules)
- Open the Command Palette in Cursor AI:
Cmd + Shift + P
(macOS) orCtrl + Shift + P
(Windows/Linux). - Type
Cursor Settings: Configure User Rules
and select it. - This will open your global rules configuration interface.
- Copy the entire content of the
core.md
file. - Paste the copied content into the User Rules configuration area.
- Save the settings.
- Note: These rules will now apply globally to all your projects opened in Cursor, unless overridden by a project-specific
.cursorrules
file.
- Note: These rules will now apply globally to all your projects opened in Cursor, unless overridden by a project-specific
Use this template when you need the AI to re-diagnose and fix an issue that wasn't resolved previously.
- Copy: Select and copy the entire content of the
refresh.md
file. - Modify: Locate the first line:
User Query: {my query}
. - Replace Placeholder: Replace the placeholder
{my query}
with a specific and concise description of the problem you are still facing.- Example:
User Query: the login API call still returns a 403 error after applying the header changes
- Example:
- Paste: Paste the entire modified content (with your specific query) directly into the Cursor AI chat input field and send it.
Use this template when you want the AI to implement a new feature, refactor existing code, or perform a specific modification task.
- Copy: Select and copy the entire content of the
request.md
file. - Modify: Locate the first line:
User Request: {my request}
. - Replace Placeholder: Replace the placeholder
{my request}
with a clear and specific description of the task you want the AI to perform.- Example:
User Request: Add a confirmation modal before deleting an item from the list
- Example:
User Request: Refactor the data fetching logic in
UserProfile.jsto use the new
useQueryhook
- Example:
- Paste: Paste the entire modified content (with your specific request) directly into the Cursor AI chat input field and send it.
- Accurate Placeholders: Ensure you replace
{my query}
and{my request}
accurately and specifically in therefresh.md
andrequest.md
templates before pasting them. - Foundation: Remember that the rules defined in
core.md
(via.cursorrules
or User Settings) underpin all interactions, including those initiated using therefresh.md
andrequest.md
templates. - Understand the Rules: Familiarize yourself with the principles in
core.md
to better understand how the AI is expected to behave and why it might ask for confirmation or perform certain validation steps.
By using these structured prompts, you can guide Cursor AI more effectively, leading to more predictable, safe, and productive development sessions.
would this work with vscode as well?