create-pr
Create Pull Request
Overview
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.
Workflow
1. Analyze Changes
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
2. Confirm Related Information (Claude Code only)
When running in Claude Code, use AskUserQuestion tool to confirm the following before generating PR content:
Related Issue:
- Question: "Is there a related GitHub Issue for this PR?"
- Header: "Issue"
- Options:
- "Enter Issue number" - Specify the issue number to link (e.g., #123)
- "No related issue" - This PR is not linked to any issue
- If user selects "Enter Issue number", they can provide the number via the "Other" option
- Use the provided number in "Closes #XXX" format in the PR description
Base Branch (only if the current branch name doesn't clearly indicate its target):
- "Clearly indicates target" examples (skip the question):
release/v1.2→ main,hotfix/auth-bug→ main,develop/feature-x→ develop - "Doesn't clearly indicate target" examples (ask the question):
feat/oauth-google,fix/parsing,chore/upgrade-deps, ad-hoc topic branches - Question: "Which branch should this PR target?"
- Header: "Base"
- Options:
- "main (Recommended)" - Standard base branch
- "develop" - For projects using gitflow
- If user needs a different branch, they can specify via the "Other" option
Non-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.
3. Generate PR Title and Description
Analyze the changes and generate an appropriate PR title and description based on:
- Pattern of changed files
- Content of commit messages
- Details of the diff
PR Title
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 changes
PR Description
Generate a description that provides the minimum prerequisite knowledge for reviewers to begin code review.
Required sections:
Overview
- Why this change is needed, what it resolves
- Summary of changes and expected effects
- Provide background information so reviewers understand the necessary context
- Approximately 2-4 paragraphs
Related Issue
- Reference issues in
Closes #XXXformat - Related external links (if applicable)
Changes
- Bullet points of main changes (approximately 3-7 items)
- Describe "what was changed and how" concisely
- Specific function names or class names are generally unnecessary
- Example:
- Add endpoint `/api/v1/xxx` - Improve error handling logic - Strengthen validation
Impact Scope (if applicable)
- Which features are affected
- Which environments are affected (if applicable)
- Whether existing features are impacted
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
- Describe specific test execution methods
- If automated tests are sufficient, indicate so
- If special manual testing is required, describe the steps
Additional Information
- Reasons for design decisions
- Technical notes
- Future improvement plans (if applicable)
- If none, write "n/a"
4. Create PR
# Verify main branch is up to date
echo -e "\n=== Checking remote status ==="
git fetch origin main
# 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 main --title "<generated title>" --body "$(cat <<'EOF'
<generated description>
EOF
)"
echo "Pull request created successfully!"
Important Notes
General Principles
-
Balance conciseness and thoroughness
- Not too detailed, not too brief
- Provide minimum+α information for reviewers to begin code review
- Implementation details (specific function names, etc.) are generally unnecessary
-
Clarify the intent of changes
- Explain not just "what" was changed, but "why"
- Describe the background of technical decisions
-
Reviewer's perspective
- Has basic knowledge of the project
- However, not familiar with this specific change area
- Provide necessary context and background
More from takuan-osho/ccmarketplace
k6-docs
Use this skill when writing or debugging Grafana k6 load testing code. Provides access to the latest official k6 documentation including API references, examples, and best practices for creating performance tests.
56interview
Conduct structured interviews to clarify scope, surface constraints, and reach a "do / don't do / done" agreement before starting non-trivial work. Use when receiving an ambiguous request, a vague task description, or before entering plan mode for any non-trivial implementation. Skip for one-line concrete fixes ("rename foo to bar") or single-fact questions. Supports requirements definition, debugging investigation, architecture review, security review, documentation creation, and general exploration.
32gemini-search
Web search using Google Gemini CLI. This skill should be used when performing web searches through the Gemini CLI tool instead of the built-in WebSearch tool. Requires the Gemini CLI to be installed and configured.
19tdl
This skill should be used when implementing or improving Traceable Development Lifecycle (TDL) practices in software projects. Use this skill to establish traceability across the 5-phase workflow (analysis → requirements → ADR → design → implementation). Provides tools, templates, and best practices for ADRs, commit messages, PR templates, structured logging, and traceability analysis as cross-cutting code-integration patterns.
13gcm
Generate Git Commit Message. This skill should be used when generating a commit message for staged changes. It analyzes git staged changes and generates an appropriate English commit message following Conventional Commits format.
13multi-ai-collab
Orchestrate multiple AI agents with specialized personas for cross-review and collaborative development
13