Get the FREE Ultimate OpenClaw Setup Guide →

git-helper

npx machina-cli add skill next-open-ai/openclawx/git-helper --openclaw
Files (1)
SKILL.md
1.1 KB

Git Helper Skill

Use this skill to help users manage their Git repositories.

Common Operations

  1. Status & Changes:
    • git status to see current state.
    • git diff or git diff --cached to see exact line changes.
  2. Committing:
    • git add <files> to stage.
    • Write clear and descriptive commit messages following conventional commits standard.
  3. Branching:
    • git checkout -b <branch> to create a new branch.
    • git branch -a to list all branches.
  4. History:
    • git log --oneline --graph --decorate -n 10 for a compact history view.
  5. Conflict Resolution:
    • Use git status to identify conflicting files.
    • Ask the user how they wish to resolve the conflict before editing the files.

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

  1. Step 1: Run git status to see current state and git diff to review changes.
  2. 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: ...'.
  3. 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.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers