Use @Prompts in Chat for Custom Prompts

Hi Cursor Team,

Great job on building an amazing product so far!

Since GPT-4 is very steerable, I would love the ability to save and edit custom prompts in Cursor to be able to reuse common instructions and include it in the chat using @Prompts or something similar (just like @Docs for example).

I guess this is already possible by maybe creating text files of instructions and using @Files but a dedicated @Prompts tag + add/edit/delete functionality would be much better UX for creating reusable custom instructions that are accessible from any project in Cursor.

Cheers :slight_smile:

14 Likes

Exactly what I have been thinking!

Please develop this

1 Like

Just would like to comment on this, it would be really useful for things like this git usecase: AI git commit messages - #2 by fire

Would love that too. It’s on our to-do.

3 Likes

thank you for suggesting this. we will try to figure out a good idiomatic solution to this problem soon.

2 Likes

Great feature request!

I had the issue of trying out the ā€œrules for aiā€ feature, which is basically a custom prompt, but it interfered many times, where it would output code (since that was the rule) when I just wanted text.

So basically one custom prompt limited me to use it for only one purpose, and changing or disabling the prompt was very tedious. At the end I therefore decided to not use it anymore.

An @Prompt feature with different pre-defined prompts for different purposes would be great!

Edit: Just found a comment for the same topic. How big is the impact of a custom prompt?
Most of the time gpt understands what I want, or I have to iterate once or twice.

2 Likes

I’ve started using Cursor for a while, and i would love to see this feature. Is there any option coz i see that the topic is dead for almost a year?

Hi @Konradstr ,

You might be interested in this topic where the idea of ā€˜canned prompts’ came up:

There are a few samples in that topic that you could copy, paste and modify, and then you would have custom prompts available via the @ feature.

I have seen a few other posts with similar ideas and sample file contents, if I come across them again, I will update this post with further links.

1 Like

Regarding the requested feature of enabling custom prompts within Cursor:

Several workarounds have been suggested, such as canned prompts, using Espanso, or leveraging notepads. While these solutions might work in specific scenarios, they are not streamlined. To ensure an efficient workflow, I believe this feature should include the following key capabilities:

  1. First-party integration within Cursor IDE with intuitive triggering via @ commands, e.g., @Prompt.
  2. Per-project customization using version control, allowing prompts to be stored and managed alongside project files.
  3. Support for referencing external files or other prompts via markdown links or @ commands.
  4. System variable interpolation, such as ${user_input}, to dynamically insert user input into prompts.

Proposed Workflow

  1. Users define prompt files within the repository, possibly inside .cursor/prompts/, similar to how .cursor/rules/ allows per-project rules.

    Example prompt file:

    // .cursor/prompts/my-prompt.md  
    
    Refine the following user input for clarity.  
    Take into account the current tech stack: @docs/tech-stack.md  
    (Alternatively, using markdown links: [tech-stack](../docs/tech-stack.md))  
    
    **User input:**  
    ${user_input}
    
  2. Users reference the prompt in the chat box using the @ symbol:

    @my-prompt [the question to be refined...]
    
  3. When sent to the LLM, this expands into:

    Refine the following user input for clarity.  
    Take into account the current tech stack:  
    [... interpolated content from docs/tech-stack.md]  
    
    **User input:**  
    [... interpolated question]
    

Comparison with GitHub Copilot

GitHub Copilot already supports prompt files that:

  • Reference external files
  • Can be shared within VS Code
  • Are defined on a per-project basis

Bringing similar functionality to Cursor would enhance usability and streamline prompt-driven workflows.

Any update on this? Sure, keeping a prompts.md file on the side and copy pasting is not that painful, but having it built-in would be nice, and could also open up interesting templating features