home / skills / openclaw / skills / commit
This skill creates a contextual git commit from current changes and pushes the branch, automating staging and upstream setup.
npx playbooks add skill openclaw/skills --skill commitReview the files below or copy the command above to add this skill to your agents.
---
name: commit
description: Create a git commit with a contextual message based on current changes, then push the branch.
allowed-tools: [Bash]
---
## Context
- Current git status: !`git status`
- Current git diff (staged and unstaged changes): !`git diff HEAD`
- Current branch: !`git branch --show-current`
- Recent commits: !`git log --oneline -10`
## Your task
Based on the above changes, stage everything, create one commit with a contextual message, and push the current branch.
Required sequence:
1. Stage changes.
2. Create a single commit.
3. Push the current branch to origin (use `--set-upstream origin <branch>` if needed).
Do not use interactive commands and do not output extra commentary.
This skill automates creating a concise, contextual git commit from the repository's current changes and pushes the branch to the remote. It is designed for archives and backup workflows where a single, descriptive commit should encapsulate all outstanding modifications. The skill stages all changes, composes an informative commit message based on status and diffs, and pushes the branch to origin.
The skill inspects the repository state by reading the working tree status, the diff against HEAD, the active branch name, and recent commits to infer context. It stages all unstaged and modified files, constructs one commit message that summarizes the changes, and performs a git commit. Finally, it pushes the current branch to the origin remote, setting upstream if the branch has no tracking reference.
Will this skill push to a different remote name?
No — it targets the origin remote. Change the remote configuration before running if a different target is needed.
What happens if the branch has no upstream?
The skill sets the upstream for the current branch when pushing so the branch tracks origin/<branch>.
Can I preview the commit message before it is created?
This automation generates and uses a contextual message; preview capability should be implemented separately if you need confirmation.