Pull requests
Generate pull requests and PR descriptions directly from your IDE. Bob analyzes changes, creates detailed descriptions, and streamlines your workflow.
Why use this feature?
- Save time: Generate detailed PR descriptions automatically based on your changes.
- Maintain consistency: Ensure all PRs follow a consistent format.
- Improve collaboration: Provide clear context for reviewers with well-structured descriptions.
- Streamline workflow: Create PRs without leaving your IDE.
How it works
Bob analyzes your branch changes, commit history, and branch name to understand the purpose and scope of your work. It then generates a meaningful PR title and detailed description that summarizes your changes, making it easier for reviewers to understand the context and purpose of your PR. After generation, you can review and edit the PR description before submission.
The PR generation process is interactive, allowing you to select the target branch and remote repository before creating the PR.
Getting started
Prerequisites
- Your changes must be committed to a branch.
- You must have push access to the remote repository.
Basic usage
You can choose from 3 options to initiate a PR flow:
- Click the PR icon in the Source Control panel.
- Use the command palette (Cmd + Shift + P on Mac, Ctrl + Shift + P on Windows/Linux) and search for "Bob: Generate PR".
- Type
/create-prin the Bob chat interface.
Bob will then guide you through the following steps:
- Select the base branch you want to merge into. Bob will suggest the three most likely branches.
- Select the remote repository, if you have multiple remotes.
- Review the generated PR description and title.
- Create the PR.
- Get the newly created PR link in your chat.
Using templates for PR descriptions
Bob automatically detects and uses your project's existing PR templates when generating pull request descriptions. This ensures your PRs are consistent with your team's established standards. When Bob detects multiple PR templates in your project, you can select which template to apply to your pull request.
Template detection
Bob searches for PR templates in the following locations relative to your project root:
${cwd}/pull_request_template.md${cwd}/docs/pull_request_template.md${cwd}/.github/pull_request_template.md${cwd}/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md${cwd}/PULL_REQUEST_TEMPLATE/pull_request_template.md${cwd}/docs/PULL_REQUEST_TEMPLATE/pull_request_template.md
If Bob finds multiple templates, Bob will ask the user to choose which template to use for the PR description.
Default template
If no template is found in your project, Bob uses a built-in template that includes:
- A descriptive title derived from your branch name
- A summary of changes
- Key implementation details
- Testing information
- Any relevant links or references
Editing the generated description
After generating the PR description, Bob presents it inline in the chat. You can then:
- Confirm and continue: Approve the description as-is to proceed with creating the PR.
- Request changes: Type your feedback in the chat and Bob will regenerate the description based on your input. You can iterate as many times as needed before confirming.
Customizing templates
For the best results with Bob's PR generation:
- Use clear section headings in your templates (e.g.,
## Summary,## Changes) - Include placeholder text that provides context (e.g.,
<!-- Describe the purpose of this PR -->) - Consider adding sections for testing instructions and related issues
Tips and best practices
- Use descriptive branch names to help Bob generate more accurate PR descriptions.
- Review and edit the generated description before creating the PR.
Commit messages
Generate meaningful commit messages automatically with Bob. Save time, maintain consistency, and follow conventional commit standards with AI assistance.
Literate coding
Write code with AI assistance directly in your editor using natural language instructions right where the code should go. Bob generates the implementation in context with inline diffs.