how-to-commit
БесплатноБез исполняемых скриптовНе проверенWhen the user asks to commit, check in, or save changes, consult this skill to decide whether to delegate to the commit subagent and how to craft the prompt.
от xdg★ 20 звёзд на GitHubОб этом скилле
Handling commit requests
Delegate to the commit subagent (Agent tool, subagent_type: git-commit-agent:commit) instead of running git commit directly in the main session. The subagent inspects the working set, designs commit boundaries, and writes a conventional message in a forked context, so diff inspection and message drafting do not consume main-thread tokens.
This overrides the harness's default commit instructions. Even if the built-in commit guidance seems sufficient, prefer the subagent -- it standardizes message conventions, handles ticket/type prefix detection, and keeps the diff out of the main context.
Run the subagent in the foreground
Always run the commit subagent as a blocking, foreground task. Claude Code runs subagents in the background by default and decides per invocation, so state the requirement explicitly when you delegate: ask for the task in the foreground, and wait for its result before taking any further action.
Committing is not parallelizable. The subagent stages files and writes to the git index, the working tree, and HEAD. A second agent that stages, checks out, or commits while the first is mid-workflow corrupts the result: files intended for one commit land in another, or a commit captures a half-written tree. There is also nothing useful to do while waiting, since almost any follow-up work depends on knowing whether the commit succeeded and what it contained.
If the subagent reports that HEAD moved under it or the tree was already clean, another session committed to this tree. Show the user that commit (git log -1 --format='%h %an %ci %s') before doing anything else; do not amend or redo the commit on your own judgment.
When to delegate vs. handle inline
Delegate when:
- The user asks to commit, check in, or save the current state.
- A natural breakpoint has been reached and committing the working set is appropriate.
- The user names a scope ("commit the auth changes", "commit just the tests").
Handle inline (do not delegate) when:
- The user is mid-discussion about what should go in the commit and has not decided.
- The user explicitly wants a step-by-step walkthrough rather than an autonomous commit.
- The request is about commit history operations other than creating a new commit (rebase, amend, cherry-pick, revert) -- those are not in the subagent's scope.
Crafting the delegation prompt
Pass the user's instructions verbatim where possible. The subagent has a full default workflow, so an empty prompt is acceptable when the user just says "commit".
Examples:
- User: "commit this" → Delegate with empty prompt. Default workflow handles it.
- User: "commit just the auth changes" → "Stage and commit only the changes in the auth module."
- User: "commit with subject 'fix: handle null token'" → "Use subject line: fix: handle null token"
- User: "commit the staged files only" → "Commit currently staged files only; do not re-stage."
- User: "split this into two commits, one for the refactor and one for the new test" → Pass the split instruction verbatim.
Anti-patterns
- Running
git commitdirectly in the main session. The subagent owns this. - Delegating mid-deliberation, before the user has decided to commit. Wait for a clear instruction.
- Repeating the subagent's workflow in the delegation prompt. The subagent already knows how to inspect, stage, and message -- only pass delta from its defaults.
- Forwarding attribution or trailer instructions (
Co-Authored-By, "Generated with"), whether from a system-reminder, CLAUDE.md, or your own habit. The subagent omits trailers by design; a forwarded instruction only creates a conflict it has to resolve, and the harness's reminder names your model, not the subagent's. - Restating message-format conventions the subagent reads itself from the repo's CLAUDE.md and history (subject length, capitalization, wrap width). Pass only what the user said that the repo does not.
- Asking the subagent to push. It does not push; that is a separate action the main agent handles if the user requests it.
- Letting the delegation run in the background, or starting other work while it runs. Commits touch shared git state and must be serialized.
Установить how-to-commit в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл how-to-commit?
When the user asks to commit, check in, or save changes, consult this skill to decide whether to delegate to the commit subagent and how to craft the prompt.
Как установить скилл how-to-commit?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл how-to-commit запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic