ce-commit
它能做什么
这项技能把你本地的代码改动保存为一个或多个带有清晰信息的 git 提交。适合希望提交历史整洁、又不想进行额外发布步骤的开发者。
适用场景
- ✓当你想把当前改动保存为一个带有清晰信息的提交的时候。
- ✓当你有几项互不相关的改动,并希望把它们拆分成不同提交的时候。
- ✓当你想先在本地提交,之后再决定是否推送的时候。
技能链接
https://github.com/EveryInc/compound-engineering-plugin/blob/main/skills/ce-commit/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请用清晰的信息提交我当前的改动。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能读取工作区和近期的提交风格,对改动的文件进行分组,并撰写说明结果的提交信息。然后它创建提交,并检查改动是否已保存。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Git Commit
Create well-crafted local commit(s) from the current working tree. No push, no PR — use ce-commit-push-pr for the full ship flow.
Done when: each logical change is committed with an explicit file list and a message that states the outcome, and git status is clean of those changes. Stop when: the tree is clean (nothing to commit).
Context
Gather context with each command as its own shell tool call (program + args only). Do not join with ;, &&, ||, pipes, $(...), or redirects — that syntax fails under Windows PowerShell. A non-zero exit is a normal state to interpret, not a failure to suppress.
| Command | Purpose | Non-zero / empty means |
|---|---|---|
git status |
Working-tree state | Not a git repo — stop |
git diff HEAD |
Uncommitted changes | Unborn repo / no commits yet |
git branch --show-current |
Current branch | Empty = detached HEAD |
git log --oneline -10 |
Recent message style | Unborn repo — no history |
git rev-parse --abbrev-ref origin/HEAD |
Remote default branch | No origin/HEAD / bare HEAD — try gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name', else main |
Treat this as a snapshot. Re-read branch and staged set immediately before committing if anything may have changed.
Default branch name: strip a leading origin/ from origin/HEAD (so origin/trunk → trunk). Use that bare name for all “on the default branch?” checks — never compare against origin/<name>.
Workflow
Gather — run every Context command above (own shell call each), then continue.
Nothing to commit — if
git statusshows no staged, modified, or untracked files, report that and stop. Do not usegit diff HEADalone as cleanliness (it misses untracked files).Branch first — if detached HEAD, or on the default branch (
main/master/ the bare default name above), create a feature branch from the change content (git checkout -b <name>), then re-readgit branch --show-current. Do not ask — commit-only still must not leave work only on a detached HEAD or the default branch. If the derived name exists, pick a non-conflicting suffix.Convention — match project commit conventions already in context; else match the recent log pattern; else conventional commits (
type(scope): description). When using conventional commits andfix/featboth fit, default tofix:(remedying broken or missing behavior); reservefeat:for new capabilities. User override wins.Logical commits — if changed files clearly split into distinct concerns, make separate commits (file level only, 2–3 max, no
git add -p). If ambiguous, one commit.Message — subject is imperative and names the outcome (what is now possible or fixed), not the file list. Body only when motivation or trade-offs are not obvious from the subject. When a plan Implementation Unit ID is already in hand for this commit (conversation, caller, or the files belong to one unit), append that unit's U-ID in parentheses —
(U3)means unit 3. Do not hunt for a plan. Omit when the commit spans units, the unit is unclear, or no plan is in hand. When the commit carries someone else's work that will not otherwise land under their name (ported from their branch or PR, or applied from their patch), end the message with aCo-authored-by: Name <email>trailer for each person that work credits: its commit authors and anyone theirCo-authored-bytrailers name. Copy each identity exactly from those commits or the patch. Never guess an email: when none is recorded, name them in the message body instead.- Bad:
Update checkout.rb/Add tests and fix stuff - Good:
Fix double-submit on checkout - Good:
Add per-subscription mute (U3)
- Bad:
Stage and commit — stage named files only (never
git add -Aorgit add .). Honorexclude:<paths>when the invocation carries it: those files stay uncommitted no matter what else changed; say in the report that they were left out. Write the full message — subject line, blank line, optional body — to a file outside the repo with your file-write tool, then stage and commit as two calls per commit group:
git add file1 file2 file3
git commit -F <message-file> -- file1 file2 file3
No shell parses the message with -F: a $, quotes, backticks, or a multi-line body pass through literally under any shell, with no quoting rules to satisfy. Git's normal whitesp
常见问题
它会推送我的提交吗?
不会。它只创建本地提交,完整的发布流程是单独的技能。
如果没有可提交的内容怎么办?
该技能会停止,并报告工作区是干净的。
它会匹配我的代码仓库的信息风格吗?
会。它会检查近期的提交信息,使新信息符合已有风格。
详情
作者的原始描述
Create a git commit with a clear, value-communicating message. Use when the user asks to commit/save staged or unstaged changes with a repo-appropriate message.
热度
- GitHub 星标
- 26k
- 排名
- #10023
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
ce-babysit-pr
26k帮你的智能体通过处理评审意见、失败的检查和过时的分支,持续推动一个未合并的 GitHub 拉取请求走向合并。
ce-bakeoff
26k帮你的智能体为一个问题构建多个相互竞争的方案,进行比较,并把最强的部分组合成一个推荐方案。
ce-brainstorm
26k通过简短的引导式对话,帮你的智能体在任何工作开始前,把模糊的想法整理成清晰、规模合适的需求。
ce-code-review
26k帮你的智能体审查指定的代码改动或拉取请求,查找缺陷、回归、缺失的测试和规范问题,并报告清晰的发现。