Write a commit message for what you staged, not everything you edited
Описание и применение
Автоматизированный рецепт генерации сообщения коммита, отражающего только подготовленные изменения, чтобы избежать недостоверных описаний.
Задача
When only part of a file is staged, a commit message that describes all edits in the file misrepresents the commit content.
Результат
The workflow demonstrates how to generate a commit message that accurately reflects only staged changes, preventing misleading commit descriptions.
Рабочий процесс
- Clone the agent-toolbox repo and switch to demo branch
- Append a new test to test/todo.test.js
- Stage the file with git add
- Rename an existing test in the same file without staging
- Verify status shows MM and diff shows staged vs unstaged changes
- Prompt the assistant with the Good Commit skill to generate a commit message
- Review the proposed message to ensure it matches git diff --cached
- Copy the Good Commit skill into your own repo and use the same prompt
- Optionally contribute improvements via issues
Доказательства
Suppose you add a todo validation test and also tidy another test in the same file. You stage only the new test. A commit message describing both edits would promise a change that is not in the commit.
The assistant should explain that this proposal covers the staged test addition and mention the unstaged test-name edit separately.
- Дата записи: 2026-10-15T21:41:11.580Z