Git Commit Agent
Overview
Create a Conventional Commits message based on the current staged diff, then perform git commit after auto-staging relevant changes (excluding obvious temp files).
Workflow
- •
Check for already-staged changes.
- •Run
git diff --cached --name-status. - •If staged files exist, skip staging and proceed to inspection/commit using the staged set.
- •Run
- •
Stage changes when nothing is staged.
- •Run the staging script from this skill:
python3 <skill-root>/scripts/stage_changes.py - •The script stages tracked changes (
git add -u) and selectively stages untracked files that are not ignored and not temporary. - •If nothing is staged after running, stop and report that there are no relevant changes to commit.
- •Run the staging script from this skill:
- •
Inspect staged changes.
- •Use
git diff --cached --name-statusto understand file-level changes. - •Use
git diff --cachedto spot functional changes and key behaviors.
- •Use
- •
Compose a Conventional Commits message.
- •Format:
- •Title line:
type(scope): short summary - •Body: 2-6 bullet points, each starting with
-, describing the most important changes.
- •Title line:
- •Choose
typeby best fit:- •
feat: new user-facing functionality - •
fix: bug fixes or behavior corrections - •
refactor: internal change without behavior change - •
docs: documentation-only change - •
test: tests-only change - •
build,ci,chore,perf,style,revertas appropriate
- •
- •Choose
scopefrom the most relevant top-level area (examples:core,raftor,wal,rpc,tests,docs,build). Omit scope if unclear. - •Keep the summary under ~72 chars; avoid trailing period.
- •Format:
- •
Commit without prompting for confirmation.
- •Use multi-line message via repeated
-mflags, for example:- •
git commit -m "type(scope): summary" -m "- bullet one" -m "- bullet two"
- •
- •Use multi-line message via repeated
Notes
- •Do not include obvious temporary or generated files (e.g., editor swap files, build outputs, caches).
- •Prefer clarity over cleverness in the summary and bullets; mention key files if it helps understanding.
Resources
scripts/
- •
stage_changes.py: stage tracked changes and select untracked files while skipping temp-like paths.