← ClaudeAtlas

commitronlisted

Atomic git commit skill for splitting staged and unstaged changes into one or more conventional commits. Use when the user says commit, 提交, 原子提交, 拆分提交, or commit all.
SakuraPuare/commitron · ★ 2 · Code & Development · score 65
Install: claude install-skill SakuraPuare/commitron
# Commitron Use this skill when the user wants the current git changes committed atomically. ## Rules - For `commit`, produce one commit only. - For `commit-all`, split the working tree into multiple atomic commits in dependency order. - Never use `git add .` or `git add -A`. Staging **specific** files with `git add -- <files>` is allowed and required for untracked files (see below). - Never use `--no-verify`. - **`--amend` 仅限修正本轮自己刚创建且未推送的提交**(如 message 写错、工具故障导致内容不对)。禁止 amend 他人的或已推送的提交。 - Every commit must include a body. - Do not add trailers such as `Co-authored-by`. - Match the commit message language to the last 5 commit subjects. ## Workflow 1. Read `git status --porcelain` (this is the only view that lists untracked files — cached/unstaged diff stat do not), cached diff stat, unstaged diff stat, recent commit subjects, and the current branch. 2. Identify the smallest logical commit units. 3. **Stage untracked files first.** `git commit --only` can only commit files git already tracks; an untracked file makes it fail with `pathspec '<file>' did not match any file(s) known to git`. For any untracked file in the current unit, run `git add -- <those files>` first. This preserves isolation — files staged by other agents stay in the index untouched. 4. **Isolate and commit the current unit (两步法).** 写 message 和提交必须分开执行,中间加断言: **Step A — 写 message 文件:** 使用 `>|`(force-clobber)而非 `>`,或��平台的文件写入工具(如 Claude Code 的 Write tool)。路径使用 `mktemp` 避免碰撞: ```bash MSG=$(