It would be great if given a PR’s diff, cursor could generate a PR description. Is there a way to do this now?
Hi @oveddan
Right now, no, I’ve passed the feature request on to the devs.
@oveddan not sure how much prompting you are OK with doing but I am sure you can do it by modifying my existing prompt, push it to a git repo, crawl it with cursor’s doc crawling feature and use it as:
@create-description @PR Diff
This is my semi hacky way to do things. I squash the commits in the PR into one.
Then I run:
git diff HEAD~1 >> dif.txt
I then prompt cursor to make a pr description from that file
Smart!
Here’s how I just did this:
- in the terminal, use Cmd K and ask cursor to diff with main and output that into a pull request summary in
pr_request.md
- use Cmd+I to activate composer, ask to update @pr_request.md to remove diff and make pr request a better, more human summary, referencing and closing the issue
- in github pull requests view, I created a new pull request and copied the contents of pr_request.md in, creating the pull request
Perhaps I’ll find a better way to automate this using something like “Project Rules”; see also Using the “project-rules” in 0.45.2 - Discussion - Cursor - Community Forum
Wow, this is next level @gokcin - are you still using this often? here, is @create-description
the name of the “doc” indexed with @Docs
, or is there some other way to run a prompt? I can’t seem to find much info on this custom prompting technique on cursor’s website, is it pretty much just through @Docs
or is there some other way you are using prompting?
hello @codekiln and thanks!
yes I am generating my prs and commits on a daily basis with the prompts in that are included in that repository which are crawled with the docs feature. and yes you just reference the crawled doc with @ and than add whatever you want as additional context.
To answer your other question about easier ways of prompting in cursor, when I discovered this usage, cursor did not have the notepads feature so you can accomplish the same result by creating a notepad(cmd + shift + p
→ Notepad: Create and Open New Notepad
) and than reference it with @
with the same name if you want simplify the process. However I like putting my prompts under version control so thats why I have not changed my approach.
On an unrelated note about creating custom prompts in an easy way, I have a tip for you. There is an amazing CLI tool called fabric which is like a huge collection of amazing prompts that you can use with local/cloud LLMs. One specific pattern there gave me inspiration to use the create_pattern pattern and create this prompt in my repo that just creates prompts. So what you can do is to add the prompt generator prompt to a notepad, name it as generate-prompt
and than when you want to create a new prompt, mention it with @generate-prompt <what you want your prompt to do in plain text english>
and than paste the nicely formatted markdown output to a new prompt and use it.
So with github cli, you can create PRs, through your terminal. You can combine this with advanced prompting and make cursor output the github cli command that creates the PR. Here is an example that uses this prompt and claude-3.5-sonnet to create this pr. The trick is to force cursor to output the cli command under backticks and bash as the language so that the play icon appears and you just click and boom