You are executing the `/open-pr` command. Follow these steps precisely:
Creates a new branch, commits your changes, pushes to remote, and opens a pull request. Use this when you're ready to submit your work for review instead of manually running git commands.
/plugin marketplace add andrzejsliwa/claude-code-marketplace/plugin install github@claude-code-marketplaceYou are executing the /open-pr command. Follow these steps precisely:
draft (optional): Create PR as draft if specified (e.g., /open-pr draft)CRITICAL: Run this check FIRST before any other steps.
Check current branch with git branch --show-current.
If on main or master branch:
feature/descriptive-name or fix/descriptive-name)git checkout -b <branch-name>If on any other branch: Proceed to Step 1.
Run git status and git diff to analyze all changes:
If you detect multiple distinct tasks from conversation context, ask user using AskUserQuestion tool (both questions in same group):
Question 1 (always ask if multiple tasks detected):
Question 2 (ask ONLY if unstaged/untracked files exist that Claude didn't modify):
Commit Message Rules:
Style: Concise, factual, savant-like. State what was done, not why (unless discussed during implementation)
Simple changes: Title only (no description)
Complex changes: Title + description
Hard limit: 80 words total
Format: Always use heredoc for commit message
Footer: Always append:
š¤ Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Examples:
# Simple change
git commit -m "$(cat <<'EOF'
Add user authentication middleware
š¤ Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"
# Complex change
git commit -m "$(cat <<'EOF'
Refactor database connection pooling
Extracted connection logic into separate module. Added retry mechanism
for failed connections. Configured pool size based on environment variables.
š¤ Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"
If creating multiple logical commits:
Check if force-push is needed (git status shows diverged branch).
If force-push required: Ask user for confirmation before proceeding.
Otherwise: Auto-push with git push -u origin <branch-name>
On push failure: Explain error and ask if you should retry with alternative approach.
PR Title: Use title from commit message (if single commit) or summarize all commits (if multiple)
PR Description Rules:
Always include description (even for simple changes)
Same style as commit messages: factual, concise, savant-like
For single commit: Expand on commit message with more context
For multiple commits: List key changes made across commits
Avoid self-praise language, state facts only
Hard limit: 150 words
Footer: Always append:
š¤ Generated with [Claude Code](https://claude.com/claude-code)
PR Metadata:
draft parameter passed: add --draft flagCreate PR:
gh pr create --title "PR title" --body "$(cat <<'EOF'
PR description content here.
š¤ Generated with [Claude Code](https://claude.com/claude-code)
EOF
)" [--draft]
On PR creation failure: Explain error and ask if you should retry with alternative approach.
After successful PR creation, extract PR URL from gh output and open it:
xdg-open <PR_URL>
If any step fails:
After successful completion, output: