Skip to content
Skills Library
Programming · Automation

create-pr

/create-pr

Push a completed clean feature branch and create a pull request for a Jira issue. Use when implementation and required quality gates have succeeded and the branch is ready for delivery.

Repository
ai-helpers ↗
Licence
Apache-2.0
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Push a completed clean feature branch and create a pull request for a Jira issue. Use when implementation and required quality gates have succeeded and the branch is ready for delivery.

Original author description

Push a completed clean feature branch and create a pull request for a Jira issue. Use when implementation and required quality gates have succeeded and the branch is ready for delivery.

How it works

  1. Name
  2. Synopsis
  3. Description
  4. Implementation
  5. Return Value
  6. Examples
  7. Arguments
  8. Guidelines
Original SKILL.md headings · 109 lines, 520 words
SKILL.md preview
---
name: create-pr
description: Push a completed clean feature branch and create a pull request for a Jira issue. Use when implementation and required quality gates have succeeded and the branch is ready for delivery.
---

## Name
openshift-developer:create-pr

## Synopsis
```text
/openshift-developer:create-pr <ISSUE_KEY> [--upstream <owner/repo>] [--head <fork-owner>:<branch>]
```

## Description
Creates a pull request from a completed feature branch and links it to a Jira issue. Reads the repo's PR template, inspects the commit log, and generates a well-structured PR title and body. It is the delivery building block selected by `jira-solve` after the chosen implementation and quality chain succeeds.

## Implementation

### Step 1: Gather context

1. Parse arguments:
   - `$1` — Jira issue key (required, e.g. `OCPBUGS-1234`)
   - `--upstream` — target repository (default: infer from `gh repo view --json nameWithOwner`)
   - `--head` — PR head ref in `fork-owner:branch` format (default: current branch)

2. Determine the current branch:
   ```bash
   BRANCH=$(git branch --show-current)
   ```

3. Discover remotes, then determine the base branch:
   ```bash
   REMOTE=$(git remote | head -1)
   BASE_BRANCH=$(git remote show "$REMOTE" | sed -n 's/.*HEAD branch: //p')
   ```
   Fall back to `main` if detection fails.

4. Read the commit history for the PR:
   ```bash
   git log "${BASE_BRANCH}..HEAD" --format="%h %s%n%n%b" --reverse
   ```

5. Read the PR template if it exists:
   ```bash
   cat .github/PULL_REQUEST_TEMPLATE.md 2>/dev/null || true
   ```

### Step 2: Compose the PR

1. **Title**: Must start with `<ISSUE_KEY>: ` followed by a concise summary derived from the commits.

2. **Body**: Structure using the PR template if one exists. Include:
   - A description of the changes based on the commit log
   - A link to the Jira issue: `https://redhat.atlassian.net/browse/<ISSUE_KEY>`
   - The following footer at the very end:
     ```text
     Always review AI generated responses prior to use.
     AI-assisted response via openshift-developer plugin
     ```

### Step 3: Create the PR

Before pushing, require `git status --short` to be empty. Refuse to push the default
branch or to force-push. Push the current feature branch to the selected remote, unless
the caller prohibits external writes. Do not create a PR when the branch was not pushed.

Build and run the `gh pr create` command:

```bash
gh pr create \
  --repo <UPSTREAM> \
  --head <HEAD_REF> \
  --no-maintainer-edit \
  --title '<ISSUE_KEY>: <summary>' \
  --body '<body>'
```

- If `--upstream` was provided, use it as `--repo`.
- If `--head` was provided, use it directly.
- If neither was provided, omit `--repo` and `--head` (defaults to current repo context and current branch).

### Step 4: Report

Print the PR URL returned by `gh pr create`.

## Return Value
- **PR URL**: the URL of the newly created pull request

## Examples

1. **Create a PR for a Jira issue (simple)**:
   ```text
   /openshift-developer:create-pr CNTRLPLANE-1234
   ```

2. **Create a PR targeting a specific upstream from a fork**:
   ```text
   /openshift-developer:create-pr OCPBUGS-5678 --upstream openshift/hypershift --head hypershift-community:fix/OCPBUGS-5678
   ```

## Arguments
- `$1` — Jira issue key (required)
- `--upstream` — target repository in `owner/repo` format (optional)
- `--head` — PR head ref in `fork-owner:branch` format (optional)

## Guidelines

- Discover remotes first (e.g. `git remote` or `git branch -vv`) before selecting one
- Always include the Jira issue key prefix in the PR title
- Always include the AI-generated footer at the end of the PR body
- Use the repo's PR template when available
- Derive the PR description from the actual commit log, not from assumptions

Versions

RepositoryScoreLicence
This page · openshift-eng/ai-helpers100Apache-2.0
wanteddev/montage-web100MIT
niekcandaele/claude-helpers100MIT
yonatangross/orchestkit100MIT
microsoft/aspire100MIT
rolemodel/skills100MIT
moeru-ai/airi100MIT
sakuro/dotfiles100MIT
fcakyon/claude-codex-settings100Apache-2.0

Database snapshot: 13.11.2026 · package version 7578d4c9d417 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90open-pr
    Bring the branch up to date, push it, open the pull request for an issue in the body shape of the repository, and watch CI. The implement-issue skill uses it. Use it directly when a branch is ready.
  • 100commit-push-pr
    Use when asked to commit and push a feature branch, with or without a pull request. Its no-PR mode publishes without a PR. Not for a PR body alone: use create-pull-request.
  • 100push
    Push current branch changes to origin and create or update the corresponding pull request; use when asked to push, publish updates, or create pull request.
  • 100push
    Push current branch changes to origin and create or update the corresponding pull request; use when asked to push, publish updates, or create pull request.
  • 100push
    Push current branch changes to origin and create or update the corresponding pull request; use when asked to push, publish updates, or create pull request.
  • 90push-pr
    Commits changes, pushes to remote, and creates or updates a pull request for the current branch. Use when the user says "push pr", "create pr", "push and create pr", or invokes "codagent:push-pr".

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.