danievanzyl/code-skills/gh-draft-pr
- community
Checking that the SKILL.md file is still in the repository.
Commit any outstanding changes, push the current branch, and open a draft PR via the gh CLI. Use this skill whenever the user says "/gh-draft-pr", "open a draft PR", "ship a draft", "raise a draft PR", "push and open a PR", or otherwise wants to take their local branch from working state to a draft PR on GitHub in one step. Also trigger when the user mentions draft PRs, opening a PR for review-not-yet-ready work, or wants their WIP up on GitHub.
Install
npx vskill@latest install danievanzyl/code-skills/gh-draft-prSKILL.md
GH Draft PR
Take a local branch from working state to a draft PR on GitHub: stage + commit any outstanding changes, push, then open a draft PR.
Usage
title— optional one-line PR title. If omitted, derive from the latest commit subject.
Workflow
1. Sanity checks
Run in parallel:
Then:
- If current branch == default branch (main/master): stop. Tell the user to switch to a feature branch first — never open PRs from main.
- If
gh pr listreturns a PR: stop. Tell the user the PR already exists with its URL. Don't try to recreate. - If
gh auth statusfails anywhere: stop and tell the user to rungh auth login.
2. Commit outstanding changes
If git status --porcelain is non-empty:
Stage everything tracked + untracked, but skip likely secrets (.env*, credentials*, *.pem, id_rsa*). If any of those appear in git status, ask the user before staging.
Generate a commit message from the diff. Style: imperative, concise, follow the repo's existing commit style (run git log -5 --oneline to match tone). One subject line, optional body if the change is non-trivial.
If nothing to commit, skip this step.
3. Push
-u is safe to pass even if upstream already set — it just re-asserts.
4. Build PR title and body
Title:
- Use the user-provided argument if given.
- Otherwise: latest commit subject (
git log -1 --pretty=%s). - Keep under 70 chars.
Body: generate from git log <base>..HEAD and git diff <base>..HEAD --stat. Template:
Write to a temp file to avoid shell escaping pain:
5. Create the draft PR
gh infers --head from the current branch.
6. Confirm
Output the PR URL on a single line. Example:
Rules
- Never use
--no-verifyon commits or--forceon push unless the user explicitly asks. - Never commit files matching
.env*,credentials*,*.pem,id_rsa*without asking. - Always
--draft— this skill only opens drafts. If the user wants ready-for-review, they cangh pr readyafter. - Always pass body via
--body-file, never inline. - Don't open a PR from the default branch.
- Don't recreate a PR if one already exists for the branch — surface the existing URL instead.
- If
gh auth statusfails, stop and tell the user to rungh auth login.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/gh-draft-pr/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/danievanzyl/code-skills/gh-draft-pr)