Prepare, verify, and publish a scoped GitHub pull request. Use when the user asks to commit local work, push a feature branch, or create or verify a GitHub PR. This workflow always uses main as the PR base branch.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Github Pr?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/damacus-github-pr)
---
name: github-pr
description: Prepare, verify, and publish a scoped GitHub pull request. Use when the user asks to commit local work, push a feature branch, or create or verify a GitHub PR. This workflow always uses main as the PR base branch.
---
# GitHub Pull Request Workflow
> Upstream attribution: Adapted from the original [`github-pr` skill](https://github.com/damacus/skills/blob/b97d545a1099c1096bbaf9e346f833526b849a56/skills/workflow/github-pr/SKILL.md) authored by Dan Webb in `damacus/skills` commit `b97d545`.
Use this skill to take an explicitly selected local change through a conventional commit, push, and GitHub pull request. `main` is always the base branch. Do not discover or substitute another default branch unless the user explicitly overrides this rule.
Run GitHub CLI commands with elevated network access. Check `gh auth status` before the first GitHub write and ask the user to run `gh auth login` if authentication fails.
## Workflow
### 1. Inspect the work and current publication state
- Inspect `git status --short`, `git diff`, and `git diff --cached` before staging anything.
- Identify the exact files that belong to the requested work. Preserve unrelated staged, unstaged, and untracked changes.
- Check whether the current branch already has a PR with `gh pr list --head <branch> --state all`. If it has an open PR, verify and summarize that PR instead of creating a duplicate. If it is closed or merged, do not reuse the branch without explicit user direction.
- Refresh `origin/main` before creating a new feature branch. Do not silently rebase, reset, stash, or rewrite any worktree state.
### 2. Create or verify the feature branch
- Never commit the requested work directly on `main`.
- If starting from `main`, create a branch from refreshed `origin/main` with `git switch -c codex/<type>-<short-slug> origin/main`.
- If the current branch is detached, create an appropriately named branch before committing. If it is an existing feature branch, confirm that it is the intended branch and does not already have a conflicting PR.
- Prefer `codex/` branch names, with an appropriate type such as `feat`, `fix`, `docs`, `chore`, or `refactor`.
### 3. Summarize and stage only the selected changes
- Summarize the selected diff in plain language before writing the commit message.
- Produce a concise conventional commit subject that describes the user-visible intent. Keep it under 50 characters when practical.
- Stage explicit paths only: `git add -- <selected-paths>`. Never use `git add .` or `git add -A` by default.
- Inspect `git diff --cached --stat` and run `git diff --cached --check` before committing. If unrelated files are staged, stop and ask the user which changes belong in the PR.
### 4. Verify the change
- Identify the repository's normal validation commands from its documented project contract, CI configuration, or task runner.
- Run the relevant checks before publishing. For documentation-only work, use focused validation such as repository-provided linting plus `git diff --check` when no runtime test applies.
- Report the exact commands and outcomes in the task conversation, not the PR description. Do not claim tests passed when they were not run.
- If required validation fails because of this change, fix it before publishing. If it is demonstrably pre-existing, report that evidence and ask whether to publish a draft PR.
### 5. Commit and push
- Commit only after the staged diff and validation match the requested scope: `git commit -m "<conventional subject>"`.
- Push the current branch with upstream tracking: `git push -u origin HEAD`.
- After pushing, check again for an existing PR for the exact branch. Do not create a second PR if one already exists.
### 6. Create and verify the PR
- Create a ready PR only when the relevant validation passed. If validation is incomplete or failed for a reason the user accepts, ask whether to create a draft instead.
- Use explicit, non-interactive GitHub CLI arguments:
```fish
gh pr create --base main --head <branch> --title "<conventional subject>" --body "<PR body>"
```
- Write the title and body using the PR description style below.
- Do not add a Verification, Testing, Test Plan, or CI Results section. Keep validation evidence in the task conversation.
- Include upgrade instructions or breaking changes only when readers need to act on them.
- Verify the created or existing PR with `gh pr view <number> --json number,url,state,isDraft,baseRefName,headRefName,title`.
- Report the PR URL, branch, commit, base (`main`), validation results, and any known follow-up.
## PR Description Style
The title and opening paragraph must pass the **passer-by test**: could someone unfamiliar with the task understand what changed and why it matters?
- Say what was added, removed, fixed or improved in simple terms.
- Lead with the change users or maintainers will notice and why it helps them.
- Prefer one short paragraph and a few concrete bullets. Use headings only when they help the reader.
- Keep technical detail only when it is needed to understand the change or take an upgrade action. Explain necessary project terms; avoid internal implementation jargon.
- Do not repeat anything CI measures or reports: test counts, pass/fail results, lint or formatting results, coverage, build status, check commands, job lists or routine validation checklists.
- Omit branch synchronisation, merge-conflict resolution, commit hashes and the history of the work from the description.
- State compatibility changes and required user actions clearly, without burying them in implementation details.
- Read the title and opening paragraph on their own before publishing. Replace vague claims such as "modernise the architecture" with the actual improvement.
Example:
```markdown
Makes removing HAProxy configuration safer and adds clearer setup instructions.
* Adds a migration guide with examples for common setups.
* Fixes installation on newer Linux releases.
* Keeps unrelated configuration when removing an entry.
## Upgrading
Debian 12 or newer is now required. Removing a user list removes the whole list.
```
## Write Safety
- Invoking this skill to publish authorizes the normal commit, push, and PR-creation sequence. If the user asks only for a draft, analysis, status, or a commit without a PR, stop at that boundary.
- Do not amend existing commits, force-push, rebase, reset, stash, close PRs, or alter unrelated files unless the user explicitly asks.
- Do not create a duplicate PR. Existing PR status is a result to report, not an error to work around.
- Do not add reviewers, labels, assignees, projects, or milestones unless the user requests them.
- If GitHub authentication, repository access, branch push, or PR creation fails, report the precise blocker and leave the local commit intact.
## Completion Criteria
A publication request is complete only when the selected change is committed, pushed to its intended feature branch, represented by one verified PR against `main`, and accompanied by an accurate validation summary in the task conversation. Keep CI-measured results out of the PR description.