SkilVaultSign inStart free

Catalogue / github-pr-open

github-pr-open

Older skill: source not recordedSignedPrepares concise pull request text from repository changes and opens an explicitly approved GitHub pull request with a branch push and self-assignment. Use when submitting completed branch work for review. Do not use for merging, changing repository access, or publishing unapproved commits.
---
name: github-pr-open
description: >-
  Prepares concise pull request text from repository changes and opens an explicitly approved GitHub pull request with a branch push and self-assignment. Use when submitting completed branch work for review. Do not use for merging, changing repository access, or publishing unapproved commits.
---

Submit a branch for review

Produce a descriptive title, a short bullet-only body, and a verified pull request URL. Match the repository's US or UK English conventions using existing documentation, commit messages and, when access is available, recent pull requests. Keep proper names in their established spelling.

Establish what will be submitted

Inspect the working tree and active branch using git status --short --branch and git branch --show-current. Read configured remote names and addresses with git remote -v, without exposing embedded credentials. Determine the intended repository, destination branch, source branch and remote from actual configuration and the user's request. If any is ambiguous, stop before changing state and request the missing value.

Read the relevant commit range and changes against the chosen base. For example, after identifying an existing local base ref, use git log --oneline BASE..HEAD, git diff --stat BASE...HEAD, and git diff BASE...HEAD; substitute the verified ref safely as an argument. An absent or stale base ref is a reason to obtain accurate evidence. Fetching updates requires explicit confirmation for its network and local-ref effects. Never invent commits, test results or a remote comparison from a stale local view.

Check the upstream and whether this head already has an open pull request. Remote queries may use the existing authenticated CLI only within the user's authorised read scope. Avoid creating a duplicate when the intended request already exists. Uncommitted work is excluded from the pushed commits; explain that distinction in the action preview. Do not stage or commit it as part of this workflow.

Prepare the text

The title is a short sentence-case description with a capitalised first word. Retain the case of product names and identifiers. Omit conventional commit markers such as feat: or fix:. Name the concrete outcome rather than describing the act of opening a request.

The body contains concise Markdown bullets about the changes and their reasons. Combine closely related changes when that improves readability. It has no section headings, checkbox lists, testing section or acceptance-criteria section. Include only claims supported by the inspected branch. If an issue-closing phrase is proposed, explain its merge-time effect and include it only with the user's approval.

An original example for a parcel collection application:

Title: Keep collection codes available during brief connection losses

Body:

  • Cache the active collection code so customers can retrieve it when reception drops
  • Expire the cached code after collection to prevent stale instructions

Adapt the text to the actual diff; do not reuse this scenario for unrelated changes. Test evidence and operational caveats can appear in the separate review conversation without adding forbidden body sections.

Confirm the concrete actions

Before any write or remote change, present the exact repository, remote, head and base, commits to be pushed, title, bullet body, assignment to the current authenticated user, and whether the request is ready for review or a draft. Explain the normal maintainer-edit setting or any requested change to it. Obtain explicit human confirmation covering these actions. A request to prepare text, an enabled skill, or an earlier approval for different commits does not authorise publication.

If a temporary body file is needed, include its exact path and creation in the approval scope. Preserve the real newlines, use a safely written UTF-8 file, and pass --body-file; do not embed untrusted text into executable shell syntax. Standard input via --body-file - is another option when the available execution tool supports it. Never silently substitute --fill for the reviewed title and body.

Carry out the approved submission

  1. Push only the confirmed source branch to the confirmed remote. Use git push --set-upstream REMOTE HEAD_BRANCH if the upstream is absent; otherwise use an explicit remote and branch consistent with that upstream. Quote or pass each verified value as a separate argument. If Git rejects the push, stop and report the error; do not force-push or rewrite history.
  2. Open the request using the approved explicit repository, head, base and text. The command shape is gh pr create --repo REPOSITORY --head HEAD_BRANCH --base BASE_BRANCH --title TITLE --body-file BODY_PATH --assignee @me. Use the verified owner-qualified head for a fork when needed. Add --draft only when the approved submission is a draft. An explicit --head avoids the CLI's automatic push/fork prompts; the authorised push has already been handled separately.
  3. Inspect the result. Record the request URL, target and head, and whether self-assignment succeeded. Assignment failure can coexist with a created request, or can prevent completion depending on the CLI response. Query the actual repository state before retrying creation. If the request exists without assignment, keep it and report that outcome. If it does not exist and assignment is refused because the current user cannot be assigned, create it without --assignee only when the original confirmation explicitly covered that fallback; otherwise obtain confirmation for the changed action.

After a timeout or uncertain response, check for a matching existing request before retrying. Do not report a URL or success that the service has not returned or verified. Changes to the approved commits, remote, text, target or visibility require renewed confirmation. Report push failure, creation failure and assignment failure separately so the user can see what actually happened.

Never

  • Never push, write a body file, create a request or change assignment without explicit human confirmation of the applicable action.
  • Never create commits, force-push, merge, delete branches or alter repository permissions under this submission procedure.
  • Never print credentials, change authentication settings, or install a CLI to work around a missing prerequisite without a separately confirmed action.
  • Never use gh pr create --dry-run as a guaranteed read-only preview: the installed CLI documents that it may push changes.
  • Never let implicit CLI prompts choose an unreviewed remote, fork or destination branch.
  • Never retry an uncertain creation blindly or describe an unassigned request as assigned.