gh-draft-pr

Stage, commit, push, and create a draft GitHub PR via the gh CLI.

1|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/danievanzyl/code-skills --skill gh-draft-pr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh-draft-pr
Source: https://github.com/danievanzyl/code-skills/tree/main/skills/gh-draft-pr
Command: npx skills add https://github.com/danievanzyl/code-skills --skill gh-draft-pr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Commit outstanding changes, push the current branch, and open a draft PR via the gh CLI.

Core Features & Use Cases

  • Draft PR creation: stage, commit, push, and create a draft PR in one step.
  • Guardrails: prevents PRs from being opened from the default branch and checks for existing PRs.
  • CLI-driven workflow: integrates git and the gh CLI into your existing development pipeline.

Quick Start

Tell me to run /gh-draft-pr with an optional title to create a draft PR from your current branch.

Frequently Asked Questions about gh-draft-pr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a draft PR from my current branch using the GitHub CLI?

To create a draft PR from your current branch, the workflow automates staging changes, committing, pushing, and opening a draft PR using the gh CLI in a single step. It returns the resulting PR URL upon success.

Do I need the gh CLI installed to automate opening a draft PR?

Yes, you need the gh CLI installed and authenticated. The workflow requires both git and the gh CLI to push your current branch and create the draft PR, running pre-checks to verify gh authentication.

What happens if I try to open a draft PR from the default branch?

If you try to open a draft PR from the default branch, the workflow enforces guardrails by preventing the action. It runs pre-checks for default branch usage and existing PRs to protect your repository.

Can I stage and commit outstanding changes while opening a draft PR simultaneously?

Yes, you can stage and commit outstanding changes while opening a draft PR simultaneously. The workflow handles end-to-end drafting by staging, committing, pushing, and creating the PR in one go.

Why does my draft PR creation workflow fail with an existing PR check?

Your draft PR creation workflow fails because it checks for existing PRs on your current branch. This guardrail prevents duplicate pull requests and provides failure guidance if a PR already exists.