commit
Installation
SKILL.md
Commit
这个 skill 的产出是一次范围正确的本地提交(或一条只读生成的消息)。三件事决定成败:选对变更集、消息符合 emoji + Conventional Commits、报告与 Git 实际结果一致。不 push。
1. 先分流模式
- message-only:用户只要生成、推荐或改写 commit message。只读
git status、git diff --cached、git diff和必要文件;不git add、不git commit、不改.gitignore或其他工作树/index。默认分析 staged changes;用户点名另一组 unstaged/untracked 变更时只分析该范围,并说明 staged 内容被排除。范围不唯一时只说明需要选哪组。 - execute-commit:用户明确要求提交。才进入下面的 stage、Ignore vs Commit 和 commit 流程。
2. 确定提交范围(execute-commit)
第一次探测合并成一次调用:
git status --short --branch && git diff --cached --stat
按顺序判断: