commit-and-pr
Creates a branch, commits changes, pushes, and opens a PR. Use when the user wants to submit their changes as a pull request.
Packaged view
This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.
Install command
npx @skill-hub/cli install betagouv-zacharie-commit-and-pr
Repository
Skill path: .claude/skills/commit-and-pr
Creates a branch, commits changes, pushes, and opens a PR. Use when the user wants to submit their changes as a pull request.
Open repositoryBest for
Primary workflow: Ship Full Stack.
Technical facets: Full Stack.
Target audience: everyone.
License: Unknown.
Original source
Catalog source: SkillHub Club.
Repository owner: betagouv.
This is still a mirrored public skill entry. Review the repository before installing into production workflows.
What it helps with
- Install commit-and-pr into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
- Review https://github.com/betagouv/zacharie before adding commit-and-pr to shared team environments
- Use commit-and-pr for development workflows
Works across
Favorites: 0.
Sub-skills: 0.
Aggregator: No.
Original source / Raw SKILL.md
---
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
1. **Create and switch to the new branch**:
```bash
git checkout -b {branch-name}
```
2. **Stage the changes** (be specific, avoid staging sensitive files):
```bash
git add {specific-files}
```
3. **Commit with a conventional commit message**:
Format: `{type}: {short description}`
```bash
git commit -m "{type}: {description}"
```
4. **Push to remote**:
```bash
git push -u origin {branch-name}
```
5. **Create the PR**:
```bash
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