| name | git-add-commit-push |
| description | Stage all changes, create a commit with auto-generated or custom message, and push to current branch. Use when the user says "commit", "push", "save changes", or wants to finalize their work. |
| triggers | ["/commit","/push","commit","push","commiter","pousser","save changes","sauvegarder les changements"] |
| allowed-tools | Bash(git:*) |
| user-invocable | true |
Git Add, Commit & Push
Context
- Current branch: !
git branch --show-current
- Status: !
git status --short
- Changes summary: !
git diff HEAD --stat
- Changes detail: !
git diff HEAD
Instructions
- Run
git add .
- Create a commit:
- If user provided a message, use it directly
- Otherwise, generate a concise message based on the changes above
- Push to origin:
git push -u origin <branch>
Auto-generated Message Format
- First line: short summary (50 chars max)
- Blank line
- Body: details if needed
- End with:
Co-Authored-By: Claude <noreply@anthropic.com>
Run commands sequentially and confirm the result.
Finishing a Development Branch
When all stories in a plan are completed and validated, present exactly these 4 options:
Options
- Merge back to main locally —
git checkout main && git pull && git merge {branch} && git branch -d {branch}
- Push and create a Pull Request — push branch, then suggest creating PR
- Keep the branch as-is — no cleanup, branch stays for later
- Discard this work — requires explicit confirmation ("discard") before deleting
Process
- Run
pnpm test (or equivalent) — stop if tests fail
- Identify the base branch:
git merge-base --fork-point main HEAD (or master)
- Present the 4 options above
- Execute the chosen option
- Clean up worktree if applicable (Options 1, 2, 4)
Safety
- Never merge with failing tests
- Never discard without explicit typed confirmation
- Never force-push without explicit user request