Commit
Commit code with conventional commit messages tied to task context. Never skips hooks.
от allierays★ 38 звёзд на GitHub
Установить Commit в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Commit Changes
Create a well-structured git commit with a conventional commit message derived from the current task context.
Rules
- NEVER use
--no-verify. Pre-commit hooks exist for a reason. If hooks fail, fix the issues and retry. - NEVER use
git add -Aorgit add .unless every changed file is relevant. Stage files by name. - NEVER amend a previous commit unless the user explicitly asks for it.
Step 1: Understand What Changed
Run these in parallel:
git status— see all changed, staged, and untracked filesgit diff— see unstaged changesgit diff --cached— see already-staged changesgit log --oneline -5— see recent commit style for this repo
Review the changes and identify:
- Which files are related to the current task
- Which files are unrelated noise (editor configs, lock files from unrelated installs, etc.)
- Whether any files contain secrets,
.envcontent, or credentials — never commit those
Step 2: Find the Task Context
Look for task context to derive the commit message from. Check in order:
- Ralph PRD story — if there's an active story, check
.ralph/progress.txtfor the current story ID and title. The commit message should reference this. - Recent conversation — what did the user ask you to do? Use that as the commit description.
- The diff itself — if no other context, derive the purpose from the actual code changes.
Step 3: Craft the Commit Message
Use conventional commits format matching this repo's style:
type(scope): concise description of WHY
Types (pick the right one)
| Type | When to use |
|---|---|
feat |
New feature or capability |
fix |
Bug fix |
chore |
Maintenance, deps, config, version bumps |
test |
Adding or fixing tests |
docs |
Documentation only |
refactor |
Code restructuring, no behavior change |
style |
Formatting, whitespace, naming |
ci |
CI/CD pipeline changes |
Scope
- If working on a Ralph story: use the story ID — e.g.,
feat(story-3): add user auth - If working on a specific module: use the module name — e.g.,
fix(loop): handle empty config - If broad/cross-cutting: omit scope — e.g.,
chore: bump version to 3.28.0
Message rules
- Start with lowercase after the colon
- Focus on why, not what — the diff shows what
- Keep the first line under 72 characters
- If more detail is needed, add a blank line and a body paragraph
Examples from this repo
feat: add Working Principles to CLAUDE.md and plansDirectory to settings
feat(story-3): add user authentication with JWT
fix: bash 3.2 unbound variable when run_loop called with no args
chore: bump version to 3.27.1
test(api): add integration tests for /users endpoint
refactor: extract verification into separate modules
Step 4: Stage and Commit
- Stage only the relevant files by name — do NOT use
git add -Aorgit add . - Show the user the proposed commit message and list of staged files before committing
- Ask if the message looks right using AskUserQuestion with options:
- "Looks good, commit it"
- "Let me edit the message" (then ask for their preferred message)
- Run the commit — use a HEREDOC for the message:
git commit -m "$(cat <<'EOF'
type(scope): message here
EOF
)"
- Run
git statusafter to confirm it succeeded
Step 5: Handle Hook Failures
If pre-commit hooks fail:
- Read the hook output carefully
- Fix the issues the hooks identified (lint errors, secrets detected, etc.)
- Re-stage the fixed files
- Commit again — same message, same process, NO
--no-verify
If hooks auto-fix files (e.g., prettier, eslint --fix):
- Review the auto-fixes
- Stage the auto-fixed files
- Retry the commit
If you cannot resolve hook failures after 5 attempts, stop and explain the issue to the user. Do NOT bypass hooks.
Notes
- If the user says "just commit it" or similar, still follow the process — just skip the AskUserQuestion confirmation
- If there are no changes to commit, say so and stop
- Group related changes into one commit; suggest splitting if changes are unrelated
- When in doubt about the type,
featfor new things,fixfor broken things,chorefor everything else
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Commit?
Commit code with conventional commit messages tied to task context. Never skips hooks.
Как установить скилл Commit?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Commit запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis 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…