Standard workflow for all PR operations ('create PR', 'open PR', 'pull request', 'commit and PR'): replaces bash-based gh/git workflows with end-to-end orchestration—handles uncommitted changes (auto-invokes creating-commit/creating-branch), analyzes commit history, generates convention-aware content, detects fork/origin. Canonical PR implementation for git-workflows.
/plugin marketplace add cblecker/claude-skills/plugin install git-workflows@claude-skillsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Use this skill for pull request creation requests: "create a PR", "open a PR", "submit for review", or similar.
Use other skills for: viewing existing PRs (GitHub MCP directly), updating PRs (GitHub MCP update), or only committing changes (creating-commit).
Creates GitHub pull requests with automatic commit handling, repository detection, PR content generation, branch pushing, and GitHub PR creation via MCP.
Extract from user request: draft status ("draft"/"WIP" → true, default false), PR title/description (if provided), target branch (if specified, else mainline)
Objective: Collect all PR context and validate prerequisites in a single atomic operation.
Steps:
Determine base branch from user request (optional):
Run ../../scripts/gather-pr-context.sh (optionally pass base_branch parameter if determined in step 1)
Parse the JSON response and handle results:
IF success: false:
Handle error based on error_type:
not_git_repo:
message and suggested_action from responseon_base_branch:
message from responseno_commits:
message and suggested_action from responseOther errors:
IF success: true:
Extract and store context:
{
"current_branch": "feature-branch",
"base_branch": "main",
"is_fork": true,
"repository": {
"upstream_owner": "owner",
"upstream_repo": "repo",
"origin_owner": "user",
"origin_repo": "repo"
},
"branch_validation": {
"is_feature_branch": true,
"has_uncommitted_changes": false
},
"uncommitted_files": [],
"commit_history": [...],
"diff_summary": {...},
"uses_conventional_commits": true
}
IF branch_validation.has_uncommitted_changes: true:
List files from uncommitted_files array
INFORM: "Uncommitted changes detected - creating commit first"
INVOKE: creating-commit skill (handles mainline detection internally)
WAIT for creating-commit to complete
IF creating-commit succeeded: RE-RUN Phase 1 (gather context again after commit) Continue to Phase 2
IF creating-commit failed: STOP immediately EXPLAIN: "Cannot create PR without committing changes" EXIT workflow
IF no uncommitted changes: Continue to Phase 2
Phase 1 complete. Continue to Phase 2.
Objective: Confirm target branch for pull request.
Steps:
Use base_branch from Phase 1 context (already detected mainline)
IF user specified different target branch in Step 1 of Phase 1:
Store pr_base for later phases
Phase 2 complete. Continue to Phase 3.
Objective: Create compelling PR title and description using context from Phase 1.
Generate PR content considering:
commit_history array (contains hash, subject, body for each commit)diff_summary object (files_changed, insertions, deletions)uses_conventional_commits flag for title formatSteps:
uses_conventional_commits: true from contextcommit_history and diff_summary in contextContext Available for PR content generation:
commit_history: Array of commits with hash, subject, bodydiff_summary: Files changed, insertions, deletionsuses_conventional_commits: Whether to use conventional format for titlebase_branch: Target branch for PRcurrent_branch: Source branch for PRContinue to Phase 4.
Objective: Present generated PR content for user review and approval.
Steps:
HANDLE user selection:
Continue to Phase 5.
Objective: Push current branch to remote.
Plan Mode: Auto-enforced read-only if active
Steps:
Use current_branch from Phase 1 context (no need to query git)
Push branch with upstream tracking:
git push -u origin <current_branch>
IF push fails:
Continue to Phase 6.
Objective: Create PR on GitHub using MCP.
Plan Mode: Auto-enforced read-only if active
Steps:
Prepare parameters from Phase 1 context:
repository objectcurrent_branchpr_base (from Phase 2)Determine draft: Check user request for "draft", "WIP", "work in progress"
Create: mcp__github__create_pull_request with all parameters
Error Handling: IF failure:
Continue to Phase 7.
Objective: Provide PR URL and confirm success with standardized output.
Steps:
Extract from Phase 6: PR number, URL, state, title
Format output using standardized template:
✓ Pull Request Created Successfully
**PR Number:** #<number> \
**Title:** <title> \
**URL:** <pr_url> \
**Status:** <Open|Draft> \
**Base Branch:** <base_branch> \
**Head Branch:** <head_branch>
[If draft: **Notes:** Mark as 'Ready for review' when ready]
[If open: **Notes:** The pull request is ready for review]
Workflow complete.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.