| name | commit-and-pr |
| description | Creates a branch, commits changes, pushes, and opens a PR. Use when the user wants to submit their changes as a pull request. |
When the user invokes this skill, follow these steps:
1. Analyze the changes
Run git status and git diff to understand what has changed. Based on the changes, determine:
- The type of change:
fix, feat, chore, refactor, docs, test, style
- A short descriptive name (2-4 words, kebab-case)
2. Create branch name
Format: {type}--{short-description}
Examples:
fix--login-validation
feat--export-csv
chore--update-dependencies
refactor--user-service
3. Execute the workflow
-
Create and switch to the new branch:
git checkout -b {branch-name}
-
Stage the changes (be specific, avoid staging sensitive files):
git add {specific-files}
-
Commit with a conventional commit message:
Format: {type}: {short description}
git commit -m "{type}: {description}"
-
Push to remote:
git push -u origin {branch-name}
-
Create the PR:
gh pr create --title "{type}: {description}" --body "$(cat <<'EOF'
## Summary
{bullet points describing the changes}
## Test plan
{how to verify the changes work}
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
4. Return the PR URL
After creating the PR, display the URL so the user can review it.
Notes
- If already on a feature branch, ask the user if they want to use it or create a new one
- If there are no changes to commit, inform the user
- Always check
git status before starting to understand the current state