Create pull request

From microsoft/vscode-pull-request-github · View interactive version

Create pull request is an AI agent skill from the GitHub repository microsoft/vscode-pull-request-github. Create a GitHub Pull Request from the current or specified branch. Use when: opening a PR, submitting code for review, creating a draft PR, publishing a branch as a pull request, proposing changes to a repository.

How to use this skill

Skill file

Create a GitHub Pull Request

Gather the necessary information, prepare a clear title and description, then call the tool to open the pull request.

When to Use

Procedure

1. Gather Information

Determine the required parameters before calling the tool:

2. Check for Uncommitted or Unpushed Changes

Before creating the PR, inspect the working tree state. If you need to run git commands, give an explanation for why the command needs to be run.

  1. Check for uncommitted changes: Use the git tool or VS Code SCM context to determine whether there are staged or unstaged file changes. If yes:
  1. Check for unpushed commits: Determine whether the local branch has commits that have not been pushed to the remote (i.e. the branch is ahead of its upstream). If yes:
  1. Confirm the branch is on the remote: The create_pull_request tool requires the head branch to be present on the remote. If it is not, push it first.

If all changes are already committed and pushed, proceed directly to the next step.

3. Prepare PR Details

Write a good title and description if the user has not provided them:

Title: Use imperative mood, keep it under 72 characters, and describe what the PR does (e.g. Add retry logic for failed API requests).

Body: Include:

4. Call the Tool

Use the github-pull-request_create_pull_request tool with the gathered parameters:

github-pull-request_create_pull_request({
	title: '<descriptive title>',
	head: '<branch-name>',        // branch name only, not owner:branch
	body: '<description>',        // optional but recommended
	base: '<base-branch>',        // optional; omit to use repo default
	draft: false,                 // set true for work-in-progress
	headOwner: '<owner>',         // optional; omit if same as repo owner
	repo: { owner: '<owner>', name: '<repo>' }  // optional
})

5. Confirm Result

After the tool returns successfully:

Best Practices

Titles

Descriptions

Draft PRs

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.