This skill should be used when the user asks to "submit a PR", "create a pull request", "open a PR", "push my changes as PR", or wants help with PR workflow including branch management and commit migration.
From codeblendnpx claudepluginhub chenxizhang/agent-skills-and-plugins --plugin codeblendThis skill uses the workspace's default tool permissions.
references/git-workflow.mdscripts/detect-branch.shThis skill guides users through submitting pull requests with intelligent branch management, automatic PR generation, and proper labeling.
The submit-pr skill handles the complete PR workflow:
Before starting the PR workflow, verify the GitHub CLI is available and authenticated.
Run: command -v gh
If gh is not installed, attempt to install based on the platform:
brew install ghsudo apt install ghsudo dnf install ghwinget install GitHub.cliRun: gh auth status
If not authenticated, inform the user:
Please run
gh auth loginto authenticate with GitHub before continuing.
Use the detect-branch script or run these commands:
# Get current branch name
git branch --show-current
# Check if on main/master
BRANCH=$(git branch --show-current)
if [[ "$BRANCH" == "main" || "$BRANCH" == "master" ]]; then
echo "On default branch"
fi
# Check for unpushed commits
git log origin/$BRANCH..$BRANCH --oneline
If on main/master with unpushed commits:
If already on a feature branch:
Show unpushed commits:
git log origin/main..HEAD --oneline --no-decorate
Present options to the user:
Generate a branch name from the first commit message using these rules:
Detect commit type from conventional commit prefix:
| Prefix | Branch Prefix |
|---|---|
fix:, bugfix: | fix/ |
feat:, feature:, add: | feature/ |
refactor:, chore:, docs:, test:, style:, perf:, ci:, build: | feature/ |
| No prefix | feature/ |
Convert to kebab-case:
fix:)Examples:
fix: authentication bug in login ā fix/authentication-bug-loginfeat: add user profile page ā feature/add-user-profile-pageAdd dark mode support ā feature/add-dark-mode-supportrefactor: simplify API handlers ā feature/simplify-api-handlersPresent the generated branch name to the user and allow them to modify it if desired.
If migrating from main/master:
# Store current commit hash
CURRENT_COMMIT=$(git rev-parse HEAD)
# Create new branch at current position
git checkout -b <branch-name>
# Go back to main/master and reset to origin
git checkout main
git reset --hard origin/main
# Return to feature branch
git checkout <branch-name>
Important: Warn the user that this will modify their main/master branch. Get confirmation before proceeding.
PR Title:
PR Description: Generate a structured description:
## Summary
<Brief summary of changes based on commit messages>
## Changes
<Bulleted list of commits included>
## Test Plan
- [ ] <Suggested test items based on change type>
---
š¤ Generated with [Claude Code](https://claude.ai/code) via CodeBlend
Show the generated title and description to the user for review/editing.
# Push the branch
git push -u origin <branch-name>
# Create the PR
gh pr create --title "<title>" --body "<description>"
# Add the codeblend label
gh pr edit --add-label "codeblend"
If the "codeblend" label doesn't exist, create it:
gh label create codeblend --description "PR created with CodeBlend AI assistant" --color "7C3AED"
After successful PR creation, display:
No upstream configured:
git push -u origin <branch-name>
Branch already exists on remote: Ask user if they want to force push or use a different branch name.
PR already exists for branch: Show existing PR URL and ask if user wants to update it instead.
Label creation fails (no permission): Skip label addition and inform user they can add it manually.
For detailed git commands and edge case handling, see:
references/git-workflow.md - Complete git operation referenceHelper scripts are available in the scripts/ directory:
detect-branch.sh - Detects current branch and commit status--draft flag for work-in-progress PRsGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.