关于 commit
用于检查 Git 变更、暂存相关文件并按约定标签创建原子提交的技能。若提交涉及 AI 上下文文件,还会在提交正文中记录相关变更。
主要功能
- 01检查已跟踪及未跟踪变更
- 02选择性暂存任务相关文件
- 03按约定格式编写提交信息
- 04记录 AI 上下文变更
适用场景
- 01提交范围明确的错误修复
- 02避免暂存凭据及无关文件
- 03在 Git 历史中记录 AI 指引更新
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ jimweller/ clanker-skills --skill commit安装后在 Claude Code 中输入/commit确认已加载。
详细介绍
STARTER_CHARACTER = 📌
提交更改
流程
1. 检查更改
git status
git diff HEAD
git diff --stat HEAD
检查是否有新的未跟踪文件:
git ls-files --others --exclude-standard
2. 暂存文件
添加与当前工作相关的未跟踪和已更改文件。
不要暂存:
.env或凭据文件- 大型二进制文件
- 与当前任务无关的文件
3. 创建提交
编写一条原子化的提交消息,并使用 Conventional Commit 标签:
feat:-- 新功能或能力fix:-- 修复错误refactor:-- 重构代码,但不改变行为docs:-- 仅修改文档test:-- 添加或修复测试chore:-- 构建、CI、工具链变更perf:-- 性能改进
如果跨多个软件包进行 monorepo 更改,请在作用域中注明主要软件包:
feat(workflows): add DAG condition evaluator
fix(web): resolve SSE reconnection on navigation
refactor(isolation): simplify worktree resolution order
提交消息格式:
tag(scope): concise description of what changed
[Optional body explaining WHY this change was made,
not just what changed. Include context changes that aren't
obvious from the diff.]
[Optional: Fixes #123, Closes #456]
4. 记录 AI 上下文更改
如果本次提交修改了任何 AI 上下文资源,请在提交正文中添加 Context: 部分:
feat(orchestrator): add retry logic for session recovery
Added exponential backoff when SDK subprocess crashes mid-session.
Previously a single crash would fail the entire workflow.
Context:
- Updated .claude/rules/orchestrator.md with retry conventions
- Added .claude/commands/debug-session.md for session state inspection
- Surfaced issue: mock.module() in retry tests needs isolated batch
Fixes #482
AI 上下文更改包括:
.claude/rules/-- 新增、更新或删除按需使用的约定.claude/commands/-- 创建或修改斜杠命令.claude/skills/-- 创建或修改斜杠命令.llmdocs/-- 新增或更新参考文档CLAUDE.md-- 全局规则更改**/CLAUDE.md-- 文件夹本地规则更改
Git 日志是未来会话的长期记忆。
评论
支持 Markdown