From gh-workflow
Creates a draft pull request from current working changes. Handles branching, committing, pushing, and opening the PR with the project's PR template. Triggers on requests like "create a draft PR," "open a draft pull request," "push my changes and open a PR," "ship this as a PR," "submit a draft for review," "PR this," or any variation of branching and opening a draft PR against main.
How this skill is triggered — by the user, by Claude, or both
Slash command
/gh-workflow:drafting-prThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Creates a draft pull request from current working changes: analyzes changes, explores the codebase if needed, asks clarifying questions, then creates a branch (if on main), stages and commits, pushes, and opens a draft PR following the project's PR template.
Creates a draft pull request from current working changes: analyzes changes, explores the codebase if needed, asks clarifying questions, then creates a branch (if on main), stages and commits, pushes, and opens a draft PR following the project's PR template.
!git branch --show-current
!`git status`
!`git diff HEAD`
!`git log --oneline -5`
!git rev-parse --show-toplevel | xargs -I {} cat {}/.github/PULL_REQUEST_TEMPLATE.md 2>/dev/null || echo "No PR template found"
Before starting, verify:
git status shows a clean working tree, stop and tell the user: "No changes detected. Stage or modify files before creating a PR."gh auth status fails, stop and tell the user: "GitHub CLI is not authenticated. Run gh auth login first."Do not proceed if any validation fails.
Track progress through these phases:
- [ ] Phase 1: Codebase Exploration (if needed)
- [ ] Phase 2: Clarifying Questions
- [ ] Phase 3: Create branch
- [ ] Phase 4: Stage and commit
- [ ] Phase 5: Push to remote
- [ ] Phase 6: Create draft PR
The goal here is to catch things the developer may have overlooked — missing related changes, broken consumers, inconsistencies — so these can be surfaced before the PR is created rather than discovered during review.
Skip when the diff is small and self-contained: a single file change, a documentation update, a config tweak, or changes isolated to one module with no exported API changes.
Run when any of these apply:
When running:
Read, Grep, Glob, LSP to check for downstream consumers, missing updates, and consistency with existing patternsTask for deeper analysis across multiple areas in parallelUse AskUserQuestion to present a single consolidated prompt. Lead with your understanding of the changes, then ask only what you genuinely need answered:
Keep the question concise. Don't ask about things you can reasonably infer from the diff. Wait for the response before proceeding.
If currently on main or master:
fix/issue-description or feat/feature-name)git checkout -b <branch-name>If already on a feature branch, skip to Phase 4. The branch name will be validated for remote conflicts in Phase 5.
git add (avoid staging sensitive or untracked files like .env, credentials, local config)Co-Authored-By: Claude <[email protected]> in the commit messageBefore pushing, check if a remote branch with the same name already exists:
git ls-remote --heads origin `git branch --show-current`
If a remote branch with the same name exists, create a new branch from the current one before pushing:
feat/feature-name-2, then -3, etc.) until the name is unique on the remotegit checkout -b <new-unique-branch-name>Then push with upstream tracking:
git push -u origin `git branch --show-current`
If the push fails, report the error and stop.
Create the draft pull request:
gh pr create --draft --title "<title>" --body "<body>"
Title: Concise and descriptive, based on the changes. Use the user's preferred title from Phase 2 if provided.
Body:
- [ ])If gh pr create fails with "already exists," output the existing PR URL and stop. For other errors, report the raw error message.
After success, output the PR URL to the user.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub ibara1454/agent-marketplace --plugin gh-workflow