Token导航 LogoToken导航TokenDH.com
开发敏感数据clawhub未标认证来源可访问clear审计提醒

proper-git-commit正确的 git 提交

Agent Skill

proper-git-commit 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 OpenClaw 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,721

周安装

152

GitHub Stars

公开资料未说明

下载量

1,204
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:proper-git-commit(正确的 git 提交)
来源仓库:https://github.com/hugogu/proper-git-commit
安装命令:
openclaw skills install proper-git-commit
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install proper-git-commit

简介

智能 git 提交工具,支持远程同步与修改感知。

  • 自动暂存变更并生成符合规范的 commit 消息。
  • 可通过命令“/commit”触发交互式提交流程。
  • 适用于保持本地与远程仓库一致性的日常开发操作。proper-git-commit 属于开发类 Skill,可作为该场景下的辅助能力补充。
  • 需确保当前目录为有效 git 仓库且有写入权限。

SKILL.md

name
git-commit
description
>
license
MIT
allowed-tools
Bash

Smart Git Commit

Commit local changes safely: sync remote → analyze diff → stage → amend or new commit → push (if asked).


Step 1 — Remote Sync Check

git fetch origin 2>&1

Then check if the remote branch has commits the local branch doesn't:

git status -sb          # shows tracking info, e.g. ## main...origin/main [behind 3]
git rev-list HEAD..@{u} --count 2>/dev/null   # 0 means in sync

If the remote is ahead (count > 0): sync via rebase:

git pull --rebase origin <current-branch>

Watch the output for conflict markers. If the rebase fails or conflicts are reported:

git rebase --abort

Then stop everything and tell the user:

⚠️ Remote conflict — commit aborted Remote has new commits that conflict with your local changes. The rebase was aborted automatically to keep your work safe. To see which files conflict: ``bash git diff --name-only --diff-filter=U ` **To resolve and continue:** `bash # 1. Re-run the rebase git pull --rebase # 2. Open each conflicted file and fix the markers: # <<<<<<< HEAD ← your local changes # (your code) # ======= # (remote code) # >>>>>>> abc1234 ← remote commit # 3. Stage each resolved file git add <file1> <file2> ... # 4. Continue the rebase git rebase --continue # 5. Repeat steps 2–4 for each conflicted commit, then run /commit again ` **To abort and restore your original state:** `bash git rebase --abort # already done — your branch is back to where it was ``

Do not proceed with staging or committing. Wait for the user to resolve.

If the rebase succeeds (no conflicts), continue.


Step 2 — Inspect Staged / Unstaged Changes

git status --porcelain   # list of changed files
git diff --staged        # staged diff
git diff                 # unstaged diff

If nothing is staged and there are unstaged changes, stage everything that looks relevant (avoid committing secrets like .env, *.pem, credentials.*):

git add -A               # or specific files — use judgment

If there is truly nothing to commit, tell the user and stop.


Step 3 — Amend Analysis (Strict Criteria)

Compare the current staged diff against the last commit to decide: new commit or --amend?

git log -1 --format="%H %s"   # last commit hash + subject
git show --stat HEAD           # files changed in last commit
git show HEAD                  # full diff of last commit
git log origin/<branch>..HEAD --oneline  # commits not yet pushed

Only amend if ALL of the following are true:

  1. The last commit has not been pushed to the remote (it appears in git log origin/<branch>..HEAD).
  2. The current staged change has the same commit type (feat/fix/docs/…) as the last commit.
  3. The current staged change affects the same scope (same module/area) as the last commit.
  4. The change is a direct continuation or correction of the exact same atomic operation — e.g., a typo fix in code just added, or a file that was accidentally omitted from the last commit.

Do NOT amend in any of these cases:

SituationWhy
Last commit is feat:, this is fix:Different type → different thing
Last commit is feat:, this adds teststest: is a separate concern
Last commit is feat:, this reformats codestyle: is a separate concern
Last commit is feat:, this updates config/CIDifferent type
Last commit has already been pushedRewriting published history is dangerous
Scope differs (e.g., auth vs user)Different areas

When in doubt, create a new commit. The amend path is the exception, not the rule.


Step 4 — Generate Commit Message

Analyze the staged diff to determine:

  • type: What kind of change? (see table below)
  • scope (optional): Which module, component, or area?
  • description: One-line summary — imperative mood, present tense, under 72 chars
  • body (optional): Why this change? What problem does it solve? Include only if non-obvious.
  • footer: Breaking changes + issue refs + agent/model info

Commit Types

TypeUse for
featNew feature or behavior
fixBug fix
docsDocumentation only
styleFormatting, whitespace (no logic change)
refactorCode restructure (no feature or fix)
perfPerformance improvement
testAdd or update tests
buildBuild system, dependencies
ciCI/CD, pipeline configuration
choreMaintenance, misc tooling
revertRevert a prior commit

Footer — Agent & Model Info

Always append agent and model info in the footer. Use what's available from the environment:

Co-authored-by: Claude <noreply@anthropic.com>
AI-model: claude-sonnet-4-6

If the exact model ID is available (from the system context), use it. Otherwise use the family name.

Full Format

<type>[optional scope]: <description>

[optional body — explain WHY, not WHAT]

[breaking change if any]
[issue refs if any]
Co-authored-by: Claude <noreply@anthropic.com>
AI-model: <model-id>

Step 5 — Execute Commit

New commit:

git commit -m "$(cat <<'EOF'
<type>[scope]: <description>

<optional body>

Co-authored-by: Claude <noreply@anthropic.com>
AI-model: <model-id>
EOF
)"

Amend last commit (only when criteria in Step 3 are fully met):

git commit --amend -m "$(cat <<'EOF'
<updated message>

Co-authored-by: Claude <noreply@anthropic.com>
AI-model: <model-id>
EOF
)"

Step 6 — Push (only if user asked)

If the user explicitly asked to push:

git push origin <current-branch>

Never force-push to main/master. If a force push is needed, confirm with the user first.


Safety Rules

  • Never commit secrets: .env, *.pem, credentials.*, *.key
  • Never skip hooks with --no-verify unless the user explicitly asks
  • Never use git reset --hard or other destructive commands without explicit user request
  • If a pre-commit hook fails: fix the issue, re-stage, create a new commit (never --amend after hook failure)
  • If the rebase produces conflicts: git rebase --abort and stop — do not proceed

Example Messages

feat(auth): add JWT refresh token rotation

Tokens now rotate on each use to limit exposure window.
Refresh tokens are stored hashed in Redis with a 7-day TTL.

Co-authored-by: Claude <noreply@anthropic.com>
AI-model: claude-sonnet-4-6
fix(api): handle null response from payment gateway

Gateway returns null instead of an error object on timeout;
guard added to prevent unhandled exception in checkout flow.

Closes #482

Co-authored-by: Claude <noreply@anthropic.com>
AI-model: claude-sonnet-4-6
docs: update contributing guide with commit conventions

Co-authored-by: Claude <noreply@anthropic.com>
AI-model: claude-sonnet-4-6

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

79.21%
按下载量换算954

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills