git-commit · thinkflowlab — скилл для Claude Code: что делает и как установить
Скилл git-commit для Claude Code создаёт коммит Git или готовит текст сообщения только по содержимому индекса. Включается при запросе на коммит или составление описания изменений.
Apache-2.0 ★ 413 обновлён 2026-11-17
npx skills add ThinkFlowLab/OpenDirector --skill git-commit -a claude-codeЧто делает git-commit
Скилл проверяет git diff --staged перед любыми другими операциями. Если индекс пуст, процесс немедленно останавливается без добавления файлов и без создания пустого коммита. Агент не читает рабочее дерево и не использует контекст предыдущей беседы как доказательство изменений.
Заголовок строится по шаблону [type] scope: imperative description, где тип отражает назначение правки ([feat], [bugfix], [refactor]), а тело сообщения начинается со строки ## summary. Текст сохраняется во временный файл вне рабочего дерева, после чего выполняется git commit --file <message-file> без флагов путей.
Команды git add, git stage и git commit -a полностью запрещены во время подготовки коммита. Если пользователь отдельно запросил отправку изменений, скилл выполняет git rebase на настроенную upstream-ветку и запрещает force push при конфликтах.
Какие задачи решает
- оформить коммит строго из подготовленного индекса
- составить структурированное сообщение с типом и блоком summary
- исключить случайное попадание незаиндексированных файлов в коммит
- разрешить конфликты при обязательном rebase перед отправкой ветки
Примеры запросов агенту
- Подготовь текст коммита для текущего staged diff
- Закоммить проиндексированные изменения
- Сделай коммит для staged файлов с типом bugfix
Как установить git-commit
1Через Skills CLI (Vercel)
npx skills add ThinkFlowLab/OpenDirector --skill git-commit -a claude-code2Вручную: положить файлы
~/.claude/skills/git-commit/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/git-commit/
1Через Skills CLI (Vercel)
npx skills add ThinkFlowLab/OpenDirector --skill git-commit -a codex2Вручную: положить файлы
.agents/skills/git-commit/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add ThinkFlowLab/OpenDirector --skill git-commit -a cursor2Вручную: положить файлы
.cursor/skills/git-commit/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install ThinkFlowLab/OpenDirector .agents/skills/git-commit2Вручную: положить файлы
.github/skills/git-commit/SKILL.md1Через Skills CLI (Vercel)
npx skills add ThinkFlowLab/OpenDirector --skill git-commit -a gemini-cli2Командой платформы
gemini skills install https://github.com/ThinkFlowLab/OpenDirector --path .agents/skills/git-commitВручную: положить файлы
.devin/skills/git-commit/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о git-commit
Как установить git-commit в Claude Code?
Выполните команду npx skills add ThinkFlowLab/OpenDirector --skill git-commit -a claude-code.
Что делает git-commit?
Анализирует git diff --staged, формирует заголовок с префиксом и описанием, добавляет блок ## summary и коммитит через временный файл.
Что нужно для работы git-commit?
Нужен репозиторий Git с предварительно заиндексированными файлами. Если индекс пуст, скилл прерывает выполнение.
Исходный текст
SKILL.md · Apache-2.0
--- name: git-commit description: Create a OpenDirector Git commit, or draft its message, from the current staging area only. Inspect git diff --staged first; never stage files or include unstaged work. --- # Git Commit Commit only changes the user has already staged. Creating or editing this skill does not authorize a commit. A message-only request authorizes only drafting the message; execute a commit when the user requests it. ## Workflow 1. Run `git diff --staged` before any other Git inspection command. If command output is truncated, read the remaining staged diff before describing it. For binary files, describe only what can be established from staged metadata or staged content. 2. If the diff is empty, stop and report that nothing is staged. Do not stage files, create an empty commit, or infer a commit from prior work. 3. Base the message exclusively on this staged diff. Additional inspection may use `git diff --staged --stat`, `git diff --staged --name-status`, or `git show :path` to read the index version. Working-tree files, previous conversation, and the product roadmap are not evidence of staged work. 4. Choose a type prefix and, when useful, one scope from the guidance below. Write a title and a body whose first line is exactly `## summary`. 5. Before committing, run `git diff --staged` again. If its content changed during preparation, reread the new diff and revise the message. If it became empty, stop. Do not include newly staged material without review. 6. Save the exact message to a temporary file outside the working tree and run `git commit --file <message-file>` without a pathspec or any option that changes the staging area. Respect normal sandbox permissions. 7. After success, report the commit hash and title. Inspect the resulting commit with `git log -1 --format='%h %s'` and `git show --stat --oneline HEAD` as needed. If hooks or validation fail, report the failure and stop; leave the staging area as returned, without automatic fixes or retries. ## Staging and commit boundaries - While preparing or creating a commit, never run `git add`, `git stage`, `git commit -a` / `--all`, or any equivalent staging operation, including `git update-index` or `git apply --cached` / `--index`. - Never use `git commit --include`, `--only`, or path arguments. They can commit working-tree content or bypass part of the reviewed index. - Do not unstage, reset, stash, restore, edit, or regenerate project files as part of committing. Partially staged files must retain that boundary. - Do not split staged work, amend commits, bypass hooks, or push unless separately requested. Mixed staged changes may use an umbrella title and summary bullets; do not silently select a subset. - Before any separately requested `git push`, you must first run `git rebase` onto the current branch's configured upstream. If no upstream is configured, do not push; report the blocker instead. If the rebase stops with conflicts, follow the workflow below and do not push until it completes successfully. - If a hook changes the index or files, report the observed effect. Do not undo its changes or claim that the index necessarily remained unchanged. ## Rebase conflict handling When the required pre-push rebase stops with conflicts: 1. Run `git status` and `git diff --name-only --diff-filter=U` to identify every conflicted path. Inspect both sides of each conflict before editing. 2. Resolve each conflict deliberately, preserving intended local and upstream changes. Never discard user work or select an entire side merely to make the conflict disappear. 3. Stage only resolved conflict paths with explicit `git add -- <path>...` commands. Do not stage unrelated working-tree changes; this is the only exception to the no-staging rule above. 4. Confirm `git diff --name-only --diff-filter=U` is empty and run `git diff --cached --check`. Run relevant focused validation for the resolved files when available. 5. Run `git rebase --continue`, preserving the existing commit message. Repeat these steps if a later commit conflicts. 6. After successful completion, run `git status` and ensure no rebase is in progress before pushing. If a conflict cannot be resolved confidently, run `git rebase --abort`, report the affected paths and blocker, and wait for instructions. Never use a force push to bypass conflicts. ## Title Use `[type] scope: imperative description`, omitting `scope:` when a change spans the repository or a scope would add little information. Keep the full title about 70 characters or less. Use English by default for titles and bodies; follow an explicit user language preference. Choose the type by the staged change's purpose, not its file extension: | Prefix | Use | |---|---| | `[feat]` | New user-visible behavior or a newly usable capability. | | `[bugfix]` | Correctness fixes, regressions, stale-result protection, or recovery fixes. | | `[refactor]` | Code or directory restructuring that preserves behavior. | | `[perf]` | A performance improvement supported by the staged implementation; quote measurements only when verified. | | `[docs]` | Documentation, tutorials, comments, examples, and skill instructions. | | `[test]` | Tests, fixtures, or test infrastructure. | | `[build]` | Dependencies, lockfiles, packaging, and build tooling. | | `[ci]` | Automated integration, validation, or delivery pipelines. | | `[chore]` | Repository or operational maintenance not covered above. | UI additions and visual fixes use `[feat]` or `[bugfix]`; CSS files alone do not imply a formatting-only change. When a commit includes supporting tests and docs, choose the type of its main behavior change. Scopes describe the affected area, independently of the type: | Scope | OpenDirector area | |---|---| | `web` | Browser workbench, layouts, components, and local interactions. | | `api` | HTTP / SSE entrypoints, routes, and request handling. | | `agent` | Server-side creative decisions, tools, and evaluation. | | `workflow` | Durable orchestration, dispatch, waiting, and recovery. | | `media` | Probing, proxies, audio, rendering, and export processing. | | `providers` | Language-model and image, video, or speech adapters. | | `storage` | Database, object storage, repositories, and migrations. | | `contracts` | API, event, and shared timeline contracts. | | `repo` | Repository layout, shared tooling, and repository skills. | Use a narrower product scope such as `projects`, `assistant`, `timeline`, or `exports` when clearer. The browser assistant UI is distinct from the server-side `agent`. Future architecture is context for naming, not evidence that a capability already exists. Avoid prefixes such as `[agent]` or `[media]` that mix the type of change with its subsystem. ## Body The required body starts with `## summary`, followed by a short paragraph or Markdown bullets. For multiple distinct points, use bullets starting with `- `. Explain the concrete change and its purpose; state an important preserved invariant when it helps reviewers assess a refactor or fix. Wrap prose and bullet continuation lines manually near 70 characters. Keep commands, identifiers, and URLs intact when wrapping would break them. Use a structured tool argument or a temporary message file with actual newlines; do not interpolate message text into shell command strings. Add the following only when relevant and supported: - `## validation`: commands or checks actually performed against the staged content. A passing working-tree build does not verify a partially staged version. If that distinction cannot be resolved, omit the section or explicitly describe the verification limit. Never invent passing tests. - `## breaking changes`: incompatible API, event, timeline, storage, or command changes, their impact, and a migration action when known. - `Refs: #123` or `Fixes: #123`: only for a real issue supplied by the user or verified from repository context. Use `Fixes` only when addressed. Do not require empty optional sections, repeat the title as the entire summary, include secrets, or claim simulated generation is a real model integration. Describe only the staged result, not the work chronology. Example format (not a claim about the current staging area): ```text [refactor] web: organize the workbench into feature modules ## summary - Move the frontend into apps/web and update resource imports. - Separate layout controls, project operations, and assistant types while preserving existing browser storage keys and schemas. - Update installation, development, and build instructions. ```
© ThinkFlowLab · Apache-2.0 · ThinkFlowLab/OpenDirector
Похожие скиллы
Все скиллы по теме «Git и GitHub» →Сначала — git-commit от других авторов.