git-helper
npx machina-cli add skill next-open-ai/openclawx/git-helper --openclawGit Helper Skill
Use this skill to help users manage their Git repositories.
Common Operations
- Status & Changes:
git statusto see current state.git difforgit diff --cachedto see exact line changes.
- Committing:
git add <files>to stage.- Write clear and descriptive commit messages following conventional commits standard.
- Branching:
git checkout -b <branch>to create a new branch.git branch -ato list all branches.
- History:
git log --oneline --graph --decorate -n 10for a compact history view.
- Conflict Resolution:
- Use
git statusto identify conflicting files. - Ask the user how they wish to resolve the conflict before editing the files.
- Use
Safeguards
NEVER run git push, git reset --hard, or git clean -fd without EXPLICIT user confirmation via the notify_user tool.
Source
git clone https://github.com/next-open-ai/openclawx/blob/main/presets/workspaces/code-assistant/skills/git-helper/SKILL.mdView on GitHub Overview
git-helper assists users in managing Git repositories with common operations like checking status, diffing changes, staging, committing with conventional messages, managing branches, and inspecting history. It also guides conflict resolution and safeguards high-risk actions by requiring explicit user confirmation.
How This Skill Works
The skill runs through the allowed bash tool to execute Git commands. It interprets requested actions (status, diff, add, commit, branch, log, conflict handling) and runs the appropriate commands, while prompting for user input on resolutions and confirmations when needed.
When to Use It
- You want a quick snapshot of your repo status and changes (git status, git diff).
- You’re ready to commit work with a clear, conventional message (git add, git commit).
- You need to create or switch to a feature/topic branch (git checkout -b, git branch -a).
- You want a compact, visual history of recent commits (git log --oneline --graph --decorate -n 10).
- You’re resolving merge conflicts and need guidance on how to proceed with user input.
Quick Start
- Step 1: Run git status to see current state and git diff to review changes.
- Step 2: Create a branch with git checkout -b <branch>, then stage changes with git add and commit with a conventional message using git commit -m 'feat: ...'.
- Step 3: If conflicts arise, run git status to identify files and ask the user how to resolve before editing.
Best Practices
- Always run git status before making significant changes.
- Use git diff to review changes before staging or committing.
- Stage only the intended files with git add <files> to avoid broad changes.
- Write clear, conventional commit messages (e.g., feat:, fix:, docs:).
- When conflicts occur, confirm the chosen resolution with the user before editing; avoid dangerous actions like push or reset --hard without explicit confirmation.
Example Use Cases
- Check the repo status and view changes with git status and git diff.
- Create and switch to a new feature branch with git checkout -b feature/login.
- Stage changes (git add) and commit with a descriptive conventional message (git commit -m 'feat: add login flow').
- Review recent history in a graph view using git log --oneline --graph --decorate -n 10.
- Identify and resolve a merge conflict by checking git status and confirming the resolution approach with the user.