← 返回 Skills 市场
ihomway

Git Commit Template

作者 ihomway · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
286
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install git-commit-template
功能描述
Standardized Git commit message templates using changelog-style categories. Use when creating Git commits with structured format - Added (new features), Chan...
使用说明 (SKILL.md)

Git Commit Template

Create structured, changelog-style Git commit messages using five standard categories. This ensures consistent, searchable, and maintainable commit history across projects.

Commit Structure

All commits follow this format:

[Type] Short descriptive title (under 72 chars)

Optional body with detailed explanation, implementation notes,
breaking changes, or migration instructions.

Commit Types

Added

For new features, functionality, or capabilities.

git commit -m "[Added] user authentication with JWT" -m "Implemented JWT-based auth with login/logout endpoints and token refresh"

Changed

For changes in existing functionality, refactoring, or improvements.

git commit -m "[Changed] improved database query performance" -m "Added composite indexes, reduced query time from 250ms to 15ms"

Deprecated

For features that will be removed in future releases.

git commit -m "[Deprecated] legacy API v1 endpoints" -m "Will be removed in v3.0. Migration guide: docs/migration.md"

Removed

For removed features, code, or dependencies.

git commit -m "[Removed] support for Python 3.7" -m "Minimum version now 3.8. Updated CI/CD and docs."

Fixed

For bug fixes and error corrections.

git commit -m "[Fixed] memory leak in WebSocket handler" -m "Fixed unclosed connections causing unbounded memory growth. Closes #1234"

Quick Start

Method 1: Interactive Helper Script (Recommended)

Use the bundled Python script for guided commit creation:

python scripts/commit.py

The script will:

  1. Show staged files
  2. Prompt for commit type selection
  3. Ask for title and optional body
  4. Preview and confirm before committing

Method 2: Direct Command Line

For quick commits:

# Title only
python scripts/commit.py Added "user profile page"

# Title with body
python scripts/commit.py Fixed "login timeout" "Increased session timeout from 5 to 15 minutes"

Method 3: Manual Git Commands

Standard git workflow with template:

# Stage changes
git add src/auth.py tests/test_auth.py

# Commit with template
git commit -m "[Added] two-factor authentication" \
  -m "Implemented TOTP-based 2FA with QR code generation and backup codes"

Guidelines

Title Best Practices

  • Keep under 72 characters
  • Use imperative mood: "add" not "added"
  • Be specific: "[Fixed] null pointer in user parser" not "[Fixed] bug"
  • No period at end
  • Describe what changed, not how

Body Best Practices

  • Wrap at 72 characters
  • Explain why the change was made
  • Include breaking changes prominently
  • Reference issue numbers: "Closes #123", "Fixes #456"
  • Add migration instructions for deprecations
  • Only add body for complex changes

When to Use Each Type

Added: New endpoints, features, files, tests, documentation sections Changed: Refactoring, performance improvements, API modifications, dependency updates Deprecated: Marking features for future removal, providing migration paths Removed: Deleting features, dropping support, removing dependencies Fixed: Bug fixes, error corrections, security patches

Common Patterns

Breaking Changes

Always call out breaking changes:

[Changed] restructured API response format

BREAKING CHANGE: Response structure modified.
Old: { "user": {...} }
New: { "data": {...}, "meta": {...} }

Migration: Access response.data instead of response.user

Multiple Related Changes

Group related changes in one commit with bullet points:

[Added] comprehensive logging system

- Structured logging with context
- Log rotation and archival
- Monitoring dashboard integration
- Performance metrics collection

Security Fixes

Be cautious with details:

[Fixed] authentication bypass vulnerability

Fixed token validation issue. Details withheld per responsible
disclosure. See security advisory SA-2024-001.

Workflow Integration

Pre-commit Checks

The helper script automatically:

  • Verifies staged files exist
  • Validates commit type
  • Ensures title is non-empty
  • Shows file list in confirmation

Git Hooks

Compatible with standard git hooks (pre-commit, commit-msg, etc.):

# Use --no-verify to skip hooks if needed
python scripts/commit.py Fixed "urgent hotfix" --no-verify

Searching Commit History

The structured format makes history searchable:

# Find all new features
git log --oneline --grep="^\[Added\]"

# Find all bug fixes
git log --oneline --grep="^\[Fixed\]"

# Generate changelog
git log --oneline --grep="^\[Added\]\|^\[Changed\]\|^\[Fixed\]"

Examples Reference

For comprehensive examples, best practices, and anti-patterns, see:

  • references/examples.md - Detailed examples for each commit type with good/bad patterns

Script Features

The scripts/commit.py helper provides:

  • Interactive mode: Guided commit creation with prompts
  • Direct mode: Command-line commit creation
  • Validation: Type checking and staged file verification
  • Preview: Show commit before creation
  • Multi-line bodies: Support for detailed descriptions
  • Error handling: Clear error messages and guidance
安全使用建议
This appears to be a simple, local Git commit helper. Before installing or running it: ensure you have git installed (the manifest doesn't list it); review the script if you have bespoke security policies; be aware the script supports --no-verify which will skip Git hooks (so using that flag can bypass pre-commit checks); and run it in repositories where you are comfortable creating commits (it will perform normal 'git commit' operations). If you need guaranteed isolation, run the script in a disposable clone or inspect the code locally first.
功能分析
Type: OpenClaw Skill Name: git-commit-template Version: 1.0.0 The skill bundle provides a legitimate utility for standardizing Git commit messages using a Python helper script (scripts/commit.py). The script uses safe subprocess calls to interact with the local git binary and contains no evidence of data exfiltration, network activity, or malicious intent.
能力评估
Purpose & Capability
The skill's name, description, SKILL.md, and included Python script all align: they implement a commit-message helper. One minor inconsistency: the manifest declares no required binaries, but the script invokes the 'git' executable via subprocess — the skill therefore implicitly requires git on PATH but doesn't list it.
Instruction Scope
SKILL.md and the script limit actions to commit-related local tasks: listing staged files, prompting for commit type/title/body, and invoking 'git commit'. There are no instructions to read arbitrary system files, access environment secrets, or send data to external endpoints. The script uses subprocess.run without shell=True (no obvious command injection vector in the repo-provided code).
Install Mechanism
This is instruction-only with no install spec; no code is downloaded from external URLs during install. The included script is small and runs locally, so install risk is low.
Credentials
The skill requests no environment variables, no credentials, and no config paths. The script does not read environment secrets. This is proportionate to the functionality.
Persistence & Privilege
The skill is not marked always:true and does not modify other skills or global agent configuration. It can be invoked by the user or autonomously (platform default), which is expected for a helper; nothing indicates elevated or persistent privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install git-commit-template
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /git-commit-template 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of standardized Git commit message templates using changelog-style categories. - Supports five commit types: Added, Changed, Deprecated, Removed, Fixed. - Introduces a structured commit format and best practice guidelines. - Provides an interactive Python helper script for guided, validated commit creation. - Includes examples, search patterns, and integration notes for common Git workflows.
元数据
Slug git-commit-template
版本 1.0.0
许可证
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Git Commit Template 是什么?

Standardized Git commit message templates using changelog-style categories. Use when creating Git commits with structured format - Added (new features), Chan... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 286 次。

如何安装 Git Commit Template?

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

Git Commit Template 是免费的吗?

是的,Git Commit Template 完全免费(开源免费),可自由下载、安装和使用。

Git Commit Template 支持哪些平台?

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

谁开发了 Git Commit Template?

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

💬 留言讨论