create-pr · tartinerlabs — Claude Code skill: what it does, how to install
Pushes branches and opens GitHub PRs or GitLab MRs with schema migration checks and automatic self-assignment.
npx skills add tartinerlabs/skills --skill create-pr -a claude-codeWhat create-pr does
The skill manages the pull and merge request workflow. It starts by inspecting your git tree: if you are sitting on the base branch, it invokes create-branch, and any unstaged modifications are routed to the commit skill. Before pushing upstream, it runs a pre-flight check on database schema changes, halting execution if tables changed without an accompanying migration.
It inspects git remote get-url origin to pick between the GitHub CLI (gh) and GitLab CLI (glab). Generated descriptions use concise bullet points, avoiding headings like ## Summary or task checklists. On GitHub, it links layered branches using --base <parent-branch> and adjusts descriptions after running gh stack submit when stacks are present.
Without an authenticated gh or glab CLI binary, pull request creation cannot proceed. If the authenticated account lacks collaborator permissions on the remote repository, the skill still opens the request but omits the assignee flag.
What it helps with
- open a pull request on GitHub via the
ghCLI - submit a merge request on GitLab using
glab - catch unmigrated database schema changes before pushing
- link layered branches into stacked PRs on GitHub
Example prompts for the agent
- Push this branch and open a pull request
- Create a PR targeting release with me assigned
- Submit this change as a GitLab merge request
How to install create-pr
1Skills CLI (Vercel)
npx skills add tartinerlabs/skills --skill create-pr -a claude-code2Manually: put the files in place
~/.claude/skills/create-pr/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/create-pr/
1Skills CLI (Vercel)
npx skills add tartinerlabs/skills --skill create-pr -a codex2Manually: put the files in place
.agents/skills/create-pr/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add tartinerlabs/skills --skill create-pr -a cursor2Manually: put the files in place
.cursor/skills/create-pr/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install tartinerlabs/skills create-pr2Manually: put the files in place
.github/skills/create-pr/SKILL.md1Skills CLI (Vercel)
npx skills add tartinerlabs/skills --skill create-pr -a gemini-cli2Platform CLI
gemini skills install https://github.com/tartinerlabs/skills --path plugins/workflow/skills/create-prManually: put the files in place
.devin/skills/create-pr/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add tartinerlabs/skills --skill create-pr -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about create-pr
How do I install create-pr in Claude Code?
Run npx skills add tartinerlabs/skills --skill create-pr -a claude-code. You can also configure it manually by placing the file at ~/.claude/skills/create-pr/SKILL.md.
What does the create-pr skill do?
It pushes your branch and opens a pull request or merge request with self-assignment. The skill checks database migrations before pushing and picks gh or glab based on your remote URL.
What dependencies are required for create-pr?
You need git and either gh for GitHub or glab for GitLab installed with valid credentials. The gh stack extension can also be used if already present.
Source text
SKILL.md · MIT
---
name: create-pr
description: Use when opening a PR, submitting for review, pushing a branch, or creating a pull request. Pushes and creates GitHub PRs with auto-assignment and description.
license: MIT
allowed-tools: Read Skill Bash(git:*) Bash(gh:*) Bash(glab:*)
model: haiku
effort: medium
compatibility: Requires git and a GitHub (gh) or GitLab (glab) remote
metadata:
short-description: Push a branch and open a pull request.
---
You 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
1. 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-branch` skill
- If there are uncommitted changes, commit them via the `commit` skill — never with a raw `git commit` here. Ask first only if some changes look unrelated to the rest
2. Run the migration drift pre-flight per `rules/migration-drift.md`. If a schema changed without a migration, stop and ask before pushing
3. Push current branch to remote (with `-u` flag if needed)
4. Analyse recent commits to generate PR title and description
5. 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` (`@me` resolves 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 stack` extension 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 submit` carry auto-generated titles and bodies that will not match the rules. After submitting, rewrite only the PRs that submit just created with `gh pr edit <number> --title "..." --body "..."` following `rules/pr-title.md` and `rules/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.
- **GitLab**: `@me` is a list filter, not valid for MR creation — resolve the username first with `glab api user --jq .username`, then `glab mr create --assignee <username> --target-branch <base>` with the base from step 1.
Auto-assign to the current user. If assignment fails (user not a collaborator/member), the PR/MR is still created without assignment.
© tartinerlabs · MIT · tartinerlabs/skills
Similar skills
All skills for Git and GitHub →create-pr by other authors comes first.