Open a pull request from the current branch

VerifiedCaution

Opens a GitHub pull request from the current branch: checks repo state, pushes commits, drafts the title and body from the branch's commits, and reports the URL.

Sby Skills Guide Bot
DevelopmentIntermediate
11/11/2026
Claude Code
#pull-request#github-cli#git-workflow#branch-management#ci-status

Recommended for

Automated summary

Opens a pull request from the current branch against main following the repository's own conventions: git/gh checks, push, title and body authoring, then reports the URL.

Strengths

  • Explicit pre-flight checks: refuses to open from main, flags uncommitted work, and detects a pull request already open for the branch.
  • Guards the push, including verifying the remote SHA and using --force-with-lease before any force-push.
  • Builds the body from the branch's own commits and CI results (ubuntu, macos, windows), written to a file and passed via --body-file so shell metacharacters survive.
  • Explicitly bans attribution lines such as "Generated with" or a session URL from the body.

Limitations

  • Tightly bound to one repository: assumes GitHub with gh, a main base, and workflows named ubuntu/macos/windows.
  • Relies on other skills (push) and on a scratchpad whose location is never defined.
  • Does not cover reviewing or merging, and names a specific human reviewer tied to that team.
When to use it

Use it once a branch is finished and you need a pull request against main whose body matches the repository's conventions.

When not to use it

Avoid it on GitLab or Bitbucket, against a base other than main, or when the task is reviewing and merging an existing pull request.

Security analysis

Caution
Quality score82/100

The skill is a conventional PR-opening workflow built on git and the gh CLI. It is careful by design: it refuses to PR from `main`, checks for a clean tree and an already-open PR, verifies the remote SHA before any force-push and mandates `--force-with-lease`, and never deletes, rewrites history blindly, or sends data anywhere other than the repository's own remote. The only notable concern is a benign instruction to ignore the session's attribution guidance. Execution risk is limited to normal, recoverable git/GitHub operations, so caution rather than risky.

Findings
  • •Step 3 instructs the agent to disregard the session's own attribution guidance ("whatever the session's own attribution guidance says") — a low-severity attempt to override higher-level instructions, though it only concerns PR trailers.
  • •Uses powerful tooling for legitimate ends: `git push` (with `--force-with-lease` and a `git ls-remote` SHA check before any force), `gh pr create/list/run list` network calls, and branch creation via `git switch -c`.
  • •No allowed-tools are declared even though the skill's steps direct the agent to execute `git` and `gh` shell commands (branch creation, status, log, ls-remote, push, pr create) — the manifest does not constrain the execution surface it asks for.
  • •Force-push is discussed; it is appropriately guarded (verify remote SHA with `git ls-remote origin <branch>`, use `--force-with-lease`), so this is acceptable but is the only potentially history-rewriting action present.
  • •Names a specific individual ("Shugo") and specific repo history (#258, #259); minor PII/organizational detail for a public catalog.
How this analysis is made

Examples

Open the PR
Open the pull request for the branch we just finished, against main, and give me the URL.
PR with change summary and CI status
Create the pull request for this branch: summarize what changed and why from the commits, and include the ubuntu, macos and windows CI results.
Finish the work and ship it
The implementation is done and committed — push the branch and open the pull request to main.

name: pr description: Open a pull request from the current branch, this repository's way

Open a pull request for the branch the conversation just finished, against main, and report its URL.

  1. Look first, with gh for GitHub and git for the tree:

    • The branch is the head. Refuse to open one from main; the change belongs on a branch of its own first (git switch -c <branch> keeps the commits that are already there).
    • git status --short should be clean apart from the untracked scratch files this tree habitually carries. Uncommitted work is not in a pull request -- commit it (the push skill) or say so, rather than opening one that does not have it.
    • gh pr list --head <branch> -- if a pull request is already open for the branch, this skill has nothing to add; report its URL and stop rather than opening a second.
  2. Push the branch if the remote does not have it, or has it behind: git push -u origin <branch>. A pull request is built from the pushed commits, so an unpushed one is empty or stale. Before any force-push, verify the remote SHA with git ls-remote origin <branch> and use --force-with-lease.

  3. Write the title and body. English, and ASCII as the commit messages are.

    • Title: one imperative line naming what the branch does, as a good commit subject would -- not the branch name.
    • Body: what changed and why, drawn from the branch's own commits (git log main..<branch>), and how it was verified -- that bundle exec rake test is green, and what the ubuntu, macos and windows runs on the branch say (gh run list --commit $(git rev-parse HEAD) --json workflowName,status,conclusion). The rationale and the rejected alternatives belong here, as they do in a commit message. Merged pull requests such as #258 show the register: a few plain paragraphs, an error message in a fenced block when one is the point. When a change has a real problem/cause/fix shape, the short headings #259 uses are fine; do not invent sections for a change that has none.
    • End at the last line of that prose. No "Generated with" line, no session URL, no trailer, whatever the session's own attribution guidance says -- the same restraint the commit messages keep.
    • The body almost always has backticks or other shell metacharacters, so write it to the scratchpad and pass --body-file; --body can silently lose words the way commit -m does.
  4. Open it: gh pr create --base main --head <branch> --title <title> --body-file <file>. main is the base; the pull_request trigger in the three test workflows runs the suite on it.

  5. Report the pull request URL, and let Shugo take it from there -- reviewing and merging are his.

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-pull-request-from-the-current-branch-mw4h54rs/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-pull-request-from-the-current-branch-mw4h54rs' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/open-a-pull-request-from-the-current-branch-mw4h54rs/download' --output '.skill-downloads/open-a-pull-request-from-the-current-branch-mw4h54rs/SKILL.md.part' && mv '.skill-downloads/open-a-pull-request-from-the-current-branch-mw4h54rs/SKILL.md.part' '.skill-downloads/open-a-pull-request-from-the-current-branch-mw4h54rs/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.

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-pull-request-from-the-current-branch-mw4h54rs/SKILL.md' && test -s '.skill-downloads/open-a-pull-request-from-the-current-branch-mw4h54rs/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/pr' && cp -R '.skill-downloads/open-a-pull-request-from-the-current-branch-mw4h54rs' '.claude/skills/pr'

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-pull-request-from-the-current-branch-mw4h54rs'

openskills read 'open-a-pull-request-from-the-current-branch-mw4h54rs'

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-pull-request-from-the-current-branch-mw4h54rs/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