Draft Pull Request Workflow

Draft a pull request from the current branch via GitHub CLI.

Updated Jul 28, 2025
One-click install
npx skills add https://github.com/hudrazine/claude-code-toolkit --skill draft-pull-request-workflow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Draft Pull Request Workflow
Source: https://github.com/hudrazine/claude-code-toolkit/tree/main/plugins/git-workflow/skills/draft-pr
Command: npx skills add https://github.com/hudrazine/claude-code-toolkit --skill draft-pull-request-workflow

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill streamlines the process of creating draft pull requests by ensuring consistent structure, clear motivation, and automated checks, reducing review cycles and manual edits.

Core Features & Use Cases

  • Validate context (current branch, working tree) and detect existing open PRs.
  • Determine the base branch automatically from repository defaults when not provided.
  • Run repository-quality gates (lint, test, build) before drafting the PR.
  • Draft a semantically formatted title and a concise body aligned with repository templates.
  • Propose the PR content to the user for confirmation and then create a draft PR via GitHub CLI.
  • Provide next-step guidance after creation (e.g., push, update, or convert to ready).

Quick Start

Run the workflow to generate a draft PR from your current branch using GitHub CLI.

Frequently Asked Questions about Draft Pull Request Workflow

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

FAQPage Schema
How do I automate draft pull request creation from a git branch?

Automate draft pull request creation by resolving the base branch, enforcing quality gates like lint and test, and generating a structured PR body via GitHub CLI. This ensures consistent metadata and passing checks before opening a draft PR.

What is the best way to structure a draft PR for code review?

The best way to structure a draft PR is using a semantically formatted title and a concise body aligned with repository templates. This clarifies motivation and reduces manual edits during the code review cycle.

Can I run project tests before opening a draft PR on GitHub?

Yes, you can run repository quality gates including lint, test, and build checks before opening a draft PR on GitHub. Enforcing these gates ensures the working tree is validated before the PR metadata is generated.

How does base branch resolution work when drafting a pull request?

Base branch resolution automatically detects and applies the repository's default branch when a specific base is not provided. This streamlines the pull request workflow by correctly targeting the integration branch without manual input.

Why does my pull request workflow check for existing open PRs?

A pull request workflow checks for existing open PRs to prevent duplicate requests on the same branch. Validating current context and detecting active PRs ensures you only create a draft PR when no conflicting open request exists.

What should I do after creating a draft PR?

After creating a draft PR, you should follow next-step guidance to push remaining commits, update metadata, or convert the draft to ready for review. This post-creation workflow ensures the PR transitions smoothly into active code review.