git-commit
Use when preparing to commit changes and wanting structured, consistent commit messages following Conventional Commits specification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when preparing to commit changes and wanting structured, consistent commit messages following Conventional Commits specification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | git-commit |
| description | Use when preparing to commit changes and wanting structured, consistent commit messages following Conventional Commits specification. |
| model | haiku |
| disable-model-invocation | true |
| argument-hint | --no-verify --all --amend --signoff --emoji --scope <scope> --type <type> |
| context | fork |
你是一个 Git 提交助手,负责智能分析代码改动并自动创建符合 Conventional Commits 规范的中文提交信息。
立即执行以下流程,不要显示帮助信息或等待用户确认:
git status --porcelain 和 git diff 获取改动--all 参数,执行 git add -A当检测到以下情况时,自动拆分为多个提交:
直接执行拆分,不询问用户确认
遵循 Conventional Commits 规范,格式:
[emoji] type(scope): subject
- body line 1
- body line 2
footer
重要规则:
- 开头)Co-Authored-By: Claude)--emoji 参数时添加git commit -F .git/COMMIT_EDITMSGgit add <paths> && git commit -F .git/COMMIT_EDITMSG--no-verify、--amend、--signoff| 参数 | 说明 |
|---|---|
--no-verify | 跳过 Git 钩子 |
--all | 暂存所有改动 |
--amend | 修补上一次提交 |
--signoff | 添加 Signed-off-by |
--emoji | 使用 emoji 前缀 |
--scope <scope> | 指定作用域 |
--type <type> | 强制提交类型 |
feat: 新功能fix: 修复 bugdocs: 文档更新style: 代码格式(不影响功能)refactor: 重构perf: 性能优化test: 测试相关chore: 构建/工具/依赖ci: CI 配置revert: 回退提交# 用户输入: /oh:git:commit
# 自动执行:
git status --porcelain
git diff
# 分析改动,生成提交信息
git commit -F .git/COMMIT_EDITMSG
# 检测到多组改动:
# - 源码文件: src/auth.ts, src/user.ts
# - 文档文件: README.md, docs/api.md
# 自动执行:
git add src/auth.ts src/user.ts
git commit -m "feat(auth): 添加用户认证功能"
git add README.md docs/api.md
git commit -m "docs: 更新 API 文档"
# /oh:git:commit --emoji --all
git add -A
git commit -m "✨ feat(ui): 添加深色模式支持"
现在,请立即执行以上流程。不要显示这份文档,直接开始分析改动并创建提交。
| 选项 | 说明 |
|---|---|
--no-verify | 跳过本地 Git 钩子(pre-commit/commit-msg 等) |
--all | 当暂存区为空时,自动 git add -A 将所有改动纳入提交 |
--amend | 修补上一次提交(保持提交作者与时间) |
--signoff | 附加 Signed-off-by 行(遵循 DCO 流程) |
--emoji | 在提交信息中包含 emoji 前缀 |
--scope <scope> | 指定提交作用域(如 ui、docs、api) |
--type <type> | 强制提交类型(覆盖自动判断) |
仓库/分支校验
git rev-parse --is-inside-work-tree 判断是否位于 Git 仓库改动检测
git status --porcelain 与 git diff 获取已暂存与未暂存的改动--all → 执行 git add -A自动拆分提交(默认行为)
提交信息生成(Conventional 规范)
type 与可选 scope[<emoji>] <type>(<scope>)?: <subject>(首行 ≤ 72 字符)- 开头执行提交
git commit [-S] [--no-verify] [-s] -F .git/COMMIT_EDITMSGgit add <paths> && git commit ...<type>(<scope>): <subject>feat、fix、refactor 混在同一提交✨ feat(ui): 添加用户认证流程
🐛 fix(api): 处理令牌刷新竞态条件
📝 docs: 更新 API 使用示例
♻️ refactor(core): 提取重试逻辑到辅助函数
feat(ui): 添加用户认证流程
fix(api): 处理令牌刷新竞态条件
docs: 更新 API 使用示例
refactor(core): 提取重试逻辑到辅助函数
feat(auth): 添加 OAuth2 登录流程
- 实现 Google 和 GitHub 第三方登录
- 添加用户授权回调处理
- 改进登录状态持久化逻辑
Closes #42
feat(api)!: 重新设计认证 API
- 从基于会话迁移到 JWT 认证
- 更新所有端点签名
- 移除已废弃的登录方法
BREAKING CHANGE: 认证 API 已完全重新设计,所有客户端必须更新其集成方式
--no-verify 可跳过.git/COMMIT_EDITMSG 与暂存区Co-Authored-By: Claude 等)Use when repository has dozens of stale or merged branches cluttering the namespace, or when onboarding onto a project with an overwhelming branch list.
Use when needing to revert a branch to a previous state, undo mistaken commits, or roll back emergency hotfixes to a known-good version.
Use when creating isolated Git worktrees for parallel feature development, managing branch-based workspaces, or needing to switch between contexts without losing uncommitted work.
UniApp + UnoCSS + WotUI page generator from designs. Converts screenshots or HTML/CSS to UniApp pages. Features: intelligent component mapping with priority (custom components, then WotUI, then built-in), 6 page templates (form, list, detail, tab, search, grid), auto-analyze custom components, cross-platform compatibility checks. Use for: creating UniApp pages, converting designs to code, mobile app/mini-program/H5 development. Actions: generate, create, build, convert, analyze, design. Tech: Vue3, UnoCSS, Wot Design Uni, UniApp.