Automated PR creation and management tool incorporating linting and documentation cross-referencing.
Install
mkdir -p .claude/skills/pr-jellyrock && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18875" && unzip -o skill.zip -d .claude/skills/pr-jellyrock && rm skill.zipInstalls to .claude/skills/pr-jellyrock
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Create OR update a pull request using the JellyRock template at `.github/pull_request_template.md`. Detects an existing open PR for the current branch and routes to update-mode (diff body, ask, then `gh pr edit`) instead of duplicating; aborts cleanly on merged/closed PRs. Scans branch + commits for related issues, falls back to `gh` issue search, surfaces architecture docs whose related-files were touched, and runs the four-pillar judgment passes (tech-debt scan, decision-shape detect, followup capture) so journal hygiene is part of shipping rather than a separate manual step. Required for all PRs in this repo — supersedes any default PR-creation flow.Key capabilities
- →Create pull requests using a template
- →Update existing pull requests
- →Scan branch and commits for related issues
- →Surface architecture documentation for touched files
- →Run pre-push quality checks for journal hygiene
How it works
The skill renders a PR body from a template, populates sections with branch signal, and runs quality checks before creating or updating a PR, handling existing PRs by diffing and confirming changes.
Inputs & outputs
When to use pr
- →Opening a new pull request
- →Updating an existing PR
- →Validating PR content quality
- →Linking documentation to code changes
About this skill
Create or Update a Pull Request
Open a PR whose body comes from .github/pull_request_template.md, with the Issues and Docs sections filled in from real signal on the branch, and run the four-pillar judgment passes BEFORE pushing so journal hygiene lands in the same change set. If a PR already exists for the current branch, route to update-mode: diff the current body against the freshly-rendered one, ask before applying, and use gh pr edit instead of gh pr create. This replaces the generic PR-creation flow — do not call gh pr create or gh pr edit directly outside this skill.
Contract
Goal. Be the single, mandatory path for opening or updating a pull request in this repo. The skill renders the PR body from .github/pull_request_template.md, fills the Issues and Docs sections from real branch signal (not intent), and runs three judgment passes — tech-debt scan, decision-shape detect, followup capture — BEFORE the body is pushed, so journal hygiene lands in the same change set rather than as separate manual chores. It is create-or-update aware: an existing open PR for the branch routes to update-mode (diff the current body against a fresh render, confirm, then gh pr edit), and merged/closed PRs abort cleanly instead of opening a duplicate. It ships at the Sonnet tier because the work is template-fill + structured signal-gathering with bounded judgment, with the genuinely judgment-heavy tech-debt walk delegated to its own sub-agent — supersede any default PR-creation flow with this skill; never call gh pr create/gh pr edit directly outside it.
Inputs. No $ARGUMENTS — the skill operates on the current branch and its commits. It expects a non-main, non-detached branch with a clean working tree and an upstream it can push (the pre-flight establishes these, pushing the branch where needed). It reads the PR template, the branch's commit log and diff vs main, an existing PR's body (when one is open) including the embedded <!-- /pr render: sha=... --> marker, and the architecture-docs related-files lint.
Outputs. A created or updated pull request whose body is the filled template (section headings and HTML comments preserved) ending in a hidden <!-- /pr render: sha=<40-char> ts=<ISO-8601-UTC> --> marker that lets the next invocation narrow judgment-pass scope to "since last render"; an imperative-mood title with code identifiers backticked; drafted journal entries (tech-debt / decision / followup) surfaced per-candidate for the user to accept into /log; on the update path, a pre-render backup of the prior body in .claude/handoffs/; and the PR URL printed. No journal entry is written without per-candidate user accept; no body is overwritten without confirmation.
Success criteria.
- The pre-flight gates hold: not on
main, not detached, clean tree, branch pushed — hard failures stop and report; an obvious push is not gated behind a verbal question. - Existing-PR routing is correct: open → update-path (diff, confirm,
gh pr edit); merged or closed → abort with the right recovery instruction; none → create-path. - The four-pillar judgment passes run against the resolved
<lower>SHA (prior render marker on update,mainon create) so the user isn't re-asked about already-handled candidates, and each candidate is confirm/skip per-item. - The Issues section always contains something (a real
Fixes/Ref #N, orNone); the title backticks code identifiers; the Docs checkboxes reflect the actual diff, not intent. gh pr create/gh pr edit/Writepermission prompts are left intact — they are the user's gate on body content and backup creation, not suppressed.
Failure modes to avoid.
- Polluting the skill's context with the tech-debt walk. Never
Read docs/architecture/tech-debt.mdinline from inside/pr— that inline read IS the context pollution Pass 1 exists to prevent. Spawntech-debt-scanas aTasksub-agent with an explicitmodel: sonnet, and never narrate sub-agent invocation while the transcript shows aRead. - Auto-applying journal entries. The judgment passes produce drafts only; apply a tech-debt edit or invoke
/logonly on explicit per-candidate accept. - Overwriting a PR body without confirmation or backup. On the update path, always diff-then-confirm and write the prior body to
.claude/handoffs/beforegh pr edit; ifgh pr editfails, the backup is the recovery path — surface it, don't claim success. - Opening a duplicate on a merged/closed PR. Abort with the recovery instruction; never silently create a second PR.
- Rephrasing the title to drop a code reference when the spell-check precheck fails — backtick the identifier instead; dropping the reference is the wrong fix.
- Suppressing the create/edit/Write permission prompts by allowlisting them — they are intentional user gates.
When NOT to use.
- You want to investigate review comments on an existing PR — that's
/pr-review, not/pr(which CREATES or updates a PR). - There is no branch to ship (on
main, or nothing committed) — there's nothing to open a PR for. - You need to bypass the journal-hygiene passes for a genuinely trivial change — that's still in-scope (skip the judgment block with one confirmation), not a reason to call
gh pr createdirectly.
Implementation
gh pr edit and Write are intentionally NOT pre-approved in this skill's frontmatter — the permission prompts they trigger are the user-approval gate for body overwrites and local backup file creation. Don't try to suppress them.
The mechanical close-loop side (move ## Currently running → ## Recently shipped, bump last-updated:) runs automatically after the PR merges via .github/workflows/journal-sync.yml. This skill does NOT touch that — its job is the judgment side: tech-debt entries, decision entries, and followup entries that need a human call.
Pre-flight (abort if any fails)
Run in parallel:
git rev-parse --abbrev-ref HEAD— must NOT bemain, must NOT beHEAD(detached). If detached, abort and ask the user to check out a branch first.git status --porcelain— must be empty (no uncommitted changes).git rev-parse --abbrev-ref --symbolic-full-name @{u}— if no upstream, rungit push -u origin <branch>. The permission prompt is the gate; don't ask verbally.git rev-list --count @{u}..HEAD— if non-zero, rungit push.
If a hard check (on main / detached HEAD / dirty tree) fails, stop and report. Pushing a feature branch to open its PR is obvious — don't gate it behind a verbal question.
Detect existing PR (route create vs update)
Run gh pr view --json number,url,state,isDraft,author,body,headRefOid for the current branch. Branch on state:
MERGED— abort. Print:PR #<N> is already merged at <url>. Switch off this branch (e.g.git switch main && git pull) before opening a follow-up PR.Don't try to update or open a duplicate.CLOSED(not merged) — abort. Print:PR #<N> at <url> was closed without merging. Reopen manually withgh pr reopen <N>if you want to revive it, or start a new branch.Don't silently open a duplicate.OPEN— enter the update path. Capture<N>,<url>,<author.login>,<body>, and<headRefOid>for later steps.- No PR exists (
gh pr viewexits non-zero with "no pull requests found for branch") — enter the create path (today's flow).
Update-path setup (skip on create path)
- Author warn (best-effort) — run
gh api user --jq .login. If the result differs from the captured<author.login>, print one line:Note: PR #<N> was opened by <other-user>. Body edits will appear under your account.Don't abort. Ifgh api userfails (auth/rate limit), skip the warn silently — it's informational only. - Resolve lower-bound SHA — this becomes the input range for judgment passes (so the user isn't re-asked about candidates already accepted/skipped on the prior /pr render):
- Parse the PR body for the marker
<!-- /pr render: sha=([a-f0-9]{40}) ts=(\S+) -->. If multiple markers exist (rare — copy-paste), take the LAST match. - If a marker SHA is found AND
git merge-base --is-ancestor <sha> HEADexits 0 → use that SHA. - Otherwise, fall back:
gh pr view --json commits --jq '.commits[0].oid'. If that SHA is also reachable from HEAD, use it. - Ultimate fallback (force-push edge case where neither prior SHA is reachable): use
main— same scope as the create path. Print one line so the user knows the narrow scope was lost:Note: prior /pr render SHA unreachable from HEAD (rebase or force-push?). Falling back to full-branch scope for judgment passes.
- Parse the PR body for the marker
- The resolved SHA is referenced as
<lower>throughout the rest of this skill. On the create path,<lower>ismain.
Four-pillar judgment passes (before drafting the PR body)
Three quick passes that surface journal entries the user should write — each with one-line confirm/skip per candidate. Drafts only; the user accepts before any /log invocation. Skip the whole block (with one user "skip judgment passes" confirmation) if the change is trivial (typo / dep bump / docs-only).
Both pass 1 and pass 2 use the <lower> SHA resolved in "Detect existing PR" above as their lower bound. On the create path that's main (today's behavior). On the update path it's the prior /pr render SHA — so the user isn't re-asked about candidates already accepted/skipped on a previous /pr invocation against the same PR.
Pass 1 — Tech-debt scan
Invoke /tech-debt-scan as a sub-agent (not inline) to keep its candidate-walk from polluting the /pr skill's context. Spawn it with an explicit model: sonnet (matching tech-debt-scan's own frontmatter pin) — a sub-agent with no model override inherits the session model, and if that session is a 1M-context model the spawn hits the "usage cred
Content truncated.
When not to use it
- →When creating a PR on the `main` branch
- →When directly calling `gh pr create` or `gh pr edit` outside this skill
Limitations
- →Operates on the current branch and its commits, no `$ARGUMENTS`
- →Requires a non-`main`, non-detached branch with a clean working tree and an upstream
- →Does not auto-apply journal entries; they are drafts requiring user acceptance
How it compares
This skill enforces a standardized PR creation and update process with automated content filling and pre-push quality checks, unlike generic `gh pr` commands.
Compared to similar skills
pr side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| pr (this skill) | 0 | 1mo | Review | Intermediate |
| resolve-conflicts | 81 | 8mo | Review | Intermediate |
| dependency-upgrade | 26 | 4mo | Review | Intermediate |
| git-commits | 21 | 3mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by jellyrock
View all by jellyrock →You might also like
resolve-conflicts
antinomyhq
Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.
dependency-upgrade
wshobson
Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing. Use when upgrading framework versions, updating major dependencies, or managing breaking changes in libraries.
git-commits
bonny
Create well-structured git commits in logical chunks following best practices
git-advanced-workflows
wshobson
Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.
github-multi-repo
ruvnet
Multi-repository coordination, synchronization, and architecture management with AI swarm orchestration
git-workflow-enforcer
CrazyDubya
Ensures commits follow conventional commits, branch naming conventions, and PR templates. Use when creating commits, branches, or PRs, or when user mentions git workflow.