Token导航 LogoToken导航

Agent Skill · 运维和基础设施

gh-pr(生长激素受体)

gh-pr 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

gh-pr 是运维和基础设施类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在运维和基础设施类的 2,449 个 Skill 里排第 2,446。

总安装 1周安装 12GitHub Stars 6下载 97核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/akiojin/skills --skill gh-pr

这个 Skill 是做什么的

运维和基础设施类 Skill 处理部署、监控、日志和云资源,多数需要较高的执行权限。

用于处理 GitHub 仓库、Issue 和 Pull Request 的协作信息管理。适合在 Codex、Claude、Cursor 等宿主中整理代码变更与协作事项。支持自动生成 PR 描述、检查 TODO 项并规范提交格式。

安装方式:npx skills add https://github.com/akiojin/skills --skill gh-pr。需注意权限范围,避免对无权限仓库执行写操作或敏感信息泄露。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

gh-pr 怎么安装?

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

gh-pr 支持哪些 AI 工具?

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

gh-pr 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

gh-pr 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

gh-pr 用的人多吗?

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

gh-pr 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理运维和基础设施类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

运维和基础设施类 Skill 对比

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

头脑风暴 · Codex、Claude

3,148,776173,131操作浏览器MIT通过
copywriting

文案写作 · Codex、Claude

1,996,72425,583需要联网MIT通过
openclaw-secure-linux-cloud

OpenClaw secure linux cloud 命令行 · Codex、Claude

1,853,08840接触敏感数据未明确未通过
xget

xget 命令行 · Codex、Claude

1,799,28040执行命令未明确未通过
requesting-code-review

代码审查请求 · Codex、Claude

1,590,144173,103权限未标注MIT通过
gh-pr

生长激素受体 · 本页

16需要联网MIT通过

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

SKILL.md 原文

GH PR

Overview

Create or update GitHub Pull Requests with the gh CLI using a detailed body template and strict same-branch rules.

Decision rules (must follow)

  1. Do not create or switch branches. Always use the current branch as the PR head.
  2. Check local working tree state before push/PR operations.

- git status --porcelain - If output is non-empty (tracked or untracked changes), pause and ask the user what to do. - Present 3 options: continue as-is, abort, or manual cleanup then rerun. - Do not run git stash, git commit, or git clean automatically unless explicitly requested.

  1. Check for an existing PR for the current head branch.

- gh pr list --head <head> --state all --json number,state,mergedAt,updatedAt,url,title,mergeCommit

  1. If no PR exists → create a new PR.
  2. If any PR exists and is NOT merged (mergedAt is null) → push only and finish (do not create a new PR).

- This applies to OPEN or CLOSED (unmerged) PRs. - Only update title/body/labels if the user explicitly requests changes.

  1. If all PRs for the head are merged → check for post-merge commits (see below).
  2. If multiple PRs exist for the head → use the most recently updated PR for reporting, but the create vs push decision is based on mergedAt.

Post-merge commit check (critical)

When all PRs for the head branch are merged, you must check whether there are new commits after the merge:

  1. Get the merge commit SHA of the most recent merged PR.
  2. Count commits after the merge: git rev-list --count <merge_commit>..HEAD
  3. Decision:

- If new commits exist → create a new PR (these changes are not in the base branch) - If no new commits → report "No changes since last merge" and finish (do not create an empty PR)

Why this matters

  • Scenario A: PR merged → user makes local changes → pushes → changes are NOT in the merged PR

- Without this check, the changes would be lost or require manual intervention

  • Scenario B: PR merged → user says "create PR" without new changes → would create empty/duplicate PR

- This check prevents unnecessary PR creation

PR title rules (must follow)

  1. Format: <type>(<scope>): <subject> — Conventional Commits 形式に準拠する。
  2. type: feat / fix / docs / chore / refactor / test / ci / perf のいずれか。
  3. scope: 省略可。変更の影響範囲を端的に示す(例: gui, core, pty)。
  4. subject: 70文字以内。命令形(imperative mood)で書く(例: "add …" / "fix …")。先頭大文字禁止、末尾ピリオド禁止。
  5. ブランチ名にプレフィックス(feat/, fix/ など)がある場合、タイトルの type と一致させる。

