# Create Pr

> Create a pull request from the current branch following project conventions. Uses the branch name to find the Jira ticket, generates a PR with the standard template, pushes to origin, and closes the associated bead.

- **Type:** Skill
- **Install:** `agentstack add skill-flurdy-agent-skills-create-pr`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [flurdy](https://agentstack.voostack.com/s/flurdy)
- **Installs:** 0
- **Category:** [Productivity](https://agentstack.voostack.com/c/productivity)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [flurdy](https://github.com/flurdy)
- **Source:** https://github.com/flurdy/agent-skills/tree/main/skills/create-pr

## Install

```sh
agentstack add skill-flurdy-agent-skills-create-pr
```

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

## About

# Create Pull Request

Create a pull request from the current branch using project conventions.

## Usage

```
/create-pr
```

## Instructions

### 1. Gather Context

Run these commands to understand the current state:

```bash
# Get current branch name
git branch --show-current

# Check if branch needs pushing
git status -sb

# Get commits on this branch not on main
git log main..HEAD --oneline

# Get diff summary against main
git diff main...HEAD --stat
```

### 2. Extract Jira Ticket from Branch Name

Parse the branch name to find the ticket number:

- Pattern: `{type}/{TICKET-NUMBER}-{description}`
- Example: `feat/AB-123-sanitize-input` → `AB-123`
- Ticket format: 2-4 uppercase letters, dash, numbers (e.g., `AB-123`, `SSP-456`)

If no ticket found, ask the user.

### 3. Look Up Jira Ticket

Use the `/jira-ticket` skill or the Jira MCP tools directly to get ticket details for the PR description:

```
mcp__jira__jira_get with:
  path: /rest/api/3/issue/{ticketNumber}
  jq: "{key: key, summary: fields.summary, description: fields.description}"
```

### 4. Generate PR Title

Use conventional commit format based on branch prefix:

| Branch Prefix | PR Title Format |
|---------------|-----------------|
| `feat/` | `feat(): ` |
| `fix/` | `fix(): ` |
| `refactor/` | `refactor(): ` |
| `chore/` | `chore(): ` |
| `docs/` | `docs(): ` |
| `perf/` | `perf(): ` |

Infer the scope from changed files (e.g., `offers-cms`, `web`, `api`).

### 5. Generate PR Body

Analyze the actual code changes (use `git diff main...HEAD`) to write a meaningful description.

Check for a repo-specific PR template at `.github/pull-request-template.md` or `.github/pull_request_template.md`. If found, use that format. If not, ask user for confirmation on generating the body ourselves.

### 6. Push and Create PR

```bash
# Push branch with upstream tracking
git push -u origin {branch-name}
```

Create the PR targeting main:

```bash
~/.claude/skills/create-pr/scripts/gh-pr-create.sh --base main --title "{title}" --body "$(cat  --reason="PR # created: "
   ```

3. If multiple beads plausibly match, ask the user which (if any) to close with `AskUserQuestion`. If none match, skip silently — don't invent one.

4. Tell the user the bead was closed and how to reopen it if review requires major changes:

   ```bash
   bd update  --status=in_progress
   ```

Note: `/ready-to-merge` already closes a bead only "if still in_progress" post-merge, so closing here is compatible — by merge time it's normally already closed and that step no-ops.

### 8. Return Result

Output the PR URL so the user can view it, and note the bead that was closed (or left open, if none matched).

## Source & license

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

- **Author:** [flurdy](https://github.com/flurdy)
- **Source:** [flurdy/agent-skills](https://github.com/flurdy/agent-skills)
- **License:** MIT

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-flurdy-agent-skills-create-pr
- Seller: https://agentstack.voostack.com/s/flurdy
- 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%.
