git-commit
Skill0 starsChanged 10 months agoMITView on GitHub
Generates commit messages by analyzing git diffs and learning project commit style. Use when committing code changes, when the user asks for help writing commit messages, or mentions git commit.
- Reads credentials
174 other projects use a version of this.
Adopted by
Most recently taken up by
- HAOYI99/skillstheir own version, first seen Nov 8, 2026
- swjybky/deepwritetheir own version, first seen Nov 8, 2026
- PC2005-cloud/dsh-pettheir own version, first seen Nov 8, 2026
- stuff4ai/skillstheir own version, first seen Nov 8, 2026
- apattichis/agentic-research-toolkittheir own version, first seen Nov 8, 2026
- Darna-Digital/skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use github-pr-create, git-issue and 8 more.
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.
mjun0812Skillgithub-pr-create
Pull Requestを作成するSkill。現在のbranchからpull requestを作成する。言語指定可能。 ユーザーが「PR作って」「pull request作成して」のように依頼したら使うこと。
Also in 3 projects that use this
klauswgSkillgit-issue
Prepare, review, create, or update evidence-based GitHub issues for the current repository with duplicate detection, repository-native templates, valid labels, and post-publication verification. Use when the user asks to draft, file, submit, publish, edit, or refine a GitHub issue, bug report, feature request, performance issue, or technical proposal. Always require the user to review and explicitly approve the exact final issue before any GitHub write.
Also in 3 projects that use this
gologo13Skillgit-push
Push current branch to origin and sync with remote updates; keywords: git, rebase. Use only on explicit request; before execution, review diffs and list impact scope.
Also in 6 projects that use this
GoogleSkillgithub-pr-review
Review a GitHub pull request and leave inline comments in a natural human reviewing voice, indistinguishable from comments typed by hand on the GitHub web UI. Deliberately bounded to defects a reader can settle by looking at the anchored line, rather than a deep audit, so every comment is cheap for the author to check. Scales to 2-20 comments by PR size, parallelises analysis across sub-agents, drafts for approval, then posts individually with human pacing. Use when the user says "review this PR", "review PR 123", pastes a github.com/.../pull/N link, or asks for comments on a pull request. Don't use for reviewing local uncommitted changes or a diff against a branch (use the `review` skill for that).
Also in 4 projects that use this
GitHubSkillmulti-stage-dockerfile
Create optimized multi-stage Dockerfiles for any language or framework
Also in 3 projects that use this
Microsoft AzureSkilltest-discipline
Update tests when changing APIs — no exceptions
Also in 3 projects that use this
Other versions174 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 174
- github/awesome-copilot★ 41ksame name
- doocs/leetcode★ 37ksame name
- tisfeng/Easydict★ 15ksame name
- doocs/md★ 14ksame name
- spinabot/brigade★ 11ksame name
- PC2005-cloud/dsh-pet★ 5.9ksame name
- GitTools/GitVersion★ 3.1ksame name
- igorescodro/alkaa★ 1.6ksame name
- microsoft/hve-core★ 1.6ksame name
- mattmireles/gemma-tuner-multimodal★ 1.5ksame name
164 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
- git-branchSkill
- git-cleanupSkill
- git-prSkill
- git-repo-guideSkill
The file
Files
Git Commit
智能 Git 提交 - 学习项目风格,生成规范 commit message
Context
- 当前分支: !
git branch --show-current - Git 状态: !
git status --short - 暂存变更统计: !
git diff --cached --stat - 暂存变更详情: !
git diff --cached - 提交历史样本: !
git log --format="%s" -15
Workflow
执行以下 3 个步骤,不要跳过任何步骤。
Step 1: 前置检查与分析
1.1 前置检查
首先检查以下条件,如不满足则立即停止并提示用户:
| 检查项 | 失败时的处理 |
| 暂存区为空 | 停止并提示:暂存区为空,请先使用 git add 添加文件 |
| 在 main/master 分支 | 警告:⚠️ 当前在保护分支,建议创建新分支后再提交 |
| 检测到敏感文件 | 警告并列出文件,建议排除 |
敏感文件模式(检测暂存区):
.env, .env.*, *.env
*credential*, *secret*, *token*, *password*
*.pem, *.key, *.p12, *.pfx
id_rsa, id_dsa, id_ecdsa1.2 学习项目提交风格
分析 Context 中的「提交历史样本」,识别以下模式:
语言判断:
- 统计 15 条历史 commit 中的中文/英文比例
- 中文字符占比 > 50% → 使用中文
- 否则 → 使用英文
格式判断:
| 模式 | 识别特征 | 示例 |
| Conventional + Scope | 匹配 类型(范围): | feat(api): xxx |
| Conventional 无 Scope | 匹配 类型: | feat: xxx |
| 方括号前缀 | 匹配 [类型] | [feat] xxx |
| 无前缀 | 无固定前缀 | Add user login |
Scope 提取:从历史中提取常用 scope 列表,如:api, ui, core, auth, docs
1.3 分析暂存变更
根据 git diff --cached 判断变更类型:
| 变更类型 | 识别信号 |
feat | 新增文件、新函数/类/组件、新 API 端点 |
fix | 修复条件判断、异常处理、边界情况 |
refactor | 重命名、提取函数、移动代码(功能不变) |
docs | .md 文件、注释、README |
test | test_.py、.spec.ts、*.test.js |
chore | package.json、配置文件、CI/CD |
style | 纯格式化、空格、缩进 |
Scope 推断(根据文件路径):
src/api/*→ apisrc/ui/*→ uisrc/core/*→ core- 跨多模块 → 不加 scope
Step 2: 生成预览
根据 Step 1 的分析结果,生成 commit message 并展示预览。
输出格式:
╭─────────────────────────────────────────────────────╮
│ 📋 Git 提交预览 │
╰─────────────────────────────────────────────────────╯
🎨 检测到的项目风格:
语言: [中文/英文]
格式: [feat(scope): / feat: / 无前缀]
常用 Scope: [api, ui, core, ...]
📝 生成的提交信息:
╭─────────────────────────────────────────────────────╮
│ <type>(<scope>): <subject> │
╰─────────────────────────────────────────────────────╯
📁 将提交的文件:
• file1.py (+xx, -xx)
• file2.py (+xx, -xx)
[共 N 个文件, +XX 行, -XX 行]
⚠️ 注意事项:
[如有敏感文件警告或其他提示,在此显示]
─────────────────────────────────────────────────────
请选择操作:
• 输入 "ok" 或 "确认" → 执行提交
• 输入修改意见 → 重新生成
• 输入 "cancel" 或 "取消" → 放弃操作Commit Message 生成规则:
- 使用检测到的项目风格(语言、格式)
- Subject 长度 ≤ 50 字符
- 动词开头(中文:添加/修复/重构;英文:add/fix/refactor)
- 不加句号结尾
Step 3: 确认执行
等待用户输入,根据响应执行:
| 用户输入 | 操作 |
ok/确认/y/yes | 执行 git commit -m "..." |
| 修改意见(如"改成fix") | 根据意见重新生成,返回 Step 2 |
cancel/取消/n/no | 输出 🚫 已取消提交 并结束 |
执行成功后输出:
✅ 提交成功!
📝 feat(api): 添加用户注册接口
🔑 commit: a1b2c3d
🌿 分支: feature/user-authDefault Conventions
如果项目提交历史不足 5 条,无法判断风格,使用以下默认规范:
格式: <type>(<scope>): <subject>
语言: 中文
动词: 祈使句(添加/修复/更新/重构/删除)
类型:
feat 新功能
fix 问题修复
refactor 重构
docs 文档
test 测试
chore 构建/工具/配置
style 代码格式
perf 性能优化Error Handling
| 情况 | 输出 |
| 暂存区为空 | ❌ 暂存区为空\n💡 请先使用 git add <file> 添加要提交的文件 |
| 在保护分支 | ⚠️ 当前在 main 分支\n💡 建议: git checkout -b feature/xxx |
| 检测到敏感文件 | ⚠️ 检测到敏感文件:\n ❌ .env.local\n💡 请使用 git reset HEAD <file> 移除 |
| git 命令失败 | ❌ Git 命令执行失败\n💡 错误信息: <stderr> |
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
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.

