Навык git-commit
Automates the process of staging changes and creating commits using the conventional commit message format.
- Звёзды на GitHub
- 45
- Файлы
- 1
- Последний коммит
- 31 мая 2026 г.
- Лицензия
- MIT
- Разрешённые инструменты
- 2
Что делает навык git-commit?
git-commit — это Agent Skill. Automates the process of staging changes and creating commits using the conventional commit message format.
Сводка сгенерирована из SKILL.md навыка.
О skill git-commit
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.
Что агент может делать с ним
- 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.
Написано на основе skill SKILL.md. Каждый сценарий использования проверен по цитате из него.
Как установить навык git-commit
Каждая команда копирует папку навыка в каталог навыков клиента. Перезапустите клиент или начните новую сессию, чтобы загрузить его.Установка навыка git-commit в Плагин
/plugin marketplace add sequenzia/agent-alchemy /plugin install agent-alchemy-git-tools@agent-alchemy
Установка навыка git-commit в Claude Code
~/.claude/skills/git-commit/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit ~/.claude/skills/git-commitУстановка навыка git-commit в Claude Code (project)
.claude/skills/git-commit/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit .claude/skills/git-commitУстановка навыка git-commit в Codex
~/.agents/skills/git-commit/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit ~/.agents/skills/git-commitУстановка навыка git-commit в Gemini CLI
~/.gemini/skills/git-commit/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit ~/.gemini/skills/git-commitУстановка навыка git-commit в 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
Открыть на 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
Файлы в этом навыке
1Вопросы о навыке git-commit
Как установить навык git-commit в Claude Code?
Выполните npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit ~/.claude/skills/git-commit. Claude Code загружает навыки из ~/.claude/skills (все проекты) или .claude/skills (один проект) и использует навык, когда его описание соответствует задаче.
Какие клиенты могут использовать навык git-commit?
Любой клиент, который читает формат Agent Skills: Claude Code, Codex, Gemini CLI и claude.ai (загрузить как ZIP). Скрипты в навыке выполняются только там, где клиент разрешает выполнение кода.
What format does the commit message follow?
It follows the conventional commit format, including a type, an optional scope, and a description.