/create-pr:create-prfrom create-pr
Create Pull Request. This skill should be used when creating a pull request from the current branch. It analyzes changes between the current branch and main branch, then generates an appropriate title and description following Conventional Commits format.
Ships in create-pr. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill analyzes the differences between the current branch and the main branch, generating an appropriate Pull Request title and description. It follows Conventional Commits format and provides reviewers with sufficient context to begin code review.
First, analyze the differences between the current branch and the main branch in detail.
Performance Optimization (Parallel Fan-Out Pattern)
The following 4 git commands have no interdependencies and can be executed in parallel. By running them concurrently, latency can be reduced by approximately 75% compared to sequential execution.
| Command | Purpose |
|---|---|
git diff main...HEAD --name-only | List of changed files |
git diff main...HEAD --stat | Change statistics |
git log main..HEAD --pretty=format:"- %s" | Commit history |
git diff main...HEAD --unified=3 | Detailed diff |
Note for AI agents: These commands should be invoked as parallel tool calls in a single request, not sequentially. This follows the Google ADK Parallel Fan-Out pattern for optimal performance.
# The following commands can be run in PARALLEL (no dependencies between them):
# [Parallel 1] List of changed files
echo "=== Changed files ==="
CHANGED_FILES=$(git diff main...HEAD --name-only)
echo "$CHANGED_FILES"
# [Parallel 2] Change statistics
echo -e "\n=== Change statistics ==="
git diff main...HEAD --stat
# [Parallel 3] Commit history
echo -e "\n=== Commit history ==="
COMMIT_MESSAGES=$(git log main..HEAD --pretty=format:"- %s")
echo "$COMMIT_MESSAGES"
# [Parallel 4] Detailed diff (to understand the nature of changes)
echo -e "\n=== Analyzing detailed changes ==="
git diff main...HEAD --unified=3
When running in Claude Code, use AskUserQuestion tool to confirm the following before generating PR content:
Related Issue:
Base Branch (only if the current branch name doesn't clearly indicate its target):
release/v1.2 → main, hotfix/auth-bug → main, develop/feature-x → developfeat/oauth-google, fix/parsing, chore/upgrade-deps, ad-hoc topic branchesNon-Claude-Code Environments: If AskUserQuestion is unavailable (Codex, Gemini CLI, plain terminal, etc.), do not block. Default to main as the base branch and skip Issue linking unless the user already provided an issue number; surface both choices in the final summary so the user can correct them.
Analyze the changes and generate an appropriate PR title and description based on:
Generate from the change content (determine from the essence of the changes, not the branch name).
Title format (Conventional Commits):
feat: - New feature additionfix: - Bug fixrefactor: - Refactoringtest: - Test addition/modificationdocs: - Documentation updatechore: - Build/configuration changesGenerate a description that provides the minimum prerequisite knowledge for reviewers to begin code review.
Required sections:
Overview
Related Issue
Closes #XXX formatChanges
- Add endpoint `/api/v1/xxx`
- Improve error handling logic
- Strengthen validation
Impact Scope (if applicable)
Checklist
- [ ] Code follows the style guidelines
- [ ] Tests have been added/updated
- [ ] Documentation has been updated (if relevant)
- [ ] Build is successful
- [ ] Ready for review
How to Test
Additional Information
# Verify the base branch chosen in step 2 is up to date
echo -e "\n=== Checking remote status ==="
git fetch origin <base>
# Check if branch exists on remote
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
if git ls-remote --heads origin "$CURRENT_BRANCH" | grep -q "$CURRENT_BRANCH"; then
echo "Branch already pushed to remote"
else
echo "Pushing branch to remote..."
git push -u origin "$CURRENT_BRANCH"
fi
# Create PR
echo -e "\n=== Creating Pull Request ==="
gh pr create --base <base> --title "<generated title>" --body "$(cat <<'EOF'
<generated description>
EOF
)"
echo "Pull request created successfully!"
Balance conciseness and thoroughness
Clarify the intent of changes
Reviewer's perspective
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub takuan-osho/ccmarketplace --plugin create-pr