Post 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".
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.
Post formatted comments on GitHub PRs and issues, approve PRs, and merge PRs using the gh CLI. Comments follow purpose-specific templates for consistency. This skill does not perform code review analysis — use Claude Code's built-in /review for that.
Two workflows:
| Workflow | What it does |
|---|---|
| Comment | Post a formatted comment on a PR or issue |
| Approve & merge | Approve a PR and/or merge it (prefers rebase) |
Comment types:
| Type | Shorthand | Use when |
|---|---|---|
| Feedback | feedback | Reviewing code, suggesting improvements, noting observations |
| Question | question | Asking for clarification on implementation, design, or intent |
| Status | status | Posting a progress update on in-progress work |
| Approval | approval | Summarizing approval rationale before or after approving |
| Request Changes | request-changes | Requesting specific code changes with action items |
Run gh auth status to confirm the CLI is installed and authenticated.
If gh is not installed, guide the user:
brew install ghwinget install --id GitHub.cli or scoop install ghIf gh is installed but not authenticated, guide the user through gh auth login.
Check that the token has repo scope. If it does not, the user needs:
gh auth refresh -s repo
If the repository has no GitHub remote, inform the user and suggest gh repo create or git remote add origin.
Identify the PR or issue from the user's input. The user may provide:
#42, 42)https://github.com/owner/repo/pull/42)Resolve the target and fetch context:
# For a PR
gh pr view N --json number,title,body,state,author,reviewDecision,mergeStateStatus,baseRefName,headRefName,labels
# For an issue
gh issue view N --json number,title,body,state,author,labels
If the user said "issue", use issue commands. If "PR", "pull request", or ambiguous, try PR first. If the PR does not exist, try as an issue.
Store TARGET_TYPE (pr or issue) and TARGET_NUMBER.
Choose between the two workflows based on user signals:
If the user says "approve" without "merge", perform approval only (Step 6 without Step 7). If the user says "merge" without "approve", ask whether to approve first or just merge directly.
If the workflow is unclear, ask the user with AskUserQuestion.
Store WORKFLOW (comment or approve-merge).
Decide which language to use for the comment. Check in this order:
CLAUDE.md in the project root. If it is written in Traditional Chinese or contains a language directive (e.g., language: zh-TW), use Traditional Chinese.When the user asks for "Chinese" without specifying a variant, default to Traditional Chinese (繁體中文).
Store COMMENT_LANG — either en or zh-TW. This determines which template file to read in Step 5.
Map the user's request to one of the five types. Use these signals:
If ambiguous, ask the user with AskUserQuestion presenting the five options.
Store COMMENT_TYPE.
Run in parallel:
# Read existing conversation on the target
gh pr view N --comments --json comments
# or
gh issue view N --comments --json comments
# Repo info
gh repo view --json nameWithOwner --jq '.nameWithOwner'
Also gather context from the conversation and codebase:
The goal is to fill the template with specific, concrete information — not vague placeholders.
Read the appropriate template from <skill-path>/templates/{COMMENT_TYPE}.md (or {COMMENT_TYPE}-zh-TW.md if COMMENT_LANG is zh-TW).
Fill in every section using information gathered from the conversation and codebase. For each template section:
src/auth/middleware.ts:42).Show the user the complete comment in a fenced markdown block:
**Target:** PR #42 — The PR title
**Comment type:** feedback
---
{filled template body}
Use AskUserQuestion to ask the user to approve or request changes. If the user requests changes, revise and present again.
After the user approves, post the comment:
# For PR
gh pr comment N --body "$(cat <<'COMMENT_EOF'
{filled comment body}
COMMENT_EOF
)"
# For issue
gh issue comment N --body "$(cat <<'COMMENT_EOF'
{filled comment body}
COMMENT_EOF
)"
Report success and the link to the comment.
This step applies only to PRs. If TARGET_TYPE is issue, inform the user that issues cannot be approved and stop.
gh pr view N --json reviewDecision,reviews,state,mergeable
If the user has already approved this PR, inform them and ask whether to re-approve.
Read the approval template (same as Step 5c — use <skill-path>/templates/approval.md or the zh-TW variant). Fill it with a summary of what was reviewed and why the PR is ready.
Present the approval message to the user via AskUserQuestion for confirmation.
gh pr review N --approve --body "$(cat <<'APPROVE_EOF'
{approval message}
APPROVE_EOF
)"
Report success.
After reporting the approval, actively offer:
"PR approved. Want me to rebase-merge it now?"
This step applies only to PRs. If TARGET_TYPE is issue, inform the user that issues cannot be merged and stop.
gh api repos/{owner}/{repo} --jq '{
allow_merge_commit: .allow_merge_commit,
allow_squash_merge: .allow_squash_merge,
allow_rebase_merge: .allow_rebase_merge
}'
Extract {owner}/{repo} from gh repo view --json nameWithOwner --jq '.nameWithOwner'.
Choose from the repo's allowed strategies in this priority order:
--rebase) — preferred for linear history--squash) — if rebase is not allowed--merge) — last resortIf none are allowed (unlikely), inform the user and stop.
Store MERGE_STRATEGY.
gh pr view N --json mergeStateStatus,reviewDecision,statusCheckRollup
Check for blockers:
mergeStateStatus is BLOCKED — required reviews or checks not satisfiedIf blocked, inform the user of the specific blocker. Do not attempt to force-merge or bypass required checks.
Show the user:
Use AskUserQuestion for explicit approval before merging.
gh pr merge N --rebase # or --squash or --merge per 7b
After successful merge, report:
After a successful merge, check whether the PR is linked to a GitHub issue:
Closes #N, Fixes #N, or Resolves #N (case-insensitive).issues/N.If a linked issue is detected, offer:
"PR merged. Issue #N should auto-close via
Closes #N. Want me to post a wrap-up comment on the issue?"
gh issue comment N --body "...".After the linked issue follow-up (or immediately after merge if no linked issue was found), offer to switch back to the PR's base branch (available from baseRefName fetched in Step 2) and delete the local issue branch:
"Want me to switch back to
BASE_BRANCHand delete the localissues/Nbranch?"
git checkout BASE_BRANCH && git branch -d issues/N (where BASE_BRANCH is the PR's base branch, e.g., dev, develop, or main).issues/N. If the branch does not follow this pattern, skip this step.gh CLI./review — this skill posts comments and performs approve/merge actions, not code review analysis.templates/approval-zh-TW.md (opens in a new tab)templates/approval.md (opens in a new tab)templates/feedback-zh-TW.md (opens in a new tab)templates/feedback.md (opens in a new tab)templates/question-zh-TW.md (opens in a new tab)templates/question.md (opens in a new tab)templates/request-changes-zh-TW.md (opens in a new tab)templates/request-changes.md (opens in a new tab)templates/status-zh-TW.md (opens in a new tab)templates/status.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
/git:gh-commentfrom git
npx claudepluginhub chienchuanw/chuan-skills --plugin git9 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.