Token导航 LogoToken导航

Agent Skill · 运维和基础设施

prepare-pull-request(准备拉取请求)

用于围绕 GitHub 仓库、Issue、Pull Request、分支、提交和代码协作流程提供辅助能力。它适合让 Agent 查询项目状态、整理变更、辅助创建或检查协作事项,并把仓库中的信息转成可执行的下一步。使用时需要区分只读查询和写入操作;涉及创建 PR、修改 Issue、推送分支或访问私有仓库时,应确认 token 权限、目标仓库范围和用户授权。

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

总安装 282周安装 12GitHub Stars 公开资料未说明下载 99核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/curev/skills --skill prepare-pull-request

这个 Skill 是做什么的

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

prepare-pull-request 用于围绕 GitHub 仓库、Issue、Pull Request、分支、提交和代码协作流程提供辅助能力,适合让 Agent 查询项目状态、整理变更、辅助创建或检查协作事项。适用于运维和基础设施类任务,使用时需区分只读查询和写入操作。

涉及创建 PR、修改 Issue、推送分支或访问私有仓库时,应确认 token 权限、目标仓库范围和用户授权。通过 npx skills add 命令从指定 GitHub 仓库安装,需确认权限范围和维护状态。

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

来源仓库内路径:skills/prepare-pull-request

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

prepare-pull-request 怎么安装?

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

prepare-pull-request 支持哪些 AI 工具?

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

prepare-pull-request 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

prepare-pull-request 是免费的吗?

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

prepare-pull-request 用的人多吗?

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

prepare-pull-request 安全吗?

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

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

值得选的地方

  • 同时适配 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通过
prepare-pull-request

准备拉取请求 · 本页

282—只读MIT通过

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

SKILL.md 原文

Prepare Pull Request Workflow

Complete workflow for preparing PR branches: analyze changes first, stash with readable message, sync main branch, create/switch branch, review changes, run quality checks, commit, and push.

Workflow Steps

1. Repository State Detection

First step: Detect current state before any operation.

git rev-parse --abbrev-ref HEAD  # Returns branch name, or "HEAD" when detached
git symbolic-ref -q HEAD         # Exit 0 if on branch, 128 if detached HEAD

States:

  • On branch: git rev-parse --abbrev-ref HEAD returns branch name (e.g. main, feat/foo)
  • Detached HEAD: Returns HEAD. Check with git symbolic-ref -q HEAD (non-zero exit = detached)

Detached HEAD handling: Warn user: "当前处于 detached HEAD 状态,无法创建分支。请先 git checkout main 或 git checkout <branch> 切换到有效分支。"

2. Analyze Changes, Stash, and Branch Strategy

Main branch detection: Auto-detect default branch.

# Option A: From remote (most accurate)
git remote show origin 2>/dev/null | grep "HEAD branch" | cut -d' ' -f5

# Option B: Try main first, fallback to master (when remote unreachable)
git rev-parse --verify main &>/dev/null && MAIN=main || MAIN=master

Analyze existing changes before stash (required): Never stash blindly.

git status --short
git diff --name-status
git diff --stat
# Identify change intent (feat/fix/refactor/docs...) and key files first

Stash with human-readable message: Include why + scope.

CURRENT=$(git rev-parse --abbrev-ref HEAD)
STASH_MSG="wip(<CURRENT>): stash before syncing main for <branch-name> [<short-change-summary>]"
git stash push -u -m "$STASH_MSG"   # -u = --include-untracked
# Use -a (--all) only if user explicitly needs ignored files

Branch existence check (local + remote):

# Before: git checkout -b <branch-name>
git rev-parse --verify <branch-name> &>/dev/null && echo "local exists"
git ls-remote --heads origin <branch-name> | grep -q . && echo "remote exists"

# If exists: ask user — delete local/remote, use different name, or checkout existing

If current branch is NOT main/master: ask user before branch operations.

Prompt example:

  • "当前分支是 <CURRENT>(非主分支)。要怎么继续?"
  • "A. 切换并创建新分支(推荐,用于新 PR)"
  • "B. 保持当前分支,直接在此分支提交并推送"

If user chooses B, skip "create new branch" and continue commit/push on current branch.

Sync main branch and create/switch branch workflow:

git checkout $MAIN
git pull origin $MAIN
# Keep current branch up to date with main before creating/switching branch
git checkout <target-branch>
# For new branch:
# git checkout -b <branch-name>   # Only after existence check passes
git merge $MAIN
git stash pop

Stash pop conflict handling:

git stash pop
# If conflict: git reports "CONFLICT (content): Merge conflict in <file>"
# Actions:
# 1. Inform user: "stash pop 发生冲突,请手动解决 <files>"
# 2. After resolve: git add <resolved-files> && git stash drop  # drop the stash entry
# 3. Do NOT run stash pop again — stash entry may be partially applied
# 4. If user wants to abort: git reset --hard HEAD && git stash drop (discards stash, restores working tree)

Branch naming: Infer from changes if not specified. Use prefixes: feat/, fix/, refactor/, docs/, style/, test/, chore/.

3. Review Changes

git diff
git diff --name-only  # Get modified files list