PR body rules (must follow)

Section classification

SectionRequiredNotes
SummaryYES1-3 bullet points。"what" と "why" を両方含める
ChangesYESファイル/モジュール単位で変更内容を列挙
TestingYES実行したコマンドまたは手動テスト手順を具体的に記載
Related Issues / LinksYESIssue番号、spec、または "None" を明記
ChecklistYES全項目を確認してチェック/N-A を付ける
ContextConditional3ファイル以上の変更、または非自明な変更理由がある場合は必須
Risk / ImpactConditional破壊的変更・パフォーマンス影響・ロールバック手順がある場合は必須
ScreenshotsConditionalUI 変更がある場合のみ必須
DeploymentOptionalデプロイ手順がある場合のみ記載
NotesOptionalレビュアーへの補足がある場合のみ記載

Validation (agent must check before creating PR)

  1. Required セクションに TODO が残っていたら PR を作成してはならない。
  2. Conditional セクションが該当しない場合は、セクション自体を削除する(空の TODO を残さない)。
  3. Summary の各 bullet は 1文で完結 させる。曖昧な表現("いくつかの変更", "various fixes")を禁止する。
  4. Changes は 変更ファイルまたはモジュール名を含む 具体的な記述にする。
  5. Testing は 再現可能な手順 を書く("テスト済み" のような曖昧な記述を禁止)。
  6. Checklist の未チェック項目には理由コメントを付ける(例: - [] Docs updated — N/A: no user-facing change)。
  7. Related Issues は #123 形式または URL で記載する。該当なしの場合は "None" と明記する。

Issue/PR Comment Formatting (must follow)

  • Final comment text must not contain escaped newline literals such as \n.
  • Use real line breaks in comment bodies. Do not rely on escaped sequences for formatting.
  • Before posting, verify the final body does not accidentally include escaped control sequences (\n, \t).
  • If a raw escape sequence must be shown for explanation, include it only inside a fenced code block and clarify it is intentional.

Issue Progress Comment Template (required for issue-based work)

When work is tracked in GitHub Issues, progress updates must use this template:

Progress
- ...

Done
- ...

Next
- ...
  • Post updates at least when starting work, after meaningful progress, and when blocked/unblocked.
  • In Next, explicitly state blockers or the immediate next action.

Workflow (recommended)

  1. Confirm repo + branches

- Repo root: git rev-parse --show-toplevel - Current branch (head): git rev-parse --abbrev-ref HEAD - Base branch defaults to develop unless user specifies.

  1. Check local working tree state (preflight)

- Run git status --porcelain. - If empty, continue. - If non-empty, show detected files and ask the user to choose: - Continue as-is - Abort - Manual cleanup first (git commit / git stash / git clean) and rerun - Proceed only when the user explicitly chooses continue.

  1. Fetch latest remote state

- git fetch origin to ensure accurate comparison

  1. Check existing PR for head branch

- Use decision rules above to pick action. - Treat mergedAt as the source of truth for "merged".

  1. If all PRs are merged, perform post-merge commit check

- Get merge commit: gh pr list --head <head> --state merged --json mergeCommit -q '.[0].mergeCommit.oid' - Count new commits: git rev-list --count <merge_commit>..HEAD - If 0 → finish with message "No new changes since merge" - If >0 → proceed to create new PR

  1. Ensure the head branch is pushed

- If no upstream: git push -u origin <head> - Otherwise: git push

  1. Collect PR inputs (for new PR or explicit update)

- Title, Summary, Context, Changes, Testing, Risk/Impact, Deployment, Screenshots, Related Links, Notes - Optional: labels, reviewers, assignees, draft

  1. Build PR body from template
  • Read the template from the gh-pr skill path (not the current project path):

