К основному содержанию
скилл CX Codex

git-commit · microsoft — скилл для Claude Code: что делает и как установить

Скилл git-commit для Claude Code пошагово уточняет пути для коммита, стейджит только их и создаёт один локальный коммит в формате Conventional Commits или готовит текст сообщения без коммита.

MIT ★ 1 627 обновлён 2026-10-25

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add microsoft/hve-core --skill git-commit -a claude-code
Открыть на GitHub

Что делает git-commit

Скилл сначала собирает список изменённых, новых и удалённых файлов через git status --porcelain=v1 -z --untracked-files=all, затем просит пользователя подтвердить, какие пути войдут в коммит целиком, без правки отдельных «хунков». После стейджинга он повторно проверяет через инструмент хоста (get_changed_files), что в индексе оказались именно выбранные пути и ничего лишнего, и только после этого формирует сообщение и коммитит через git commit -F -.

Если у файла есть и застейдженные, и незастейдженные изменения, скилл останавливается и просит разобраться с ними вручную — частичный стейджинг он не трогает. Текст коммита всегда строится по отдельным правилам commit-message, которые задают типы, скоупы и формат футера.

В режиме message-only скилл читает уже застейдженные изменения через git --no-pager diff --staged и выдаёт готовое сообщение в блоке кода, не трогая индекс и не делая коммит.

Какие задачи решает

  • собрать один Conventional Commit из выбранных вручную файлов
  • сгенерировать текст коммит-сообщения для уже застейдженных изменений
  • подтвердить точный список застейджённых путей перед коммитом
  • откатить лишний стейджинг без потери чужих изменений
  • поменять сообщение последнего коммита или отменить его через soft reset

Примеры запросов агенту

  • Сделай коммит изменений в src/api.py и README.md
  • Сгенерируй сообщение коммита для застейдженных изменений, mode=message-only
  • Отмени последний коммит, но оставь изменения в индексе

Как установить git-commit

1Через Skills CLI (Vercel)

npx skills add microsoft/hve-core --skill git-commit -a claude-code

2Вручную: положить файлы

~/.claude/skills/git-commit/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/git-commit/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о git-commit

Как установить git-commit в Claude Code?

Выполните npx skills add microsoft/hve-core --skill git-commit -a claude-code, скилл появится в ~/.claude/skills/git-commit/SKILL.md.

Что делает git-commit?

Скилл стейджит только подтверждённые пользователем пути, проверяет точный состав индекса и создаёт один локальный коммит в формате Conventional Commits, либо генерирует текст сообщения для уже застейдженных изменений без коммита.

Что будет, если у файла есть частично застейдженные изменения?

Скилл остановится и попросит разобраться с хунками вручную — он никогда не достейджит и не трогает частично застейдженный путь.

Исходный текст

SKILL.md · MIT
---
name: git-commit
description: 'Stage user-selected paths, confirm the exact staged set, and create one local Conventional Commit, or generate a commit message for staged changes without committing. Use when you want a guarded commit or a ready-to-paste message.'
argument-hint: '[mode={commit|message-only}]'
license: MIT
user-invocable: true
disable-model-invocation: true
---
<!-- cspell:ignore pathspecs unstages -->

# Git Commit

## Goal

Create one local Conventional Commit from whole paths the user selects and confirms, or generate a message for the currently staged changes without touching the index.

## Inputs

* `mode` (optional): `commit` (default) runs the select, stage, confirm, and commit protocol. `message-only` generates a message for the staged changes and never stages, unstages, or commits.

## Message Rules

Generate every message by following the `commit-message` instructions. They own types, scopes, description and body limits, and the footer line. Once generated, the message is authoritative for the commit.

## Message-Only Mode

1. Read the staged changes with `git --no-pager diff --staged`. Use the host's staged-changes tool instead when the user asks to avoid the terminal or no terminal is available.
2. When nothing is staged, output `No changes to commit.` and stop.
3. Generate the message from the complete staged diff.
4. Output the message in a fenced code block and tell the user to copy it as-is or edit it before committing.

## Commit Protocol

1. Inventory candidate paths. Before changing the index, run `git status --porcelain=v1 -z --untracked-files=all` and `git rev-parse --verify HEAD` in the target repository.
   * Record tracked, untracked, deleted, renamed, copied, and initially staged paths. Treat only an `R` or `C` status record that supplies both old and new paths as one logical selection. Present a separate deletion and untracked addition as independent candidates without inferring a rename.
   * If `HEAD` cannot be verified, stop, because this workflow cannot restore a rejected staging change safely.
   * If any path has both staged and unstaged changes, stop and ask the user to resolve its hunk-level intent outside this workflow. Do not restage a partially staged path.
   * If there are no candidate changes, output `No changes to commit.` and stop.
2. Confirm whole-path intent. Present the candidate paths and their states without file contents, then ask the user to select the whole paths intended for this commit.
   * Every initially staged path must be selected. If the user excludes one, stop before changing the index; never unstage prior user work.
   * A status-reported rename or copy is selected only as its complete old-and-new path pair.
   * If the selection is empty, ambiguous, unsafe to represent as shell arguments, or absent, stop without staging or committing.
3. Stage only the selection with `git --literal-pathspecs add -- <safely quoted selected paths>`. Never use an unscoped `git add -A` or `git add -u` path.
   * Quote each path for the active shell and keep `--` before path arguments. If a path cannot be represented safely, stop.
   * Record only the selected paths that were not initially staged as this invocation's staging delta.
   * If staging fails, report a concise error and stop without retrying.
4. Inspect and confirm the staged set. Use the host's staged-changes tool, such as `get_changed_files` with `sourceControlState` set to `staged` and `repositoryPath` set to the full project path.
   * Verify that the exact staged path set contains every selected path, contains every initially staged path, and contains no unselected path. If it differs, restore this invocation's staging delta and stop.
   * Present the exact staged paths without file contents or suspected sensitive values. Ask the user to confirm that these paths and their staged content are intended for the local commit.
   * If the user rejects, does not respond, or gives an ambiguous answer, restore this invocation's staging delta and stop without committing.
   * If no staged changes remain, output `No changes to commit.` and stop without creating an empty commit.
5. Generate the message from the staged changes and commit once, without showing the message first.
   * Pipe the exact message, including body and footer line, through STDIN, for example `echo "<full message>" | git commit -F -`. Preserve newlines exactly and end with the footer line followed by a newline.
   * Run no other Git command at this step (no push, pull, fetch, diff, show, status, log, branch, switch, merge, rebase, or tag).
6. After the commit succeeds, print `Commit created successfully with the following message:`, a blank line, and the full message in a fenced `markdown` code block.
7. If the commit fails, for example because a hook rejects it, report a concise error with a suggested fix and stop without retrying.

### Staging-Delta Restoration

* Restore only paths newly staged by this invocation with `git --literal-pathspecs reset -- <safely quoted staging-delta paths>`. This resets their index entries to `HEAD`, preserves working-tree content, and leaves initially staged paths unchanged.
* Treat both paths of a selected status-reported rename or copy as one restoration unit.
* If restoration fails, report the affected path names and stop. Do not retry or run another recovery command.

### Allowed Commands

* Normal flow: `git status --porcelain=v1 -z --untracked-files=all`, `git rev-parse --verify HEAD`, path-scoped `git --literal-pathspecs add -- <paths>`, path-scoped `git --literal-pathspecs reset -- <paths>` for staging-delta restoration only, and `git commit -F -` or a single-line `git commit -m`.
* Adjustment flow: `git reset --soft HEAD^` as defined in Post-Commit Adjustments.
* Never use Git CLI to obtain file contents or diffs in commit mode. Use `git status` only for path and index-state metadata, and rely on the staged-changes tool for staged content.
* Never use root `.gitignore` presence, absence, length, or completeness as staging authorization.
* Never add a pre-commit hook, require a secret-scanner dependency, or claim that this workflow performs deterministic secret detection. Repository-owned scanning remains a separate downstream control.

## Post-Commit Adjustments

Start this flow only when, immediately after the commit is displayed, the user explicitly asks to change its message or to undo it.

1. Treat the commit just created in this session as the target; do not run history commands to confirm it.
2. Run `git reset --soft HEAD^` to uncommit while preserving the index and working tree.
3. For an undo without a new message, print `Commit undone (changes staged, no new commit message requested).` and stop without committing.
4. For a message change, merge the requested edits into the previous message, correct anything that breaks the commit-message instructions, and commit again with `git commit -F -`.
5. Print `Commit message updated successfully:`, a blank line, and the updated message in a fenced `markdown` code block.

Constraints for this flow:

* Use one soft reset per commit created; repeat only after the user acknowledges the previous update.
* Never amend, rebase, or use the reflog, and never change file contents; only the message changes.
* Keep the original type and scope unless the user supplies valid replacements, and keep exactly one footer line last.
* If the reset or the new commit fails, report a concise error and stop.

## Success Criteria

* Wait only for the two required user decisions: whole-path selection before staging and exact staged-set confirmation before commit. Never infer either decision from silence.
* Only selected paths and initially staged paths enter the commit, and a rejected staged set leaves the initial index and working tree unchanged.
* Message-only mode leaves the index untouched.
* No push or remote operation occurs.

