Token导航 LogoToken导航

Agent Skill · 研究检索

git-pr-merge(git pr 合并)

git-pr-merge 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

git-pr-merge 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 64,698。

总安装 294周安装 12GitHub Stars 2下载 94核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:git-pr-merge(git pr 合并)
来源仓库:https://github.com/xiaojiongqian/skills-hub
仓库路径:skills/git-pr-merge
安装命令:
npx skills add https://github.com/xiaojiongqian/skills-hub --skill git-pr-merge
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/xiaojiongqian/skills-hub --skill git-pr-merge

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

git-pr-merge 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中根据条件快速定位目标内容。适用于 PR 管理、变更筛选或协作流程支持场景。通过安装命令从指定仓库添加,功能细节依赖原始文档说明。使用前应确认权限范围,注意是否触发网络或文件操作。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/git-pr-merge

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/xiaojiongqian/skills-hub --skill git-pr-merge;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

git-pr-merge 怎么安装?

在终端执行 npx skills add https://github.com/xiaojiongqian/skills-hub --skill git-pr-merge。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

git-pr-merge 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

git-pr-merge 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/xiaojiongqian/skills-hub --skill git-pr-merge 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

git-pr-merge 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

git-pr-merge 用的人多吗?

公开数据是累计安装 294 次,近一周安装 12 次,下载 94 次,GitHub 2 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

git-pr-merge 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
git-pr-merge

git pr 合并 · 本页

2942执行命令未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Git PR Merge

Overview

End-to-end pull request merge workflow: review the diff for quality, security, and docs/tests coverage, validate locally on disposable branches or worktrees, finalize with gh pr merge when safe, and clean up. Default target is the PR base branch. dev may proceed autonomously; main requires human confirmation before the final merge.

Prefer Claude as the host when available. Medium and large PRs benefit from Claude's internal review and simplification helpers; other agents should fall back to the bundled sub-agent prompts in this skill.

Quick start

Merge PR #123
Merge PR #456 with squash and delete the source branch
Review PR #789 targeting main; merge only after I confirm

Inputs

  • pr: required. PR number, #123, or full PR URL.
  • target_branch: optional. Default the PR baseRefName from gh pr view. If provided and different from baseRefName, treat it as a non-standard target override; review and commenting may proceed, but do not autonomously merge unless a human explicitly confirms the alternate integration flow.
  • merge_strategy: optional. merge | squash | rebase. Default merge.
  • delete_branch: optional. Default false. Applies only when the GitHub merge succeeds and the source branch is not protected.
  • use_worktree: optional. Default false.

Operating model

  • Execute the full flow autonomously once the user requests a merge, except for protected-branch confirmation gates.
  • Use gh pr merge for the final standard merge so GitHub remains the source of truth for branch protection, merge queues, and merge state.
  • Do not pause for routine confirmations during fetch, review, validation, cleanup, or PR comments.
  • Stop only when a required input is missing, access is unavailable, a blocking issue is found, or a human confirmation gate is required.
  • Never force-push or manually rewrite target-branch history.
  • Never delete protected branches such as main, master, dev, or develop.
  • If the merge flow fails after review has started, leave a traceable PR comment and stop cleanly.
  • If the host is non-interactive and the target branch requires human confirmation, stop after review/comment and do not merge.

Preconditions

  1. Confirm repo scope and remotes:

- pwd - git rev-parse --show-toplevel - git remote -v

  1. Verify GitHub CLI access:

- gh auth status

  1. Resolve the PR and capture metadata:

- gh pr view <pr> --json number,title,state,isDraft,headRefName,headRefOid,baseRefName,author,mergeable,commits,additions,deletions,body,url - gh pr checks <pr> - gh pr diff <pr>

  1. Determine the target branch:

- If the user specified target_branch, use it. - Otherwise default to baseRefName. - If target_branch!= baseRefName, record that the run is in non-standard target-override mode.

  1. Apply target-branch policy:

