commit

A Git commit command that reviews local changes, checks files before editing, and creates a commit with a suitable message. It can also hand off to commands that push changes and open a pull request.

In plain words
What is it for?
Use it to inspect changed files, review their differences, check copyright years, create a Git commit, or submit changes for review.
Why use it?
It reduces the chance of overwriting unfinished work or committing sensitive files, while avoiding the need to write commit messages by hand.

Command for Claude Code

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.

agentmods
npx agentmods add commands/modelengine-group/fit-framework/commit
Clone the repo
git clone --depth 1 https://github.com/ModelEngine-Group/fit-framework

Made for: Claude Code.

Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,156 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00008 $0.02156
Opus 5 $0.00004 $0.01078
Sonnet 5 $0.00002 $0.00431
Haiku 4.5 $0.00001 $0.00216

Measured yesterday against content hash 8320ab1cf5bd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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.

.claude/commands/commit.md · 287 lines

How it starts

The opening of the file, as written. The whole thing — 287 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Commit Command

提交当前变更到 Git。

此命令已迁移到官方插件,将调用 commit-commands 插件。

用法:

  • /commit - 创建 Git 提交
  • /commit-commands:commit - 直接使用插件命令
  • /commit-commands:commit-push-pr - 一键提交+推送+创建PR

实际执行: 调用 /commit-commands:commit 插件命令

插件功能:

  • 自动分析变更内容
  • 生成符合规范的提交消息
  • 支持交互式和直接提交模式
  • 添加 Co-Authored-By 签名
  • 自动检测敏感信息

扩展用法: 如需一键完成提交→推送→创建PR,使用:

/commit-commands:commit-push-pr

注意事项:

  • 不要提交包含敏感信息的文件(.env, credentials 等)
  • 确保提交消息清晰描述了变更内容
  • 遵循项目的 commit message 规范

⚠️ 提交前确认用户本地修改(CRITICAL)

强制要求:在执行任何编辑操作之前,必须先检查用户的本地修改,避免覆盖用户的工作。

检查流程

步骤 0:检查用户本地修改

# 查看所有已修改的文件
git status --short

# 查看每个文件的具体修改内容
git diff

处理规则

  1. 仔细阅读 git diff 的输出,理解用户已经做了哪些修改
  2. 在用户修改的基础上进行增量编辑,不要覆盖用户的实现
  3. 如果你计划的修改与用户的修改有冲突,必须先询问用户:
    我发现该文件已有本地修改:
    - 你的修改:[描述用户的修改]
    - 我计划的修改:[描述你计划的修改]
    请确认如何处理。
    
  4. 禁止按自己的想法重写用户已经实现的代码
  5. 禁止添加用户没有要求的"改进"

⚠️ 提交前的版权头年份检查(CRITICAL)

强制要求:在执行提交之前,必须检查并更新所有修改文件的版权头年份。参见项目规则第 5 条。

检查流程

步骤 1:获取当前年份

# 动态获取当前年份(绝对不要硬编码)
date +%Y
# 输出示例:2026

步骤 2:检查修改的文件

# 查看即将提交的文件
git status --short

# 或查看已暂存的文件
git diff --cached --name-only

步骤 3:检查版权头

对于每个修改的文件:

# 检查文件是否包含版权头
grep -l "Copyright" <modified_file>

# 查看版权年份
grep "Copyright.*[0-9]\{4\}" <modified_file>

步骤 4:更新版权年份

如果文件包含版权头且年份不是当前年份,使用 Edit 工具更新:

常见格式:

  • Copyright (C) 2024-2025Copyright (C) 2024-<CURRENT_YEAR>
  • Copyright (C) 2024Copyright (C) 2024-<CURRENT_YEAR>
  • Copyright (C) 2025Copyright (C) <CURRENT_YEAR>(如果已是当前年)

示例:

# 假设当前年份为 2026

# 格式 1:年份范围
Edit(
  file_path="src/example.java",
  old_string="Copyright (C) 2024-2025 FIT Framework",
  new_string="Copyright (C) 2024-2026 FIT Framework"
)

# 格式 2:单一年份
Edit(
  file_path="src/another.java",
  old_string="Copyright (C) 2024 FIT Framework",
  new_string="Copyright (C) 2024-2026 FIT Framework"
)

检查清单

在执行 git commit 之前,必须确认:

  • 已使用 date +%Y 动态获取当前年份
  • 已检查所有即将提交的修改文件
  • 对于包含版权头的文件,已检查年份是否为当前年份
  • 如果年份不是当前年份,已使用 Edit 工具更新
  • 绝对不要硬编码年份(如 2026)
  • 只更新修改的文件,不批量更新项目中所有文件

Read the full file on GitHub · 287 lines

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. yesterday First seen · 287 lines · 8 tokens per session scan A 8320ab1cf5bd

Subscribe to this mod's changes

commit is a command published in the GitHub repository ModelEngine-Group/fit-framework (2,117 stars, last pushed 5mo ago), licensed MIT. It adds 8 tokens to every session and 2,156 once invoked, about $0.0000 per session on Opus 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.