git-commit skill
Automates the process of staging changes and creating commits using the conventional commit message format.
- GitHub stars
- 45
- Files
- 1
- Last commit
- May 31, 2026
- License
- MIT
- Allowed tools
- 2
What does the git-commit skill do?
git-commit automates the process of staging changes and creating commits using the conventional commit message format.
Summary generated from the skill's SKILL.md.
About the git-commit skill
Automating the staging and committing of code changes using the conventional commit format is what this skill enables for developers. When an agent receives instructions to save changes or commit work, it uses Bash to inspect the repository state and stage all files, including untracked ones. It then analyzes the staged diff to determine the appropriate type, such as feat, fix, or refactor, and constructs a structured message following specific rules like using the imperative mood and keeping descriptions under 72 characters.
An agent should load this skill whenever a user wants to finalize a task in a git repository. The process relies on executing git status, git add, and git diff commands to understand the context of the work. If a pre-commit hook prevents the commit from being created, the skill reports the specific failure so the user can address the issues. It produces a formal commit with a short hash and a standardized message, ensuring the project history remains clean and consistent.
What an agent can do with it
- 1Commit all current workAsk the agent to save all your current progress and staged changes into a new git commit.
- 2Generate standardized commit messagesHave the agent analyze a diff to write a message that follows the conventional commit specification.
- 3Handle pre-commit hook errorsUse the agent to identify why a commit failed due to local repository hooks.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the git-commit skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the git-commit skill in Plugin
/plugin marketplace add sequenzia/agent-alchemy /plugin install agent-alchemy-git-tools@agent-alchemy
Install the git-commit skill in Claude Code
~/.claude/skills/git-commit/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit ~/.claude/skills/git-commitInstall the git-commit skill in Claude Code (project)
.claude/skills/git-commit/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit .claude/skills/git-commitInstall the git-commit skill in Codex
~/.agents/skills/git-commit/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit ~/.agents/skills/git-commitInstall the git-commit skill in Gemini CLI
~/.gemini/skills/git-commit/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit ~/.gemini/skills/git-commitInstall the git-commit skill in Claude.ai
npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit git-commit && zip -r git-commit.zip git-commit # claude.ai → Customize → Skills → + → Create skill → Upload a skill → git-commit.zip
SKILL.md
View on GitHubGit Commit
Create a commit with a conventional commit message based on staged changes. Automatically stages all changes and analyzes the diff to generate an appropriate commit message.
Workflow
Execute these steps in order.
Step 1: Check Repository State
Check for changes to commit:
git status --porcelain
- If output is empty, report: "Nothing to commit. Working directory is clean." and stop.
- If changes exist, continue to Step 2.
Step 2: Stage All Changes
Stage all changes including untracked files:
git add .
Report: "Staged all changes."
Step 3: Analyze Changes
View the staged diff to understand what changed:
git diff --cached --stat
git diff --cached
Analyze the diff to determine:
- The type of change (feat, fix, docs, refactor, etc.)
- The scope (optional, based on affected files/modules)
- A concise description of what changed
Step 4: Construct Commit Message
Build a conventional commit message following this format:
<type>(<optional-scope>): <description>
[optional body]
Types:
feat- New featurefix- Bug fixdocs- Documentation onlystyle- Formatting, no code changerefactor- Code restructuring without behavior changetest- Adding or updating testschore- Maintenance tasksbuild- Build system or dependenciesci- CI configurationperf- Performance improvement
Rules:
- Use imperative mood ("add" not "added")
- Use lowercase
- No trailing period
- Keep description under 72 characters
- Add a body only for complex changes or breaking changes
- Do NOT add co-author, attribution, or "Generated with" lines
Step 5: Create Commit
Create the commit using a heredoc for proper formatting:
git commit -m "$(cat <<'EOF'
<commit message here>
EOF
)"
Step 6: Handle Result
On success:
- Report the commit hash: "Committed: {short_hash} - {message}"
On pre-commit hook failure:
- Report: "Pre-commit hook failed. The commit was NOT created."
- Explain what the hook reported
- Instruct: "Fix the issues above and run the commit command again. Do NOT use --amend as that would modify the previous commit."
Error Recovery
If the commit fails:
- Hook failure: Fix the reported issues, then stage and commit again (do NOT amend)
- Unstage changes:
git reset HEADto unstage without losing changes
Notes
- This command stages ALL changes including untracked files
- Pre-commit hooks run automatically; their failures mean no commit was created
- Always create a NEW commit after hook failure, never amend the previous commit
Files in this skill
1git-commit skill questions
How do I install the git-commit skill in Claude Code?
Run npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit ~/.claude/skills/git-commit. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the git-commit skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
What format does the commit message follow?
It follows the conventional commit format, including a type, an optional scope, and a description.