Token导航 LogoToken导航TokenDH.com
开发只读github未标认证来源可访问许可证需确认审计通过

pr-split公关分裂

Agent Skill

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

总安装

674

周安装

27

GitHub Stars

450

下载量

218
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/ag-grid/ag-charts --skill pr-split

简介

pr-split 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。

  • 适用于将大型 PR 拆分为独立模块、隔离变更范围以简化审查与测试流程。
  • 通过分析 diff 内容自动识别可拆分单元,支持生成多个子 PR 或分支建议。
  • 安装前需确认对目标仓库的分支与推送权限,注意是否会触发 git 操作。
  • 建议在使用前查阅原始 README 了解拆分策略与边界条件。

SKILL.md

PR Split Instructions

Intent

Transform a large branch into a sequence of small, high-quality PRs that:

  • Each do ONE thing well
  • Are easy to review (500-1000 lines ideal)
  • Tell a coherent story in sequence
  • Pass all quality checks
  • Have clear, descriptive commit messages that explain WHY

The goal is reviewer experience, not mechanical splitting. Each PR should be something you'd be proud to send for review.

Help

If the user provides a command option of help:

  • Explain how to use this prompt.
  • Explain if they are missing any prerequisites or tooling requirements.
  • DO NOT proceed, exit the prompt immediately after these steps.

Phase 0: Prerequisites

Tooling Requirements

  • Git CLI must be available
  • GitHub CLI (gh) must be available and authenticated
  • Working tree must be clean (no uncommitted changes)
  • Must be on a feature branch, not the main branch

Verification

Verify the working tree is clean, not on main branch, and gh CLI is authenticated before proceeding.

Identify Base Branch

Determine the correct base branch — do not assume latest. The user's branch may have been created from a release branch. Run the shared detection script:

bash .rulesync/skills/git-conventions/detect-base-branch.sh

This iterates all origin/bX.Y.Z release branches (newest version first), compares merge-base distances, and prints BASE_BRANCH=<branch>. If a release branch is closer than origin/latest, it is selected. Otherwise latest is used. Store as BASE_BRANCH and use it everywhere this skill references the base branch.

Extract JIRA Ticket or Branch Prefix

Determine the commit message prefix from the branch name:

  1. Detect the project from the repo name (enclosing directory): Repo Branch Pattern JIRA Prefix ag-studio st-NNNNN/description ST- ag-charts ag-NNNNN/description AG- ag-grid ag-NNNNN/description AG- *(default)* ag-NNNNN/description AG-
  2. If branch matches the project's pattern: extract JIRA ticket (e.g., ST-12345, AG-12345)
  3. Otherwise: derive prefix from branch name (e.g., feature/null-keys becomes null-keys)

Store this prefix for use in commit messages and PR titles.

Phase 1: Understand the Changes

Use a sub-agent (type: Explore) to deeply analyse the changes:

1.1 Gather Information

  • Get the full diff against {BASE_BRANCH}
  • Review all commit messages and their content
  • Understand the scope: files changed, lines added/removed, packages touched

1.2 Analyse for Logical Units

Focus on content and purpose, not commit boundaries. Identify:

  • Distinct features or concerns: What separate things does this branch accomplish?
  • Logical dependencies: What must be merged first for later changes to make sense?
  • Natural boundaries: Package boundaries, code vs tests vs docs, refactoring vs features
  • Reviewer cognitive load: What groupings would be easiest to understand in isolation?

Key questions to answer:

  • Could a reviewer understand each proposed PR without seeing the others?
  • Does each PR have a single, clear purpose?
  • Are dependencies between PRs clear and minimal?

Phase 2: Design the Split

2.1 Present Split Options

After analysis, use AskUserQuestion to present 2-3 concrete split proposals based on content analysis:

Option types to consider:

  1. By logical unit (recommended default) - Group changes by feature or concern
  2. By package/module - Split across codebase boundaries (core, then community, then enterprise)
  3. Custom - User specifies split points

Guidelines:

  • Each option should include the number of PRs and what goes in each
  • Options must be based on actual content analysis, not commit preservation
  • Prioritize options that create coherent, reviewable units
  • Target 500-1000 lines per PR for optimal reviewability

Do NOT offer "By commit" splitting. If commits are already well-structured, the user can trivially do this themselves. The value of this command is reorganising changes into logical, reviewable units.

2.2 Handle User Choice

If user selects a pre-defined option: Proceed with that strategy.

If user selects "Custom": Ask for details on how many PRs and what goes in each.

2.3 Confirm the Split Plan

Present the detailed plan for confirmation:

## Proposed Split Plan

### PR 1: [Title]
- Purpose: [what this PR accomplishes]
- Files: [list or patterns]
- Lines: ~XXX

### PR 2: [Title]
- Purpose: [what this PR accomplishes]
- Files: [list or patterns]
- Lines: ~XXX
- Depends on: PR 1

[etc.]

Use AskUserQuestion to confirm before proceeding.

2.4 Validate the Plan

Run the /plan-review skill to check for completeness and correctness.

Phase 3: Execute the Split

3.1 Prepare a Clean Starting Point

Create a temporary branch that holds all changes as staged files:

  1. Record the current branch name
  2. Create a temporary branch from the current HEAD
  3. Soft reset to the merge base with {BASE_BRANCH} (converts all commits to staged changes)

3.2 Create PR Branches

For each PR in the plan:

First PR:

  • Branch from {BASE_BRANCH}
  • Bring in the relevant files from the temporary branch
  • Use git checkout <temp-branch> -- <files> for clean file extraction
  • Use git add -p for partial file staging when needed

Subsequent PRs:

  • Branch from the previous PR's branch
  • Bring in the next set of files
  • Maintain the dependency chain

3.3 Commit Message Quality

Each commit message must:

  • Start with the JIRA ticket or branch prefix
  • Use imperative mood ("Add", "Fix", "Refactor")
  • Explain WHAT changed and WHY (not just what files)
  • Be concise but complete
  • No LLM attribution or emoji

Good example:

AG-12345 Add null category handling for bar series

Previously, null categories caused bars to render at position 0.
Now they are filtered out during data processing, matching the
behaviour of line and area series.

Bad example:

AG-12345 Update files

3.4 Cleanup

After creating all PR branches:

  • Delete the temporary branch
  • Verify no uncommitted changes remain

Phase 4: Quality Iteration (CRITICAL)

This phase is essential. Each PR must be polished until reviewer-ready, not just "builds".

4.1 For Each PR Branch (in order)

  1. Rebase onto base

- First PR: rebase onto {BASE_BRANCH} - Subsequent PRs: rebase onto previous PR branch

  1. Run /pr-review (via sub-agent)

- Identify code quality issues - Check for logical coherence - Assess scope appropriateness

  1. Assess Logical Coherence

- Does this PR do ONE thing well? - Would a reviewer understand this in isolation? - Is the scope appropriate (500-1000 lines)? - Is anything missing that should be included? - Is anything included that belongs in a different PR?

  1. Assess Presentation Quality

- Is the commit message clear and descriptive? - Does it explain WHY, not just WHAT? - Would the PR title make sense in a changelog?

  1. Run Build Validation

- Run the project's pre-commit validation commands against each affected package - Ensure type checking, linting, and tests all pass before proceeding

  1. Fix Issues

- Code quality issues: fix and amend or add fixup commits - Commit message issues: git commit --amend to improve - Scope issues: consider re-splitting if the scope is wrong - Use code-fixup skill for complex fixes

  1. Iterate Until High Quality

- Repeat steps 2-6 until the PR is reviewer-ready - "Reviewer-ready" means: builds, tests pass, logical scope, clear purpose, good commit message - Ask yourself: "Would I be proud to send this for review?"

4.2 Quality Checklist

Before proceeding to create PRs, verify each branch meets these criteria:

  • Single, clear purpose
  • Appropriate scope (ideally 500-1000 lines)
  • Commit message explains the change and its motivation
  • All builds and tests pass
  • A reviewer could understand this PR in isolation
  • No obvious issues flagged by /pr-review

Phase 5: Create PRs and Push

5.1 Push Branches

Push each branch with upstream tracking:

git push -u origin "${branch_name}"

5.2 Create Draft PRs

For each branch, create a draft PR using gh pr create:

  • First PR targets {BASE_BRANCH}
  • Subsequent PRs target the previous PR's branch

PR Description Template:

## Summary

[Brief description of what this PR accomplishes and why]

## Position in Stack

PR N of M in the series.

**Previous PR:** #<number> (if applicable)
**Next PR:** #<number> (if applicable)

## JIRA

Jira: [TICKET-12345](https://jira.example.com/browse/TICKET-12345)

## Test Plan

- [ ] Unit tests pass
- [ ] Build succeeds
- [ ] Lint passes

Phase 6: Report Results

Output a summary of the created PRs:

# PR Split Complete

## Summary

Split `{original_branch}` into {N} stacked PRs.

## PR Chain

| # | Branch | PR | Description | Base |
|---|--------|-----|-------------|------|
| 1 | {branch-part-1} | #{pr1} | {desc1} | {BASE_BRANCH} |
| 2 | {branch-part-2} | #{pr2} | {desc2} | {branch-part-1} |
| ... | ... | ... | ... | ... |

## Dependency Diagram

{BASE_BRANCH} └── {branch-part-1} (PR #{pr1}) └── {branch-part-2} (PR #{pr2}) └── {branch-part-3} (PR #{pr3})

## Reviewer Instructions

1. Review PRs in order (1, 2, 3, ...)
2. Each PR shows only its incremental changes
3. To see cumulative changes up to PR N, compare `{branch-part-N}` to `{BASE_BRANCH}`
4. Approve and merge in order; later PRs will auto-update their base

Error Handling

Dirty Working Tree

  • Inform the user they need to commit or stash changes
  • Provide the command: git stash or git commit -am "WIP"
  • Exit without making changes

Merge Conflicts During Rebase

  • Pause and show the conflicts to the user
  • Ask if they want to resolve manually or abort
  • Do not attempt automatic conflict resolution

Build/Lint/Test Failures

  • Attempt to fix using code-fixup skill
  • If fixes fail after 2 attempts, ask the user for guidance
  • Do not push branches with known failures

GitHub CLI Failures

  • Provide manual instructions for creating the PR via GitHub web UI
  • Include the branch name, base branch, and suggested title/body

Sub-Agent Usage Summary

PhaseSub-Agent TypePurpose
1ExploreAnalyse code changes and identify logical groupings
2plan-review (skill)Validate the split plan
4general-purposeRun /pr-review for each branch
4code-fixup (skill)Fix build/lint/test issues

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

33.26%
按下载量换算73

Claude

30.74%
按下载量换算67

Cursor

20.15%
按下载量换算44

Gemini CLI

8.91%
按下载量换算19

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

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

安装前确认

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

来源信息

继续浏览同类 Skills