From routine
Creates GitHub pull requests from current branch: analyzes git diffs, categorizes changes, generates ticket-ID prefixed titles and templated bodies, runs gh pr create. Use after commits for review.
npx claudepluginhub delexw/claude-code-miscThis skill is limited to using the following tools:
Analyze code changes on the current branch and create a well-structured pull request using `gh`.
Creates draft pull requests via GitHub CLI: gathers git context with status/logs/diffs, generates conventional commit titles, formats markdown bodies. Triggers on PR creation phrases.
Analyzes git diffs and commit history to fill PR templates and create pull requests via gh CLI. Use when creating PRs, filling templates, or needing description help.
Creates GitHub Pull Requests using GitHub CLI: detects existing PRs for branches, pushes changes, generates titles/bodies from commits. Handles monorepos/submodules. Use for /create-pr or PR/review requests.
Share bugs, ideas, or general feedback.
Analyze code changes on the current branch and create a well-structured pull request using gh.
Check that you're in a git repo, on a feature branch (not main/master), gh is authenticated, and warn about uncommitted changes:
git rev-parse --is-inside-work-tree
git branch --show-current
gh auth status
git status --porcelain
If any check fails, report the specific error and stop. If git status --porcelain returns output, warn the user: "You have uncommitted changes — they won't be included in this PR." Then continue (don't stop).
Before creating a new PR, check if one already exists for this branch:
gh pr list --head "$(git branch --show-current)" --state all --json number,title,state,url
If a base branch was specified in the instructions (e.g. for stacked PRs), use that. Otherwise auto-detect: try main, then master, then the default branch from gh repo view --json defaultBranchRef.
Use the base branch determined above for all diffs:
git log --oneline <base>..HEAD
git diff <base>..HEAD --stat
git diff <base>..HEAD
Group the diff into:
Note modified files, functions/classes affected, and import changes.
Look for .github/PULL_REQUEST_TEMPLATE.md in the project root. If found, use it as the PR body template and fill in every section with actual content from the diff analysis. If no template exists, write a clear description covering what changed and why.
PR title format: [TICKET-ID]: brief description (max 80 chars). The ticket ID must be the very first element in the title. Extract the ticket ID from the branch name or commit messages. Example: [EC-1111]: Fix item license search query. Do NOT place conventional prefixes (feat:, fix:, etc.) before the ticket ID.
Write the PR body to a temp file to safely handle special characters, quotes, and newlines:
tmpfile=$(mktemp /tmp/pr-body.XXXXXX.md)
cat > "$tmpfile" << 'PRBODY'
<body content here>
PRBODY
gh pr create --title "<title>" --body-file "$tmpfile" --draft [--base "<base_branch>"]
rm -f "$tmpfile"
If a base branch was specified in the instructions (e.g. for stacked PRs), use --base to target it instead of the default branch.
Then open it in the browser (suppress output — do not let gh pr view print anything to stdout):
gh pr view --web 2>/dev/null || true
Return ONLY this JSON (no other text before or after):
{
"pr_url": "<full GitHub PR URL>",
"pr_number": <number>,
"title": "<PR title>",
"status": "success"
}
On failure:
{
"pr_url": "",
"pr_number": 0,
"title": "",
"status": "failed",
"error_message": "<what went wrong>"
}
gh auth login."