Skip to content
Back to skills

Github Pr Publish

ASecurity

Use only when the user explicitly requests `github-pr-publish`, or its publication phase through `github-pr-codex-review-cycle`, `github-pr-publish-and-ai-review-request`, or `github-issue-delivery`, for specified local branches or worktrees. Publish as a PR without requesting AI review in this phase.

  • 2 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 26, 2026
securitygorailsgit

Security analysis

A100/100

Scanned November 26, 2026

npx -y skills add daisukekobayashi/dotfiles --skill github-pr-publish --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Github Pr Publish?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Github Pr Publish
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/daisukekobayashi-github-pr-publish-dotfiles/badge)](https://www.skillsdirectory.com/skills/daisukekobayashi-github-pr-publish-dotfiles)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: github-pr-publish
description: Use only when the user explicitly requests `github-pr-publish`, or its publication phase through `github-pr-codex-review-cycle`, `github-pr-publish-and-ai-review-request`, or `github-issue-delivery`, for specified local branches or worktrees. Publish as a PR without requesting AI review in this phase.
---

# GitHub PR Publish

## Scope

Use this orchestration skill to publish one or more local branches or worktrees
as GitHub pull requests. It covers the normal path from local changes to a
remote PR: inspect state, verify, commit when needed, push, and create or reuse
the PR. Pull request templates are optional; use them when present and fall
back to a minimal generic PR body when absent.

This skill is not for:
- implementing feature changes before publication
- applying review feedback
- requesting AI, Copilot, Codex, or human review
- merging pull requests
- deleting branches or worktrees
- force pushing
- cleaning up after merge

## Approval Model

An explicit publication request can arrive directly or through the named
composing workflows. Require a delegated caller to forward the actual user
request, exact target, and existing authorizations; a skill reference or automatic
selection is insufficient. Subject to governing approval instructions, treat
the explicit publication request as approval for ordinary non-destructive commits
and normal pushes for the requested target branches. Ask for any missing approval
after preparing the verified publication target.

Still stop and ask before any action outside that narrow scope, including:

- force push, branch deletion, reset, rebase, amend, or merge
- staging secret-like files, credentials, tokens, private keys, or local-only config
- staging unrelated files that are not part of the requested work
- staging or publishing dependency manifests or lockfiles when the user did not explicitly ask for those changes
- publishing from the default branch

## Workflow

1. Resolve targets.
   - Identify each branch or worktree requested by the user.
   - If no target is specified, use the current worktree and branch.
   - For multiple targets, process them sequentially and stop on the first failure.
2. Resolve repository context for each target.
   - Confirm the target is inside a git repository.
   - Resolve the current branch with `git branch --show-current`.
   - Resolve the remote repository with `gh repo view --json nameWithOwner,url,defaultBranchRef`.
   - Stop if the current branch is the default branch.
3. Inspect local state before changing anything.
   - Run `git status --short --branch`.
   - Run `git diff --stat`.
   - Run `git diff --check`.
   - If `git diff --check` fails, stop and report the whitespace or conflict-marker problem.
   - Run `git log --oneline <default-branch>..HEAD` when the default branch is available locally.
   - Look for untracked or modified secret-like files such as `.env`, credentials, tokens, private keys, or local config. Do not stage them; stop or ask when they affect the requested commit.
   - Separate requested work from unrelated local changes. Do not stage unrelated files.
4. Confirm there is publishable work.
   - If the branch has no commits ahead of the base and no working tree changes for the requested work, stop and report that there is nothing to publish.
   - If there are working tree changes for the requested work, plan one logical commit from the implementation diff and the current conversation context.
   - If the branch already has suitable commits and no requested working tree changes, skip committing.
5. Confirm recent verification.
   - If the current conversation already has a successful verification log after the target's latest code changes, use it.
   - Otherwise determine the repository's required verification command from local guidance and run it before committing.
   - If the required verification command is not discoverable, ask the user which command to run before publishing.
   - If verification fails, stop that target and report the likely cause without committing, pushing, or creating a PR.
6. Commit when needed.
   - Use the `git-commit` skill for staging and commit message generation.
   - Stage only files belonging to the requested work.
   - Derive the commit message from the implementation diff, issue context, branch name, and current conversation.
   - Never stage secrets or unrelated local files.
7. Push the branch.
   - `<remote>` is the repository remote resolved in step 2. The PR base branch is the existing PR's base, otherwise the base `github-pr-create` uses: the default branch unless the user specifies another base.
   - Read the upstream with `git config --get branch.<branch>.remote` and `git config --get branch.<branch>.merge`; no output means no upstream.
   - Continue when there is no upstream, the same branch name on `<remote>`, or the PR base branch, local or remote-tracking. Stop and report any other upstream, such as a differently named branch or another remote; it may back an existing PR.
   - Push with `git push -u <remote> <branch>:refs/heads/<branch>`. The explicit refspec keeps a base upstream or `push.default=upstream` from sending the branch to the base. This sets the upstream for the same branch name; report it when it replaced the PR base branch.
   - Re-read the upstream; stop and report unless the remote is `<remote>` and the merge ref is `refs/heads/<branch>`.
   - Do not force push, delete remote branches, or rewrite history.
8. Create or resolve the PR.
   - Use the `github-pr-create` skill for the target branch.
   - That skill should use a pull request template when present and a minimal generic body when no template exists.
   - That skill should apply its related issue rules: `Closes #123` for issues fully completed by the PR, and `Refs #123` for parent trackers, partial work, follow-ups, or context.
   - Reuse an existing PR when one already exists for the branch.
9. Verify and report the result.
   - Run `gh pr view --json number,url,title,state,baseRefName,headRefName`.
   - Report the branch, commit SHA if one was created, push target, PR URL, whether the PR was new or existing, and the verification command/result.

## Output Format

Use this structure:

```markdown
**Published**
- Branch: `<branch>`
- Commit: `<sha>` or "No new commit needed"
- Push: `<remote>/<branch>`
- PR: <url>
- Verification: `<command>` passed

**Notes**
- <any skipped files, existing PR reuse, or follow-up needed>
```

For multiple targets, repeat the same fields per target.

## Guardrails

- Do not proceed to commit, push, or PR creation until verification has succeeded for the target's latest changes.
- Do not continue to later targets after a verification, commit, push, or PR creation failure.
- Do not create a PR from the default branch.
- Do not create duplicate PRs for a branch that already has one.
- Do not force push, merge, delete remote branches, rewrite history, or clean up worktrees.
- Do not stage dependency manifests or lockfiles, edit them, or install dependencies unless the user explicitly asks.
- Do not hardcode or print secrets while summarizing diffs, commits, or templates.
- Do not request AI, Copilot, Codex, or human review.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.