Get the FREE Ultimate OpenClaw Setup Guide →

commit

npx machina-cli add skill parcadei/Continuous-Claude-v3/commit --openclaw
Files (1)
SKILL.md
1.9 KB

Commit Changes

You are tasked with creating git commits for the changes made during this session.

Process:

  1. Think about what changed:

    • Review the conversation history and understand what was accomplished
    • Run git status to see current changes
    • Run git diff to understand the modifications
    • Consider whether changes should be one commit or multiple logical commits
  2. Plan your commit(s):

    • Identify which files belong together
    • Draft clear, descriptive commit messages
    • Use imperative mood in commit messages
    • Focus on why the changes were made, not just what
  3. Present your plan to the user:

    • List the files you plan to add for each commit
    • Show the commit message(s) you'll use
    • Ask: "I plan to create [N] commit(s) with these changes. Shall I proceed?"
  4. Execute upon confirmation:

    • Use git add with specific files (never use -A or .)
    • Create commits with your planned messages
    • Show the result with git log --oneline -n [number]
  5. Generate reasoning (after each commit):

    • Run: bash "$CLAUDE_PROJECT_DIR/.claude/scripts/generate-reasoning.sh" <commit-hash> "<commit-message>"
    • This captures what was tried during development (build failures, fixes)
    • The reasoning file helps future sessions understand past decisions
    • Stored in .git/claude/commits/<hash>/reasoning.md

Important:

  • NEVER add co-author information or Claude attribution
  • Commits should be authored solely by the user
  • Do not include any "Generated with Claude" messages
  • Do not add "Co-Authored-By" lines
  • Write commit messages as if the user wrote them

Remember:

  • You have the full context of what was done in this session
  • Group related changes together
  • Keep commits focused and atomic when possible
  • The user trusts your judgment - they asked you to commit

Source

git clone https://github.com/parcadei/Continuous-Claude-v3/blob/main/.claude/skills/commit/SKILL.mdView on GitHub

Overview

This skill guides you to create git commits with explicit user approval and without Claude attribution. It emphasizes reviewing changes, planning logical commits, and presenting a plan before executing commits. The process promotes atomic commits and clear messaging for traceability.

How This Skill Works

You inspect the working tree with git status and git diff to understand changes. You then plan how to group changes into atomic commits and draft descriptive, imperative messages. After the user confirms, you execute git add with specific files (never -A or .), create commits using the planned messages, and generate per-commit reasoning with: bash "$CLAUDE_PROJECT_DIR/.claude/scripts/generate-reasoning.sh" <commit-hash> "<commit-message>"; the reasoning is stored at .git/claude/commits/<hash>/reasoning.md.

When to Use It

  • When you have just finished a session and need to commit changes derived from the conversation
  • When you want to group related changes into cohesive, atomic commits
  • When you need clear, imperative commit messages that explain why changes were made
  • When you want to avoid broad git adds and only commit specific files
  • When you want to capture per-commit reasoning and store it in the repository

Quick Start

  1. Step 1: Review changes with git status and git diff to understand what changed.
  2. Step 2: Plan your commits by grouping files and drafting clear, imperative messages; present the plan to the user.
  3. Step 3: Upon confirmation, run git add <path> for each commit, create the commits with the planned messages, generate reasoning after each commit, and verify with git log --oneline -n [number].

Best Practices

  • Review git status and git diff before planning commits
  • Group related changes into logical commits and avoid large monoliths
  • Draft clear, imperative commit messages that explain the intent
  • Add only the intended files with git add <path> (never -A or .)
  • Do not include attributions; commits should be authored by the user

Example Use Cases

  • Plan and commit skeleton: add new files with a message like 'Initialize project skeleton'.
  • Add a new feature: commit the relevant files with a message such as 'Add feature X and unit tests'.
  • Fix a bug in authentication: stage only the fixed files and commit 'Fix login crash on empty input'.
  • Update documentation: commit README changes with 'Update usage instructions'.
  • Refactor and test: group refactor changes and new tests into one or more cohesive commits with descriptive messages.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers