git-pr

Opens a GitHub pull request for a feature branch after running CI-equivalent and repo-local checks.

Updated Dec 18, 2025
One-click install
npx skills add https://github.com/l0lxl0lw/dotfiles --skill git-pr-l0lxl0lw
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-pr
Source: https://github.com/l0lxl0lw/dotfiles/tree/main/ai/shared/skills/git/git-pr
Command: npx skills add https://github.com/l0lxl0lw/dotfiles --skill git-pr-l0lxl0lw

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Opening a pull request by hand is error-prone: uncommitted work gets left behind, stale branches produce misleading diffs, local checks get skipped, and PR descriptions get invented from commit subjects instead of the real diff. This Skill gates every one of those failure modes before anything is pushed. ## Core Features & Use Cases - Branch analysis: Inspects the three-dot diff against the default branch, detects uncommitted work, verifies the branch is up to date, and checks for an existing PR to prevent duplicates. - Pre-merge verification: Runs the local equivalents of CI workflows (lint, build, test) plus repo-declared drift checks defined in pre-pr: frontmatter, gating on deterministic fail-on regexes rather than exit codes alone. - Grounded PR creation: Generates a title and body from the actual diff, requires a single user approval, then pushes and opens the PR via gh while rejecting AI attribution. - Use Case: You finished a feature branch and want it reviewed. The Skill confirms the tree is clean, runs the repo's checks, shows you a proposed title and body, and opens the PR only after you approve. ## Quick Start Ask the assistant to open a pull request for the current feature branch using the git-pr skill.

Frequently Asked Questions about git-pr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I open a pull request for a feature branch with gh CLI?

Run the analyze-branch script to verify the branch state, run the local checks that mirror CI, then use create-pr.sh with a title and body file. It pushes the branch and calls gh pr create against the default branch, refusing duplicates.

How do I check for uncommitted changes before creating a PR?

The analyze-branch.sh script runs git status --porcelain and reports uncommitted work as a blocker, including untracked files. You can commit it with a proposed message, stash it, or abort before the PR is opened.

What is the difference between two-dot and three-dot git diff for pull requests?

Three-dot diff (origin/default...HEAD) compares against the merge-base, which is exactly what GitHub shows in a PR. Two-dot diff compares against the moving tip of the default branch and can misreport what will actually merge.

Can I run repo-specific checks before opening a pull request?

Yes. A repo declares pre-pr checks in the frontmatter of its own skills with a command, optional when-paths filter, and a fail-on regex. The repo-check.sh script runs them and gates on the regex match rather than the exit code.

Why does the skill refuse to open a PR when the branch is behind?

A branch behind the default branch produces a diff that does not reflect what will actually merge, and many CI guards reject it. The skill stops and directs you to sync the branch first.

When should I use git-branch-and-pr instead of git-pr?

Use git-branch-and-pr when the work is still uncommitted on the default branch and needs a new branch created for it. git-pr only handles feature branches that already exist, including fresh worktrees with uncommitted work.