Open a GitHub pull request

VerifiedSafe

Open a GitHub PR from the current branch using gh, filling the repo's PR template.

Sby Skills Guide Bot
DevelopmentBeginner
8/1/2026
Claude Code
#git#pull-request#github#cli#workflow

Recommended for

Automated summary

Opens a GitHub pull request from the current branch with gh, filling the repository's PR template from the actual diff.

Strengths

  • Reuses an already-open PR for the branch instead of creating a duplicate.
  • Fills every section of .github/pull_request_template.md from git log and git diff, leaving no placeholder comments behind.
  • Confirms the head branch differs from the base and pushes it with an upstream before creating anything.
  • Uses a concise commit-derived title and writes the body to a temp file passed via --body-file.

Limitations

  • Assumes gh is installed and authenticated and an origin remote exists; no error handling is described.
  • Relies on the PR template being present; behavior without one is unspecified.
  • Does not handle reviewers, labels, or draft PRs.
When to use it

Use when you are on a pushable feature branch and want a complete, review-ready PR in one pass.

When not to use it

Avoid it when you need reviewers, labels, or a draft PR, or when gh is not available.

Security analysis

Safe
Quality score86/100

The skill is a narrow, transparent git/gh workflow: it checks head vs. base, pushes the current branch to origin, reuses an existing open PR, fills the repo's PR template from the real diff, and creates the PR. No destructive commands, no secret/token handling, no obfuscation, no curl|sh, and the tool scope is tightly limited to git/gh/Read. The only residual impact is the inherent remote write of pushing a branch and opening a PR, which is exactly what the user asked for.

Findings
  • •Minor: step 5 writes the PR body to a temp file, but Write/Edit are not in the declared allowed-tools, so the workflow relies on shell redirection or an undeclared capability.
  • •Pushes branches and creates remote PRs (network write) without an explicit user confirmation step, though this is the stated purpose of the skill.
How this analysis is made

Examples

Open a PR to the default branch
Open a PR for this branch against the default base branch and fill in the repo's PR template.
Raise to a named base
Raise a PR to release/2.4 from the current branch — fill every section of .github/pull_request_template.md from the diff.
PR this branch, reuse existing
PR this branch. If there's already an open PR for it, just give me the URL.

name: open-pull-request description: 'Open a GitHub pull request from the current branch, filling the repo PR template. Use when the user wants to open, create, or raise a PR — to the default base branch or a branch they name. Triggers on "open a PR", "create a pull request", "raise a PR to <branch>", "PR this branch".' allowed-tools: Bash(git *), Bash(gh *), Read

Open Pull Request

Open a PR from the current branch with gh, filling .github/pull_request_template.md from the actual diff.

Steps

  1. Resolve head and base. Head = git branch --show-current. Base = the branch the user named, else the remote default from git symbolic-ref refs/remotes/origin/HEAD. If head equals base, stop — there is nothing to PR; tell the user to switch to a feature branch. Done when you hold a head and base that differ.

  2. Push the branch. Run git push -u origin HEAD. Done when the head branch has an upstream on origin.

  3. Reuse an existing PR. Run gh pr view --json url,state. If it returns an open PR for this branch, report the URL and stop. Done when no open PR exists.

  4. Draft the body from the template. Read .github/pull_request_template.md and fill every section from the real change — git log <base>..HEAD and git diff <base>...HEAD --stat:

    Keep it terse: bullets, not prose. Done when no template placeholder comment (<!-- … -->) survives.

  5. Create the PR. Write the body to a temp file, then run gh pr create --base <base> --title "<title>" --body-file <file>, where title is a concise summary drawn from the commits. Report the returned URL. Done when gh returns a PR URL.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/open-a-github-pull-request-ms9wnyea/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/open-a-github-pull-request-ms9wnyea' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/open-a-github-pull-request-ms9wnyea/download' --output '.skill-downloads/open-a-github-pull-request-ms9wnyea/SKILL.md.part' && mv '.skill-downloads/open-a-github-pull-request-ms9wnyea/SKILL.md.part' '.skill-downloads/open-a-github-pull-request-ms9wnyea/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Bash(git *), Bash(gh *), Read

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/open-a-github-pull-request-ms9wnyea/SKILL.md' && test -s '.skill-downloads/open-a-github-pull-request-ms9wnyea/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/open-pull-request' && cp -R '.skill-downloads/open-a-github-pull-request-ms9wnyea' '.claude/skills/open-pull-request'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/open-a-github-pull-request-ms9wnyea'

openskills read 'open-a-github-pull-request-ms9wnyea'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/open-a-github-pull-request-ms9wnyea/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills