From 8de7bc7b734cc2e18e6a721c927cb051ea1df7eb Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Sun, 3 May 2026 20:16:57 +0200 Subject: [PATCH] =?UTF-8?q?chore(skills):=20git-commit=20=E2=80=94=20triag?= =?UTF-8?q?e=20pre-existing=20changes=20before=20committing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a mandatory step between assessing changes and grouping commits: surface any modified/untracked files that weren't touched in the current session and ask the user whether to include them. Co-Authored-By: Claude Opus 4.6 --- .claude/skills/git-commit/SKILL.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.claude/skills/git-commit/SKILL.md b/.claude/skills/git-commit/SKILL.md index 45f6a40d9..92a4f2722 100644 --- a/.claude/skills/git-commit/SKILL.md +++ b/.claude/skills/git-commit/SKILL.md @@ -14,16 +14,31 @@ allowed-tools: Bash, Read, Grep, Glob, Write, Edit ## Workflow 1. Run `git status` and `git diff --stat` to assess all pending changes. -2. Group changes into **logical commits** — each commit should represent one +2. **Triage: session vs pre-existing.** Separate changes you made in this + session from changes that were already dirty when the session started. + Check the conversation history — if you didn't touch a file, it's + pre-existing. After grouping your own commits, surface any remaining + modified or untracked files to the user: + + > These files are also modified/untracked but weren't part of this + > session's work: + > - `path/to/file` — + > - `path/to/other` — + > + > Should any of these be included in a commit? + + Wait for the user's answer before staging them. Never silently skip + or silently include pre-existing changes. +3. Group changes into **logical commits** — each commit should represent one coherent change. Common groupings: - A bug fix (all files touched to fix one issue) - A new feature or system (e.g., new trait files + localization + events) - Refactoring / cleanup (encoding fixes, comment fixes, renaming) - Config / meta changes (CLAUDE.md, .claude/ skills, mod descriptor) - Data corrections (province remapping, missing fields) -3. For each logical group, stage only the relevant files and commit with a +4. For each logical group, stage only the relevant files and commit with a properly formatted message. -4. After all commits, update CHANGELOG.md. +5. After all commits, update CHANGELOG.md. ## Commit Message Format