Token导航 LogoToken导航

Agent Skill · 待分类

create-pr(创建公关)

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

create-pr 是待分类类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描有提醒项,按安装量在待分类类的 11,209 个 Skill 里排第 8,897。

总安装 269周安装 11GitHub Stars 公开资料未说明下载 87核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/tenfyzhong/skills-hub --skill create-pr

这个 Skill 是做什么的

这个 Skill 的分类还没最终确定,用法以来源仓库的说明为准。

create-pr 用于处理 GitHub 仓库的 Pull Request 协作流程。适合在 Codex、Claude、Cursor 等宿主中需要创建或审查 PR 时使用。它支持自动提取提交信息、添加审稿人和处理 CI 检查结果。使用前需确保已配置 gh CLI 身份验证和远程仓库写入权限。

遇到变基冲突时应暂停自动化流程并手动解决合并问题。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

create-pr 怎么安装?

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

create-pr 支持哪些 AI 工具?

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

create-pr 需要什么权限?

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

create-pr 是免费的吗?

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

create-pr 用的人多吗?

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

create-pr 安全吗?

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

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

值得选的地方

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

先想清楚的地方

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

适不适合你

更适合

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

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

待分类类 Skill 对比

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

infsh CLI · Codex、Claude

4,374,576382权限未标注未明确未收录
ai-video-generation

AI 视频生成 · Codex、Claude

4,313,376382调用外部服务未明确有提醒
lark-openapi-explorer

云雀 OpenAPI 浏览器 · Codex、Claude

2,064,1209,011需要联网未明确有提醒
lark-workflow-standup-report

Lark 工作流程站立报告 · Codex、Claude

2,041,6328,978需要联网未明确通过
use-my-browser

使用我的浏览器 · Codex、Claude

1,848,49140操作浏览器未明确未通过
create-pr

创建公关 · 本页

269—需要联网未明确有提醒

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

SKILL.md 原文

Create PR Skill

Create a Pull Request from the current branch with intelligent remote detection and PR content generation.

Prerequisites Check (MUST verify first)

Before proceeding, verify:

# 1. Check if in a git repository
git rev-parse --is-inside-work-tree

# 2. Check if gh CLI is available and authenticated
gh auth status

# 3. Check current branch is not main/master
CURRENT_BRANCH=$(git branch --show-current)
DEFAULT_BRANCH=$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)
if [ "$CURRENT_BRANCH" = "$DEFAULT_BRANCH" ]; then
  echo "ERROR: Cannot create PR from default branch"
  exit 1
fi

# 4. Check for uncommitted changes (warn user if any)
git status --porcelain

If checks fail, STOP and inform the user:

  • Not in git repo → "This skill requires a git repository. Please navigate to a git project."
  • gh not authenticated → "Please run gh auth login first."
  • On default branch → "You are on the default branch. Please checkout a feature branch first."
  • Uncommitted changes → "You have uncommitted changes. Please commit or stash them first."

Input

The user may optionally provide:

  • Target base branch (defaults to main/master)
  • Draft mode flag
  • Specific reviewers

Workflow

Step 1: Detect Repository Configuration

# Get all remotes
git remote -v

# Get current branch name
CURRENT_BRANCH=$(git branch --show-current)

# Detect default branch (main or master)
DEFAULT_BRANCH=$(gh repo view --json defaultBranchRef -q '.defaultBranchRef.name')

# Get repository info
gh repo view --json owner,name,isFork,parent

Step 2: Identify Upstream and Fork Remotes

Determine the remote configuration:

# List all remotes with their URLs
git remote -v

# Check if this repo is a fork
IS_FORK=$(gh repo view --json isFork -q '.isFork')

# If it's a fork, get parent info
if [ "$IS_FORK" = "true" ]; then
  PARENT_OWNER=$(gh repo view --json parent -q '.parent.owner.login')
  PARENT_NAME=$(gh repo view --json parent -q '.parent.name')
fi

Remote Classification Logic:

ScenarioUpstream RemotePush Remote
Single remote (origin)originorigin
Fork: origin=fork, upstream=parentupstreamorigin
Fork: origin=parent, fork remote existsoriginfork remote
Multiple remotes, one is forknon-fork remotefork remote