- If the target branch is dev, continue autonomously after review and validation. - If the target branch is main, require explicit human confirmation immediately before the final merge. - If the target branch is something else and the repo norm is unclear, prefer review/comment only instead of guessing.

Do not continue if the PR is closed, already merged, inaccessible, or still in draft state.

Review workflow

Review mode

Choose review depth from total changed lines (additions + deletions):

  • Small: < 100
  • Medium: 100-500
  • Large: > 500

Always perform:

  • code quality review
  • security review
  • docs and tests completeness review
  • impact and regression review

If the host agent supports deeper review helpers or subagents, use them for medium and large PRs. If not, perform the review manually.

Sub-agent delegation

For medium and large PRs, use sub-agents when available:

  • Code review sub-agent: Performs the detailed code quality, security, impact, and docs/tests review. Invoke after capturing the PR diff and metadata.

- Claude: use the code-reviewer skill (or the Agent tool with a review prompt). - Other agents: use the bundled prompt at <path-to-skill>/agents/code-reviewer.md to spawn a sub-agent. Pass the PR diff and metadata as input.

  • Code simplifier sub-agent: Optional, non-blocking follow-up for duplication, dead code, and unnecessary complexity. Use only after the merge decision is already made, or after a review-only run when the user wants cleanup suggestions.

- Claude: use the simplify skill (or the Agent tool with a simplification prompt). - Other agents: use the bundled prompt at <path-to-skill>/agents/code-simplifier.md to spawn a sub-agent. Pass the list of changed files and their post-merge content.

For small PRs, sub-agent delegation is optional — inline review is sufficient.

Required review checks

  1. Read the diff and identify the changed modules.
  2. Check for obvious bugs, unsafe behavior, sensitive data, and risky edge cases.
  3. Check whether docs and tests are adequate for the size and type of change.
  4. Distinguish issues introduced by this PR from historical issues that already existed.

Docs and tests policy

Use three modes:

  • Strict mode:

- for large PRs or obvious feature additions - require meaningful design or requirement documentation, either in changed docs, a sufficiently detailed PR body, or linked external docs - require tests for new public behavior

  • Update mode:

- for medium PRs - require doc/test updates when public behavior, interfaces, or contracts changed

  • Consistency mode:

- for small PRs - verify that existing docs and tests still match the new behavior

If docs or tests are clearly insufficient for the chosen mode, do not merge.

Historical issues

If review finds problems that are clearly outside the PR diff and not introduced by this PR:

  • do not block the merge for those issues alone
  • optionally create a GitHub issue to track the historical debt
  • note it in the PR summary comment

PR comment discipline

Before posting any PR comment:

  1. Inspect recent PR comments from the current actor:

- gh api repos/<owner>/<repo>/issues/<pr>/comments?per_page=10

  1. Only post a new comment when there is materially new information, for example:

- final merge completed - blocker set changed - mergeability or conflict status changed - validation outcome changed - PR head SHA changed - the previous run had no traceable comment and this run does

  1. If the latest merge comment from this workflow already states the same outcome and same actionable blocker set, do not add another comment.

Comment content rules:

  • Always include Execution harness: <claude|codex> near the top. Use the current host agent identity.
  • Keep comments concise and high-signal. Prefer a one-line summary plus only the sections needed to act.
  • Do not restate obvious PR context that GitHub already shows on the same page, such as PR title or source/target branches, unless branch targeting itself is the issue.
  • Do not dump long command lists or repeat passing checks unless they are directly relevant to the decision.
  • Omit any section whose only content would be filler or repeated background.

Blocking issues

If review finds blocking issues, do all of the following:

  1. Add a PR review comment describing:

- the blocking problem - affected files or lines - concrete fixes needed

  1. If the current user has permission and the repo workflow uses draft PRs, mark the PR back to draft:

- gh pr ready <pr> --undo - Skip this step if the current user is not the PR author and does not have maintainer access.

  1. Stop without merging.

Use a comment shape like:

## PR merge blocked

**Execution harness**: <claude|codex>
**Summary**: <one-line blocker summary>
**Review mode**: <Small|Medium|Large> (<N> lines changed)

### Blocking issues
- Prefer a short bullet list for 1-2 blockers.
- Use a table only when there are several blockers and the structure adds clarity.

### Next actions
1. specific fix instruction
2. ...

Workspace preparation

Before switching branches:

  1. Record the current branch:

- git rev-parse --abbrev-ref HEAD

  1. Check for local modifications:

- git status --porcelain

  1. If dirty, stash automatically:

- git stash push -m "pr-merge-<pr>-auto-stash"

Restore the stash at the end if one was created.

Target branch setup

Default mode

Operate in the current worktree:

git fetch origin
git checkout <target_branch>
git pull --ff-only origin <target_branch>

Worktree mode

If use_worktree=true, use a temporary worktree to avoid disturbing the current checkout:

temp_dir="/tmp/git-pr-merge-<pr>-$(date +%s)"
git fetch origin
git worktree add "$temp_dir" origin/<target_branch>
cd "$temp_dir"

If worktree creation fails, either recover cleanly or fall back to default mode only when it is safe to do so.

Merge preparation

  1. Check out the PR branch locally:

- gh pr checkout <pr> - record source_branch from headRefName

  1. Create a disposable validation branch:

- for merge or squash: - git checkout -B pr-merge-<pr>-validate origin/<target_branch> - for rebase: - git checkout -B pr-merge-<pr>-rebase <source_branch>

  1. Dry-run the integration without publishing it:

- merge: git merge --no-commit --no-ff <source_branch> - squash: use the same local dry-run merge for conflict and regression detection: git merge --no-commit --no-ff <source_branch> - rebase: git rebase origin/<target_branch>

  1. Run validation only on the disposable branch. Never rebase or merge directly on the real target branch during validation.

If the dry-run setup succeeds, continue to validation.

Conflict handling

Automatically resolve only conflicts that are clearly mechanical:

  • import ordering or duplicated import blocks
  • formatting-only and comment-only conflicts
  • lockfile or dependency-manifest additions when both sides can be combined mechanically
  • simple config-list merges where both entries can safely coexist

For each resolved conflict, record the file, the resolution strategy, and a brief rationale so it can be included in the post-merge comment.

Do not auto-resolve:

  • logic or control-flow conflicts
  • deletion-vs-modification conflicts
  • schema or API contract conflicts
  • ambiguous product-behavior conflicts

If a non-mechanical conflict appears:

  1. Abort the in-progress validation state:

- git merge --abort or git rebase --abort

  1. Add a PR review comment listing each unresolved conflict with file paths and a description of why it cannot be auto-resolved.
  2. If the current user has permission, mark the PR back to draft:

- gh pr ready <pr> --undo

  1. Stop without merging.

Validation before merge

Run the smallest sufficient validation based on changed modules and repo tooling.

Preferred order:

  1. lint or static checks
  2. type checks
  3. unit or integration tests for affected modules

Detect commands from the project when possible:

  • Node: npm run lint, npm run typecheck, npm test, npm run test:unit
  • Python: ruff check. or flake8, mypy, pytest
  • Go: go vet./..., go test./...
  • Rust: cargo clippy, cargo test

For monorepos or multi-package projects, prefer running checks only for affected packages or workspaces rather than the entire project. Look for workspace-level scripts (e.g., nx affected, turbo run test --filter=..., pnpm --filter).

If checks fail:

  1. capture the failing command and error
  2. comment on the PR with the failure summary
  3. abort the validation state safely:

- git merge --abort if merge validation is active - git rebase --abort if rebase validation is active

  1. clean up the disposable validation branch or worktree state
  2. if the current user has permission, mark the PR back to draft
  3. stop without merging

