/pr:prfrom pr
Commit uncommitted changes from new branch(es) off main, push, and open one PR per related-change group.
Ships in pr. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Follow these instructions strictly.
This command's job:
main, commit only that group's files, push, and open a PR to main.This command does NOT run check commands and does NOT edit source files. Any verification (lint, type-check, build, test) is assumed to have happened beforehand.
git status to inspect the working tree. If there are no uncommitted changes and no relevant untracked files, report "no changes to commit" and exit.git status shows files that look unrelated to the work in this session (e.g. local dev artifacts, IDE configs, files in unexpected directories, or files no prior step in this session touched), STOP and wait for the user's explicit instruction before continuing — do NOT proceed automatically even in auto mode.{theme, theme_slug, files[], commit_message, pr_title, pr_body}. Briefly report the resulting groups to the user (format: Group N (<theme>): <file list>); do NOT wait for approval, just proceed.Apply these rules in order:
.gitattributes itself (would alter normalization of other files mid-restore).core.autocrlf=true or active smudge/clean filters (round-trip verification can yield false positives).For each group, derive a short theme_slug (kebab-case, ≤ 24 chars, ASCII) from the theme — it will appear in the branch name for traceability across retries.
main named claude/<YYYYMMDD-HHMMSS> (e.g. claude/20250101-123456). If GITHUB_RUN_ID is set (running inside a GitHub Actions runner), prefer claude/<GITHUB_RUN_ID>-<YYYYMMDD-HHMMSS> for traceability.origin.main as the base. Required format:
[Claude] <改善内容の短い要約>Precondition: the working tree carries all changes; HEAD is on main (or a branch equivalent to it).
git stash push --include-untracked -m "claude/pr-split-<YYYYMMDD-HHMMSS>"git stash list that the stash entry was actually created. If the stash is empty (e.g. only ignored files were "changed"), STOP and report — there is nothing to split.STASH_REF=$(git rev-parse stash@{0}) and use $STASH_REF (and $STASH_REF^3 for untracked) in every subsequent step. Do NOT reuse the literal stash@{0}, which can shift if any other stash operation runs.git checkout main, then confirm the working tree is clean and git rev-parse HEAD matches the main ref the run started on. If main has drifted (e.g. a leftover commit from a previous failed run), STOP and report — do NOT continue. Do NOT run git pull.claude/<YYYYMMDD-HHMMSS>-<N>-<theme_slug> (or claude/<GITHUB_RUN_ID>-<YYYYMMDD-HHMMSS>-<N>-<theme_slug> in GitHub Actions). Confirm the name is not already present locally (git branch --list) nor on the remote (git ls-remote --heads origin <branch>). If it exists, append -r<retry> until unique.git checkout -b <branch>.$STASH_REF from step 1):
git restore --source=$STASH_REF --worktree --staged -- <file>...git restore --source=$STASH_REF^3 --worktree --staged -- <file>... (the 3rd parent of an --include-untracked stash holds the untracked tree)/pr):
git ls-files --error-unmatch -- <file>. If it was, run git rm -- <file>. If it was not (the deletion was of a previously-untracked file), simply ensure the file is absent (rm -f <file>) — there is nothing to remove from the index.git status and confirm only this group's files appear, in the expected mode (modified / added / deleted). If anything unexpected shows up — especially a .env, credential, or large binary — STOP and report.git commit -m "<concise English message>".git push -u origin <branch>.gh pr create --base main --title "[Claude] <日本語要約>" --body "<日本語本文>". Body must list only this group's files as bullets and include any related review findings from the conversation context.core.autocrlf false positives): after all groups are processed:
git checkout main.main: git checkout -b claude/pr-split-verify-<YYYYMMDD-HHMMSS>, then git cherry-pick <commit> for each group commit in order.git diff-tree -r --no-renames <verify-branch>^{tree} $STASH_REF^{tree} — must produce no output.git diff-tree -r --no-renames <verify-branch>^{tree} $STASH_REF^3^{tree} — every difference here must correspond to a file that existed at main (i.e. the untracked tree of the stash legitimately omits pre-existing files); paths that were untracked-and-newly-added by the user must appear identical in both trees.git checkout main && git branch -D <verify-branch>) and drop the stash (git stash drop $STASH_REF).main directly; the PR base is always main..env, credential files, large binaries that look untracked-by-mistake). Re-check this BOTH at sanity-check time AND after restoring each group's files (workflow step 2.5). If anything suspicious appears, stop and report.git push or gh pr create fails partway through the multi-PR workflow, STOP immediately. Do NOT drop the stash. Report which PRs were created so far (with URLs), which branches exist locally / on the remote, and which files remain in the stash so the user can recover manually.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub kurosame/claude-code-plugins --plugin pr