Detection Algorithm:

# Get current user's GitHub username
CURRENT_USER=$(gh api user -q '.login')

# For each remote, check if it belongs to current user
for remote in $(git remote); do
  REMOTE_URL=$(git remote get-url $remote)
  # Extract owner from URL (handles both HTTPS and SSH)
  REMOTE_OWNER=$(echo "$REMOTE_URL" | sed -E 's/.*[:/]([^/]+)\/[^/]+\.git$/\1/' | sed 's/\.git$//')

  if [ "$REMOTE_OWNER" = "$CURRENT_USER" ]; then
    FORK_REMOTE=$remote
  else
    UPSTREAM_REMOTE=$remote
  fi
done

# Default fallback
UPSTREAM_REMOTE=${UPSTREAM_REMOTE:-origin}
FORK_REMOTE=${FORK_REMOTE:-origin}

Step 3: Sync Upstream Default Branch

# Fetch latest from upstream
git fetch $UPSTREAM_REMOTE $DEFAULT_BRANCH

# Update local default branch
git checkout $DEFAULT_BRANCH
git pull $UPSTREAM_REMOTE $DEFAULT_BRANCH

# Return to feature branch
git checkout $CURRENT_BRANCH

Step 4: Update Current Branch with Upstream

# Rebase current branch onto latest default branch
git rebase $UPSTREAM_REMOTE/$DEFAULT_BRANCH

# If rebase fails, inform user
if [ $? -ne 0 ]; then
  echo "Rebase failed. Please resolve conflicts manually."
  git rebase --abort
  exit 1
fi

Step 5: Push Branch to Remote

Check if branch exists on remote and push:

# Check if branch exists on the push remote
REMOTE_BRANCH_EXISTS=$(git ls-remote --heads $FORK_REMOTE $CURRENT_BRANCH | wc -l)

if [ "$REMOTE_BRANCH_EXISTS" -eq 0 ]; then
  # Branch doesn't exist, push with upstream tracking
  git push -u $FORK_REMOTE $CURRENT_BRANCH
else
  # Branch exists, force push (after rebase) with lease for safety
  git push --force-with-lease $FORK_REMOTE $CURRENT_BRANCH
fi

Important: Always use --force-with-lease instead of --force for safety.

Step 6: Gather PR Content Information

# Get all commits between default branch and current branch
git log $UPSTREAM_REMOTE/$DEFAULT_BRANCH..HEAD --pretty=format:"%h %s%n%b" --no-merges

# Get the diff summary
git diff --stat $UPSTREAM_REMOTE/$DEFAULT_BRANCH..HEAD

# Get the full diff for analysis
git diff $UPSTREAM_REMOTE/$DEFAULT_BRANCH..HEAD

# Get list of changed files
git diff --name-only $UPSTREAM_REMOTE/$DEFAULT_BRANCH..HEAD

Step 7: Check for PR Template

# Check for PR template in common locations
PR_TEMPLATE=""
for template_path in \
  ".github/pull_request_template.md" \
  ".github/PULL_REQUEST_TEMPLATE.md" \
  "docs/pull_request_template.md" \
  "PULL_REQUEST_TEMPLATE.md"; do
  if [ -f "$template_path" ]; then
    PR_TEMPLATE="$template_path"
    break
  fi
done

# Also check for template directory
if [ -z "$PR_TEMPLATE" ] && [ -d ".github/PULL_REQUEST_TEMPLATE" ]; then
  # Use default template if exists
  if [ -f ".github/PULL_REQUEST_TEMPLATE/default.md" ]; then
    PR_TEMPLATE=".github/PULL_REQUEST_TEMPLATE/default.md"
  fi
fi

# Read template content if found
if [ -n "$PR_TEMPLATE" ]; then
  cat "$PR_TEMPLATE"
fi

Step 8: Generate PR Title and Description

Title Generation Rules:

  1. If single commit: Use commit message subject line
  2. If multiple commits: Summarize the overall change
  3. Follow conventional commit format if project uses it: <type>(<scope>): <description>
  4. Keep under 72 characters

Description Generation:

If PR template exists, fill in the template sections:

Common Template SectionHow to Fill
## Summary / ## DescriptionSummarize changes from commits and diff
## Changes / ## WhatList key changes from diff
## Why / ## MotivationExtract from commit bodies or infer from changes
## TestingList test files changed or suggest manual testing
## ScreenshotsLeave placeholder if UI changes detected
## ChecklistLeave checkboxes for user to complete
Fixes # / Closes #Extract issue references from commits

If no template, generate structured description:

## Summary

[2-3 sentences summarizing what this PR does]

## Changes

- [Key change 1]
- [Key change 2]
- [Key change 3]

## Testing

[How the changes were tested or should be tested]

---
[Any issue references found in commits]

Step 9: Create the Pull Request

# Determine the base repository for the PR
if [ "$IS_FORK" = "true" ]; then
  # For forks, create PR against parent repo
  BASE_REPO="$PARENT_OWNER/$PARENT_NAME"
  gh pr create \
    --repo "$BASE_REPO" \
    --base "$DEFAULT_BRANCH" \
    --head "$CURRENT_USER:$CURRENT_BRANCH" \
    --title "$PR_TITLE" \
    --body "$PR_BODY"
else
  # For non-forks, create PR in same repo
  gh pr create \
    --base "$DEFAULT_BRANCH" \
    --head "$CURRENT_BRANCH" \
    --title "$PR_TITLE" \
    --body "$PR_BODY"
fi

Use HEREDOC for body to preserve formatting:

gh pr create --title "$PR_TITLE" --body "$(cat <<'EOF'
## Summary

[Generated summary here]

## Changes

- Change 1
- Change 2

EOF
)"

Step 10: Report Results

After PR creation, provide:

# Get PR URL and details
gh pr view --json url,number,title,state

Output Format


PR Created Successfully

PR: #[NUMBER] - [TITLE] URL: [PR_URL] Base: [BASE_BRANCH] ← Head: [HEAD_BRANCH] Remote: Pushed to [FORK_REMOTE]

Summary

[Brief description of what the PR contains]

Files Changed
FileChanges
path/to/file.ts+[additions] -[deletions]
Next Steps
  • Review the PR description and edit if needed
  • Add reviewers if required
  • Wait for CI checks to pass
  • Address any review comments

Error Handling

SituationAction
No commits ahead of base"No changes to create PR. Your branch is up to date with [base]."
Rebase conflicts"Rebase failed due to conflicts. Please resolve manually and re-run."
Push rejected"Push failed. Check if you have write access to the remote."
PR already exists"A PR already exists for this branch: [URL]. Opening existing PR."
No remote access"Cannot access remote. Check your authentication with gh auth status."
Fork detection failed"Could not determine fork relationship. Please specify the target repo."

Advanced Options

Draft PR

gh pr create --draft --title "$PR_TITLE" --body "$PR_BODY"

Add Reviewers

gh pr create --reviewer "user1,user2" --title "$PR_TITLE" --body "$PR_BODY"

Add Labels

gh pr create --label "enhancement,needs-review" --title "$PR_TITLE" --body "$PR_BODY"

Link to Issue

If commits reference issues (e.g., "Fixes #123"), automatically add to PR body:

# Extract issue references from commits
ISSUES=$(git log $UPSTREAM_REMOTE/$DEFAULT_BRANCH..HEAD --pretty=format:"%B" | grep -oE "(Fixes|Closes|Resolves) #[0-9]+" | sort -u)

Important Notes

  1. Safety First: Always use --force-with-lease instead of --force when pushing after rebase
  2. Fork Awareness: Automatically detect and handle fork workflows
  3. Template Respect: Always check for and use PR templates when available
  4. Conventional Commits: If project uses conventional commits, follow the format
  5. Issue Linking: Preserve issue references from commit messages
  6. Review Before Submit: Show generated title/description for user approval before creating PR

平台分布

Codex

37.48%
按下载量换算33

Claude

29.19%
按下载量换算25

Cursor

18.09%
按下载量换算16

Gemini CLI

8.07%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

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

安装前确认

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

继续浏览同类 Skills