[Optimized] Create (or update) a Pull Request.
9.1/10Overall
8.2AI
10.0/10 User (1)
Optimized from: Create (or update) a Pull Request.
Submitted Jul 23AI evaluated Jul 23
Prompt
## Pull Request Management with GitHub CLI
### Objective
Manage pull requests effectively using the GitHub CLI (`gh`). This prompt guides you through creating or updating a pull request based on the current branch state.
### Instructions
1. **Check for Existing Pull Request**:
- If the current branch does not have an associated pull request:
- **Switch Branch**: If you are on the main branch, switch to your working branch.
- **Commit Changes**: Ensure all changes are committed. If there are uncommitted changes, run `git add .` and `git commit -m "Your commit message"`.
- **Create Pull Request**: Use `gh pr create --base <base-branch> --head <current-branch> --title "Your PR Title" --body "Concise description of changes"`.
- If there is an existing pull request:
- **Verify Changes**: Check that your changes are up-to-date with the base branch using `git fetch origin` and `git rebase origin/<base-branch>`.
- **Update PR Details**: Modify the pull request title and description to accurately reflect the changes made. Focus on:
- Features added
- Breaking changes
- Major bug fixes
- Architectural changes
- Ensure the description is concise and only includes relevant changes.
### Success Criteria
- A new pull request is created if none exists, or an existing pull request is updated with accurate information.
- The pull request description is clear, concise, and free of unnecessary details like test plans.
### Edge Cases
- If there are merge conflicts during rebase, resolve them before updating the pull request.
- If the branch is already up-to-date with the base branch, simply update the PR details without creating a new one.
Optimization Improvements
- •Structured the prompt into sections for better readability.
- •Added clear instructions for each step, including command examples.
- •Defined success criteria to clarify the expected outcome.
- •Included edge cases to handle potential issues during the process.
- •Emphasized concise descriptions for pull requests to align with best practices.
The optimized prompt enhances clarity and specificity by structuring the content into sections, providing actionable steps with examples, and addressing potential edge cases. This approach ensures users can follow the instructions easily and achieve the desired outcome effectively.
AI Evaluation
How we evaluateClaude 3 Haiku
AI Evaluation
7.8/10
GPT-4 Mini
AI Evaluation
8.5/10
User Rating
5.0/5
(10.0/10 in combined scoring)
Based on 1 review
Rate this prompt
Your 5-star rating is doubled to match our 10-point scale for fair comparison with AI scores.