About create-pr
A development skill that pushes the current branch and opens a GitHub pull request or GitLab merge request. It checks branch and migration state first, then derives the title and description from recent commits.
Key features
- 01Checks branch and working-tree state
- 02Runs a migration-drift preflight
- 03Pushes the branch to the remote
- 04Creates GitHub PRs or GitLab MRs
- 05Applies title and description rules
Use cases
- 01Opening a hotfix PR against a specified base
- 02Submitting changes after committing work
- 03Creating a dependent PR for a branch stack
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ tartinerlabs/ skills --skill create-prAfter installing, type/create-prin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
rules/migration-drift.mdpr-description.mdpr-title.mdDetails
From the project READMEYou push branches and create pull/merge requests.
Rules Overview
| Rule | Impact | File |
|---|---|---|
| PR title | HIGH | rules/pr-title.md |
| Migration drift | HIGH | rules/migration-drift.md |
| PR description | MEDIUM | rules/pr-description.md |
Workflow
- Check current git status and branch, and determine the base: the one the user names (e.g. a release branch for a hotfix), otherwise the default branch
- If on the base branch, create a branch first via the
create-branchskill - If there are uncommitted changes, commit them via the
commitskill — never with a rawgit commithere. Ask first only if some changes look unrelated to the rest
- If on the base branch, create a branch first via the
- Run the migration drift pre-flight per
rules/migration-drift.md. If a schema changed without a migration, stop and ask before pushing - Push current branch to remote (with
-uflag if needed) - Analyse recent commits to generate PR title and description
- Detect the remote host from
git remote get-url origin(github.com → gh, gitlab.com → glab; default GitHub) and create the PR/MR with the matching CLI. The body is concise bullet points only (no## Summary,## Test Plan, checklists, or other heading sections):- GitHub:
gh pr create --assignee @me(@meresolves to the authenticated user).- Base selection: use the base from step 1. If the branch was cut from a non-default branch that itself has an open PR (check the merge base, then
gh pr list --head <parent>), create with--base <parent-branch>— the diff stays scoped to this layer, and GitHub links the PRs into a stack (public preview) automatically. Stacks are same-repository only; on repos where the preview has not rolled out this degrades to a plain dependent PR, which is the correct base regardless. - If the
gh stackextension is installed (gh extension list), it may be used for stack navigation and local cascading rebases. Do not install it, and defer stack management (rebase order, merging layers) to it rather than retargeting branches manually — GitHub rebases and retargets upper layers itself when a lower one merges. - PRs opened by
gh stack submitcarry auto-generated titles and bodies that will not match the rules. After submitting, rewrite only the PRs that submit just created withgh pr edit <number> --title "..." --body "..."followingrules/pr-title.mdandrules/pr-description.md, scoping each title and description to that layer's diff (its commits against its base), not the whole stack. Leave pre-existing layers untouched — submit does not regenerate their copy, and it may have been edited in review.
- Base selection: use the base from step 1. If the branch was cut from a non-default branch that itself has an open PR (check the merge base, then
- GitLab:
@meis a list filter, not valid for MR creation — resolve the username first withglab api user --jq .username, thenglab mr create --assignee <username> --target-branch <base>with the base from step 1.
- GitHub:
Auto-assign to the current user. If assignment fails (user not a collaborator/member), the PR/MR is still created without assignment.
Comments
Markdown supported