pr-open/SKILL.md
Use when the user wants to open a pull request for an already-pushed branch that implements a specific issue. Idempotent — returns the existing PR if one is already open for the branch. Trigger phrases - "/pr-open", "open the pr", "create pr for this branch".
npx skillsauth add paulund/skills pr-openInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Open a pull request for the current branch and transition the issue's labels. Idempotent: if a PR already exists for the branch, returns its number without opening a duplicate.
When invoked with arguments, the first line of the prompt may carry a context envelope as JSON:
{ "issue": 582, "branch": "agent/issue-582-foo" }
When invoked directly without context, infer branch from git branch --show-current and ask the user for issue if missing.
gh pr list --head "<branch>" --state open --json number,title,url
If a PR already exists for the branch, report its number + URL and stop. Do not open a second PR.
git rev-parse --abbrev-ref --symbolic-full-name @{upstream} 2>/dev/null
If no upstream is set or the branch has unpushed commits, run:
git push -u origin HEAD
gh issue view <issue> --json number,title,body --jq '.title'
Use the issue title as the basis for a short, descriptive PR title (under 70 chars). Don't prefix with "feat:" / "fix:" unless the project uses conventional commits — check recent PRs:
gh pr list --state merged --limit 5 --json title --jq '.[].title'
gh pr create \
--base main \
--title "<descriptive title>" \
--body "$(cat <<'EOF'
## What this does
<one-paragraph plain-English summary of the change, derived from the issue body>
Closes #<issue>
EOF
)"
Keep the description clean: summary + Closes #N. No checklists, no AI output, no screenshots — those go in PR comments later in the chain.
gh issue edit <issue> --remove-label in-progress --add-label in-review
If the labels don't exist on the repo, skip silently rather than failing.
Report:
{ "issue": <N>, "pr": <PR#>, "branch": "<branch>", "url": "<pr-url>" }
🤖 Generated with footers, AI-output blocks, or checklists to the description.git status shows uncommitted changes — surface them and stop.development
Use when implementing any logic, fixing any bug, or changing any behaviour. Use when you need to prove code works, when a bug report arrives, or when modifying existing functionality. Do NOT use for config changes, data migrations, or dependency updates.
development
Use when starting a new feature, when requirements are unclear, when asked to write code without a clear spec, or before any non-trivial implementation. Do NOT use for trivial bug fixes or one-line changes.
development
Use when you want authoritative, source-cited code free from outdated patterns. Use when building with any framework or library where correctness matters. Detects the stack from dependency files, fetches official documentation, implements following documented patterns, and cites sources for every framework-specific decision.
development
Use when preparing to ship a feature, release, or deployment. Use before merging to main, creating a release, or deploying to production. Do NOT use for CI-only changes or internal refactors that don't reach production.