commit-helper 的用途是依据 git 差异生成符合 Conventional Commits 规范的提交信息,适用于创建提交、审查已暂存变更或撰写提交信息。触发场景包括“commit this”“コミットして”“write commit message”“what should I commit?”等。主要能力是识别变更类型并生成规范格式:<type>(<scope>): <subject>,可选 body 与 footer。类型包括 feat、fix、docs、style、refactor、perf、test、chore、ci。使用流程:先用 git diff --cached --stat 与 git diff --cached 查看已暂存变更;再判断类型,如新增功能用 feat、修复缺陷用 fix、文档用 docs、无行为变化的重构用 refactor;然后写主题,要求祈使语气、结尾不加句号、不超过 50 字符、冒号后小写,例如 feat(api): add user authentication endpoint,避免“updated stuff”这类模糊描述。body 可补充说明,footer 可写 BREAKING CHANGE、Closes #123 等。示例命令包括 git commit -m "fix(parser): handle empty input gracefully",以及用 heredoc 提交多行信息。限制:资料未提供安装方式、平台支持、收费与价格信息。
commit-helper
通用与其它
更新于 10-16 08:45