Finalize merge

Only execute the final merge when all of the following are true:

  • review passed
  • validation passed
  • target_branch == baseRefName
  • the target-branch policy allows a merge
  • the PR head still matches the captured headRefOid

If the target branch is main:

  • ask for explicit human confirmation immediately before running the final merge command
  • if the host is non-interactive, skip the merge and leave a review-only summary comment instead

Use GitHub CLI to finalize the standard merge:

  • merge:

- gh pr merge <pr> --merge --match-head-commit <head_sha>

  • squash:

- gh pr merge <pr> --squash --match-head-commit <head_sha>

  • rebase:

- gh pr merge <pr> --rebase --match-head-commit <head_sha>

If delete_branch=true and the source branch is not protected, add --delete-branch.

This keeps GitHub merge state, merge queues, and branch protections authoritative.

If target_branch!= baseRefName, do not run gh pr merge. Leave a summary comment with the review and validation outcome, state that the PR was not merged on GitHub, and require explicit human follow-up for the alternate target flow.

After the merge command, verify the result:

  • gh pr view <pr> --json state,merged,mergeCommit
  • git fetch origin <target_branch>
  • git log origin/<target_branch> -1

Post-merge PR comment

Add a summary comment to the PR conversation when the run produces a materially new outcome. The comment must be clear, concise, and information-dense — no filler, every line carries signal.

Use a comment shape like:

## PR merge <result>

**Execution harness**: <claude|codex>
**Mode**: <standard-merge|review-only|target-override>
**Strategy**: <merge|squash|rebase>
**Merge commit**: `<sha>` (or "N/A" if not merged)
**Summary**: <one-line result>

### Review
- Include only if the review found a non-obvious issue or the verdict is not already clear from Summary.

### Validation
- Include only the smallest sufficient validation facts to justify the decision.

### Conflicts
- Include only if conflicts existed or conflict status is the reason for the outcome.

### Cleanup
- Include only if cleanup state matters for follow-up.

### Follow-up
- Include only if a human still needs to act.

Never omit the merge result, Execution harness, or the validation outcome that justifies the decision.

Branch cleanup

Delete the source branch only when the GitHub merge succeeds, delete_branch=true, and the branch is not protected. Prefer gh pr merge --delete-branch over manual remote deletion so GitHub remains the source of truth.

Never delete main, master, dev, or develop.

Cleanup

This skill is responsible for cleaning up resources it created during the merge flow. The source branch is not a resource created by this skill — its lifecycle is controlled by the delete_branch input, not by cleanup.

At the end:

  • If a temporary worktree was created, always remove it:

- git worktree remove "$temp_dir" - If removal fails (e.g., uncommitted files), force-remove with git worktree remove --force "$temp_dir" since the worktree is purely temporary and any useful state has already been pushed.

  • Restore the original working directory.
  • Switch back to the branch that was checked out before the merge flow started.
  • Delete disposable validation branches such as pr-merge-<pr>-validate or pr-merge-<pr>-rebase.
  • Pop the auto stash if one was created:

- git stash pop

If stash pop fails due to conflicts, warn the user and leave the stash intact for manual resolution.

Final report

Report:

  • PR number and title
  • source and target branches
  • merge strategy used
  • review result
  • docs/tests assessment
  • validation commands run
  • merge result
  • cleanup result
  • any follow-up items

Bundled resources

  • agents/openai.yaml — OpenAI-compatible agent UI metadata
  • agents/code-reviewer.md — Sub-agent prompt for code review (used by non-Claude agents)
  • agents/code-simplifier.md — Optional, non-blocking prompt for post-merge or review-only simplification follow-up

平台分布

Codex

36.46%
按下载量换算34

Claude

31.16%
按下载量换算29

Cursor

17.31%
按下载量换算16

Gemini CLI

9.54%
按下载量换算9

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/xiaojiongqian/skills-hub --skill git-pr-merge 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills