From dev-skills
Use only when the user explicitly asks for a commit message without review. Trigger on: 帮我写 commit message, 给个 commit message, 生成 commit message, 这次 commit message 怎么写, write a commit message, skip review, 跳过 review, 我自审过了, only message, 只要 message. Writes a message from the current git diff in repository style. Does not review code quality or mutate the working tree; ambiguous commit requests like 帮我 commit route to dev-code-review.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dev-skills:dev-commit-writerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate a commit message for the current git working tree, in the style of the branch's existing history.
Generate a commit message for the current git working tree, in the style of the branch's existing history.
This skill only writes the message, it does not evaluate code quality. If the user wants a quality check, route them to dev-code-review instead.
Use this skill only when the user explicitly asks for only a commit message and explicitly skips review.
Trigger phrases include:
帮我写 commit message给个 commit message生成 commit messagewrite a commit message这次 commit message 怎么写skip review just give me the message跳过 review 只要 message我自审过了只要 messageonly message no reviewAmbiguous phrases such as 帮我 commit, commit 一下, or I want to commit do not trigger this skill. Route them to dev-code-review, because team policy requires review before commit.
Optional arguments:
--staged: use staged changes only--path=<glob>: limit scope to a path glob执行前先加载 references/dev-baseline.md。以下行为准则在本 skill 全程生效:不假设、最小代码、外科手术式改动、可验证成功标准。
baseline 与本 skill 的关联点:
Incidental: 段落显式列出,不能埋在 subject 里。触发本 skill 之前的入门检查:如果用户原话是模糊表达(例 帮我 commit、commit 一下、commit 这个改动、I want to commit),并不是显式说「skip review / 跳过 review / 只要 message」,先回问意图:
你是想要:
(a) 完整流程 — 先过 dev-code-review 评审,READY 后顺带出 commit message(默认推荐,符合团队约定 CLAUDE.md.template §2)
(b) 只要 commit message,跳过 review(我自审过了 / 是 hotfix / 改动很小)
回答 a / b。如果 a,我退出,你跑 dev-code-review;如果 b,我继续生成 message。
模糊请求默认走 a 路径(让用户改换 dev-code-review),不要替用户选 b 跳过 review。这是 baseline「不假设」的硬性落地。
仅当用户原话显式表达 b 意图(关键词:「skip review」「跳过 review」「我自审过了」「only message」「hotfix 不要 review」),才直接进 Step 1。
只读命令,不修改 working tree:
git status --short
git diff --stat
git diff # unstaged
git diff --cached # staged
git log --oneline -20 # 风格采样
git log -5 --pretty=format:"%H%n%s%n%n%b%n---END---" # 完整 message 采样,看 body 风格
$ARGUMENTS 含 --staged / staged / --cached → 仅 git diff --cached。$ARGUMENTS 含 --path=<glob>(或裸路径)→ 限定该路径。从 git log 采样,识别仓库的 commit 风格特征:
| 维度 | 观察点 |
|---|---|
| 前缀 | feat: / fix: / 中文「添加 / 修复」 / 无前缀 |
| Scope | feat(auth): 这种带 scope?是否常用? |
| 语气 | 祈使句(Add X)/ 陈述句(Added X)/ 中文 |
| 长度 | subject 平均长度,有无 body |
| Issue ref | #123 / JIRA-456 / 无 |
| 大小写 | subject 首字母大小写 |
仓库风格优先于 conventional commits。仅当采样出的风格不一致或 commit 数 < 3 时,退回 conventional commits(feat|fix|refactor|docs|test|chore|perf|ci|style|build)。
读 diff,问自己:用户这次想做的「一件事」是什么?
如果 diff 围绕一个清晰的目标(修一个 bug、加一个 feature、改一处配置),直接进 Step 4。
应用 baseline「不假设」原则。出现以下任一情况时,不要默默选一个 subject,而是列出候选并请用户选:
输出形式:
意图判断存在歧义,本次改动可以理解为:
(a) <候选 message 1>
(b) <候选 message 2>
(c) 拆成两个 commit:<拆分建议>
请选 a/b/c 或给我你的版本。
不要替用户决定。
在产出 message 之前,扫一遍 diff 看是否含夹带改动:
发现夹带时,有三个选择:
Incidental: 显式列出:适用于改动很小、单独成 commit 不值的场景。在 commit message footer 自动加 Refs: 行,关联 spec / plan / fix 产物。
ls .claude/artifacts/designs/ # spec
ls .claude/artifacts/plans/ # plan
ls .claude/artifacts/fixes/ # fix
按以下规则:
| 找到的 artifact 数量 | 行为 |
|---|---|
| 0 个 | 不加 Refs(可能是 docs / chore / 不走流程的小改) |
| 1 个 + subject 与 slug 语义匹配 | 自动加 Refs,例 Refs: spec/user-export 或 Refs: fix/cart-total-off-by-one |
| 1 个 + subject 与 slug 语义不匹配 | 不擅自加,回问:「我看到唯一 in-flight 是 <slug>,但 commit 主题像是 <subject>(语义不重叠)。这个 commit 关联吗?(yes / no / 你给的关联)」 |
| 同 slug 的 spec + plan | 两条都加:Refs: spec/<slug> + Refs: plan/<slug> |
| 多个不同 slug | 回问用户:「我看到这些 in-flight: [...],这次 commit 关联哪个?(可多选 / 或不关联)」 |
判断 commit subject 与 slug 是否语义匹配,看以下 signal:
subject 含 slug 中的核心名词 / 动词?(例 subject feat: add CSV export ↔ slug user-export ✓ 重叠 export)auth-refresh-token ↔ 改 src/auth//✓ 相关)fix(auth) 但 slug 是 user-export 这种 feature → 大概率不关联(用户在 feature 开发期间顺手修了无关 bug)任一信号显示不匹配时,不要硬加 Refs —— 错误的 Refs 比没 Refs 更糟糕(误导后续追溯)。宁愿问一下用户。
<subject>
<body 可选>
Refs: spec/<slug>
Refs: plan/<slug>
git log --grep="Refs:" 检索)spec / plan / fix(对应 designs/plans/fixes 目录).claude/artifacts/ 目录不存在(用户没用过 dev-skills)<type>(<scope>): <subject ≤ 72 chars>
<body 可选,仅在需要解释 why 或列 incidental 时出现>
<footer 可选,如 Refs: #123>
格式细则:
-。按 Step 3 的形式输出 a/b/c 让用户选,不输出最终 message。
fix typo and add tests —— 应拆)git add / git commit / git stash)。git log 不足 3 条或风格混乱,显式说「采样不足,使用 conventional commits 默认」。dev-commit-writer is a single-step tool, not a delegated agent lane.
Use it only when the user explicitly wants a commit message without review. In a multi-agent workflow, reviewer and verifier lanes should finish first; then the main agent may run this skill if the user still wants only message generation. See ../../docs/multi-agent-policy.md for the ownership model.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub jason-chen-coder/dev-skills --plugin dev-skills