pr
Skill1 starsChanged 18 days agoApache-2.0View on GitHub
Make a change and open a GitHub PR from a fork: sync the fork, branch, verify, push and open the PR upstream. Use for \"/pr\", \"create a PR\", \"open a pull request\".
- Commits and pushes
In this repository20 other files it gives its agents.
- deep-code-reviewSkill
- feature-pipelineSkill
- github-updatesSkill
- idea-side-sessionSkill
- mergeSkill
- model-benchSkill
- repo-reviewSkill
- re-reviewSkill
- run-ledgerSkill
- rust-best-practicesSkill
- rust-reviewSkill
- stage-approveSkill
- stage-buildSkill
- stage-intakeSkill
- stage-reviewSkill
- stage-scopeSkill
- stage-spikeSkill
- startSkill
- submit-reviewSkill
- work-evaluationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
43 rules. About 0 are common, 29 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈29
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Use this skill to turn the user's change context into a GitHub pull request using their fork as the head repository.
- Very specific: line 17
Treat the text after /pr as the context for the change to implement.
- Distinctive: line 18
Prefer doing the work end to end.
- Very specific: line 20
Use the GitHub CLI (gh) and Git.
- Distinctive: line 22
Keep the user's uncommitted work safe.
- Distinctive: line 24
Use the repository's actual default branch.
- Distinctive: line 25
Use a fork remote owned by the authenticated GitHub user.
- Very specific: line 45
If the user did not provide a branch name, create one from the context using <type>/<ticket>-<short-kebab-slug>, or …
- Distinctive: line 57
Run these checks before changing branches or remotes:
- Distinctive: line 68
If the worktree is dirty:
- Distinctive: line 71
If they are relevant, carry them forward carefully onto the PR branch.
- Distinctive: line 72
If they are unrelated or hard to classify, pause and ask which changes belong in the PR.
- Very specific: line 79
If the current GitHub repo is a fork, use its parent.nameWithOwner as the upstream target.
- Very specific: line 93
If the upstream repository is already owned by GH_USER, a separate fork is not needed.
- Distinctive: line 105
If it does not exist, create it:
- Very specific: line 115
If no local remote points at the fork, add one.
- Very specific: line 124
Avoid running gh repo fork --remote without --remote-name in an existing clone because it can rename the current origin remote.
- Very specific: line 137
If gh repo sync reports that the fork default branch cannot be fast-forwarded, stop and explain the situation.
- Distinctive: line 143
Create the feature branch from the synced fork default branch:
- Very specific: line 150
Before creation, verify an inferred name contains the required slash-delimited type prefix.
- Distinctive: line 153
If the requested branch already exists:
- Distinctive: line 158
If relevant dirty work was present before the branch switch, verify it carried over cleanly with git status --short and git diff.
- Distinctive: line 173
Run the narrowest meaningful verification first, then broader checks if the change touches shared behavior.
- Distinctive: line 177
Commit only the intended files:
- Distinctive: line 184
If the user already had relevant commits, do not rewrite them unless needed.
- Very specific: line 188
Before pushing or opening a non-draft PR, run a reviewer-minded readiness pass over the final diff.
- Distinctive: line 206
If the repository publishes a filtered or sanitized public tree, do public-tree files, Make targets, scenarios, and docs still work after …
- Very specific: line 209
Do scripts fail fast for invalid flags, missing files/images/tools, contradictory options, unsupported platforms, and warm retries?
- Distinctive: line 211
Do config/schema changes keep parsers, shell helpers, Terraform/cloud-init, docs, and tests aligned, including defaulted and legacy syntax …
- Distinctive: line 214
If the pass finds material issues, fix them before creating or marking the PR ready.
- Distinctive: line 243
Look for repository PR templates:
- Distinctive: line 251
Use a template when one clearly applies.
- Distinctive: line 260
No per-commit or per-review-round history.
- Distinctive: line 262
Leave out: rationale essays, alternatives the reviewer did not ask about, review-tool round logs, and @-mentions (ping reviewers in Slack …
- Distinctive: line 285
Create the PR from the fork branch to upstream default:
- Very specific: line 296
Add --draft only when the user asked for a draft or the work is intentionally not ready for review.
- Distinctive: line 308
Commit hash or short commit summary
- Distinctive: line 312
If the PR could not be created, leave the branch and commits intact, explain the blocker, and give the exact next command or decision …
- Very specific: line 317
Origin is already the user's fork: use origin as FORK_REMOTE.
- Distinctive: line 322
User wants a PR for existing local commits: do not recreate the branch just for ceremony.
- Distinctive: line 326
Protected upstream branch: never push the feature branch to upstream unless the user explicitly asks and has permission.
- Very specific: line 329
Sync requires force: ask before gh repo sync --force.
- Distinctive: line 331
No changes after implementation: do not create an empty PR.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PR
Use this skill to turn the user's change context into a GitHub pull request using their fork as the head repository.
Operating Model
- Treat the text after
/pras the context for the change to implement. - Prefer doing the work end to end. Ask a question only when the requested change or target repository is genuinely ambiguous.
- Use the GitHub CLI (
gh) and Git. Avoid browser-only PR creation unless the CLI is blocked. - Keep the user's uncommitted work safe. Inspect it, preserve it, and never reset, discard, or silently stash changes.
- Use the repository's actual default branch. Do not assume
main. - Use a fork remote owned by the authenticated GitHub user. If the current remote already points to that fork, reuse it instead of adding a duplicate.
Required Tools
git- Authenticated
ghCLI with access to the target repository - Network access to GitHub
Workflow
1. Understand The Request
Identify:
- The requested code or documentation change.
- The target repository.
- Any branch name, PR title, issue number, reviewers, labels, or draft/ready preference the user supplied.
If the user did not provide a branch name, create one from the context using
<type>/<ticket>-<short-kebab-slug>, or <type>/<short-kebab-slug> when there
is no ticket, for example feat/PROJ-361-session-threading or
docs/demo-runbook. Infer the same type vocabulary used for Conventional Commit
titles. The slash after the type is required; do not create flat names such as
feat-PROJ-361-session-threading or generic agent-prefixed names such as
codex/... or claude/.... Preserve an exact branch name when the user
explicitly supplies one, and follow a stricter local repository convention when
one exists.
2. Inspect Repository State
Run these checks before changing branches or remotes:
git rev-parse --show-toplevel
git status --short
git branch --show-current
git remote -v
gh auth status
gh repo view --json name,nameWithOwner,defaultBranchRef,parent,isFork,owner,urlIf the worktree is dirty:
- Decide whether the changes are part of the user's requested PR.
- If they are relevant, carry them forward carefully onto the PR branch.
- If they are unrelated or hard to classify, pause and ask which changes belong in the PR.
3. Identify Upstream And Fork
Determine the upstream repository that should receive the PR:
- If the current GitHub repo is a fork, use its
parent.nameWithOwneras the upstream target. - Otherwise, use the current repo's
nameWithOwneras the upstream target.
Determine the authenticated GitHub user and desired fork repo:
GH_USER=$(gh api user --jq .login)
UPSTREAM_REPO=<owner/repo>
REPO_NAME=$(gh repo view "$UPSTREAM_REPO" --json name --jq .name)
DEFAULT_BRANCH=$(gh repo view "$UPSTREAM_REPO" --json defaultBranchRef --jq .defaultBranchRef.name)
FORK_REPO="$GH_USER/$REPO_NAME"If the upstream repository is already owned by GH_USER, a separate fork is not
needed. In that case, use the existing write remote as the head remote and still
create a feature branch.
4. Create Or Reuse The Fork Remote
First check whether the fork exists:
gh repo view "$FORK_REPO" --json nameWithOwner,urlIf it does not exist, create it:
gh repo fork "$UPSTREAM_REPO" --clone=false --default-branch-onlyFind an existing local remote whose URL points at FORK_REPO. If one exists,
use that as FORK_REMOTE. Common cases are origin, fork, or the user's
login.
If no local remote points at the fork, add one. Prefer the name fork; if that
name is already used for a different repository, use the GitHub login or a
similarly clear name.
git remote add fork "https://github.com/$FORK_REPO.git"
FORK_REMOTE=forkAvoid running gh repo fork --remote without --remote-name in an existing
clone because it can rename the current origin remote. If you use --remote,
pass an explicit remote name.
5. Sync The Fork Default Branch
Bring the fork's default branch up to date from upstream before branching:
gh repo sync "$FORK_REPO" --source "$UPSTREAM_REPO" --branch "$DEFAULT_BRANCH"
git fetch "$FORK_REMOTE" "$DEFAULT_BRANCH"If gh repo sync reports that the fork default branch cannot be fast-forwarded,
stop and explain the situation. Only use --force after explicit user approval,
because it hard-resets the fork's default branch to upstream.
6. Create The PR Branch
Create the feature branch from the synced fork default branch:
git switch -c "$BRANCH_NAME" "$FORK_REMOTE/$DEFAULT_BRANCH"
git config "branch.$BRANCH_NAME.gh-merge-base" "$DEFAULT_BRANCH"Before creation, verify an inferred name contains the required slash-delimited
type prefix. Examples: fix/PROJ-410-finalization, chore/ci-cleanup.
If the requested branch already exists:
- Reuse it if it clearly belongs to this task.
- Otherwise create a unique suffix or ask before overwriting anything.
If relevant dirty work was present before the branch switch, verify it carried
over cleanly with git status --short and git diff.
7. Make And Verify The Changes
Implement the requested change on the PR branch. Follow the repository's local instructions, style, and test conventions.
Before committing:
git diff
git status --shortRun the narrowest meaningful verification first, then broader checks if the change touches shared behavior. If tests cannot be run, record why for the PR body and final response.
Commit only the intended files:
git add <intended-files>
git commit -m "<concise commit message>"If the user already had relevant commits, do not rewrite them unless needed.
7.5 PR Readiness Gate
Before pushing or opening a non-draft PR, run a reviewer-minded readiness pass
over the final diff. Use deep-code-review as the shared home for this pass
rather than duplicating a separate checklist here.
Marking an existing draft PR ready for review counts as opening a non-draft PR: run this gate then too, against the PR's current head at that moment, not the diff as it existed when the draft was opened.
Apply extra scrutiny to changes that touch manifest or config schemas, remote provisioning scripts, public/private repository filtering, sidecar or cross-service integration, or the repository's own high-risk areas named in its local instructions.
The gate should answer:
- Can a reviewer reproduce the promised behavior from this branch, or are any stacked PRs, branch images, CI artifacts, secrets, hardware, or internal tools still required and documented?
- If the repository publishes a filtered or sanitized public tree, do public-tree files, Make targets, scenarios, and docs still work after filtering, without leaking internal-only pipeline details?
- Do scripts fail fast for invalid flags, missing files/images/tools, contradictory options, unsupported platforms, and warm retries?
- Do config/schema changes keep parsers, shell helpers, Terraform/cloud-init, docs, and tests aligned, including defaulted and legacy syntax cases?
If the pass finds material issues, fix them before creating or marking the PR ready. If a live infra or hardware check is impossible, state the skipped check and residual risk in the PR body.
8. Push To The Fork Branch
Push the branch to the fork remote:
git push -u "$FORK_REMOTE" "$BRANCH_NAME"Confirm the local branch is tracking the fork branch, not the upstream repo's protected branch:
git status --branch --short9. Create The Pull Request
Prepare a PR title and body from the context, commits, and verification results.
The PR title must use the Conventional Commits pattern:
<type>[optional scope]: <description>, for example
fix: handle empty repository names or
chore(terraform): update branch protection. Prefer feat, fix, docs,
chore, refactor, test, build, ci, perf, style, or revert as
the type. When the user supplies a non-conventional title, convert it while
preserving intent unless they explicitly ask for exact title wording.
Look for repository PR templates:
if test -d .github; then
find .github -maxdepth 3 \( -iname '*pull_request_template*' -o -path '.github/PULL_REQUEST_TEMPLATE/*' \)
fiUse a template when one clearly applies. Either way, keep the body short; aim for under 40 lines including the template's checklists:
- Summary: one to three sentences on what the PR does. Lead with the change, not the backstory. One clause of "why" at most.
- Details: one bullet per change a reviewer must know about, a line or two
each. Name the identifiers; skip what the diff already shows. Put a stack or
dependency on one line (
Stack: #A → **this PR**). - Testing: what passes at the current head, and what was not run and why. No per-commit or per-review-round history; replace the section on each push instead of appending to it.
- Leave out: rationale essays, alternatives the reviewer did not ask about, review-tool round logs, and @-mentions (ping reviewers in Slack or a comment). Drop template subsections that do not apply instead of leaving empty headings.
Draft the body in a subagent on the sonnet tier (the mid-tier model of
whatever runtime you are in), not in the main session. Give it the commits, the diff stat, the verification results, the
template, and the rules above, and ask it to trim to the rules. Check its draft
against the rules and the diff (every claim true at the current head) before
showing it or using it. Use the same pass when rewriting a body after a push.
Without a template, use:
## Summary
- <what changed>
## Verification
- <commands run, or "Not run: <reason>">
## Notes
- <risks, rollout notes, or follow-ups if relevant>Create the PR from the fork branch to upstream default:
gh pr create \
--repo "$UPSTREAM_REPO" \
--base "$DEFAULT_BRANCH" \
--head "$GH_USER:$BRANCH_NAME" \
--title "$PR_TITLE" \
--body-file "$PR_BODY_FILE"Add --draft only when the user asked for a draft or the work is intentionally
not ready for review. If --head "$GH_USER:$BRANCH_NAME" is not accepted, fall
back to the pushed remote branch that gh pr create can see and explain the
adjustment.
10. Final Response
Report the outcome with:
- PR URL
- Upstream base:
<UPSTREAM_REPO>:<DEFAULT_BRANCH> - Fork branch:
<FORK_REPO>:<BRANCH_NAME> - Commit hash or short commit summary
- Verification commands and results
- Any skipped checks or follow-ups
If the PR could not be created, leave the branch and commits intact, explain the blocker, and give the exact next command or decision needed.
Common Edge Cases
- Origin is already the user's fork: use
originasFORK_REMOTE; ensure an upstream remote exists or use--repo "$UPSTREAM_REPO"explicitly for PR creation. - Current repo is the fork: target the parent repo for the PR, sync this fork from the parent, and push the branch to this fork.
- User wants a PR for existing local commits: do not recreate the branch just for ceremony. Ensure the fork remote exists, sync the fork default branch, rebase or merge only when appropriate, push the current branch to the fork, and create the PR.
- Protected upstream branch: never push the feature branch to upstream unless the user explicitly asks and has permission. The default path is always the fork branch.
- Sync requires force: ask before
gh repo sync --force; it rewrites the fork's default branch. - No changes after implementation: do not create an empty PR. Explain that the repository already has the requested behavior or that the requested change could not be reproduced.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