- GH_PR_SKILL_DIR="${GH_PR_SKILL_DIR:-$HOME/.codex/skills/gh-pr}" - PR_BODY_TEMPLATE="${GH_PR_SKILL_DIR}/references/pr-body-template.md"

  • Read ${PR_BODY_TEMPLATE} and fill all required placeholders.
  • Conditional セクションが該当しない場合はセクションごと削除する。
  • テンプレート内の <!-- GUIDE:... --> コメントは最終出力から削除する。
  • Required セクションに TODO が残っている場合は PR を作成せず、ユーザーに不足情報を確認する。
  1. Create or update the PR

- Create: gh pr create -B <base> -H <head> --title "<title>" --body-file <file> - Update (only if user asked): gh pr edit <number> --title "<title>" --body-file <file>

  1. Return PR URL
  • gh pr view <number> --json url -q.url
  1. Post-PR CI/merge check (automatic).
  • After PR creation or push, load github/skills/gh-fix-pr/SKILL.md and follow its workflow to inspect CI status, merge state, and review feedback.
  • If all CI checks are still pending, poll (30s interval) until complete.
  • If conflicts, review issues, or CI failures are detected, proceed with the gh-fix-pr workflow to diagnose and fix.

Command snippets (bash)

head=$(git rev-parse --abbrev-ref HEAD)
base=develop
GH_PR_SKILL_DIR="${GH_PR_SKILL_DIR:-$HOME/.codex/skills/gh-pr}"
PR_BODY_TEMPLATE="${GH_PR_SKILL_DIR}/references/pr-body-template.md"

if [ ! -f "$PR_BODY_TEMPLATE" ]; then
  echo "PR template not found: $PR_BODY_TEMPLATE" >&2
  exit 1
fi

# Preflight: local working tree state
status_lines=$(git status --porcelain)
if [ -n "$status_lines" ] && [ "${ALLOW_DIRTY_WORKTREE:-0}" != "1" ]; then
  echo "Detected local uncommitted/untracked changes:" >&2
  echo "$status_lines" >&2
  echo "Choose one before continuing: continue as-is, abort, or manual cleanup then rerun." >&2
  echo "Set ALLOW_DIRTY_WORKTREE=1 only after explicit user confirmation to continue." >&2
  exit 1
fi

# Fetch latest remote state
git fetch origin

# Check existing PRs for the head branch
pr_json=$(gh pr list --head "$head" --state all --json number,state,mergedAt,mergeCommit)
pr_count=$(echo "$pr_json" | jq 'length')
unmerged_count=$(echo "$pr_json" | jq 'map(select(.mergedAt == null)) | length')

if [ "$pr_count" -eq 0 ]; then
  action=create
elif [ "$unmerged_count" -gt 0 ]; then
  action=push_only
else
  # All PRs are merged - check for post-merge commits
  merge_commit=$(echo "$pr_json" | jq -r 'sort_by(.mergedAt) | last | .mergeCommit.oid')

  if [ -n "$merge_commit" ] && [ "$merge_commit" != "null" ]; then
    new_commits=$(git rev-list --count "$merge_commit"..HEAD 2>/dev/null || echo "0")

    if [ "$new_commits" -gt 0 ]; then
      echo "Found $new_commits commit(s) after merge - creating new PR"
      action=create
    else
      echo "No new commits since merge - nothing to do"
      action=none
    fi
  else
    # Fallback: check against base branch
    new_commits=$(git rev-list --count "origin/$base"..HEAD 2>/dev/null || echo "0")

    if [ "$new_commits" -gt 0 ]; then
      action=create
    else
      action=none
    fi
  fi
fi

# Execute action
case "$action" in
  create)
    cp "$PR_BODY_TEMPLATE" /tmp/pr-body.md

    git push -u origin "$head"
    gh pr create -B "$base" -H "$head" --title "..." --body-file /tmp/pr-body.md
    ;;
  push_only)
    echo "Existing unmerged PR found - pushing changes only"
    git push
    gh pr list --head "$head" --state open --json url -q '.[0].url'
    ;;
  none)
    echo "No action needed - no new changes since last merge"
    ;;
esac

References

  • ${GH_PR_SKILL_DIR}/references/pr-body-template.md: PR body template

平台分布

Codex

91.93%
按下载量换算89

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills