Generate a single-line commit message for ant-design by reading the project's git staged area and recent commit style. Use when the user asks for a commit message, says "msg", "commit msg", "写提交信息", or wants one-line text that covers all staged changes. Output should match the repository's existing commit style and summarize all staged changes in one line.
一、准确概括提交内容 - 基于当前 git 暂存区 生成一行 commit message,覆盖本次提交包含的全部改动。
二、保持仓库风格一致 - 优先贴近仓库已有提交习惯,而不是机械套模板。
commit message 不是对 diff 的逐文件罗列,而是对这次提交意图的压缩表达。先读暂存区,再归纳,再输出一行。
当用户提及以下任一情况时使用本 skill:
默认只根据 staged changes 生成 message,因为真正会被提交的是暂存区内容。
若用户明确说「包含未暂存内容」或「按全部改动写」,才额外查看 git diff。
生成 message 前,除了看暂存区,还要看最近提交,避免写出不符合仓库习惯的格式。
除非用户明确要求解释理由,否则最终回复只给 一行 commit message,不要附带分析、项目符号、代码块或引号。
必须先获取以下信息,再生成 message。不要猜测,也不要只凭文件名写。
建议执行的命令:
git status --short
git diff --cached --stat
git diff --cached
git log --oneline -10
git status --short:确认哪些文件已 stage,是否还有未 stage 内容。git diff --cached --stat:快速把握改动范围。git diff --cached:查看实际提交内容,这是生成 message 的依据。git log --oneline -10:检查仓库最近的提交风格、语言、type/scope 习惯。若暂存区为空:
根据 git diff --cached 的结果:
优先模仿仓库近期写法。对于 ant-design,通常可见这些形式:
fix(Component): ...docs: ...chore: ...ci: ...site: ...注意:
site,可用 site: ...;若是明确修 bug,也可用 fix(site): ...。输出应满足:
优先使用以下之一:
<type>(<scope>): <subject>
或
<scope>: <subject>
例如:
fix(Table): correct pagination when data is emptydocs: update FAQ link in issue templatesite: add one-click copy theme code buttonadd / fix / updatescope 是组件名,如 Button、TableWIP、misc、update files 这类空泛表述常见类型:
feat:新增功能fix:修复问题docs:文档改动refactor:重构test:测试改动chore:依赖、脚本、工程杂项ci:CI 流程改动site:站点展示、文档站交互、官网相关不确定时:
fixdocschoreButton、Tablesite、scripts、docs如果 staged changes 混合了文档、样式、类型、小修复等内容:
若暂存区包含明显不相关的多组改动:
chore(components): clean up styles, types and docsgit diff --cached 就写 message更多 type、scope、antd 风格示例与边界情况见 references/format-and-examples.md。