git-commit-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

What I do

我能做什么

  1. Check for sensitive files: Warn about
    .env
    ,
    credentials.json
    , or other secrets before staging
  2. Review changes: Run
    git status
    and
    git diff
    to review all unstaged changes
  3. Stage changes: Execute
    git add -A
    to stage all changes (or offer
    git add -p
    for partial)
  4. Review staged changes: Run
    git diff --cached
    to review what will be committed
  5. Run pre-commit checks: Run lint/typecheck if available in package.json
  6. Generate commit message: Create a clear, conventional commit message following standard conventions
  7. Show preview & confirm: Display the full commit and ask user to confirm/edit
  8. Commit changes: Execute
    git commit
    with the generated message
  9. Check remote status: Verify branch is up-to-date before pushing
  10. Push to remote: Push the commit to the current branch (warn on main/master)
  1. 敏感文件检查:在暂存前针对
    .env
    credentials.json
    或其他密钥类文件发出警告
  2. 变更检查:运行
    git status
    git diff
    检查所有未暂存的变更
  3. 暂存变更:执行
    git add -A
    暂存所有变更(或提供
    git add -p
    选项实现部分暂存)
  4. 检查已暂存变更:运行
    git diff --cached
    检查待提交的内容
  5. 执行pre-commit检查:如果package.json中配置了lint/类型检查,就运行对应的命令
  6. 生成提交信息:遵循标准规范生成清晰的约定式提交信息
  7. 预览与确认:展示完整的提交信息,询问用户确认或编辑
  8. 提交变更:使用生成的信息执行
    git commit
    命令
  9. 检查远程状态:推送前验证分支是否为最新版本
  10. 推送到远程:将提交推送到当前分支(向main/master分支推送时会发出警告)

When to use me

适用场景

Use this when you want to:
  • Commit all staged changes with a well-crafted commit message
  • Ensure changes are properly reviewed before committing
  • Quickly push commits to the remote repository
当你有以下需求时可以使用我:
  • 使用规范的提交信息提交所有暂存的变更
  • 确保提交前所有变更都经过妥善检查
  • 快速将提交推送到远程仓库

How to use

使用方法

  1. Load this skill:
    skill({ name: "git-commit-review" })
  2. I'll check for sensitive files and show you the changes
  3. I'll offer staging options (all or partial)
  4. I'll run lint/typecheck if available
  5. I'll generate and show you the commit message for confirmation
  6. You can edit the message if needed
  7. I'll commit and push (or skip push if you prefer)
  1. 加载该skill:
    skill({ name: "git-commit-review" })
  2. 我会检查敏感文件并向你展示变更内容
  3. 我会提供暂存选项(全部暂存或部分暂存)
  4. 如果有配置的话我会运行lint/类型检查
  5. 我会生成提交信息并展示给你确认
  6. 你可以按需编辑提交信息
  7. 我会执行提交和推送操作(你也可以选择跳过推送步骤)

Options

可选参数

  • Skip push: Tell me "don't push" to skip the push step
  • Amend: Tell me "amend" to amend the last commit
  • Dry run: Tell me "preview" to see what would happen without committing
  • Partial staging: Tell me "partial" to interactively stage hunks
  • 跳过推送:告知我「don't push」即可跳过推送步骤
  • 增补提交:告知我「amend」即可增补到上一次提交
  • 试运行:告知我「preview」即可预览所有操作,不会实际执行提交
  • 部分暂存:告知我「partial」即可交互式选择要暂存的代码块

Commit message format

提交信息格式

I'll generate commit messages following conventional commits:
  • feat: add new feature X
  • fix: resolve issue with Y
  • refactor: simplify logic in Z
  • docs: update documentation
  • chore: update dependencies
For multiple changes, I'll create a summary line and bullet points for details.
If the branch name contains an issue/ticket reference (e.g.,
feature/ABC-123
), I'll include it in the commit message.
我会遵循约定式提交规范生成提交信息:
  • feat: add new feature X
  • fix: resolve issue with Y
  • refactor: simplify logic in Z
  • docs: update documentation
  • chore: update dependencies
如果有多项变更,我会生成摘要行并以要点形式列出详情。
如果分支名包含 issue/工单编号(例如
feature/ABC-123
),我会将其包含在提交信息中。

Safety features

安全特性

  • Sensitive file warnings: Alert if
    .env
    ,
    credentials.json
    ,
    *.key
    , etc. are being staged
  • Hook verification: Never skip pre-commit hooks (
    --no-verify
    is prohibited)
  • Branch protection: Warn when pushing directly to
    main
    or
    master
  • Force push protection: Use
    --force-with-lease
    instead of
    --force
    if force push is needed
  • Up-to-date check: Warn if branch is behind remote before pushing
  • 敏感文件警告:如果
    .env
    credentials.json
    *.key
    等文件被纳入暂存会发出提醒
  • 钩子验证:永远不会跳过pre-commit钩子(禁止使用
    --no-verify
    参数)
  • 分支保护:直接向
    main
    master
    分支推送时会发出警告
  • 强制推送保护:如需强制推送,使用
    --force-with-lease
    代替
    --force
  • 版本最新检查:推送前如果分支落后于远程版本会发出警告