# Create Pull Request

> Create a GitHub pull request the user's preferred way. Use whenever opening, creating, or raising a PR with gh.

- **Type:** Skill
- **Install:** `agentstack add skill-motlin-claude-code-plugins-create-pull-request`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [motlin](https://agentstack.voostack.com/s/motlin)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [motlin](https://github.com/motlin)
- **Source:** https://github.com/motlin/claude-code-plugins/tree/main/plugins/github/skills/create-pull-request

## Install

```sh
agentstack add skill-motlin-claude-code-plugins-create-pull-request
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Create Pull Request

Use the `code:cli`, `git-workflow`, and `git-commit` skills when available. Only create a PR when the user has explicitly asked for one.

## Confirm the branch is on top of upstream main

Fetch first, then test whether the branch already contains the tip of `origin/main`:

```bash
git fetch origin
git merge-base --is-ancestor origin/main HEAD
```

- Non-zero means the branch is behind. Offer to rebase onto `origin/main` before creating the PR rather than opening a stale PR.

## Set the title from the actual commit message

Never type the title from memory. Read it from git in a subshell so it matches exactly.

First count the commits the branch adds over `origin/main`:

```bash
git rev-list --count origin/main..HEAD
```

- if one commit, then the title is that commit's message.

    ```bash
    git log -1 --pretty=%s
    ```

- More than one: write a short one-sentence summary title — same style as a commit message (present-tense verb, one line, no trailing paragraphs).

## Keep the body empty

Always pass an explicit empty string for the body so `gh` does not prompt or auto-fill.

```bash
--body ""
```

## Create the PR

When a browser is available, open the prefilled page for final review:

```bash
gh pr create --web --title "$(git log -1 --pretty=%s)" --body ""
```

On a headless system without a browser, drop `--web`:

```bash
gh pr create --title "$(git log -1 --pretty=%s)" --body ""
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [motlin](https://github.com/motlin)
- **Source:** [motlin/claude-code-plugins](https://github.com/motlin/claude-code-plugins)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-motlin-claude-code-plugins-create-pull-request
- Seller: https://agentstack.voostack.com/s/motlin
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