Check for unnecessary modifications:

  • Identify formatting-only changes (whitespace, line endings, indentation)
  • If only formatting detected, ask user: keep, revert, or proceed

4. Run Code Quality Checks

Only on modified files - never format entire project.

  1. Detect tools from project config:

- JS/TS: package.json scripts, .eslintrc*, eslint.config.*, .prettierrc* - Python: pyproject.toml, .ruff.toml, .flake8, .pylintrc, requirements.txt

  1. Run checks on modified files only: # Example: JS/TS npx eslint <modified-file> npx prettier --check <modified-file> # Example: Python ruff check <modified-file> black --check <modified-file>
  2. Handle results:

- Pass → proceed to commit - Fail → offer auto-fix on modified files only, or manual fix - No tools → inform and proceed

Critical: Only run checks configured in project. Never modify files user didn't change.

5. Generate Commit Message

git log --oneline -10  # Detect commit language from history

Language detection:

  • Most commits in Chinese → use Chinese
  • Most in English → use English
  • Mixed → prefer recent commits' language

Conventional Commits format:

<type>(<scope>)[!]: <subject>

<body>

Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

Breaking changes: Add ! after type(scope): <type>(<scope>)!

Guidelines:

  • Subject: max 50 chars, imperative mood
  • Body: max 72 chars per line, explain "why" and "how"
  • Footer: issue references or breaking changes

Examples:

Chinese:

feat(ui): 添加按钮组件

- 新增 ButtonPart 类型支持
- 实现 part-button 组件

English:

feat(ui): add button component

- Add ButtonPart type support
- Implement part-button component

Breaking change example:

feat(auth)!: change login method

Login now requires token instead of password

6. Commit and Push

Commit only modified files: Do not git add. — add only files user actually changed.

# Get changed files: modified (tracked) + staged
git diff --name-only
git diff --name-only --cached
# Combine and dedupe, then add only these:
git add <file-1> <file-2> ...
git commit -m "<commit-message>"
# Untracked new files: ask user if they should be included before adding

Push — check remote first:

# Verify remote exists and is reachable
git remote -v
git ls-remote origin &>/dev/null || echo "Remote unreachable"

# If remote unreachable: warn user, do not push
# If branch exists on remote: ask — force push (avoid), rebase, or use different branch
git push -u origin <branch-name>

Critical: Never use --force or -f flag when pushing. If push fails due to conflicts, pull and rebase/merge instead.

Example

Scenario: Adding a new button component (user may be on main or another branch like feat/other-pr)

# 1. Detect state
git rev-parse --abbrev-ref HEAD          # Check branch / detached HEAD
git rev-parse --verify main &>/dev/null && MAIN=main || MAIN=master

# 2. Analyze existing changes, then stash with readable message
git status --short
git diff --name-status
git diff --stat
git stash push -u -m "wip(feat/other-pr): stash before syncing main for feat/add-button-component [add button component]"

# 3. If current branch is not main/master, ask user:
# A) create/switch to new branch, or B) keep current branch and continue on it

# 4. Sync main and create/switch branch
git checkout $MAIN && git pull origin $MAIN
# Check branch exists: git rev-parse --verify feat/add-button-component
git checkout -b feat/add-button-component
git merge $MAIN
git stash pop  # Handle conflicts if any

# 5. Review changes
git diff
git diff --name-only  # Output: src/components/Button.tsx

# 6. Run checks on modified files only
npx eslint src/components/Button.tsx
npx prettier --check src/components/Button.tsx

# 7. Generate commit (detected Chinese from git log)
git log --oneline -10
git add src/components/Button.tsx       # Only modified files, not git add .
git commit -m "feat(ui): 添加按钮组件

- 新增 ButtonPart 类型支持
- 实现 part-button 组件"

# 8. Push (check remote first)
git ls-remote origin &>/dev/null
git push -u origin feat/add-button-component

Important Notes

  • Repository state: Detect branch vs detached HEAD first. Detached HEAD → cannot create branch, must checkout first
  • Analyze before stash: Must run git status --short, git diff --name-status, git diff --stat first
  • Non-main branch decision: If current branch is not main/master, ask user whether to create/switch to a new branch or continue on current branch
  • Stash message: Use human-readable message with branch and short change summary
  • Stash: Use -u (--include-untracked) so new files are stashed
  • Stash pop conflicts: Inform user, resolve manually, then git stash drop. Do not pop again
  • Branch exists: Check local + remote before checkout -b. If exists → delete, rename, or checkout
  • Main branch sync: Pull latest main/master and merge main into target branch before stash pop
  • Commit: Only add modified files from diff, not git add.
  • Remote before push: Run git ls-remote origin to verify reachable. If unreachable, do not push
  • Force push: Never use git push --force or -f. If push fails, pull and rebase/merge instead
  • Empty changes: Notify user if no changes after stash pop
  • Formatting-only changes: Ask user to confirm if detected
  • Code checks: Only on modified files, only configured tools, never format untouched files

平台分布

windsurf

30.25%
按下载量换算30

OpenCode

23.98%
按下载量换算24

Cursor

18%
按下载量换算18

Codex

13.13%
按下载量换算13

Claude Code

8.71%
按下载量换算9

kiro-cli

3.65%
按下载量换算4

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

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

继续浏览同类 Skills