Agent skill
git-commit-from-diff
Create git commits by inspecting the current diff and staged changes, then crafting a concise commit message from the diff. Use when the user asks to commit changes, asks for a commit message based on the diff, or wants a commit workflow that stages files and commits in a single pass.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/git-commit-from-diff
SKILL.md
Git Commit From Diff
Overview
Create a git commit by staging changes (optionally all), inspecting the staged diff, and generating a concise commit message based on what changed.
Workflow
- Check status with
git status -sb. - If there are unrelated changes, ask whether to commit everything or only specific paths.
- Stage changes with
git add -Afor “all changes” orgit add <paths>for a scoped commit. - Inspect the staged diff to craft a message:
- Preferred:
git diff --cached --statfor scope summary. - If the message is unclear, skim
git diff --cachedfor key themes.
- Preferred:
- Propose a concise, imperative commit message based on the diff. Use short subject lines like:
Refine globe layout and sidebar renderingUpdate ingestion flow and cache handling
- Commit with
git commit -m "<message>".
Guardrails
- Do not amend unless explicitly requested.
- If there is nothing staged, stop and ask whether to stage changes.
- If the user asks for a message “based on the diff,” always inspect the staged diff before committing.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?