agentleFS
eyeixeyeix/skills/commit-msg/SKILL.md

commit-msg

Skill1 starsChanged 30 days agoMITView on GitHub

Generate a git commit message for the currently staged changes. Use when the user asks to generate, write, or suggest a commit message.

16 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use implement and frontend-design.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Hugging FaceSkill

    implement

    Make tests pass. Invoke after /write-tests produces failing tests.

    Also in 3 projects that use this

  • BlockSkill

    frontend-design

    Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

    Also in 3 projects that use this

The file

Files
SKILL.md

Commit Message Generator

Overview

分析当前暂存的变更,参考近期提交风格,生成符合 Conventional Commits 规范的提交信息。

Steps

1. 收集上下文

git diff --staged          # 查看暂存的变更内容
git log --oneline -10      # 了解近期提交风格与粒度
git status                 # 确认暂存范围

2. 分析变更

根据 diff 内容判断:

问题目的
改了什么?确定 scope 和描述
为什么改?决定 type(feat/fix/refactor…)
影响范围?判断是否需要 ! 或 BREAKING CHANGE

3. 生成提交信息

格式:

<type>(<scope>): <subject>

[body]

[footer]

type 选择:

type适用场景
feat新功能
fixBug 修复
refactor重构(不改变行为)
docs仅文档变更
test添加或修改测试
chore构建、依赖、工具配置
style格式、空白、分号(不影响逻辑)
perf性能优化
ciCI/CD 配置

规则:

  • subject 使用祈使句,首字母小写,不加句号
  • subject 不超过 72 个字符
  • scope 为受影响的模块/目录(可省略)
  • 破坏性变更在 footer 加 BREAKING CHANGE: 或 type 后加 !
  • body 说明"为什么"而非"改了什么"(diff 已经说明了什么)

4. 输出

直接给出提交命令,无需额外解释:

git commit -m "$(cat <<'EOF'
feat(auth): add OAuth2 login support

Replaces the custom session-based flow with OAuth2 to support
third-party identity providers without managing credentials.
EOF
)"

若 subject 已足够清晰,省略 body。

Common Mistakes

错误正确做法
fix: fixed the bugfix(parser): handle empty input gracefully
subject 超过 72 字符拆成 subject + body
body 描述"改了什么"body 描述"为什么改"
多个不相关变更写一条提示用户拆分暂存区
翻译成中文再提交与仓库现有提交语言保持一致

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.