commit

A Git workflow for saving the current code changes as a commit, a named checkpoint in a project’s version history.

In plain words
What is it for?
Use it to inspect changes, create a Conventional Commit message, make the local commit, and optionally update the related task status.
Why use it?
It checks existing edits and repository context before committing, helping avoid overwriting unrelated work or using the wrong task information.

Skill for Claude CodeCodex

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 skills/fitlab-ai/agent-infra/commit
Any agent
npx skills add fitlab-ai/agent-infra --skill commit
Clone the repo
git clone --depth 1 https://github.com/fitlab-ai/agent-infra

Made for: Claude Code, Codex.

Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,232 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.00025 $0.01232
Opus 5 $0.00013 $0.00616
Sonnet 5 $0.00005 $0.00246
Haiku 4.5 $0.00003 $0.00123

Measured 2d ago against content hash bbe58e69b215, 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 2d 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.

.agents/skills/commit/SKILL.md · 106 lines

How it starts

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

提交代码

--agent 取值见 .agents/rules/task-management.md「合作者 token 规范」。

在不覆盖用户本地工作的前提下创建 Git commit,并在需要时更新关联任务状态。

commit core 只返回一个主结果:committedno_opcommitted_with_warningsfailedblocked,并附带结构化 warnings。push 失败或保护分支策略不会撤销已经创建的本地提交。

任务上下文

入口允许省略 task ref,也接受旧位置 task ref 或 --task <ref> / -t <ref>。先调用 agent-infra-internal task-context resolve {task-scope}

  • 显式 task scope 解析失败时停止。
  • 未显式指定 task scope 时,只有 TASK_CONTEXT_NOT_FOUND 可进入 taskless direct;detached HEAD、损坏候选或多匹配必须 fail closed。
  • 入口业务操作数包含字面 --orchestrated 时使用 mode=orchestrated,否则使用 mode=direct;不得从 run 文件或环境推断模式。
  • taskless direct 不读取、创建或完成 task intent、receipt、checkpoint 或 task.md 收尾记录。
  • task-bound direct 不要求 delegation receipt;orchestrated 必须由 core 验证匹配的 activated commit receipt 和 capability。
  • 解析成功后只使用 core 返回的 taskId;不得从环境、分支或文件名猜测任务身份。

1. 检查本地修改

在任何编辑前先检查:

git status --short
git diff

必须尊重现有用户改动;如果计划与之冲突,按禁言规则停止并记录阻塞原因。

2. 更新版权头年份

动态获取当前年份,只更新已经改动过的带版权头文件。完整流程见 reference/copyright-check.md

3. 生成提交信息

检查状态、diff 和最近历史,按 Conventional Commits 生成英文祈使句 message,并读取 reference/commit-message.md 处理协作署名。

4. 调用唯一 commit core

执行本步骤前读取 reference/commit-orchestration.md

将 message、明确 paths、expected HEAD/tree、task scope、agent、mode 和必填 push policy 写入临时 JSON,然后调用:

agent-infra-internal git-workflow commit --input {commit-operation.json}

示例:

{
  "taskRef": "TASK-YYYYMMDD-HHMMSS",
  "agent": "codex",
  "mode": "direct",
  "paths": ["lib/example.ts", "tests/example.test.ts"],
  "message": "fix(core): validate example input",
  "expectedHead": "{HEAD}",
  "expectedTree": "{TREE}",
  "push": {
    "remote": "origin",
    "refs": ["refs/heads/{branch}"]
  }
}

taskless direct 省略 taskRef;orchestrated 必须显式传 taskRefagentmode: "orchestrated"。core 统一负责 repository/worktree mutation lock、task lock(仅 task-bound)、路径和敏感文件、staged scope、HEAD/tree、branch/ref、commit、push、保护分支、warning 和幂等校验。

  • 有明确修改时最多创建一个本地 commit。
  • 无修改但需要交付本地领先的 HEAD 时只执行 push-only,不创建空 commit。
  • main / master 的自动 push 跳过并返回 COMMIT_AUTOPUSH_PROTECTED_BRANCH;本地 commit 保留。
  • 普通 push 失败返回 COMMIT_PUSH_FAILED warning;重跑只补当前 push,不重复创建 commit。
  • taskless 成功不写 task.md、review、receipt、checkpoint 或 Activity Log。

Read the full file on GitHub · 106 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 106 lines · 25 tokens per session scan A bbe58e69b215

Subscribe to this mod's changes

commit is a skill published in the GitHub repository fitlab-ai/agent-infra (84 stars, last pushed 2d ago), licensed MIT. It adds 25 tokens to every session and 1,232 once invoked, about $0.0001 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.