ClawForge smart-commit
AI-powered git commit message generation. Uses LLM to summarize changes and create meaningful commit messages. Triggers when user wants to commit changes, amend/squash commits, or needs LLM to summarize changes for commit messages. Chinese triggers: 提交, 提交代码, 提交更改, 提交修改, 要提交, commit, 提交信息, git 提交, 生成提交信息.
install
source · Clone the upstream repo
git clone https://github.com/jackjin1997/ClawForge
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/jackjin1997/ClawForge "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/smart-commit" ~/.claude/skills/jackjin1997-clawforge-smart-commit && rm -rf "$T"
manifest:
skills/smart-commit/SKILL.mdsource content
Smart Commit
AI-powered git commit message generation using LLM. Creates meaningful commit messages from code changes.
Capabilities
- Amend Last Commit - Summarize staged/unstaged changes and amend the last commit message
- Squash Commits - Summarize last N commits and create a consolidated commit
- Interactive Commit - Confirm files with user, then summarize and create new commit
Quick Start
For New Commit
# Show changed files and ask user confirmation git status # After confirmation, summarize changes with LLM # Create commit with generated message
For Amending
# Get diff of changes to amend git diff --cached # staged git diff HEAD~1 # compared to last commit # LLM summarizes, then git commit --amend -m "new message"
For Squashing
# Get last N commit messages and diffs git log -n N --format="%H %s" # LLM summarizes, then git reset --soft HEAD~N git commit -m "consolidated message"
Workflow Decision Tree
User wants git commit help? ├─ "amend" or "修改"? → Amend workflow ├─ "squash" or "合并" + number? → Squash workflow └─ New commit? → Interactive workflow
Amend Workflow
- Get changes:
(staged) orgit diff --cached
(all changes since last commit)git diff HEAD~1 - Send to LLM with prompt from
section "Amend Commit"references/prompts.md - User reviews suggested message
git commit --amend -m "message"
Squash Workflow
- Get last N commits:
git log -n N --format="%H|%s|%an|%ad" - Get combined diff:
git diff HEAD~N..HEAD - Send to LLM with prompt from
section "Squash Commits"references/prompts.md - User reviews suggested message
git reset --soft HEAD~N && git commit -m "message"
Interactive Commit Workflow
- Show
to usergit status - Ask user to confirm which files to include
- Get diff for confirmed files
- Send to LLM with prompt from
section "New Commit"references/prompts.md - User reviews suggested message
git add <files> && git commit -m "message"
LLM Prompts
See
references/prompts.md for:
- New commit message generation
- Amend commit message generation
- Squash commit message generation
Each prompt includes:
- Git diff input format
- Output format requirements
- Style guidelines (conventional commits, etc.)