Token导航 LogoToken导航

Agent Skill · 运维和基础设施

git-commit(Git 提交)

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

git-commit 是运维和基础设施类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描已通过,按安装量在运维和基础设施类的 2,449 个 Skill 里排第 2,325。

总安装 210周安装 9GitHub Stars 61下载 73核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/melodic-software/claude-code-plugins --skill git-commit

这个 Skill 是做什么的

运维和基础设施类 Skill 处理部署、监控、日志和云资源,多数需要较高的执行权限。

用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。适合围绕代码变更、仓库状态和协作事项进行整理。建议结合原始 README 了解具体操作流程。安装前需确认权限范围、维护状态及是否会触发网络请求。git-commit 属于运维和基础设施类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/git-commit

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/melodic-software/claude-code-plugins --skill g…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

git-commit 怎么安装?

在终端执行 npx skills add https://github.com/melodic-software/claude-code-plugins --skill git-commit。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

git-commit 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

git-commit 需要什么权限?

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

git-commit 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

git-commit 用的人多吗?

公开数据是累计安装 210 次,近一周安装 9 次,下载 73 次,GitHub 61 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

git-commit 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理运维和基础设施类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

运维和基础设施类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
brainstorming

头脑风暴 · Codex、Claude

3,148,776173,131操作浏览器MIT通过
copywriting

文案写作 · Codex、Claude

1,996,72425,583需要联网MIT通过
openclaw-secure-linux-cloud

OpenClaw secure linux cloud 命令行 · Codex、Claude

1,853,08840接触敏感数据未明确未通过
xget

xget 命令行 · Codex、Claude

1,799,28040执行命令未明确未通过
requesting-code-review

代码审查请求 · Codex、Claude

1,590,144173,103权限未标注MIT通过
git-commit

Git 提交 · 本页

21061接触敏感数据MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Git Commit

Comprehensive Git commit protocol implementing Conventional Commits specification with strict safety rules, proper attribution, and complete workflow guidance.

Table of Contents

Overview

This skill provides the authoritative protocol for all Git commit operations, including:

  • Conventional Commits format with required attribution footer
  • Intelligent staging decisions handling mixed staged/unstaged scenarios
  • Safety rules preventing destructive operations
  • 4-step commit workflow ensuring proper execution
  • Pre-commit hook handling for automated tooling failures
  • Pull request creation with complete context
  • System changes verification before committing

CRITICAL: This skill must be invoked before ANY commit operation to ensure compliance with safety protocols and message formatting requirements.

When to Use This Skill

This skill should be used when:

  • Creating any Git commit (regular, initial, merge)
  • Drafting commit messages following Conventional Commits
  • Handling pre-commit hook failures or modifications
  • Creating pull requests with gh pr create
  • Uncertain about commit timing (when to commit vs when to wait)
  • Validating commit safety (checking for secrets, absolute paths, etc.)
  • Amending commits (rare - requires safety checks)
  • Verifying system changes documentation before committing

IMPORTANT: Only create commits when the user explicitly requests. If unclear, ask first.

Critical Safety Rules (NEVER)

These rules are non-negotiable and MUST be followed:

NEVER Rules

  1. NEVER update git config - Configuration changes must be intentional and user-approved
  2. NEVER run destructive commands - No git push --force, git reset --hard, etc. unless explicitly requested
  3. NEVER skip hooks - No --no-verify or --no-gpg-sign flags unless explicitly requested by user
  4. NEVER force push to main/master - Warn user if they request this
  5. NEVER use git commit --amend - ONLY permitted when:

- User explicitly requests amend, OR - Pre-commit hook modified files (requires safety checks - see Hook Handling)

  1. NEVER commit without explicit user request - This is VERY IMPORTANT - only commit when user asks
  2. NEVER commit secret files - Do not commit .env, credentials.json, etc. - warn user if requested
  3. NEVER use interactive git commands - No -i flags (git rebase -i, git add -i) - not supported in non-interactive environments

Safety Verification Before Committing

Before executing any commit:

  • ✅ Check for secrets - Scan staged files for common secret patterns
  • ✅ Check for absolute paths - Ensure no machine-specific paths (like D:\repos\..., /home/user/...)
  • ✅ Verify SYSTEM-CHANGES.md - If any files outside repo were modified (configs, keys, etc.), ensure documented
  • ✅ Confirm user intent - If unclear whether to commit, ask user first

Conventional Commits Format

All commit messages MUST follow the Conventional Commits specification with required Claude Code attribution.

Basic Structure

<type>[optional scope]: <description>

[optional body]

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Commit Types

Use these standardized types:

  • feat: New feature (correlates to MINOR in SemVer)
  • fix: Bug fix (correlates to PATCH in SemVer)
  • docs: Documentation changes only
  • style: Code style changes (formatting, missing semicolons, no logic change)
  • refactor: Code refactoring (neither fixes bug nor adds feature)
  • perf: Performance improvements
  • test: Adding or updating tests
  • chore: Maintenance tasks (dependencies, tooling, configs)
  • ci: CI/CD configuration changes
  • build: Build system or external dependency changes

Breaking Changes

Indicate breaking changes using EITHER:

  1. Exclamation mark before colon: feat!: change API response format
  2. BREAKING CHANGE footer: Include BREAKING CHANGE: <description> in message body

Scope (Optional)

Add scope to provide context about what area of codebase is affected:

feat(api): add user authentication endpoint
fix(database): resolve connection timeout issue
docs(readme): update installation instructions

Message Guidelines

  • Description: Start with lowercase, no period at end, max ~50 characters
  • Focus on WHY, not WHAT: Explain intent and reason, not just the change
  • Be concise: 1-2 sentences in body if needed
  • Use imperative mood: "add feature" not "added feature" or "adds feature"

Complete Message Example

git commit -m "$(cat <<'EOF'
feat(auth): add JWT token refresh mechanism

Implements automatic token refresh to improve user experience
and reduce unnecessary re-authentication.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"

Commit Workflow (4 Steps)

Follow this complete workflow for every commit operation.

Step 1: Gather Information (Parallel)

Run these commands in parallel to understand current state:

# View all staged and unstaged changes
git status

# See exact modifications (staged and unstaged)
git diff
git diff --staged

# Review recent commits to understand message style
git log --oneline -10

Why parallel: These are independent readonly operations - no dependencies between them.

Step 2: Determine Staging Strategy and Draft Message

Based on gathered information, first determine what to commit, then draft the message.

2.1: Analyze Staging State

Count the files in each category from git status:

  • Staged files: Files in "Changes to be committed" section
  • Modified files: Files in "Changes not staged for commit" section (tracked files modified)
  • Untracked files: Files in "Untracked files" section
2.2: Apply Staging Decision Logic
Scenario A: Nothing to commit (staged=0, modified=0, untracked=0)
Working tree is clean - nothing to commit.

Exit gracefully. No commit needed.

Scenario B: Files staged, nothing modified (staged>0, modified=0)

Proceed directly to commit. User has already staged exactly what they want.

Scenario C: Nothing staged, but changes exist (staged=0, modified>0 or untracked>0)

Ask user what to commit using AskUserQuestion:

"I see {N} modified file(s) but nothing is staged yet. What would you like to commit?"

Options:
1. "Stage and commit all modified files" → `git add -u` (stage all tracked files)
2. "Let me stage specific files first" → Exit, let user stage manually, then re-run /commit

If user chooses option 1, proceed with all modified files. If user chooses option 2, exit and inform them to run git add <files> then /commit again.

Scenario D: Mixed staging (staged>0, modified>0)

Ask user using AskUserQuestion:

"I see {N} file(s) staged and {M} file(s) modified but not staged. What would you like to commit?"

Options:
1. "Commit only the staged files" → Proceed with staged files only
2. "Stage and commit everything" → `git add -u` then commit all

Respect user's choice.

2.3: Draft Commit Message

After confirming what will be committed:

  1. Review all changes to be committed
  2. Determine commit type - feat, fix, docs, refactor, style, etc.
  3. Draft concise message following Conventional Commits format
  4. Verify no secrets - Check for .env, credentials.json, API keys, tokens
  5. Verify no absolute paths - Ensure no D:\repos\..., /home/user/... in committed content
  6. Check SYSTEM-CHANGES.md - If any system files touched, verify documented

Message drafting checklist:

  • Correct type (feat/fix/docs/etc.)
  • Optional scope if applicable
  • Imperative mood description
  • Body paragraph if needed (explain WHY)
  • Attribution footer included
  • Breaking change notation if applicable

Step 3: Execute Commit (Sequential)

Run these commands in sequence (dependencies exist):

# Stage files if needed (based on Step 2 decision)
# - If user chose "stage all": git add -u
# - If files already staged: skip this step
# - If user is staging specific files: they should do this before running /commit

# Create commit with HEREDOC format (REQUIRED)
git commit -m "$(cat <<'EOF'
<type>[scope]: <description>

[optional body]

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"

# Verify commit succeeded
git status

Why sequential: Each operation depends on the previous completing successfully.

CRITICAL: ALWAYS use HEREDOC format with $(cat <<'EOF'... EOF) to ensure proper formatting and avoid shell escaping issues.

Staging commands reference:

  • git add -u - Stage all tracked modified files (doesn't include new untracked files)
  • git add -A - Stage everything (tracked + untracked, modifications + deletions)
  • git add <file> - Stage specific file(s)

Step 4: Handle Pre-Commit Hook Failures

If commit fails due to pre-commit hooks (linters, formatters, etc.):

Retry ONCE if hook modified files:

# Check if files were modified by hook
git diff

# If modifications exist, check if safe to amend
git log -1 --format='%an %ae'  # Check authorship (must be you)
git status                      # Check not pushed (must show "ahead of")

# If BOTH checks pass, amend the commit:
git add .
git commit --amend --no-edit

# If EITHER check fails, create NEW commit instead:
git add .
git commit -m "$(cat <<'EOF'
chore: apply automated linting fixes

Pre-commit hooks applied automatic formatting changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"

Amend safety protocol:

  • ✅ Check authorship first: git log -1 --format='%an %ae' - Only amend YOUR commits
  • ✅ Check not pushed: git status must show "Your branch is ahead" (not pushed to remote)
  • ✅ Only if BOTH pass: Then amend is safe
  • ❌ If EITHER fails: Create new commit instead - NEVER amend others' commits or pushed commits

When to skip retry:

  • Hook failed with errors (not just warnings)
  • Hook did not modify files
  • Safety checks failed (not your commit or already pushed)

Pull Request Creation

When user requests pull request creation, follow this workflow.

Step 1: Understand Branch Context (Parallel)

# View current branch status
git status

# See all changes since divergence from base branch
git diff main...HEAD    # Or other base branch
git log main...HEAD     # All commits that will be in PR

# Check remote tracking status
git branch -vv

Step 2: Analyze ALL Commits

Review ALL commits that will be included in PR (NOT just the latest commit):

  • Read all commit messages
  • Understand full scope of changes
  • Draft comprehensive PR summary covering entire branch

Step 3: Create Pull Request (Sequential)

# Create new branch if needed
git checkout -b feature-branch-name

# Push to remote with tracking
git push -u origin feature-branch-name

# Create PR using HEREDOC for body
gh pr create --title "feat: Brief PR title" --body "$(cat <<'EOF'
## Summary
- Bullet point summary of changes
- Key features or fixes
- Breaking changes if any

## Test plan
- [ ] Manual testing steps
- [ ] Automated tests added/updated
- [ ] Documentation updated

🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"

Return PR URL when complete so user can view it.

DO NOT push to remote unless user explicitly requests PR creation or push.

When to Commit

Only create commits when:

  • ✅ User explicitly requests: "Create a commit", "Commit these changes", "Make a commit", etc.
  • ✅ User confirms when asked for clarification
  • ✅ Completing a task where commit was part of explicit requirements

Do NOT commit when:

  • ❌ User asks to "save" or "update" without mentioning commit/git
  • ❌ Completing edits without explicit commit request
  • ❌ Uncertain about user intent
  • ❌ Multiple logical changes that should be separate commits

If unclear, ASK: "Would you like me to create a commit with these changes?"

System Changes Documentation

CRITICAL REQUIREMENT: Before committing, verify all system-level changes are documented.

What Requires Documentation

Any changes made outside this repository:

  • Configuration files (~/.gitconfig, ~/.ssh/config, etc.)
  • System-level keys or credentials (GPG keys, SSH keys)
  • Cloud resources (GitHub Secrets, environment variables)
  • Installed packages or tools
  • Environment variable modifications

Verification Process

Before executing commit:

  1. Ask yourself: "Did I modify any files outside this repo?"
  2. If YES: Check that SYSTEM-CHANGES.md has been updated
  3. If NO: Proceed with commit

See SYSTEM-CHANGES.md format requirements in repository documentation.

Examples

For concrete examples of common commit scenarios, see references/examples.md:

  • Simple feature additions with proper scoping
  • Bug fixes with detailed explanations
  • Breaking changes with proper notation
  • Documentation-only commits
  • Multi-file refactoring examples

All examples follow Conventional Commits specification with required Claude Code attribution.

Resources

This skill includes comprehensive reference documentation:

references/

Troubleshooting

For solutions to common Git commit issues, see references/troubleshooting.md:

  • GPG signing failures
  • Pre-commit hook issues
  • Commit type selection guidance
  • Mixed staging state handling
  • Amend safety check failures

All troubleshooting solutions follow safety protocols and never bypass hooks or GPG signing.

Best Practices

  • ✅ Always use HEREDOC format for commit messages - ensures proper formatting
  • ✅ Review changes before committing - Run git diff and git status first
  • ✅ Commit logically related changes together - Don't mix unrelated edits
  • ✅ Write descriptive commit messages - Focus on WHY, not just WHAT
  • ✅ Use scopes consistently - Pick scope names and stick with them across commits
  • ✅ Invoke git-commit skill - Always use this skill before committing to ensure compliance
  • ✅ Verify system changes documented - Check SYSTEM-CHANGES.md before committing
  • ✅ Follow safety protocols - Never skip hooks or bypass GPG signing
  • ❌ Never commit secrets - Add .env, credentials.json to .gitignore
  • ❌ Never commit absolute paths - Use relative paths or placeholders
  • ❌ Never commit without explicit request - Only commit when user asks

Testing

For comprehensive test scenarios and multi-model testing guidance, see references/testing.md:

  • Six detailed test scenarios covering common use cases
  • Multi-model testing notes (Sonnet, Haiku, Opus)
  • Expected behavior and success criteria for each scenario
  • Evaluation criteria for skill quality assessment

Current testing status: Verified with Sonnet. Haiku and Opus testing pending.

Version History

  • v1.3.1 (2025-11-25): Audit improvements - standardize model references to use model families (Sonnet, Haiku, Opus) instead of specific versions, add Last Verified dates to examples.md, troubleshooting.md, and testing.md for consistency
  • v1.3.0 (2025-11-17): Optimize SKILL.md for token efficiency - move Examples, Troubleshooting, and Testing to separate reference files; remove empty assets/ and scripts/ directories; improve progressive disclosure pattern
  • v1.2.0 (2025-11-13): Add test scenarios and multi-model testing documentation, add execution verbs to description, remove unused template files from scripts/ and assets/ directories
  • v1.1.0 (2025-11-13): Add intelligent staging decision logic - handles mixed staged/unstaged scenarios, asks user intent when ambiguous, detects "nothing to commit" gracefully
  • v1.0.0 (2025-11-13): Initial release - comprehensive git commit skill with Conventional Commits specification, safety protocols, and complete workflow guidance

Last Updated

Date: 2025-11-28 Model: claude-opus-4-5-20251101

平台分布

OpenCode

30.06%
按下载量换算22

trae

23.02%
按下载量换算17

Antigravity

18.57%
按下载量换算14

windsurf

13.6%
按下载量换算10

Claude Code

7.07%
按下载量换算5

Codex

3.3%
按下载量换算2

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills