open-pull-request
FreeNo executable scriptsNot checkedOpen a pull request from a feature branch with the GitHub CLI: fork base and head, title and body conventions, checks after. Use when asked to open a PR or…
by torrust★ 539 GitHub starsAbout this skill
Open a Pull Request
CLI vs MCP Decision Rule
- Inner loop (fast local branch work): prefer GitHub CLI (
gh pr create). - Outer loop (cross-system coordination): use MCP tools for structured/authenticated access.
Pre-flight Checks
Before opening a PR:
- Working tree is clean:
git status --shorthas no output. Do not open a PR while any tracked or untracked change is present. Commit the intended changes, or deliberately discard/stash unrelated changes first. - Upstream target repository confirmed from workspace metadata (
Cargo.toml→repository) - Branch is based on a recent upstream
develop(<upstream-remote>/develop): rungit fetch <upstream-remote>, then checkgit log --oneline HEAD..<upstream-remote>/develop. Rebasing before opening the PR is recommended and is required when the branch conflicts withdevelop(see Keeping the branch up to date). - Branch is pushed to your fork remote
- Commits are GPG signed (
git log --show-signature -n 1) - All pre-commit checks passed (
linter all,cargo machete, tests) - PR body claims are aligned with the actual commit range (
<upstream-remote>/develop..HEAD) - If manual verification used temporary local-only patches, PR body explicitly says they are not included
- PR body paragraphs are written as single continuous lines (no hard line wrapping)
Required pre-flight order
Run these checks immediately before gh pr create or an equivalent MCP creation request:
git status --short
git fetch <upstream-remote>
git log --oneline HEAD..<upstream-remote>/develop
Stop if the first command prints any path: restore a clean working tree first, so no uncommitted changes are accidentally omitted from, or confused with, the proposed commit range. If the final command prints commits, rebase on the fetched upstream develop before creating the PR unless that would be a bottleneck; the rebase is required when the branch conflicts with develop. A clean working tree is required both before rebasing and before opening the PR.
Keeping the branch up to date
Rebasing onto the latest upstream develop is recommended, not required, as recorded in the
ADR to stop requiring pull-request rebases.
A rebase detects integration problems before merge; the requirement was dropped only to reduce CI
CPU consumption and runner costs. Rebase:
- when opening a PR;
- when you know
develophas changed since your last push; and - in general, whenever you can and it is not a bottleneck or a problem.
Skip a recommended rebase that would be a bottleneck or a problem, for example when a queue of open PRs would rerun expensive CI after every merge, or when an in-progress review round cites the current commit ids. A rebase or other update is required only when:
- the branch conflicts with
develop; - it needs a change that landed on
developlater, or a reviewer asks for the combination to be tested before merge; or - the maintainer merge tool refuses it because GitHub's recorded base is stale and its own
refresh is unavailable (see the
merge-pull-requestskill).
# Identify the upstream remote (commonly "torrust"; verify with git remote -v)
UPSTREAM_REMOTE=torrust # replace if your remote has a different name
git fetch $UPSTREAM_REMOTE
git rebase $UPSTREAM_REMOTE/develop
# Then push (use --force-with-lease when rewriting history)
git push --force-with-lease <fork-remote> <branch-name>
Because a rebase rewrites the branch's commit ids and rebases still happen, no durable reference may
cite a PR-branch commit by id. Durable references are repository artifacts (issue specs, evidence
files, review audits), the PR body, which the maintainer merge tool copies into the merge commit,
and review replies, which stay on GitHub after the branch is rewritten.
Cite the Conventional Commit subject instead; ids are durable only once on develop. The rule holds
whether or not the branch is ever rebased: an id cited during a normal review round becomes wrong at
the next rebase. Run this check from the repository root before every push that changes an issue
spec, evidence file, or review audit, and before pushing after a rebase:
UPSTREAM_REMOTE=torrust # replace if your remote has a different name
git diff -z --name-only --diff-filter=d "$UPSTREAM_REMOTE/develop"...HEAD |
xargs -0 -r grep -IohE '\b[0-9a-f]{7,40}\b' | sort -u |
while read -r token; do
git rev-parse -q --verify "$token^{commit}" >/dev/null || continue
git merge-base --is-ancestor "$token" "$UPSTREAM_REMOTE/develop" ||
echo "PR-branch commit id: $token"
done
Empty output means no file the branch changes cites a commit that is not on develop. The check
scans every changed text file, not only the issue folder, so it also covers review audits and
evidence files. It keeps al
Install open-pull-request in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the open-pull-request skill do?
Open a pull request from a feature branch with the GitHub CLI: fork base and head, title and body conventions, checks after. Use when asked to open a PR or submit a branch for review.
How do I install the open-pull-request skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the open-pull-request skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
by Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
by Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
by Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
by Anthropic