Agent skill

Create Pull Request

by cline in cline/cline

Opens a GitHub pull request from your current branch with the gh CLI, after reviewing the commits and diff and gathering the details the PR needs.

Apache-2.0Auto-check passedDevelopment

Install Create Pull Request

skills CLI
$ npx skills add cline/cline --skill create-pull-request -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cline/cline create-pull-request --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cline/cline.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/create-pull-request .claude/skills/create-pull-request && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
create-pull-request
GitHub stars
70k
Used in
1 other repo
Token cost
~1.6k tokens
SKILL.md length
771 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
Apache-2.0

At a glance

Opens a GitHub pull request from your current branch with the gh CLI, after reviewing the commits and diff and gathering the details the PR needs.

  • Works in 7 steps: Check if gh CLI is installed → Check if authenticated with GitHub → Verify clean working directory → …
  • Opening a pull request for a finished feature branch
  • SKILL.md covers Prerequisites Check, Gather Context, Information Gathering and Git Best Practices, plus 4 more sections
  • Calls git, gh and brew

What it does

Before it creates anything, the agent checks that the GitHub CLI is installed and logged in, that you are on a feature branch rather than main or master, and what state the working directory is in. If uncommitted changes exist, it asks whether to commit them into the PR, stash them or discard them.

It then finds the base branch, lists the commits that are not on it yet and reads the diff summary to judge how big the change is and what kind it is. Details a PR needs are taken from commit messages, the branch name and the changed files where possible: the related issue number, what problem the change solves, the type of change and how it was tested. Anything still missing is put to you as a question, and the project's PR template is applied when the PR is written.

When your agent uses it

  • Opening a pull request for a finished feature branch
  • Submitting a bug fix for review with the issue number linked
  • Checking whether recent commits should be squashed before a PR goes out

Example prompts

  • “Open a PR for my fix/login-redirect branch against main.”
  • “Create a pull request for these changes and link issue 123.”
  • “I'm done with the new settings page, so submit it for review.”

Requirements

  • GitHub CLI (`gh`), installed and logged in with `gh auth login`
  • A Git repository with a feature branch and a remote named origin

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Check if gh CLI is installed
  2. Check if authenticated with GitHub
  3. Verify clean working directory
  4. Identify the current branch
  5. Find the base branch
  6. Analyze recent commits relevant to this PR
  7. Review the diff

What it can do on your machine

Read from SKILL.md and the folder at commit 6354d20. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • gh
    • brew

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • cli.github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Create Pull Request loads about 1.6k tokens when it runs. Until then it costs about 68 tokens; SKILL.md has 771 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~68
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from cline/cline at commit 6354d20, republished under its Apache-2.0 licence (© cline). 771 words, ~1,556 tokens.

Download SKILL.mdSave it as .claude/skills/create-pull-request/SKILL.md (or your agent's skills folder).
name
create-pull-request
description
Create a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, PR template usage, and PR creation using the gh CLI tool.

Create Pull Request

This skill guides you through creating a well-structured GitHub pull request that follows project conventions and best practices.

Prerequisites Check

Before proceeding, verify the following:

1. Check if gh CLI is installed
bash
gh --version

If not installed, inform the user:

The GitHub CLI (gh) is required but not installed. Please install it:

2. Check if authenticated with GitHub
bash
gh auth status

If not authenticated, guide the user to run gh auth login.

3. Verify clean working directory
bash
git status

If there are uncommitted changes, ask the user whether to:

  • Commit them as part of this PR
  • Stash them temporarily
  • Discard them (with caution)

Gather Context

1. Identify the current branch
bash
git branch --show-current

Ensure you're not on main or master. If so, ask the user to create or switch to a feature branch.

2. Find the base branch
bash
git remote show origin | grep "HEAD branch"

This is typically main or master.

3. Analyze recent commits relevant to this PR
bash
git log origin/main..HEAD --oneline --no-decorate

Review these commits to understand:

  • What changes are being introduced
  • The scope of the PR (single feature/fix or multiple changes)
  • Whether commits should be squashed or reorganized
4. Review the diff
bash
git diff origin/main..HEAD --stat

This shows which files changed and helps identify the type of change.

Information Gathering

Before creating the PR, you need the following information. Check if it can be inferred from:

  • Commit messages
  • Branch name (e.g., fix/issue-123, feature/new-login)
  • Changed files and their content

If any critical information is missing, use ask_followup_question to ask the user:

Required Information
  1. Related Issue Number: Look for patterns like #123, fixes #123, or closes #123 in commit messages
  2. Description: What problem does this solve? Why were these changes made?
  3. Type of Change: Bug fix, new feature, breaking change, refactor, cosmetic, documentation, or workflow
  4. Test Procedure: How was this tested? What could break?
Example clarifying question

If the issue number is not found:

I couldn't find a related issue number in the commit messages or branch name. What GitHub issue does this PR address? (Enter the issue number, e.g., "123" or "N/A" for small fixes)

Git Best Practices

Before creating the PR, consider these best practices:

Commit Hygiene
  1. Atomic commits: Each commit should represent a single logical change
  2. Clear commit messages: Follow conventional commit format when possible
  3. No merge commits: Prefer rebasing over merging to keep history clean
Branch Management
  1. Rebase on latest main (if needed):

    bash
    git fetch origin
    git rebase origin/main
  2. Squash if appropriate: If there are many small "WIP" commits, consider interactive rebase:

    bash
    git rebase -i origin/main

    Only suggest this if commits appear messy and the user is comfortable with rebasing.

Push Changes

Ensure all commits are pushed:

bash
git push origin HEAD

If the branch was rebased, you may need:

bash
git push origin HEAD --force-with-lease
Show full SKILL.md (353 more words)Show less

Create the Pull Request

IMPORTANT: Read and use the PR template at .github/pull_request_template.md. The PR body format must strictly match the template structure. Do not deviate from the template format.

When filling out the template:

  • Replace #XXXX with the actual issue number, or keep as #XXXX if no issue exists (for small fixes)
  • Fill in all sections with relevant information gathered from commits and context
  • Mark the appropriate "Type of Change" checkbox(es)
  • Complete the "Pre-flight Checklist" items that apply
Create PR with gh CLI

Use a temporary file for the PR body to avoid shell escaping issues, newline problems, and other command-line flakiness:

  1. Write the PR body to a temporary file:

    /tmp/pr-body.md
  2. Create the PR using the file:

    bash
    gh pr create --title "PR_TITLE" --body-file /tmp/pr-body.md --base main
  3. Clean up the temporary file:

    bash
    rm /tmp/pr-body.md

For draft PRs:

bash
gh pr create --title "PR_TITLE" --body-file /tmp/pr-body.md --base main --draft

Why use a file? Passing complex markdown with newlines, special characters, and checkboxes directly via --body is error-prone. The --body-file flag handles all content reliably.

Post-Creation

After creating the PR:

  1. Display the PR URL so the user can review it
  2. Remind about CI checks: Tests and linting will run automatically
  3. Suggest next steps:
    • Add reviewers if needed: gh pr edit --add-reviewer USERNAME
    • Add labels if needed: gh pr edit --add-label "bug"

Error Handling

Common Issues
  1. No commits ahead of main: The branch has no changes to submit

    • Ask if the user meant to work on a different branch
  2. Branch not pushed: Remote doesn't have the branch

    • Push the branch first: git push -u origin HEAD
  3. PR already exists: A PR for this branch already exists

    • Show the existing PR: gh pr view
    • Ask if they want to update it instead
  4. Merge conflicts: Branch conflicts with base

    • Guide user through resolving conflicts or rebasing

Summary Checklist

Before finalizing, ensure:

  • gh CLI is installed and authenticated
  • Working directory is clean
  • All commits are pushed
  • Branch is up-to-date with base branch
  • Related issue number is identified, or placeholder is used
  • PR description follows the template exactly
  • Appropriate type of change is selected
  • Pre-flight checklist items are addressed

© cline, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/create-pull-request of cline/cline.

Open the folder on GitHubat commit 6354d20

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in cline/cline, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Create Pull Request next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Create Pull Request compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Create Pull Request this skillcline/cline70k1 repos~1.6kAutomated safety check: PassApache-2.0
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Creating Description For Gh PRredis/jedis12k—~838Automated safety check: PassMIT
Create Pull Request with Work Item IDmakeplane/plane60k—~824Automated safety check: PassAGPL-3.0
React Router Pull Request Creatorremix-run/react-router57k—~2.5kAutomated safety check: PassMIT
Pascal Editor PR Openerpascalorg/editor25k—~619Automated safety check: PassMIT

Similar skills

  • Merges external GitHub pull requests while keeping the original author credited, and fixes conflicts after the merge instead of rewriting the contribution.

    16k GitHub starsUsed in 1 repo~847 tokens
    DevelopmentAuto-check passed
  • Official

    Generate a clear, concise GitHub PR title and description from the diff between two local git branches, and save it to prDescription.md in the repo root.

    12k GitHub stars~838 tokensUpdated today
    DevelopmentAuto-check passed
  • Opens a pull request for the current branch using the repo's template, a work item ID in the title and a description filled in from the actual diff.

    60k GitHub stars~824 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • React Router Pull Request Creator

    remix-run/react-router

    Packages finished React Router work into a draft pull request: branch, commit, push, a written PR body and the right GitHub labels.

    57k GitHub stars~2.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Pascal Editor PR Opener

    pascalorg/editor

    Opens or refreshes a pull request on pascalorg/editor from the current branch, describing only what the branch's commits and diff actually contain.

    25k GitHub stars~619 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Creates backports of a merged Ansible devel pull request onto the right stable branches by cherry-picking its merge commit onto new backport branches.

    71k GitHub stars~1.2k tokensUpdated today
    DevelopmentAuto-check passed

More from cline/cline

All 8 skills in this repo
  • Cline SDK Guide

    cline/cline

    Reference for building AI agents with the Cline SDK: the Agent runtime, ClineCore sessions, custom tools, plugins, events, providers, scheduling and multi-agent teams.

    70k GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Helps build terminal user interfaces with OpenTUI using its core imperative API or its React and Solid reconcilers, with references for layout, keyboard, animation and testing.

    70k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Guides publishing a one-time What's new dialog in the Cline desktop app: deciding if one is due, picking highlights from the changelog and editing one content file.

    70k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Covers preparing, tagging and publishing a Cline desktop app release on the stable, beta or nightly channel through the desktop-publish GitHub workflow.

    70k GitHub stars~4.5k tokensUpdated today
    Auto-check passed
  • Validates and publishes the standalone @cline/ui npm package through its own release workflow, separate from the Cline SDK runtime packages.

    70k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Walks through releasing the Cline CLI package to npm: release notes, version bump, matching git tag, and either the GitHub workflow or a local publish.

    70k GitHub stars~3.4k tokensUpdated today
    Auto-check: warnings

Works with

Categories

Questions about Create Pull Request

What does Create Pull Request do?

Opens a GitHub pull request from your current branch with the gh CLI, after reviewing the commits and diff and gathering the details the PR needs. Before it creates anything, the agent checks that the GitHub CLI is installed and logged in, that you are on a feature branch rather than main or master, and what state the working directory is in. If uncommitted changes exist, it asks whether to commit them into the PR, stash them or discard them.

When should I use Create Pull Request?

Create Pull Request fits situations like: opening a pull request for a finished feature branch; submitting a bug fix for review with the issue number linked; checking whether recent commits should be squashed before a PR goes out.

How do I install Create Pull Request in Claude Code?

Run `npx skills add cline/cline --skill create-pull-request -a claude-code`. Or copy the skill folder (.agents/skills/create-pull-request in cline/cline) into .claude/skills/create-pull-request in your project. Claude Code loads it when a task matches its description.

How do I install Create Pull Request in Codex?

Run `npx skills add cline/cline --skill create-pull-request -a codex`. Or copy the skill folder (.agents/skills/create-pull-request in cline/cline) into .agents/skills/create-pull-request in your project. Codex loads it when a task matches its description.

Can I use Create Pull Request in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cline/cline --skill create-pull-request -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/create-pull-request, .gemini/skills/create-pull-request, .github/skills/create-pull-request and .opencode/skills/create-pull-request in your project.

What does Create Pull Request need to run?

Going by SKILL.md and its folder, Create Pull Request needs the command-line tools its instructions call (git, gh and brew). Our summary lists: GitHub CLI (`gh`), installed and logged in with `gh auth login`; A Git repository with a feature branch and a remote named origin.

Does Create Pull Request access the network?

SKILL.md names 1 domain. As links in the text: cli.github.com. This is read from the text; nothing was executed.

Is Create Pull Request safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Create Pull Request use?

Create Pull Request is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Create Pull Request use?

About 1.6k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Create Pull Request?

Skills that share tags, products or a category with Create Pull Request: Contributor-First PR Merge (HKUDS/OpenHarness, 16k stars), Creating Description For Gh PR (redis/jedis, 12k stars), Create Pull Request with Work Item ID (makeplane/plane, 60k stars) and React Router Pull Request Creator (remix-run/react-router, 57k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Create Pull Request?

cline (a GitHub organization) maintains it in cline/cline, which has 69,954 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 7, 2026.

Source: cline/cline on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.