commit-changes
О программе
Этот навык Claude обрабатывает индексацию, коммиты и правку коммитов в Git с поддержкой conventional commit сообщений. Он позволяет выборочно добавлять изменения в индекс, проверять сообщения коммитов через HEREDOC и проверять историю перед финализацией. Используйте его для сохранения логических единиц работы, исправления предыдущего коммита или проверки корректности проиндексированных изменений.
Быстрая установка
Claude Code
Рекомендуетсяnpx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/commit-changesСкопируйте и вставьте эту команду в Claude Code для установки этого навыка
Документация
Commit Changes
Stage selective → clear msg → verify history.
Use When
- Save logical unit → version control
- Write conventional msg
- Amend last commit (msg or content)
- Review before commit
In
- Required: Changed files
- Optional: Commit msg (drafted if none)
- Optional: Amend prev?
- Optional: Co-author
Do
Step 1: Review
Check tree + diffs:
# See which files are modified, staged, or untracked
git status
# See unstaged changes
git diff
# See staged changes
git diff --staged
→ Clear view all modified, staged, untracked.
If err: git status fails → verify inside repo (git rev-parse --is-inside-work-tree).
Step 2: Stage Selective
Stage specific files, not git add . or -A → avoids secrets + unrelated changes:
# Stage specific files by name
git add src/feature.R tests/test-feature.R
# Stage all changes in a specific directory
git add src/
# Stage parts of a file interactively (not supported in non-interactive contexts)
# git add -p filename
Review staged before commit:
git diff --staged
→ Only intended files. No .env, creds, big binaries.
If err: accidental stage → git reset HEAD <file>. Secret staged → unstage immediately before commit.
Step 3: Write Msg
Conventional format. Always HEREDOC → proper formatting:
git commit -m "$(cat <<'EOF'
feat: add weighted mean calculation
Implements weighted_mean() with support for NA handling and
zero-weight filtering. Includes input validation for mismatched
vector lengths.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
EOF
)"
Conventional types:
| Type | When |
|---|---|
feat | New feature |
fix | Bug fix |
docs | Docs only |
test | Add/update tests |
refactor | No behavior change |
chore | Build, CI, deps |
style | Formatting, whitespace |
→ Commit created w/ msg explaining why, not what.
If err: pre-commit hook fails → fix, re-stage, create new commit (no --amend → failed commit never existed).
Step 4: Amend Last (Optional)
Amend only if not pushed:
# Amend message only
git commit --amend -m "$(cat <<'EOF'
fix: correct weighted mean edge case for empty vectors
EOF
)"
# Amend with additional staged changes
git add forgotten-file.R
git commit --amend --no-edit
→ Prev commit updated in-place. git log -1 shows amended.
If err: already pushed → no amend. New commit instead. Force-push → history divergence.
Step 5: Verify
# View the last commit
git log -1 --stat
# View recent commit history
git log --oneline -5
# Verify the commit content
git show HEAD
→ Commit in history w/ correct msg, author, files.
If err: wrong files → git reset --soft HEAD~1 (undo, keep staged), re-commit.
Check
- Only intended files committed
- No secrets (tokens, passwords,
.env) - Msg conventional
- Body explains why
-
git logshows correct metadata - Pre-commit hooks passed
Traps
- Too much at once: One commit = one logical change. Split unrelated.
git add .blind: Alwaysgit statusfirst. Stage by name.- Amend pushed: Never amend pushed commits → rewrites history, breaks collaborators.
- Vague msgs: "fix bug" tells nothing. Say what + why.
- Forget
--no-edit: Content amend → use--no-edit→ keeps msg. - Hook fail →
--amend: Hook fail = no commit.--amendhits prev commit. Always new commit after hook fix.
→
manage-git-branches— branch workflow before commitcreate-pull-request— next step after commitresolve-git-conflicts— merge/rebase conflictsconfigure-git-repository— repo setup + conventions
GitHub репозиторий
Frequently asked questions
What is the commit-changes skill?
commit-changes is a Claude Skill by pjt222. Skills package instructions and resources that Claude loads on demand, so Claude can perform commit-changes-related tasks without extra prompting.
How do I install commit-changes?
Use the install commands on this page: add commit-changes to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.
What category does commit-changes belong to?
commit-changes is in the Documentation category, tagged general.
Is commit-changes free to use?
Yes. commit-changes is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.
Похожие навыки
Этот навык получает актуальную документацию Railway, чтобы отвечать на вопросы о функциях, возможностях или конкретных URL-адресах документации. Он гарантирует, что разработчики получают точную и современную информацию напрямую из официальных источников Railway. Используйте его, когда пользователи спрашивают, как работает Railway, или ссылаются на документацию Railway.
Этот навык Claude предоставляет экспертные рекомендации по написанию кода Python в узлах Code платформы n8n, в частности, по использованию стандартной библиотеки Python и работе со специальным синтаксисом n8n, таким как `_input`, `_json` и `_node`. Он помогает разработчикам понять ограничения Python в среде n8n и рекомендует использовать JavaScript для большинства рабочих процессов, предлагая решения на Python для конкретных задач по преобразованию данных.
Навык Archon предоставляет семантический поиск на основе RAG и управление проектами через REST API. Используйте его для запросов к документации, управления иерархическими проектами/задачами и выполнения поиска информации с возможностью загрузки документов. Всегда в первую очередь обращайтесь к Archon при поиске во внешней документации, прежде чем использовать другие источники.
Этот навык Claude предоставляет экспертные рекомендации по написанию кода JavaScript в узлах Code платформы n8n. Он охватывает важный синтаксис, специфичный для n8n, включая переменные `$input`/`$json`, HTTP-хелперы и работу с DateTime, а также помогает в устранении распространённых ошибок. Используйте его при разработке рабочих процессов в n8n, требующих кастомной обработки JavaScript в узлах Code.
