← 返回 Skills 市场
wusuiling-if

Git Smart Commit

作者 wusuiling-if · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
284
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install git-smart-commit
功能描述
Analyze staged git changes and generate high-quality commit messages following Conventional Commits format. Use when: (1) user asks to commit changes, (2) us...
使用说明 (SKILL.md)

Smart Commit

Generate precise, conventional commit messages from staged git changes and optionally commit in one step.

Workflow

  1. Run git diff --cached --stat to see what's staged. If nothing is staged, check git diff --stat and ask the user if they want to stage all changes first.
  2. Run git diff --cached to get the full diff (if very large, use --stat summary + sample key hunks).
  3. Analyze the diff and generate a commit message following the rules below.
  4. Present the message to the user. If approved, run git commit -m "\x3Cmessage>".

Commit Message Format

Follow Conventional Commits:

\x3Ctype>(\x3Cscope>): \x3Csubject>

[optional body]

[optional footer]

Rules

  • type: One of feat, fix, refactor, docs, chore, test, style, perf, ci, build
  • scope: Optional. Infer from changed files (e.g., auth, api, ui, db). Omit if changes span too many areas.
  • subject: Imperative mood, lowercase, no period, max 72 chars. Be specific — not "update files" but "add retry logic to HTTP client".
  • body: Add only when the "why" isn't obvious from the subject. Wrap at 72 chars.
  • breaking changes: Add ! after type/scope and BREAKING CHANGE: footer.
  • Multiple logical changes: If the diff contains clearly unrelated changes, suggest splitting into multiple commits with git add -p.

Type Selection Guide

Signal Type
New feature, new endpoint, new UI element feat
Bug fix, error correction, patch fix
Code restructure, no behavior change refactor
Comments, README, docs, JSDoc docs
Dependencies, configs, tooling chore
Test files added/modified test
Formatting, whitespace, linting style
Performance improvement perf
CI/CD pipeline changes ci
Build system, compilation build

Quality Checklist

Before presenting the message, verify:

  • Subject is specific and descriptive (someone reading git log --oneline can understand the change)
  • Type accurately reflects the change
  • Scope is correct or intentionally omitted
  • No vague words: "update", "change", "modify", "fix stuff", "misc"
  • Breaking changes are flagged if applicable

Examples

Single file fix:

fix(auth): handle expired JWT tokens in refresh flow

Multi-file feature:

feat(api): add pagination support to list endpoints

Implement cursor-based pagination for /users, /posts, and /comments.
Default page size is 20, max 100.

Breaking change:

feat(config)!: migrate from YAML to TOML configuration

BREAKING CHANGE: config.yaml is no longer supported.
Run `migrate-config` to convert existing configs.

Chore:

chore(deps): bump express from 4.18.2 to 4.19.0

Large Diffs

For diffs exceeding ~4000 lines:

  1. Use git diff --cached --stat for overview
  2. Read key files with git diff --cached -- \x3Cimportant-file>
  3. Summarize the overall change from the stat + sampled hunks
  4. If changes are too diverse, recommend splitting the commit

Options

The user may specify preferences:

  • --no-body: Skip the body, subject only
  • --scope \x3Cname>: Force a specific scope
  • --type \x3Ctype>: Force a specific type
  • --amend: Amend the previous commit instead
  • --dry-run: Generate message without committing
安全使用建议
This skill appears to do exactly what it says: it reads your git diffs and proposes Conventional Commit messages, and can run git commit if approved. Before installing or using it: (1) ensure the git CLI is available on the agent/runtime (the skill assumes git but didn't declare it), (2) be aware the agent will read diffs from your working tree — avoid committing secrets or sensitive data without review, (3) prefer using --dry-run first or require explicit user approval before committing, and (4) review generated commit messages before allowing an automatic commit or amend.
功能分析
Type: OpenClaw Skill Name: git-smart-commit Version: 1.0.0 The skill bundle provides a legitimate utility for generating and applying Conventional Commits based on staged git changes. It uses standard git commands (git diff, git commit) as described in SKILL.md and lacks any indicators of data exfiltration, malicious execution, or harmful prompt injection.
能力评估
Purpose & Capability
Name/description match the instructions: it analyzes staged diffs and produces Conventional Commits messages and can run git commit. However, the skill's manifest lists no required binaries while the runtime steps clearly require the git CLI (git diff, git commit). This is a small metadata mismatch but not a functional incoherence.
Instruction Scope
SKILL.md stays within scope: it directs the agent to run git diff/git commit, analyze diffs, infer type/scope/subject, and optionally stage/amend/commit. It does not instruct reading unrelated files, contacting external endpoints, or accessing unrelated credentials. It may recommend staging all changes if nothing is staged — the agent should confirm with the user before making changes.
Install Mechanism
Instruction-only skill with no install spec and no code files; this has the lowest install risk. Nothing is downloaded or written to disk by the skill itself.
Credentials
No environment variables or credentials are requested, which is appropriate. The only proportionality issue is the missing declared dependency on the git binary. Also, the skill will read repository diffs (including staged and possibly unstaged content if user chooses to stage everything) — that means local code and any secrets contained in diffs could be observed by the agent during analysis; this is expected behavior for a commit-message helper but worth the user's awareness.
Persistence & Privilege
always is false and there are no config paths or requests to modify other skills or system-wide settings. The skill may run git commit if the user approves (or the agent is allowed to act autonomously), which is expected capability for this type of tool.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install git-smart-commit
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /git-smart-commit 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: auto-generate Conventional Commits messages from staged git changes
元数据
Slug git-smart-commit
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Git Smart Commit 是什么?

Analyze staged git changes and generate high-quality commit messages following Conventional Commits format. Use when: (1) user asks to commit changes, (2) us... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 284 次。

如何安装 Git Smart Commit?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install git-smart-commit」即可一键安装,无需额外配置。

Git Smart Commit 是免费的吗?

是的,Git Smart Commit 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Git Smart Commit 支持哪些平台?

Git Smart Commit 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Git Smart Commit?

由 wusuiling-if(@wusuiling-if)开发并维护,当前版本 v1.0.0。

💬 留言讨论