mcpField
W
writing-commits

writing-commits

github.com/augmnt开发244 次安装40 周前更新
代码仓库

关于 writing-commits

writing-commits 是一项帮助开发者编写提交信息及 Pull Request 标题和说明的技能,遵循 Conventional Commits 规范。它还提供分支命名规则和示例。

主要功能

  1. 01按 Conventional Commits 编写信息
  2. 02规范提交主题与类型
  3. 03提供 PR 标题和说明模板
  4. 04定义分支命名格式

适用场景

  1. 01为新功能撰写提交信息
  2. 02为破坏性变更标注提交
  3. 03准备 PR 标题和说明
  4. 04按类型命名开发分支

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/augmnt/webdev-skills --skill writing-commits

安装后在 Claude Code 中输入/writing-commits确认已加载。

详细介绍

编写提交信息

遵循 Conventional Commits:<type>(<scope>): <subject>

类型

类型用途
feat面向用户的新功能
fix修复错误
docs仅修改文档
refactor修改代码,不改变行为
test添加或修复测试
chore构建、依赖、工具

规则

  1. 主题:使用祈使语气,不加句号,≤50 个字符
  2. 范围:可选的领域标识(auth、api、ui)
  3. 破坏性变更:在类型后添加 !

示例

feat(auth): add Google OAuth login
fix(api): handle null user in profile endpoint
feat(api)!: change auth response format
chore(deps): upgrade Next.js to 15

反模式

# ❌ Avoid
"fix stuff"
"updates"
"WIP"

# ✅ Prefer
"fix(auth): resolve token refresh race condition"

PR 标题

格式与提交信息相同。PR 标题会成为压缩提交信息。

PR 正文

## What
[Brief description]

## Why
[Context/motivation]

## Testing
[How verified]

分支命名

# Format: type/short-description
feat/oauth-login
fix/token-refresh
chore/upgrade-deps

# With ticket numbers
feat/PROJ-123-oauth-login
fix/PROJ-456-token-refresh

分支应保持短期存在。合并后删除。

评论

支持 Markdown