Push a development branch and create or update a pull request via gh CLI using type-specific templates. Optionally updates README, docs, and project tracking before opening the PR. Use after finishing development, when ready to open a PR, submit work for review, or push changes.
Ships in git. 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.
Read when SKILL.md points to them.
Push a development branch and create or update a GitHub pull request. Before opening the PR, optionally update project documentation (README, docs directory, planning files) so the PR includes all relevant changes. This skill is the natural next step after gh-dev.
gh auth status
If gh is not installed or not authenticated, stop and guide the user (see Gotchas).
Then confirm the repo state:
# Current branch
git branch --show-current
# Commits ahead of default branch
git log --oneline origin/main..HEAD 2>/dev/null || git log --oneline origin/master..HEAD 2>/dev/null
# Uncommitted changes
git status --porcelain
If the current branch is main or master, stop and tell the user to check out a feature branch first.
If there are uncommitted changes, inform the user and ask how to proceed — commit them, stash them, or abort.
If there are no commits ahead of the default branch, tell the user there is nothing to open a PR for and stop.
Store the current branch name as BRANCH_NAME.
Detect whether the repository uses a development branch:
git branch -r | grep -E 'origin/(dev|develop)$'
If dev or develop exists, set BASE_BRANCH to that branch. Show the target to the user:
This PR will target
dev. Correct?
Use AskUserQuestion to confirm. Do not proceed until the user confirms the base branch. If the user wants a different base, use the branch they specify.
If neither dev nor develop exists, default to main (or master if main does not exist). Still confirm with the user before proceeding.
Extract the issue number from the branch name. If the branch follows the issues/N convention:
echo "$BRANCH_NAME" | grep -oE 'issues/[0-9]+' | grep -oE '[0-9]+'
If a number is found, fetch the issue details:
gh issue view ISSUE_NUMBER --json title,body,labels,state
Store as ISSUE_NUMBER, ISSUE_TITLE, and ISSUE_LABELS. The labels are used in Step 9 to determine the PR type.
If no issue number can be extracted, ask the user whether this PR is linked to an issue. If not, proceed without one.
Decide which language to use for the PR body. Check in this order:
CLAUDE.md in the project root. If it is written in Traditional Chinese or contains a language directive, use Traditional Chinese.Store as PR_LANG — either en or zh-TW.
git log --oneline -20
cat CLAUDE.md 2>/dev/null || true
cat CONTRIBUTING.md 2>/dev/null || cat .github/CONTRIBUTING.md 2>/dev/null || true
Infer the commit convention (prefix style, tense, scope, capitalization) the same way gh-dev does. Store as COMMIT_CONVENTION.
Check whether the readme skill is available in the current session's available skills list.
If available:
readme skill using the Skill tool.COMMIT_CONVENTION:git add README.md
git commit -m "docs: update README to reflect branch changes"
Adapt the commit message prefix to match COMMIT_CONVENTION. No Co-Authored-By or attribution.
If the readme skill is not available, skip this step silently.
ls -d doc/ docs/ 2>/dev/null
If doc/ or docs/ exists:
git diff main..HEAD or equivalent) to identify whether any documented APIs, features, workflows, or configuration changed.git add docs/affected-file.md
git commit -m "docs: update affected-file to reflect new behavior"
Adapt the commit message prefix to match COMMIT_CONVENTION. No Co-Authored-By or attribution.
If no doc/ or docs/ directory exists, skip this step.
Check whether the planning-with-files skill is available in the current session's available skills list.
If available:
planning-with-files skill using the Skill tool to update project plan files with the completed work from this branch.git add task_plan.md progress.md findings.md
git diff --cached --stat
git commit -m "docs: update project tracking for completed work"
Adapt the commit message prefix to match COMMIT_CONVENTION. No Co-Authored-By or attribution.
If the planning-with-files skill is not available, skip this step silently.
git push -u origin "$BRANCH_NAME"
If the push fails due to diverged history, inform the user and ask how to proceed. Never force-push without explicit user consent.
gh pr view "$BRANCH_NAME" --json number,title,state,url 2>/dev/null
If a PR exists and is open, proceed to update flow (Step 9f). Otherwise, create a new PR.
Map the PR to one of six types using the issue labels from Step 2:
If the type cannot be determined from labels, infer from the commit history or ask the user.
Store as PR_TYPE.
Read the appropriate template from <skill-path>/templates/{PR_TYPE}.md (or {PR_TYPE}-zh-TW.md if PR_LANG is zh-TW).
Fill every section using information from:
git log --oneline origin/main..HEAD
git diff --stat origin/main..HEAD
Plus the issue details from Step 2. Replace placeholder guidance with concrete details — file paths, function names, specific changes. If ISSUE_NUMBER exists, include Closes #ISSUE_NUMBER in the Summary section.
Build the PR title following COMMIT_CONVENTION. Keep under 80 characters.
Show the user the complete PR title and body in a fenced block. Use AskUserQuestion to ask for approval or changes. After approval:
gh pr create \
--title "{title}" \
--base "{BASE_BRANCH}" \
--body "$(cat <<'PR_EOF'
{filled PR body}
PR_EOF
)"
Report the PR URL to the user.
If a PR already exists:
gh pr edit EXISTING_PR_NUMBER \
--title "{updated_title}" \
--body "$(cat <<'PR_EOF'
{updated PR body}
PR_EOF
)"
Report the PR URL to the user.
If the update includes fix commits (e.g., addressing review feedback), prompt the user after the push:
Want me to comment on the PR to confirm the fixes? I can run
/gh-comment.
Report to the user:
If a linked issue was detected in Step 2 (ISSUE_NUMBER is set), offer:
Want me to post a status comment on issue #N? I can run
/gh-comment.
Before running any gh command, verify that the CLI is available, authenticated, and has the required token scopes:
gh auth status
If gh is not installed, guide the user to install it first:
brew install ghwinget install --id GitHub.cli or scoop install ghIf gh is installed but not authenticated, guide the user to log in:
gh auth login
A successful gh auth status does not guarantee sufficient permissions. The token must include the repo scope for creating and updating pull requests. Check the scopes listed in the gh auth status output. If the repo scope is missing, the user must refresh their token:
gh auth refresh -s repo
Do not proceed until gh auth status succeeds and confirms the repo scope is present.
If the repository has no GitHub remote, inform the user that a remote is required and suggest:
gh repo create
# or
git remote add origin https://github.com/{owner}/{repo}.git
If git log main..HEAD (or master..HEAD) returns no commits, the branch has nothing to submit. Step 1 already checks for this and stops early. Do not attempt to generate a PR title, body, or template when the diff is empty — the template filling logic in Step 9d depends on non-empty git log and git diff --stat output, and will fail if both are blank.
When checking for the readme or planning-with-files skills, do not error or warn if they are absent. These are optional enhancements — the core PR workflow works without them.
When creating a PR, the base branch is determined and confirmed with the user in Step 1. See the "Determine base branch" section there. Do not skip that confirmation gate or override the user's choice later in the workflow.
git add ., git add -A, or git add --all. Always stage files by explicit path.readme, planning-with-files) are not available, skip them silently — do not suggest installing them or warn about their absence.Closes #N consistently in PR bodies to link issues.templates/bug-zh-TW.md (opens in a new tab)templates/bug.md (opens in a new tab)templates/doc-zh-TW.md (opens in a new tab)templates/doc.md (opens in a new tab)templates/feat-zh-TW.md (opens in a new tab)templates/feat.md (opens in a new tab)templates/perf-zh-TW.md (opens in a new tab)templates/perf.md (opens in a new tab)templates/refactor-zh-TW.md (opens in a new tab)templates/refactor.md (opens in a new tab)templates/security-zh-TW.md (opens in a new tab)templates/security.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
9 skills in this plugin
/branch-reportGenerates a branch-vs-default comparison report with plain-language explanations and senior dev review. Use when the user asks to summarize, compare, review, or explain branch changes, or wants a PR summary before merging. Read-only: it produces a report to read — it does not push the branch or open/update the PR (for that use gh-pr).
/commit-msgSuggests 3 commit messages based on git diff and project conventions. Use when the user asks for commit message ideas, wants help writing a commit message, or has changes ready to commit.
/gh-archiveCapture the current state of a project by updating documentation at the end of a development session. Invokes the readme skill to refresh README.md and the planning-with-files skill to record project status in a doc/ or docs/ directory. Use after merging a PR, finishing a feature, wrapping up a coding session, or any time the user wants to snapshot where the project stands — even implicit phrases like "archive this", "wrap up the session", "document current status", "update project docs", "snapshot this repo", or "I'm done for today". Also use when the user says "end of session" or asks to prepare documentation before stepping away from a project.
/gh-commentPost formatted comments on GitHub PRs or issues, approve PRs, and merge PRs via gh CLI using purpose-specific templates (feedback, question, status, approval, request-changes). Use when commenting on a PR, leaving feedback, asking a question on an issue, posting a status update, approving a pull request, merging a PR, or any intent to interact with an existing PR or issue — even implicit phrases like "tell them", "approve it", "merge this", "LGTM", or "ship it".
/gh-devCreate a branch linked to a GitHub issue via gh issue develop, then implement the work with regular convention-following commits. Use when starting work on an issue, picking up a ticket, developing a feature branch, or any intent to begin coding against a GitHub issue.
/gh-fixRead unresolved review comments on a GitHub PR, deeply evaluate each suggestion, then either fix it (via gh-dev + simplify) and push the result, or push back via gh-comment with a reasoned reply. Use when the user wants to address PR feedback, respond to reviewer comments, fix code-review suggestions, action a review, or any phrasing like "address the comments on PR #N", "respond to the review", "fix what the reviewer asked for", "go through the PR feedback", or "handle the review comments".
/git:gh-prfrom git
npx claudepluginhub chienchuanw/chuan-skills --plugin git