commit

commit is a command for Claude Code from xiaobei930/cc-best. It costs 24 tokens per session (818 once invoked), scanned A, original, MIT.

A Git commit command that reviews changes, stages selected files, and creates a commit message following Conventional Commits, a shared format such as “fix: correct login error.”

In plain words
What is it for?
Use it to commit features, bug fixes, documentation, refactors, tests, formatting changes, dependency updates, or performance work.
Why use it?
It reduces the work of inspecting changes and writing consistent commit messages. It also lists safeguards against risky history-changing operations.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the cc-best plugin — 19 skills, 44 commands, 8 agents, 20 hooks shipped together

Good fit Use it to commit features, bug fixes, documentation, refactors, tests, formatting changes, dependency updates, or performance work.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/xiaobei930/cc-best/commit
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/xiaobei930/cc-best

Made for: Claude Code.

Or install cc-best, the plugin that ships this one along with the rest of its 19 skills, 44 commands, 8 agents, 20 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for commit

README.md
[![agentmods](https://agentmods.dev/badge/commands/xiaobei930/cc-best/commit/github.svg)](https://agentmods.dev/commands/xiaobei930/cc-best/commit)
Your own site
<a href="https://agentmods.dev/commands/xiaobei930/cc-best/commit"><img src="https://agentmods.dev/badge/commands/xiaobei930/cc-best/commit/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for commit

Your own site · 80×15
<a href="https://agentmods.dev/commands/xiaobei930/cc-best/commit"><img src="https://agentmods.dev/badge/commands/xiaobei930/cc-best/commit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 818 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00024 $0.00818
Opus 5.5 $0.00010 $0.00327
Sonnet 5.5 $0.00005 $0.00164
Haiku 4.5 $0.00002 $0.00082

Measured 1mo ago against content hash d21618505365, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

commit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/commit.md · 106 lines

What it actually says

/commit - Git 提交

执行 Git 提交操作,遵循 Conventional Commits 规范。

提交流程

1. 检查状态
   └─ git status 查看变更文件
   └─ git diff 查看具体变更

2. 暂存文件
   └─ git add <files>

3. 生成提交信息
   └─ 分析变更内容
   └─ 选择合适的类型前缀
   └─ 编写简洁的描述

4. 执行提交
   └─ git commit -m "type: description"

Conventional Commits 规范

类型前缀

类型 说明 示例
feat 新功能 feat: 添加用户登录功能
fix Bug 修复 fix: 修复音频播放崩溃问题
docs 文档更新 docs: 更新 API 文档
style 代码格式 style: 格式化代码
refactor 重构 refactor: 重构音频处理模块
test 测试 test: 添加用户服务单元测试
chore 构建/工具 chore: 更新依赖版本
perf 性能优化 perf: 优化图片加载速度

提交信息格式

<type>(<scope>): <subject>

[optional body]

[optional footer]

示例

# 简单提交
git commit -m "feat: 添加语音识别功能"

# 带范围的提交
git commit -m "fix(auth): 修复 token 过期处理"

# 带详细说明的提交
git commit -m "$(cat <<'EOF'
feat(audio): 实现实时音频处理

- 添加 AudioProcessor 类
- 支持 PCM 和 WAV 格式
- 集成 FunASR 进行识别

Closes #123
EOF
)"

禁止操作

  • 禁止 git push --force
  • 禁止 git reset --hard(已推送的提交)
  • 禁止 git commit --amend(已推送的提交)
  • 禁止 在 commit message 中添加 Co-Authored-By

最佳实践

  1. 原子提交 - 每个提交只做一件事
  2. 清晰描述 - 说明做了什么,而不是怎么做的
  3. 及时提交 - 完成一个小功能就提交
  4. 检查暂存 - 提交前确认暂存的文件正确

提交后下一步

提交完成后根据当前状态决定下一步:

在 /iterate 模式中:
  ├─ 还有待办任务 → 更新 progress.md → 执行下一任务
  ├─ 所有任务完成 → /cc-best:checkpoint 保存检查点
  └─ 上下文较长   → /cc-best:compact-context 压缩后继续

参考

  • 完整 Git 工作流规范请参考 skills/git/SKILL.md

记住: 好的提交是原子的、清晰的,每个提交只做一件事,message 说明"为什么"而非"做了什么"。

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 106 lines · 24 tokens per session scan A d21618505365

Subscribe to this mod's changes

commit is a command published in the GitHub repository xiaobei930/cc-best (48 stars, last pushed 4mo ago), licensed MIT. It adds 24 tokens to every session and 818 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.