## Example Output

````markdown
Commit created successfully with the following message:

```markdown
feat(prompts): update work item prompts to clarify json output

🔒 - Generated by Copilot
```
````

© microsoft · MIT · microsoft/hve-core

Похожие скиллы

Все скиллы по теме «Git и GitHub» →

Сначала — git-commit от других авторов.

git-commit официальный github Доводит правки до коммита: читает диф, отбирает файлы, пишет сообщение по Conventional Commits и запускает git commit. CX Codex +1 47 165установок git-commit decebals Скилл git-commit анализирует индексированные изменения через git diff и генерирует коммиты по стандарту Conventional Commits с учётом Java-проектов. CX Codex +1 264установок git-commit fvadicamo Скилл git-commit для Claude Code: формирует git-коммиты по Conventional Commits — тип, обязательный scope и subject — вместо агента, чтобы не получить «fix bug». CX Codex +1 324установок git-commit ThinkInAIXYZ Скилл git-commit генерирует коммиты по стандарту Conventional Commits — с типом, областью и описанием. Агент сам читает изменения через git diff --staged и предлагает сообщение. CX Codex +1 1установок git-commit ilteoood Скилл git-commit для Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode анализирует diff и генерирует сообщение коммита по спецификации Conventional Commits. CX Codex +1 624установок git-commit-helper davila7 Читает git diff --staged и составляет коммит-сообщение по формату Conventional Commits. Срабатывает каждый раз после Bash-инструмента и пишет лог в ~/.claude/git-commit-helper.log. CX Codex +1 7 093установок create_git_diff_commit danielmiessler Промпт create_git_diff_commit генерирует команды git add и сообщения коммитов по diff репозитория в формате Conventional Commits. GP ChatGPT ★ 44 690звёзд репо commit getsentry Скилл для коммитов в стиле Sentry: собирает conventional commits со ссылками на задачи и следит, чтобы вы не коммитили прямо в main. CX Codex +1 4 900установок ce-commit EveryInc Скилл ce-commit для Claude Code автоматически создаёт гит-коммиты с осмысленными сообщениями, разбивая изменения на логические блоки. Запускается для фиксации staged- или unstaged-файлов без пуша. CX Codex +1 3 600установок conventional-commit marcelorodrigo Заставляет их писать коммиты по спецификации Conventional Commits: тип, scope, императив в заголовке. CX Codex +1 964установок smart-commit Rohit Ghumare Скилл smart-commit гоняет линт, тайпчек и тесты перед коммитом, просматривает стейдж на мусор и собирает сообщение в формате conventional commits. CX Codex +1 ★ 2 966звёзд репо

Из того же набора148

Весь набор →
vex-generation Правило vex-generation задаёт требования к доказательствам, уровням уверенности и статусам при подготовке VEX-документов. Оно пригодится для анализа CVE с участием ИИ. CX Codex +1 ★ 1 627звёзд репо dataops Справочник Microsoft по DataOps и DS/MLOps-тестированию: где проверять данные, как писать тесты пайплайнов и что считать дрифтом, а что — ошибкой валидации. CX Codex +1 ★ 1 627звёзд репо session-log-canvas-update Скилл session-log-canvas-update сверяет схемы событий сессий Copilot с базовой структурой канваса. Помогает адаптировать парсер, тесты и отображение к новым релизам. CX Codex +1 ★ 1 627звёзд репо Backlog Grooming Субагент Backlog Grooming проверяет открытые GitHub issues, сопоставляет их с кодом и историей репозитория и выдаёт отчёт для поддержки бэклога. CX Codex +1 ★ 1 627звёзд репо ux-coaching Скилл ux-coaching ведёт UX-специалиста через формулирование проблемы, дизайн-критику или защиту решений перед стейкхолдерами через наводящие вопросы. CX Codex +1 ★ 1 627звёзд репо RAI Reviewer Субагент RAI Reviewer координирует оценку кодовой базы по выбранным стандартам ответственного ИИ и собирает отчёт. Запускайте его для аудита, анализа изменений или проверки плана. CX Codex +1 ★ 1 627звёзд репо git-setup Скилл git-setup проверяет конфигурацию Git одной командой, находит пробелы и предлагает безопасные исправления для identity, редактора, diff и merge-инструментов. CX Codex +1 ★ 1 627звёзд репо feasibility Скилл feasibility формирует и проверяет отчёты о технической осуществимости ML- и дата-проектов в Markdown со строгим блоком YAML. CX Codex +1 ★ 1 627звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой