Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计提醒

ah-create-pr啊创建公关

Agent Skill

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

总安装

210

周安装

9

GitHub Stars

公开资料未说明

下载量

73
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/arinhubcom/arinhub --skill ah-create-pr

简介

自动创建或更新 GitHub Pull Request,基于当前分支差异生成结构化描述。

  • 适用于持续集成和自动化开发流程中的 PR 生命周期管理。
  • 通过 npx 命令安装,需提供目标分支和可选 Issue 编号作为输入参数。
  • 建议在使用前验证分支状态和权限,避免重复创建或合并冲突。
  • ah-create-pr 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Create or Update GitHub Pull Request

Analyze the current branch and create or update a well-structured GitHub Pull Request. If an open PR already exists for the current branch, it is updated instead of creating a duplicate. The diff against the base branch is the single source of truth for all PR content.

Input

  • Base branch (REQUIRED): The target branch this PR will merge into (e.g., main, develop). If the user did not provide it, STOP and ask before proceeding. Never assume or default to any branch.
  • Issue number (optional): The GitHub issue number this PR addresses (e.g., 42, #42). If not provided by the user, do not attempt to infer it from the branch name -- simply omit issue references from the PR.
  • Labels (optional): Comma-separated list of labels to apply to the PR (e.g., bug,urgent, feature,frontend). If not provided by the user, auto-detect labels in step 2.
  • Current Git branch with unmerged commits
  • Git diff against the base branch

Procedure

0. Preparation

Verify GitHub CLI authentication and check for uncommitted changes before proceeding.

gh auth status

# Warn if there are uncommitted changes that won't be included in the PR
git status --porcelain

If gh auth status fails, stop and ask the user to authenticate with gh auth login. If there are uncommitted changes (staged or unstaged), warn the user that these changes will not be included in the PR and ask whether to continue or wait.

Run quality checks to catch issues before creating the PR. If any check fails, report the failure and ask the user how to proceed.

pnpm preflight
pnpm preflight:build

Also compare .env* files in the repo root: identify missing keys across them and flag any security risks or naming inconsistencies.

1. Gather Context

If the user did not provide a base branch, STOP and ask for it before proceeding.

BASE_BRANCH=<user-provided base branch>
CURRENT_BRANCH=$(git branch --show-current)

# Compute merge base for reliable diffing (works even if origin isn't fetched)
git fetch origin "${BASE_BRANCH}" --quiet
MERGE_BASE=$(git merge-base "origin/${BASE_BRANCH}" HEAD)

# Full diff against merge base (primary source of truth)
git diff "${MERGE_BASE}" --stat
DIFF=$(git diff "${MERGE_BASE}")

# Commit history on this branch
git log "${MERGE_BASE}"..HEAD --no-decorate

# Branch tracking status
git status -sb

# Check for existing open PR on this branch
EXISTING_PR_NUMBER=$(gh pr list --head "${CURRENT_BRANCH}" --state open --json number --jq '.[0].number')
EXISTING_PR_URL=$(gh pr list --head "${CURRENT_BRANCH}" --state open --json url --jq '.[0].url')
EXISTING_PR_BASE=$(gh pr list --head "${CURRENT_BRANCH}" --state open --json baseRefName --jq '.[0].baseRefName')

If an open PR already exists for the current branch, the skill will update it in Step 4 instead of creating a new one. If the existing PR targets a different base branch than the one the user provided, warn the user and ask how to proceed before continuing.

If the user provided an issue number, use it for the PR references. Do not infer issue numbers from the branch name or commit messages.

2. Analyze Changed Files

  • Categorize changes by functional area (features, components, API, config, tests, etc.).
  • Identify patterns -- look for related changes that form logical blocks (e.g., "Auth flow refactor", "Error handling improvements").
  • Validate scope -- verify all changes contribute to the same feature/fix. Flag unrelated changes that may need separate PRs.

Determine Labels

If the user provided labels, use them as-is. Otherwise, auto-detect labels by analyzing:

  1. Fetch available labels from the repository: gh label list --limit 100 --json name,description
  2. Match labels based on the PR content:

- PR title type -- map the commit type (feat, fix, refactor, docs, test, perf, chore) to matching labels (e.g., feat -> feature/enhancement, fix -> bug/bugfix, docs -> documentation) - Changed file paths -- infer domain labels from directories (e.g., changes in apps/app-name/ -> app-name, changes in src/api/ -> api/backend, changes in src/components/ -> frontend/ui, changes in infra/ -> infrastructure) - Diff content -- detect patterns like security fixes, dependency updates, breaking changes, and match to corresponding labels

  1. Select only labels that exist in the repository. Never create or suggest labels that do not exist.
  2. Limit to 1-4 labels -- pick the most relevant ones. Prefer specific labels over generic ones.

3. Generate PR Content

Read the PR body template from references/pr-body.md and follow its structure and rules exactly.

4. Create Pull Request

Title format: <type>: <brief description> -- keep under 70 characters.

  • Types: feat, fix, refactor, chore, test, docs, perf
  • For monorepos, prefix with app name: app-name/feat: description
  • Extract from the first commit if it already follows this format.

Draft mode: Create as draft if any of these apply:

  • TODOs identified in commit messages
  • Tests missing for new features
  • Scope seems too large (>20 files changed)

Push the branch to the remote if it has not been pushed yet or is behind:

git push -u origin ${CURRENT_BRANCH}

If an open PR already exists (EXISTING_PR_NUMBER is set)

Update the existing PR with the newly generated content:

gh pr edit ${EXISTING_PR_NUMBER} \
  --title "<type>: <brief description>" \
  --add-label "<label1>" --add-label "<label2>" \
  --body "$(cat <<'EOF'
<PR body from references/pr-body.md>
EOF
)"

Omit --add-label flags entirely if no labels were determined.

If no open PR exists

Create a new PR (include --label flags for each determined label):

gh pr create \
  --base "${BASE_BRANCH}" \
  --head "${CURRENT_BRANCH}" \
  --title "<type>: <brief description>" \
  --label "<label1>" --label "<label2>" \
  --body "$(cat <<'EOF'
<PR body from references/pr-body.md>
EOF
)"

Omit --label flags entirely if no labels were determined.

5. Report to User

After creating or updating the PR, provide:

  1. PR URL -- direct link to the created or updated pull request
  2. Status -- whether the PR was created or updated (existing PR detected)
  3. Summary -- brief recap of what was included
  4. Labels -- list the labels applied and briefly explain why each was chosen (or note that none were applicable)
  5. Action Items -- any TODOs or follow-ups identified
  6. Review Checklist -- quick reminders for self-review before requesting reviewers

Validation Checks

Before submitting the PR, verify:

  • All applicable sections are populated (Summary, Changes, Tests, and GH if an issue was provided)
  • No placeholder text like "TODO" or "TBD" remains (unless in explicit TODO checkboxes)
  • If an issue number was provided, closing keywords are correctly formatted
  • Changes align with branch name and commit messages
  • Test coverage is addressed (present or explicitly noted as TODO)

Error Handling

  • If no base branch was provided, STOP and ask the user for it
  • If no commits exist ahead of the base branch, abort and inform user
  • If diff is empty, check for unstaged changes and prompt user
  • If an existing open PR targets a different base branch than the user provided, warn the user and ask whether to update the existing PR's base or create a new PR

Best Practices

  • Atomic PRs: Warn if scope seems too broad (suggest splitting if >30 files or multiple unrelated features)
  • Conventional Commits: Use semantic versioning-friendly titles
  • Self-Review: Suggest the author review the generated content before requesting reviewers

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

38.17%
按下载量换算28

Claude

27.61%
按下载量换算20

Cursor

16.63%
按下载量换算12

Gemini CLI

9.49%
按下载量换算7

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills