git-create-pr
Skill8 starsChanged 48 days agoMITView on GitHub
Create a GitHub Pull Request from the current branch, following conventional commit format and pre-filling the repo's PR template. Activates on "create a PR", "open a pull request", "push this for review", or similar. Use after commits are made and pushed is not yet done; for the commits themselves use git-commit, for release/hotfix branch PRs use gitflow, and for the full review-then-commit-then-PR pipeline in one go use ship.
- Installs packages
- Commits and pushes
In this repository53 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-browserSkill
- anything-to-skillSkill
- ci-generateSkill
- ci-localSkill
- clotho-researchSkill
- codex-imagegenSkill
- create-ruleSkill
- create-skillSkill
- db-migrateSkill
- docker-initSkill
- docs-adrSkill
- docs-checkSkill
- docs-diagramSkill
- docs-initSkill
- docs-rfcSkill
- docs-updateSkill
- env-setupSkill
- find-skillsSkill
- fix-bugSkill
- git-commitSkill
- gitflowSkill
- git-releaseSkill
- git-syncSkill
- i18n-checkSkill
- implement-featureSkill
- improve-skillSkill
- inject-docsSkill
- jira-cliSkill
- motion-studioSkill
- optimize-ai-setupSkill
- orchestrateSkill
- oss-launchSkill
- prd-to-issuesSkill
- product-design-specSkill
- product-design-tokensSkill
- product-prdSkill
- project-illustratorSkill
- project-plannerSkill
- refactorSkill
- renderSkill
- review-codeSkill
- review-depsSkill
- review-designSkill
- review-perfSkill
- review-planSkill
- review-securitySkill
- shipSkill
- stopslopSkill
- test-suiteSkill
- vrt-checkSkill
- wtfSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 6 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Create a GitHub Pull Request following conventional commits, pre-filled with the repo's PR template, and opened in the browser for final …
- Distinctive: line 16
Every PR bullet must map to an actual commit or diff hunk: drop claims you can't back with evidence in git log or git diff.
- Distinctive: line 23
Check working tree is clean: git status --porcelain.
- Distinctive: line 24
If dirty: stop immediately.
- Very specific: line 27
If it's main or master: stop immediately.
- Very specific: line 28
Check commits exist: git log origin/<base>..HEAD --oneline.
- Very specific: line 32
Use --base/-b argument if provided
- Very specific: line 47
Look for .github/pull_request_template.md and fill it without changing its structure
- Distinctive: line 48
If none exists, use:
- Very specific: line 66
Ask: Create PR? (y/n/e to edit): (accept y/yes/n/no/e/edit)
- Very specific: line 81
Do not combine --reviewer, --assignee, or --label with --web: they conflict.
- Distinctive: line 97
After pushing, the PR opens in the browser pre-filled with title and body.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Create Pull Request
Create a GitHub Pull Request following conventional commits, pre-filled with the repo's PR template, and opened in the browser for final review.
Every PR bullet must map to an actual commit or diff hunk: drop claims you can't back with evidence in git log or git diff.
Invariant: never mutate the user's files to satisfy a precondition. If a check in step 1 fails, report it and stop. Do not run git checkout, git restore, git reset, git stash, or git clean against the user's tracked files to "fix" a dirty tree, and do not switch branches to route around a main/master check, those are the user's decisions, not this skill's. The only git commands this skill runs against the working tree are read-only until step 7's git push.
Workflow
- Validate preconditions (run this before anything else, including branch analysis)
- Check working tree is clean:
git status --porcelain. Any output means it's dirty.- If dirty: stop immediately. Show the
git status --porcelainoutput and tell the user to commit or stash their changes first, e.g.Working tree has uncommitted changes: M README.md. Commit or stash before opening a PR.Do not proceed to step 2, and do not touch the listed files.
- If dirty: stop immediately. Show the
- Requires
gh(brew install gh): confirmgh auth statussucceeds, else stop and tell the user to rungh auth login. - Get current branch:
git branch --show-current.- If it's
mainormaster: stop immediately. Tell the user there's no feature branch to open a PR from, e.g.Currently on main — check out a feature branch first.Do not proceed.
- If it's
- Check commits exist:
git log origin/<base>..HEAD --oneline. If empty, stop and say there's nothing to open a PR for. - Extract ticket ID from branch name (e.g.,
ABC-123fromfeature/ABC-123_description)
- Check working tree is clean:
- Determine base branch
- Use
--base/-bargument if provided - Otherwise:
gh repo view --json defaultBranchRef -q .defaultBranchRef.name - Fall back to
mainif detection fails
- Use
- Analyze changes
git log origin/<base>..HEAD --format="%h %s"for commitsgit diff origin/<base>...HEAD --statfor file changes- Synthesize these directly in the main thread: a subagent fan-out is overkill for what one
git log+ onediff --statalready summarizes. Only reach for a subagent if the diff is too large to fit in context.
- Generate PR title (conventional commit format, max 72 chars)
type(scope): [TICKET-123] descriptionortype(scope): descriptionif no ticket- Types:
feat,fix,docs,style,refactor,perf,test,build,ci,chore - Examples:
feat(auth): [ABC-123] add OAuth2 login support,fix(api): resolve null pointer in user endpoint
- Fill PR template
- Look for
.github/pull_request_template.mdand fill it without changing its structure - If none exists, use:
## Summary [Brief description] ## Changes - [Bullet points from commits] ## Testing - [ ] Tests added/updated - [ ] Manual testing completed - Save to
BODY_FILE="/tmp/pr-body-$(date +%s).md"
- Look for
- Ask for confirmation
- Show a compact summary: ticket, commit count, authors (keep lines under 60 chars)
- Preview the generated title and body
- If the repo has CI configured (
.github/workflows/*.yml) and tests haven't been verified locally this session, suggest running thecc-arsenal:ci-localskill first (via theSkilltool where available, otherwise run the workflow's gating steps locally by hand): cheaper to catch a failure now than after the PR is open - Ask:
Create PR? (y/n/e to edit):(accepty/yes/n/no/e/edit) - On
e, ask for custom title/body
- Push and create PR (after confirmation)
# Push first — required before gh pr create can reference the branch git push -u origin $(git branch --show-current) # BODY_FILE is the file written in step 5 gh pr create \ --title "type(scope): [TICKET] description" \ --body-file "$BODY_FILE" \ --base <determined-base-branch> \ --web- Do not combine
--reviewer,--assignee, or--labelwith--web: they conflict. The user adds those in the web UI.
- Do not combine
Argument Parsing
--base branch/-b branch: target branch, defaults to repo default--draft/-d: adds--drafttogh pr create
Examples
git-create-pr # uses repo default base branch
git-create-pr --base develop # target a specific base branch
git-create-pr --draft # create as draft PR
git-create-pr -b develop -d # bothAfter pushing, the PR opens in the browser pre-filled with title and body. Add reviewers/labels there.
Precondition failure (dirty tree, stop before any analysis):
Working tree has uncommitted changes:
M README.md
Commit or stash before opening a PR. Not proceeding.No git checkout, git push, or gh pr create runs after this: the turn ends here.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

