Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

merge-pr

БесплатноБез исполняемых скриптовНе проверен

Merge a pull request using gh pr merge --admin

dyoshikawaот dyoshikawa★ 1 671 звезда на GitHub

Об этом скилле

Merge Pull Request

Merge a pull request using gh pr merge --admin.

Input

the user's request

Step 1: Determine the Target PR

Parse the user's request to identify the PR to merge:

Case A: PR number or URL is provided

  • Extract the PR number from the argument
  • Examples: 123, #123, https://github.com/owner/repo/pull/123

Case B: No argument provided

  • Get the PR associated with the current branch:
    gh pr view --json number,title,state
    

Case C: Unable to determine the PR

If the PR cannot be determined (e.g., no PR exists for the current branch, or the argument is ambiguous), ask the user to specify which PR to merge.

Step 2: Verify the PR

Before merging, confirm the PR details:

gh pr view <pr_number> --json number,title,state,mergeable,author,baseRefName,headRefName

Check:

  1. The PR state is OPEN
  2. Display the PR title and number to the user (for visibility; do not wait for a reply)

If the PR is not open or not mergeable, inform the user and stop.

Step 3: Check GitHub Actions Workflow Status

Verify that all CI checks have passed before merging:

gh pr checks <pr_number>

Check:

  1. All workflow checks show pass status
  2. No checks are pending or fail

If checks are still running, do not ask — wait for them with gh pr checks <pr_number> --watch and merge once they all pass.

If any check has failed, inform the user and ask whether to:

  • Investigate failed checks before merging
  • Proceed with merge anyway (using --admin will bypass required checks)

Step 4: Merge the PR

Execute the merge command:

gh pr merge <pr_number> --admin --merge

Important: Only merge ONE PR at a time. If multiple PRs are somehow specified, ask the user which single PR to merge.

Step 5: Comment on the PR

After the merge succeeds, leave a thank-you comment mentioning the PR author:

gh pr comment <pr_number> --body "@<author_login> Thank you!"

Use the author.login value obtained in Step 2 for the mention.

Step 6: Report Result

After merging:

  1. Confirm the PR was successfully merged
  2. Display the merged PR number and title

Step 7: Clean Up Local Branch

If the local branch exists, please clean up the local branch. Execute:

git checkout main && git pull --prune && git branch -d <branch-name>

Where <branch-name> is the head branch name from Step 2 (e.g., fix/rulesync-import-targets).

Полный SKILL.md на GitHub

Установить merge-pr в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл merge-pr?

Merge a pull request using gh pr merge --admin

Как установить скилл merge-pr?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл merge-pr запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить merge-pr с