Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add tartinerlabs/skills --skill create-pr -a claude-code
Open on GitHub

What 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 gh CLI
  • 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-code

2Manually: put the files in place

~/.claude/skills/create-pr/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/create-pr/

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.

create-pr NeoLabHQ Opens draft pull requests through the GitHub CLI using repository templates. It checks for uncommitted changes and formats PR titles with emojis. CX Codex +1 1,200installs create-pr zhaono1 A skill that walks the agent through opening a pull request and keeps the English and Chinese READMEs in sync. Useful when the skill catalog changes and the docs have to follow. CX Codex +1 666installs create-pr marcelorodrigo Prepares structured pull requests, generates conventional titles, and submits them via GitHub CLI. CX Codex +1 308installs triage Matt Pocock This skill moves issues and external PRs through triage states, verification, and agent briefs. It fits maintainers managing an issue queue. 990,453installs code-review Matt Pocock Reviews changes from a chosen reference point against repository standards and the originating spec. Use it for a branch, PR, or work in progress. 789,521installs implement Matt Pocock Implements work from a specification or tickets, following a test-driven flow and ending with review and a commit. Use it when a coding task needs a defined delivery routine. 774,700installs git-guardrails-claude-code Matt Pocock This skill adds a Claude Code hook that stops risky Git commands before they run. Use it when an agent must not push or discard working-tree changes. 499,069installs setup-pre-commit Matt Pocock This skill configures pre-commit checks for a JavaScript repository, running Prettier, type checking, and tests before each commit. 489,289installs scaffold-exercises Matt Pocock This skill builds course exercise directories with sections, problems, solutions, and explainers. Use it when starting a new course section or creating exercise stubs. 480,196installs

From the same set12

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor