Split to prs

From Kevin-Liu-01/Agent-Machines · View interactive version

Split to prs is an AI agent skill from the GitHub repository Kevin-Liu-01/Agent-Machines. Split current work into small reviewable PRs. Use when the user asks to split a chat, set of changes, branch, or PR.

How to use this skill

Skill file

Split to PRs

Turn one pile of work into a few small PRs.

Hard rules

1. Check the state

Compare the current work to the repo's default branch, including committed and uncommitted changes. Summarize the real slices you see, and use the chat history to recover intent.

Before proposing slices, find ownership signals for the touched paths (CODEOWNERS, nested ownership files, tools/ownership/PRODUCTOWNERS, or repo equivalents) and use them to identify natural reviewer boundaries.

2. Propose the split

Use judgment on detail. Usually PR titles are enough. Add a one-line scope note only when a title is unclear. Show a Mermaid diagram when there are multiple slices.

Optimize for reviewer-aligned PRs with minimal unrelated diff: split independent owners or concerns, keep tightly coupled changes together, and when stacking is necessary, order foundations before consumers.

Default to independent PRs off the default branch. Stack PRs only when the dependency is real.

Ask for approval before starting.

3. Execute the split

```bash

SHA=$(git stash create "pre-split")

if [ -n "$SHA" ]; then

git update-ref "refs/backup/pre-split-$(date +%s)" "$SHA"

fi

```

4. Report back

Keep it short: PR titles and URLs, plus anything left on the starting branch or working tree. Do not delete the backup ref or original branch unless the user asks.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.