Prompt file imported from abarrows/template-nextjs-ui (
.windsurf/workflows/global-pull-request-autofill.md). Copyright stays with the author.
Workflow: Raise Autofilled Pull Request
Description
This workflow is intended to quickly raise a pull request, ideally without my intervention. The goal is to run this single workflow and upon completion, I see a link to the fully informed pull request. The pull request will be raised via the github cli. The values passed into the command will be enriched by you after carefully examining the changes. You will respond with permission to execute the command and display the information for my review below the command.
Instructions
- You must first determine which branch I am currently on. If the branch is set as the default branch, move this step to the last step before creating the PR. Use this naming format: feature/WR-XXXX- whereas you will make a 4-8 word title describing the changes. That downcased and hyphenated title will replace this: in my format example.
Exceptions
-
If I mention a different target branch to raise the pull request against, take note and when raising the pull request, do so.
-
If a ticket number is mentioned in my prompt, you will replace the WR-XXXX in hotfix/WR-XXXX-
-
If a hotfix is mentioned in my prompt the format would be: hotfix/WR-XXXX-
-
If a release branch is mentioned in my prompt the format would be: release/WR-XXXX-
-
Carefully analyze the changed files, the commit messages, and the contributors so you can summarize these changes into a pull request description. One to two paragraphs and/or a bullet list of changes is expected. Leave out any changes with mundane details like
updating propsorfixing state. Find the repository name of the branch provided. -
Populate the pull request description and any other relevant information where I ask for your input in an html comment.
// turbo 4. Execute the following command to create the pull request:
Substitute the following placeholder tokens before executing:
REPO_NAME: The repository name you identified in step 2
BASE_BRANCH: The default branch (main, develop, or master, or as specified)
FEATURE_BRANCH: The feature/hotfix/release branch you created in step 1
PR_TITLE: A short, descriptive title for the pull request
PR_BODY: The pull request description you crafted from step 2
ASSIGNEE: The assignee you identified in step 1 or default to abarrows
REVIEWERS: Space-separated list of reviewers (e.g., "--reviewer gisanchez --reviewer dominicp21")
gh pr create --repo REPO_NAME --base BASE_BRANCH --head FEATURE_BRANCH --title "PR_TITLE" --body "PR_BODY" --assignee ASSIGNEE REVIEWERS
-
If for some reason, I'm in a private repo and the reviewers that I've specified are not available the first time, retry raising the PR again but omit the reviewers the second time. Just let me know in the post summary. Confirm the pull request was created successfully and then run the github mcp command that adds Copilot as a reviewer.
-
Respond with a link to the newly created PR. Also verify that Copilot was successfully added as a reviewer. If for any reason the assignees are not assignable or Copilot is not assignable or found, continue without responding. Create the pull request and let me know after the fact in your PR summary and response.