Token导航 LogoToken导航TokenDH.com
运维和基础设施需要联网github未标认证来源可访问许可证需确认审计通过

gh-pr生长激素受体

Agent Skill

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

总安装

374

周安装

15

GitHub Stars

6

下载量

121
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合围绕仓库状态、代码变更或协作事项进行整理时使用。
  • 可结合来源仓库、安装命令和原始 README 继续核验具体用法。
  • 安装前建议确认权限范围、维护状态及是否会触发联网、命令执行或文件读写。
  • 当前分类为运维和基础设施,但具体用途需进一步确认。

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 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

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. 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 references/pr-body-template.md and fill placeholders. - If info is missing, keep TODO markers and explicitly mention them in the response.

  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

Command snippets (bash)

head=$(git rev-parse --abbrev-ref HEAD)
base=develop

# 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)
    # Create PR body from template (edit as needed)
    cat > /tmp/pr-body.md <<'BODY'
## Summary
- TODO (one-sentence outcome)
- TODO (user-visible change, if any)

## Context
- TODO (why this PR is needed)
- TODO (background, ticket, or incident link)

## Changes
- TODO (key changes, bullets)
- TODO (notable refactors or cleanup)

## Testing
- TODO (commands run)
- TODO (manual steps, if any)

## Risk / Impact
- TODO (areas impacted)
- TODO (rollback plan / mitigation)

## Deployment
- TODO (steps, flags, or "none")

## Screenshots
- TODO (UI changes only)

## Related Issues / Links
- TODO (issues, specs, docs)

## Checklist
- [ ] Tests added/updated
- [ ] Lint/format checked
- [ ] Docs updated
- [ ] Migration/backfill plan included (if needed)
- [ ] Monitoring/alerts updated (if needed)

## Notes
- TODO (optional)
BODY

    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

  • references/pr-body-template.md: PR body template

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.19%
按下载量换算40

Claude

29.29%
按下载量换算35

Cursor

18.79%
按下载量换算23

Gemini CLI

9.54%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills